/* Andy Lyon portfolio.
   Mobile first. Breakpoints match the SportsKinetic work: 576, 768, 992.
   Spacing sits on an 8px grid. One motion curve, nothing over 280ms. */

/* Palette: Fern. From colorhunt.co: navy #202734, slate #36415A, green #B7D894, pale green #E0F8C7.
   Light theme: an off-white with a hint of green, navy text and buttons. The palette greens are
   too light to read as text on it, so links and figures use a darker green. */
:root {
  --bg: #f3f7ee;
  --surface: #fcfdf9;
  --ink: #202734;
  --muted: #4a566b;
  --line: #d6e0c9;
  --accent: #3f6b1c;          /* links, headline accent, key figures */
  --accent-ink: #e0f8c7;      /* text on a filled button */
  --accent-fill: #202734;     /* buttons and highlighted bars */
  --slate: #36415a;           /* behind the app mock-ups */
  --good: #2f6b1c;
  --warn: #b3261e;
  --ph-fg: #7a4e00;
  --ph-bg: #fff1cc;
  --ph-line: #d9a400;
  --frame: #151a23;
  --bar: #c6dbae;
  --focus: #36415a;

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --wrap: 1040px;
}

/* Dark theme: follows the device unless the visitor picks a theme with the header switch.
   Its green is a softer sage (#B0D4AD) than the palette's #B7D894, which read as lime on navy (AL, 1 Dec 2026).
   Keep the two blocks below identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202734; --surface: #2a3345; --ink: #e9f1e6; --muted: #a9b5c2; --line: #36415a;
    --accent: #b0d4ad; --accent-ink: #202734; --accent-fill: #b0d4ad;
    --slate: #36415a; --good: #b0d4ad; --warn: #ffb4a2;
    --ph-fg: #f5c451; --ph-bg: #2f2a18; --ph-line: #8a6a10;
    --frame: #151a23; --bar: #46526c; --focus: #b0d4ad;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #202734; --surface: #2a3345; --ink: #e9f1e6; --muted: #a9b5c2; --line: #36415a;
  --accent: #b0d4ad; --accent-ink: #202734; --accent-fill: #b0d4ad;
  --slate: #36415a; --good: #b0d4ad; --warn: #ffb4a2;
  --ph-fg: #f5c451; --ph-bg: #2f2a18; --ph-line: #8a6a10;
  --frame: #151a23; --bar: #46526c; --focus: #b0d4ad;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7vw, 3.75rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 4vw, 1.9rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
p { margin: 0; max-width: 66ch; }
dl, dd { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 20;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 8px; text-decoration: none; font-weight: 600;
  transition: top 160ms var(--ease);
}
.skip:focus { top: 16px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.brand { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; }
.brand span { color: var(--accent); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9rem; border-radius: 8px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.site-nav a:hover { background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 0; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0;
  background: transparent; color: var(--ink); border: 0; border-radius: 12px; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle svg { width: 20px; height: 20px; }
/* Show the icon for the theme you would switch to. */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent;
  font: 600 1rem var(--body); text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 86%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- shared text bits ---------- */
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stand { font-size: 1.2rem; line-height: 1.5; max-width: 60ch; }
.muted { color: var(--muted); }
.plain { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; max-width: 66ch; }
.ph {
  background: var(--ph-bg); color: var(--ph-fg); border: 1px dashed var(--ph-line); border-radius: 4px;
  padding: 1px 7px; font-family: var(--mono); font-size: 0.82em; line-height: 1.7;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ph-block { display: block; padding: 14px 16px; max-width: 66ch; }

/* ---------- home ---------- */
.hero { display: grid; gap: 24px; padding-block: 56px 48px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.proof { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.proof a { background: var(--surface); padding: 20px; display: grid; gap: 4px; color: var(--ink); text-decoration: none; transition: background-color 160ms var(--ease); }
.proof a:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.proof b { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.proof span { font-size: 0.93rem; line-height: 1.4; }
.proof small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

.block { display: grid; gap: 24px; padding-block: 48px; border-top: 1px solid var(--line); }
.block-head { display: grid; gap: 8px; }
section[id] { scroll-margin-top: 80px; }   /* clear the sticky header on in-page links */

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.card {
  position: relative; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  transition: transform 200ms var(--ease), border-color 160ms var(--ease);
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card:active { transform: scale(0.99); }
.card-media { aspect-ratio: 16 / 10; background: var(--slate); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-media.phone-shot { display: grid; place-items: start center; padding-top: 24px; }
.card-media.phone-shot img { width: 46%; height: auto; border-radius: 16px 16px 0 0; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35); }
.card-body { display: grid; gap: 8px; padding: 20px; align-content: start; }
.card h3 { font-size: 1.25rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link */
.card p { font-size: 0.97rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 4px 0 0; padding: 0; }
.tags li { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }

.about { display: grid; gap: 24px; }
.about-photo { width: 160px; height: 160px; border-radius: 24px; object-fit: cover; object-position: 62% 30%; background: var(--slate); }
.about-text { display: grid; gap: 16px; }
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-size: 0.97rem; }

/* ---------- case study ---------- */
.case { display: grid; gap: 48px; padding-block: 40px 64px; }
.case > section, .case > .head { display: grid; gap: 16px; }
.back { font-size: 0.93rem; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }
.case section > .eyebrow { color: var(--accent); }
.sheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-top: 8px; }
.sheet div { padding: 14px 16px 14px 0; min-width: 0; }
.sheet dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sheet dd { margin-top: 4px; font-size: 0.95rem; line-height: 1.45; }

.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ledger div { background: var(--surface); padding: 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.ledger b { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.ledger span { font-size: 0.93rem; line-height: 1.4; }
.ledger small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ledger .ph { text-transform: none; letter-spacing: 0; }

.bars { display: grid; gap: 10px; max-width: 720px; }
.bars .row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: 4px 12px; align-items: center; font-size: 0.93rem; }
.bars .track { grid-column: 1 / -1; grid-row: 2; height: 14px; border-left: 1px solid var(--muted); }
.bars .fill { display: block; height: 14px; background: var(--bar); min-width: 2px; border-radius: 0 4px 4px 0; }
.bars .hot .fill { background: var(--accent-fill); }
.bars .val { font-family: var(--mono); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
/* A four-step scale (the Bet builder's edge levels): one row from tablet up, two by two on phones.
   The meter repeats the level in filled bars, so it never relies on colour alone. */
.edge-scale { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.edge-scale li { background: var(--surface); padding: 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.edge-scale b { font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.edge-scale li > span:last-child { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.edge-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 96px; margin-bottom: 8px; }
.edge-meter i { height: 6px; border-radius: 3px; background: var(--line); }
.e1 .edge-meter i:nth-child(-n+1), .e2 .edge-meter i:nth-child(-n+2), .e3 .edge-meter i { background: var(--accent); }
@media (min-width: 768px) {
  .edge-scale { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .edge-scale li { padding: 20px; }
}
.cap { font-size: 0.84rem; color: var(--muted); max-width: 70ch; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--ink); }
.v { font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.v.bad { color: var(--warn); } .v.good { color: var(--good); } .v.mid { color: var(--muted); }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 16px; align-items: start; }
.shots.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
figure img { width: 100%; background: var(--frame); border: 1px solid var(--line); border-radius: 16px; }
figure.phone img { aspect-ratio: 390 / 844; object-fit: cover; object-position: top; max-width: 260px; }
figure.phone.foot img { object-position: bottom; }   /* show the foot of a tall screenshot */
figure.wide img { border-radius: 12px; }
figcaption { font-size: 0.84rem; line-height: 1.4; color: var(--muted); }
figcaption b { color: var(--ink); font-weight: 600; }
/* Case-study images open larger in the viewer (site.js). The badge says so on touch screens too. */
.zoom { position: relative; display: block; cursor: zoom-in; border-radius: 16px; }
figure.phone .zoom { max-width: 260px; }
figure.wide .zoom { border-radius: 12px; }
.zoom:focus-visible { outline-offset: 4px; }
.zoom-hint {
  position: absolute; bottom: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 999px; background: rgb(21 26 35 / 0.72); color: #e9f1e6; opacity: 0.85;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.zoom-hint svg { width: 16px; height: 16px; }
.zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; transform: scale(1.08); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The viewer is dark in both themes, so every image is judged against the same ground.
   Its own colour values keep captions and pills readable when the page is in light theme. */
.viewer {
  --ink: #e9f1e6; --muted: #a9b5c2; --good: #b0d4ad; --warn: #ffb4a2; --focus: #b0d4ad;
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgb(21 26 35 / 0.97); color: var(--ink); color-scheme: dark;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: rgb(21 26 35 / 0.6); }
.viewer[open] { animation: viewer-in 200ms var(--ease) both; }
@keyframes viewer-in { from { opacity: 0; } }
html.viewer-open { overflow: hidden; }
/* One fixed cell, so a fitted image can use max-height: 100%; zoomed or tall images overflow it and scroll. */
.viewer-stage { display: grid; grid-template: minmax(0, 100%) / minmax(0, 100%); overflow: auto; overscroll-behavior: contain; padding: 64px 16px 8px; min-height: 0; }
.viewer-stage img {
  margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 8px; background: var(--frame);
}
.viewer-stage.can-zoom img { cursor: zoom-in; }
.viewer-stage.tall img { max-height: none; margin-top: 0; }
.viewer-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-bar {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "count btns" "cap cap";
  gap: 4px 16px; align-items: center; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-width: var(--wrap); width: 100%; margin: 0 auto;
}
.viewer-count { grid-area: count; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.viewer-cap { grid-area: cap; font-size: 0.9rem; line-height: 1.45; color: var(--muted); max-width: 72ch; }
.viewer-cap b { color: var(--ink); font-weight: 600; }
.viewer-btns { grid-area: btns; display: flex; gap: 8px; }
.viewer-btn {
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid #46526c; border-radius: 999px; background: #2a3345; color: var(--ink);
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.viewer-btn svg { width: 22px; height: 22px; }
.viewer-btn:hover { background: #36415a; }
.viewer-btn:active { transform: scale(0.96); }
.viewer-btn[hidden] { display: none; }
.viewer-close { position: absolute; top: 8px; right: 16px; }
@media (min-width: 768px) {
  .viewer-stage { padding: 72px 32px 8px; }
  .viewer-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "count cap btns"; padding-inline: 32px; }
  .viewer-close { top: 16px; right: 24px; }
}

.pill { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; margin-right: 4px; white-space: nowrap; }
.pill.before { color: var(--muted); } .pill.after { color: var(--good); } .pill.cut { color: var(--warn); }

.steps { display: grid; border-top: 1px solid var(--line); max-width: 780px; }
.steps div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.96rem; }
.steps time { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 2px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.sw { display: grid; gap: 6px; font-size: 0.82rem; }
.sw i { display: block; height: 56px; border-radius: 8px; border: 1px solid var(--line); }
.sw code { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.entry { font-family: var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; font-size: 0.82rem; line-height: 1.65; overflow-x: auto; white-space: pre-wrap; margin: 0; max-width: 780px; }
.entry b { color: var(--accent); font-weight: 600; }

.quotes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.quotes blockquote { margin: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 8px; align-content: start; }
.quotes p { font-family: var(--display); font-size: 1.05rem; line-height: 1.35; }
.quotes footer { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.pager { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.pager a { display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 160ms var(--ease), transform 120ms var(--ease); }
.pager a:hover { border-color: var(--accent); }
.pager a:active { transform: scale(0.98); }
.pager small { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager b { font-family: var(--display); font-size: 1.1rem; line-height: 1.25; }
.pager .next { text-align: right; }

/* ---------- contact ---------- */
.contact-band { border-top: 1px solid var(--line); padding-block: 48px; display: grid; gap: 16px; }
.contact-grid { display: grid; gap: 32px; padding-block: 40px 64px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.email { font-family: var(--display); font-size: clamp(1.25rem, 5vw, 1.75rem); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
label { font-weight: 600; font-size: 0.95rem; }
input, textarea {
  font: 16px var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 48px; width: 100%;
  transition: border-color 160ms var(--ease);
}
input:hover, textarea:hover { border-color: var(--muted); }
textarea { min-height: 160px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.status { font-size: 0.93rem; color: var(--muted); min-height: 1.5em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 8px; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px; }

/* ---------- breakpoints ---------- */
/* The narrowest phones (320px): tighten the header so nothing scrolls sideways. */
@media (max-width: 359px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .site-nav a { padding: 0 4px; }
}
@media (min-width: 576px) {
  .brand { font-size: 1.125rem; }
  .site-nav a { padding: 0 12px; font-size: 0.95rem; }
  .header-tools { gap: 4px; }
  .proof { grid-template-columns: repeat(3, 1fr); }
  .bars .row { grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 5.5rem; }
  .bars .track { grid-column: auto; grid-row: auto; }
  .pager { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  body { font-size: 18px; }
  .hero { padding-block: 96px 64px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards .feature { grid-column: 1 / -1; grid-template-columns: 1.2fr 1fr; }
  .cards .feature .card-media { aspect-ratio: auto; min-height: 320px; }
  .cards .feature .card-body { padding: 32px; align-content: center; }
  .cards .feature h3 { font-size: 1.6rem; }
  .about { grid-template-columns: 160px minmax(0, 1fr); gap: 40px; }
  .block { padding-block: 64px; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
}
@media (min-width: 992px) {
  .site-nav a { padding: 0 16px; }
  .case { gap: 64px; padding-block: 56px 96px; }
}

/* ---------- motion ---------- */
/* Pages cross-fade where the browser supports it; everywhere else the page fades up 8px. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 160ms cubic-bezier(0.3, 0, 1, 1) both fade-out; }
::view-transition-new(root) { animation: 240ms var(--ease) both fade-up; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
main { animation: fade-up 240ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

@media print {
  .site-header, .site-footer, .pager, .contact-band, .skip { display: none; }
  body { background: #fff; }
}
