/* The Marketing Cartel · components (E02). Consumes tokens.css. Motion: transform/opacity only.
   Contents: 0 utilities · 1 buttons · 2 proof badge (#37) · 3 chips & device tags · 4 navbar (#21 #19 #33)
   · 5 dropdown panel (#20) · 6 theme toggle · 7 marquee · 8 device frame · 9 section header */

/* ---------- 0 · utilities --------------------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--wide { width: min(100% - 2 * var(--gutter), var(--container-wide)); margin-inline: auto; }

/* grain: a static 128px noise tile, blended over whatever it sits on (never animated) */
.has-grain { position: relative; isolation: isolate; }
.has-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("textures/grain.png") 0 0 / 128px 128px repeat;
  mix-blend-mode: var(--grain-blend);
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 2;
}

/* ---------- 1 · buttons ----------------------------------------------------------------------------- */
.btn {
  --btn-h: 52px;
  --btn-px: 22px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 0;
  border-radius: var(--r-button);
  background: none;
  font: var(--w-ui) var(--text-sm) / 1 var(--font-sans);
  letter-spacing: -.004em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-micro) var(--e-out);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.btn[aria-disabled="true"], .btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.btn--sm { --btn-h: 40px; --btn-px: 16px; gap: var(--space-2); font-size: .875rem; }
.btn--lg { --btn-h: 58px; --btn-px: 26px; font-size: var(--text-body); }

/* primary: the adapted sphere gradient + grain; hover = a second gradient layer fading in (opacity only) */
.btn--primary {
  color: var(--on-brand);
  background: var(--grad-brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 -1px 0 rgb(0 0 0 / .22), var(--shadow-2);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--grad-brand-hover);
  opacity: 0;
  transition: opacity var(--d-ui) var(--e-out);
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: url("textures/grain.png") 0 0 / 128px 128px repeat;
  mix-blend-mode: soft-light;
  opacity: .55;
  pointer-events: none;
}
.btn--primary:hover::before, :root:not([data-input="pointer"]) .btn--primary:focus-visible::before { opacity: 1; }
.btn--primary:disabled, .btn--primary[aria-disabled="true"] { filter: saturate(.25); }

/* ghost: quiet, identified by its label; the hover wash is a pseudo-layer (opacity) */
.btn--ghost {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 4%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in oklab, var(--fg) 7%, transparent);
  opacity: 0;
  transition: opacity var(--d-micro) var(--e-out);
}
.btn--ghost:hover::before { opacity: 1; }

/* trailing arrow: nudges on hover (transform) */
.btn__arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: -10px;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / .16);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14);
}
.btn--ghost .btn__arrow { background: color-mix(in oklab, var(--fg) 7%, transparent); box-shadow: none; }
.btn__arrow svg { width: 14px; height: 14px; transition: transform var(--d-ui) var(--e-spring); }
.btn:hover .btn__arrow svg { transform: translate(2px, -2px); }
.btn--sm .btn__arrow { width: 22px; height: 22px; margin-right: -6px; }
.btn--sm .btn__arrow svg { width: 11px; height: 11px; }

/* ---------- 2 · proof badge (#37): avatars + one-star rating + claim; symmetric padding ----------------- */
/* the #37 no-want was asymmetric horizontal padding. Solved by construction: the pill starts with round avatars
   and ends with a round rating chip, so both ends are concentric circles with the same 6px inset. */
.badge-proof {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px;
  border-radius: var(--r-full);
  background: var(--frost-bg);
  -webkit-backdrop-filter: blur(var(--frost-blur));
  backdrop-filter: blur(var(--frost-blur));
  box-shadow: inset 0 0 0 1px var(--frost-line), var(--shadow-1);
  font: var(--w-ui) var(--text-sm) / 1.2 var(--font-sans);
  color: var(--fg);
}
.badge-proof__avatars { display: inline-flex; }
.avatar {
  --size: 28px;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: var(--r-full);
  box-shadow: 0 0 0 2px var(--bg-raised);
  font: 700 .625rem / 1 var(--font-sans);
  letter-spacing: 0;
  color: #fff;
  transition: transform var(--d-spring) var(--e-spring);
}
.avatar + .avatar { margin-left: -5px; }
.avatar:nth-child(1) { background: var(--violet-700); }
.avatar:nth-child(2) { background: var(--pink-700); }
.avatar:nth-child(3) { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .avatar:hover { transform: translateY(-4px); }
}
.badge-proof__text { color: var(--fg); }
.badge-proof__text b { font-weight: var(--w-strong); }
.badge-proof__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--fg-accent);
  font: 700 .8125rem / 1 var(--font-sans);
  letter-spacing: -.01em;
}
.badge-proof__rating svg { width: 13px; height: 13px; }

/* ---------- 3 · chips & device tags ---------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--bg-sunken);
  font: var(--w-ui) var(--text-xs) / 1 var(--font-sans);
  color: var(--fg-muted);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--r-md);
  background: var(--frost-bg);
  -webkit-backdrop-filter: blur(var(--frost-blur));
  backdrop-filter: blur(var(--frost-blur));
  box-shadow: inset 0 0 0 1px var(--frost-line), var(--shadow-2);
  font: var(--w-ui) var(--text-sm) / 1.15 var(--font-sans);
  color: var(--fg);
  white-space: nowrap;
}
.tag__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--fg-accent);
}
.tag__icon svg { width: 17px; height: 17px; }
.tag__value { display: block; font: 780 1.0625rem / 1 var(--font-sans); letter-spacing: -.02em; }
.tag__label { display: block; margin-top: 3px; font: var(--w-ui) .75rem / 1 var(--font-sans); color: var(--fg-muted); }

/* ---------- 4–5 · navbar + dropdown: desktop only → components.desktop.css. The phone top bar + menu sheet: chapter 11. */

/* ---------- 6 · theme toggle ---------------------------------------------------------------------- */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-button);
  background: none;
  color: var(--fg);
  cursor: pointer;
  isolation: isolate;
}
.theme-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in oklab, var(--fg) 7%, transparent);
  opacity: 0;
  transition: opacity var(--d-micro) var(--e-out);
}
.theme-toggle:hover::before { opacity: 1; }
.theme-toggle svg { grid-area: 1 / 1; width: 19px; height: 19px; transition: transform var(--d-ui) var(--e-spring), opacity var(--d-ui) var(--e-out); }
.theme-toggle .i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
.theme-toggle[aria-pressed="true"] .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
.theme-toggle[aria-pressed="true"] .i-moon { opacity: 1; transform: none; }

/* ---------- 7 · marquee: one continuous loop (transform), edge-masked, pauses offscreen / reduced motion -- */
.marquee {
  --gap: 56px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: var(--gap);
  width: max-content;
  padding-right: var(--gap);
  animation: marquee 48s linear infinite;
}
.marquee__group { display: flex; align-items: center; gap: var(--gap); }
.marquee.is-paused .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* client stand-ins: typographic placeholders until real logos are licensed (data-ficticio="stand-in") */
.logo-standin { color: light-dark(var(--neutral-700), var(--neutral-400)); white-space: nowrap; line-height: 1; opacity: .9; }   /* E10 (audit M9): client names are text: 5.5:1 light, 4.7:1 dark (at .9 opacity) */
.logo-standin--caps { font: 800 .9375rem / 1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
.logo-standin--heavy { font: 850 1.3125rem / 1 var(--font-sans); letter-spacing: -.04em; }
.logo-standin--serif { font: italic 400 1.4375rem / 1 var(--font-serif); letter-spacing: -.01em; }
.logo-standin--light { font: 300 1.25rem / 1 var(--font-sans); letter-spacing: -.02em; }
.logo-standin--mono { font: 600 .9375rem / 1 var(--font-mono); letter-spacing: -.02em; }
.logo-standin b { font-weight: 850; }

/* ---------- 8 · device frames, drawn in CSS (E10): generic phone + laptop, zero image bytes, crisp at any DPR ----
   No vendor frame images (Apple's Design Resources licence excludes website content; PUBLISH-BLOCKERS #1). The box
   keeps the old frame image's proportions (phone 640×1308, laptop 1600×1053; the laptop also its screen rectangle),
   so every layout, storyboard and tag position built around those frames stands unchanged. Static paint only: nothing here animates. */
.device {
  --st: 1.95%;         /* screen inset top    (of the box height) */
  --sb: 1.95%;         /* screen inset bottom (of the box height) */
  --sl: 4%;            /* screen inset left   (of the box width)  */
  --sr: 4%;            /* screen inset right  (of the box width)  */
  --sr-x: 12.2%;       /* screen corner radius, horizontal (of screen width): the body radius minus the bezel */
  --sr-y: 5.72%;       /* screen corner radius, vertical   (of screen height) */
  /* the frame's edge: a lighter metal band, then the ink bezel — it holds the outline on the dark theme too */
  --device-rim: inset 0 0 0 1.5px #4a4459, inset 0 0 0 3px #0c0a12;
  position: relative;
  display: block;
}
.device__screen {
  position: absolute;
  z-index: 1;
  top: var(--st);
  bottom: var(--sb);
  left: var(--sl);
  right: var(--sr);
  overflow: hidden;
  border-radius: var(--sr-x) / var(--sr-y);
  background: var(--bg-raised);
}
.device__screen > img, .device__screen > picture > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* the phone: an ink slab with a thin even bezel (4% of its width on every side), a hairline rim and a punch-hole
   camera dot — no notch, no island, no buttons: a phone, not a model */
.device--phone {
  aspect-ratio: 640 / 1308;
  border-radius: 15.2% / 7.45%;
  background: linear-gradient(145deg, #2a2536, #0c0a12 60%);
  box-shadow: var(--device-rim);
}
.device--phone::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 3.1%;
  left: 50%;
  width: 4.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #2f2a3d 0 18%, #07060b 46%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06);
  transform: translateX(-50%);
}
/* the laptop: a lid with a thin bezel, a deeper chin and a webcam dot, on a plain base a little wider than the lid —
   no logo, no notch. The lid and the base are the box's own ::before/::after (no extra elements, no images). The base
   is an inline SVG on a full-box layer above the screen: a box covering the screen (as the frame image did) keeps
   Chromium from rasterising the screenshot soft where a frosted tag (backdrop-filter) overlaps it (case cards, E10;
   a clip-path base brought the blur back). preserveAspectRatio=none is safe: the box always keeps 1600:1053. */
.device--laptop { --st: 11.339%; --sb: 11.339%; --sl: 10.829%; --sr: 10.829%; --sr-x: .6%; --sr-y: .9%; aspect-ratio: 1600 / 1053; }
.device--laptop::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 9.02%;
  bottom: 6.55%;
  left: 9.375%;
  right: 9.375%;
  border-radius: 3.1% 3.1% .8% .8% / 4.6% 4.6% 1.2% 1.2%;
  background:
    radial-gradient(closest-side, #3a3447 55%, transparent) 50% 1.2% / .7% 1% no-repeat,
    linear-gradient(160deg, #2c2738, #0c0a12 55%);
  box-shadow: var(--device-rim);
}
.device--laptop::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1053' preserveAspectRatio='none'%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23847d94'/%3E%3Cstop offset='.18' stop-color='%234a4458'/%3E%3Cstop offset='.6' stop-color='%232c2738'/%3E%3Cstop offset='1' stop-color='%2312101a'/%3E%3C/linearGradient%3E%3Cpath d='M11 984h1578v8c0 28-26 50-60 50H71c-34 0-60-22-60-50z' fill='url(%23b)'/%3E%3Cpath d='M11 984h1578v1.5H11z' fill='%23fff' fill-opacity='.22'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

/* ---------- 9 · section header: number chip + eyebrow + title (used by the guide and later sections) ---- */
.sec-head { display: grid; gap: var(--space-4); }
.sec-head__meta { display: flex; align-items: center; gap: var(--space-3); }
.sec-num {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--fg-accent);
  font: 700 .75rem / 1 var(--font-mono);
  letter-spacing: .02em;
}

/* ---------- 10 · backgrounds — one layer per viewport (Rules: chapter 06 of the guide) --------------------
   .bg-blinds (#6, hero) · .bg-topo (#1, About) · .bg-grid (#4, final CTA). Each is a positioned layer the
   section places (position/inset/z-index); each fades out where the content lives. Static: nothing animates. */
.bg-blinds {
  pointer-events: none;
  background:
    /* reeds: each 68px reed brightens toward its right edge, then snaps back = the fluted-glass edge */
    repeating-linear-gradient(90deg, transparent 0 1px, color-mix(in oklab, var(--bg) 0%, transparent) 1px,
      color-mix(in oklab, var(--bg) 30%, transparent) 67px, var(--blinds-reed-light) 67px 68px),
    /* left clouds */
    radial-gradient(34% 44% at 3% 38%, var(--blinds-a) 0%, transparent 72%),
    radial-gradient(26% 34% at 12% 12%, var(--blinds-b) 0%, transparent 70%),
    radial-gradient(24% 30% at 7% 74%, var(--blinds-c) 0%, transparent 72%),
    /* right clouds */
    radial-gradient(32% 44% at 97% 30%, var(--blinds-b) 0%, transparent 72%),
    radial-gradient(28% 40% at 92% 70%, var(--blinds-a) 0%, transparent 72%),
    radial-gradient(22% 28% at 89% 8%, var(--blinds-c) 0%, transparent 70%);
  -webkit-mask-image:
    linear-gradient(90deg, #000 0%, #000 7%, transparent 33%, transparent 67%, #000 93%, #000 100%),
    linear-gradient(180deg, transparent 0%, #000 16%, #000 64%, transparent 96%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, #000 0%, #000 7%, transparent 33%, transparent 67%, #000 93%, #000 100%),
    linear-gradient(180deg, transparent 0%, #000 16%, #000 64%, transparent 96%);
  mask-composite: intersect;
}
.bg-blinds.has-grain::after { opacity: calc(var(--grain-opacity) * 1.6); }

/* #1 topographic lines: an SVG of wavy contours used as a mask over a token colour, so it themes itself;
   a radial fade keeps it off the content (Arthur: "aparece/some", never everywhere, never under text) */
.bg-topo {
  pointer-events: none;
  background: color-mix(in oklab, var(--fg) 26%, transparent);
  -webkit-mask-image: url("textures/topo-lines.svg"), radial-gradient(70% 80% at 50% 50%, transparent 30%, #000 78%);
  -webkit-mask-size: 100% 100%, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-image: url("textures/topo-lines.svg"), radial-gradient(70% 80% at 50% 50%, transparent 30%, #000 78%);
  mask-size: 100% 100%, 100% 100%;
  mask-composite: intersect;
}

/* #4 contribution grid: purple squares rising from a section's bottom edge (replace.so), fading upward */
.bg-grid {
  pointer-events: none;
  background: var(--brand);
  -webkit-mask-image: url("textures/grid-squares.svg"), linear-gradient(180deg, transparent 0%, #000 70%);
  -webkit-mask-size: 672px auto, 100% 100%;
  -webkit-mask-repeat: repeat-x, no-repeat;
  -webkit-mask-position: 50% 100%, 0 0;
  -webkit-mask-composite: source-in;
  mask-image: url("textures/grid-squares.svg"), linear-gradient(180deg, transparent 0%, #000 70%);
  mask-size: 672px auto, 100% 100%;
  mask-repeat: repeat-x, no-repeat;
  mask-position: 50% 100%, 0 0;
  mask-composite: intersect;
  opacity: .9;
}

/* ---------- 11 · phone chrome (<1024px): top bar · bottom sheet · menu (E04) --------------------------- */
.nav__menu, .nav__menu-nojs, .action-bar, .menu__theme { display: none; }
@media (max-width: 1023.98px) {
  html { scroll-padding-top: calc(var(--topbar-h) + var(--space-4)); scrollbar-gutter: stable; }   /* no reflow when a sheet locks the page (classic scrollbars) */

  /* the top bar: full width, frost, ~56px under the status bar */
  .site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-nav);
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--frost-bg);
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    box-shadow: inset 0 -1px 0 var(--frost-line);
    transition: transform var(--d-ui) var(--e-out);
  }
  .nav { display: flex; align-items: center; gap: 2px; height: var(--topbar-h); padding-inline: var(--gutter) calc(var(--gutter) - 6px); }
  .nav__logo { display: inline-flex; align-items: center; gap: 9px; height: 44px; margin-right: auto; color: var(--fg); }
  .nav__logo svg { width: 32px; height: 32px; }
  .nav__wordmark { font: 780 1.0625rem / 1 var(--font-sans); letter-spacing: -.024em; }
  /* the full name from 350 px; "Marketing Cartel" below (measured 2026-10-07: room 155 px at 320, the full name needs 168) */
  .nav__wordmark .wm-short { display: none; }
  @media (max-width: 349.98px) { .nav__wordmark .wm-full { display: none; } .nav__wordmark .wm-short { display: inline; } }
  .nav__capsule, .nav__actions > .btn, .nav-panel, .nav-bridge { display: none; }
  .nav__actions { display: flex; align-items: center; gap: 2px; }
  .theme-toggle, .nav__menu, .nav__menu-nojs { width: 44px; height: 44px; }
  .nav__menu, .nav__menu-nojs {
    display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-button);
    background: none; color: var(--fg); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav__menu svg, .nav__menu-nojs svg { width: 22px; height: 22px; }
  .js .nav__menu-nojs, html:not(.js) .nav__menu { display: none; }

  /* bottom sheet: a native modal <dialog> that rises from the bottom (transform only). @starting-style gives the
     entry; transition-behavior keeps it on screen while it slides out. */
  .sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: min(88svh, 760px);
    margin: 0;
    padding: 0 var(--gutter);
    border: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--panel-bg);
    color: var(--fg);
    box-shadow: var(--shadow-3);
    overflow: auto;
    overscroll-behavior: contain;
    transform: translateY(0);
    transition: transform var(--d-ui) var(--e-out), overlay var(--d-ui) allow-discrete, display var(--d-ui) allow-discrete;
  }
  .sheet:not([open]) { transform: translateY(100%); }
  @starting-style { .sheet[open] { transform: translateY(100%); } }
  .sheet::backdrop {
    background: rgb(20 16 31 / .45);
    opacity: 1;
    transition: opacity var(--d-ui) var(--e-out), overlay var(--d-ui) allow-discrete, display var(--d-ui) allow-discrete;
  }
  .sheet:not([open])::backdrop { opacity: 0; }
  @starting-style { .sheet[open]::backdrop { opacity: 0; } }
  html.has-sheet { overflow: hidden; }
  .sheet__grip { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--line-strong); opacity: .5; }
  .sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-inline: calc(-1 * var(--gutter)); padding: 4px calc(var(--gutter) - 6px) 4px var(--gutter); background: var(--panel-bg); }
  .sheet__title { font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
  .sheet__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-button); background: none; color: var(--fg); cursor: pointer; }
  .sheet__close svg { width: 22px; height: 22px; }
  /* the action stays in reach: the foot sticks to the sheet's bottom edge while the links scroll */
  .sheet__foot { position: sticky; bottom: 0; display: grid; gap: var(--space-1); margin: var(--space-6) calc(-1 * var(--gutter)) 0; padding: var(--space-3) var(--gutter) calc(var(--space-2) + var(--safe-b)); background: var(--panel-bg); box-shadow: 0 -1px 0 var(--line); }
  .sheet__foot .btn { width: 100%; justify-content: center; }
  .sheet__tel { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font: var(--w-ui) var(--text-body) / 1 var(--font-sans); color: var(--fg); }
  .sheet__tel svg { width: 18px; height: 18px; color: var(--brand); }

  /* the menu: the desktop dropdown groups; Services as tiles, the rest as rows */
  .menu__group { margin: var(--space-5) 0 var(--space-2); font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
  .menu > .menu__group:first-child { margin-top: var(--space-1); }
  .menu__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .menu__tiles > li { display: grid; }
  .menu-tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-3);
    min-height: 88px; padding: 14px; border-radius: var(--r-md);
    background: var(--bg-sunken); font: var(--w-strong) var(--text-body) / 1.2 var(--font-sans); color: var(--fg);
  }
  .menu-tile__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
  .menu-tile__icon svg { width: 18px; height: 18px; }
  .menu__rows { border-top: 1px solid var(--line); }
  .menu__rows--top { margin-top: var(--space-5); }
  .menu-row { display: flex; align-items: center; min-height: 50px; border-bottom: 1px solid var(--line); font: var(--w-ui) 1.0625rem / 1.2 var(--font-sans); color: var(--fg); }
  .menu-tile:active, .menu-row:active { transform: scale(.98); }
  @media (prefers-reduced-motion: reduce) { .sheet, .sheet::backdrop { transition: none; } }
}

/* ---------- 12 · phone action bar + top bar behaviour (<1024px, E04; SPEC §3.3) ------------------------- */
@media (max-width: 1023.98px) {
  .action-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px var(--gutter) calc(8px + var(--safe-b));
    background: var(--frost-bg);
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    box-shadow: inset 0 1px 0 var(--frost-line);
    transform: translateY(calc(100% + 2px));
    transition: transform var(--d-ui) var(--e-out);
  }
  .action-bar[data-state="shown"] { transform: none; }
  .action-bar__cta { flex: 1; min-height: 48px; justify-content: center; }
  .action-bar__cta .lbl-short { display: none; }
  .action-bar__tel, .action-bar__menu {
    display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0;
    border-radius: var(--r-button); background: var(--bg-sunken); color: var(--fg); cursor: pointer;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fg) 8%, transparent);
  }
  .action-bar__tel { color: var(--brand); }
  .action-bar__tel svg, .action-bar__menu svg { width: 21px; height: 21px; }
  .action-bar__tel:active, .action-bar__menu:active, .action-bar__cta:active { transform: scale(.97); }
  /* the page end keeps the bar's height free: the footer's last line is never under it */
  .site-footer { padding-bottom: calc(var(--bar-h) + var(--safe-b) + var(--space-6)); }

  /* the top bar (logo · theme · ☰) hides on scroll down, returns on scroll up. ☰ also lives in the action bar, which
     comes after the hero CTA and steps aside at #contact; while it is shown the top gives its ☰ up — one ☰ on screen,
     never two (Arthur 29/09). The theme toggle is on top and in the menu */
  html.topbar-hidden .site-nav { transform: translateY(-100%); }
  html.bar-visible .site-nav .nav__menu { visibility: hidden; }   /* hidden, not display:none: its 44px slot stays, so the theme toggle beside it does not jump (CLS 0.0007 on every page without a hero CTA, where the bar appears on the first scroll while the top bar is still on screen) */
  .menu__theme { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-5); padding-block: 2px; border-block: 1px solid var(--line); font: var(--w-ui) 1.0625rem / 1.2 var(--font-sans); }

  @media (max-width: 359.98px) {
    .action-bar__cta .lbl-long { display: none; }
    .action-bar__cta .lbl-short { display: inline; }
  }
  /* wider phones and tablets: the bar's content stays a thumb-sized group in the middle */
  @media (min-width: 640px) { .action-bar { justify-content: center; } .action-bar__cta { flex: 0 1 26rem; } }
  /* landscape phones: a slimmer bar (the hit areas stay ≥ 44px) */
  @media (max-height: 500px) {
    .action-bar { padding-block: 4px calc(4px + var(--safe-b)); }
    .action-bar__cta, .action-bar__tel, .action-bar__menu { min-height: 44px; height: 44px; }
    .action-bar__tel, .action-bar__menu { width: 44px; }
  }
  @media (prefers-reduced-motion: reduce) { .action-bar, .site-nav { transition: none; } }
}

/* ---------- 13 · phone form fields + the audit sheet (<1024px, E04) ------------------------------------ */
@media (max-width: 1023.98px) {
  .audit-form { display: grid; gap: var(--space-4); }
  .audit-form__title { font: 750 var(--text-h4) / 1.2 var(--font-sans); letter-spacing: -.018em; }
  .audit-form__submit { width: 100%; margin-top: var(--space-1); justify-content: center; }
  .audit-form__note { font-size: var(--text-sm); color: var(--fg-muted); text-align: center; }
  .audit-form__note a { display: inline-block; margin-left: .25em; padding-block: 12px; color: var(--fg); font-weight: var(--w-strong); }
  .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }   /* WebKit: an input's intrinsic width pushed the column 5px wide */
  .field__label { font: var(--w-strong) var(--text-sm) / 1.2 var(--font-sans); color: var(--fg); }
  .field__label span { font-weight: 400; color: var(--fg-muted); }
  .input {
    width: 100%; min-width: 0; height: 50px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
    background: var(--bg-raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong);
    font: 400 1rem / 1 var(--font-sans);   /* 16px: below that iOS zooms on focus */
  }
  .input::placeholder { color: var(--fg-muted); }
  .input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
  .input:user-invalid { box-shadow: inset 0 0 0 2px var(--accent); }

  .audit-sheet { padding-bottom: calc(var(--space-5) + var(--safe-b)); }
  .audit-sheet { height: min(88svh, 760px); }   /* E05: the sheet holds its height from step to step (it scrolls inside) instead of bobbing with each question */
  .audit-sheet__promises { display: grid; gap: 6px; margin: var(--space-1) 0 var(--space-5); font: var(--w-ui) var(--text-sm) / 1.3 var(--font-sans); color: var(--fg-muted); }
  .audit-sheet__promises li { display: inline-flex; align-items: center; gap: 6px; }
  /* E05 ★ (REVIEW option 1): the promises greet the first question, then step aside so each step's Continue fits the screen */
  .audit-sheet:has(.gp:not([data-step="q1"])) .audit-sheet__promises { display: none; }
  .audit-sheet__promises svg { flex: none; width: 15px; height: 15px; color: var(--brand); }
  /* E10: a promise that wraps keeps its tick on the first line (the competitor line takes two lines on phones) */
  .audit-sheet__promises li { align-items: flex-start; }
  .audit-sheet__promises svg { margin-top: calc((1lh - 15px) / 2); }
  /* E05: the contact step keeps its title in the sheet too ("Where should we send it?" is a step, not the sheet name) */
}

/* ---------- 14 · phone buttons (<1024px): labels may wrap (text at 200%), small buttons keep a 44px target ---- */
@media (max-width: 1023.98px) {
  /* text at 200% (iOS/Android large text): a long word breaks instead of pushing past the screen */
  h1, h2, h3, h4, p, li, dd, dt, blockquote, label { overflow-wrap: break-word; }
  .btn { white-space: normal; text-align: center; line-height: 1.15; padding-block: 8px; }
  .btn--sm { --btn-h: 44px; }
}

/* ---------- 15 · the free game plan (E05, SPEC §4): the adaptive form, inline in #contact and in the phone sheet ---
   Every width. Options are cards (the raised surface), the native radio/checkbox covers the card invisibly (the whole
   card is the hit area, the focus ring moves to the card) and .gp__tick draws the state. One step at a time; a step
   comes in with a 220 ms rise (transform/opacity only), none with reduced motion. */
.gp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }   /* minmax: a long word at 200% text wraps instead of widening the track */
.gp__intro { font: var(--w-ui) var(--text-sm) / 1.4 var(--font-sans); color: var(--fg-muted); }
.gp:not([data-step="q1"]) .gp__intro { display: none; }          /* it introduces the first question only */
.gp__top { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; margin-bottom: calc(-1 * var(--space-2)); }
.gp__back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -8px; padding: 0 12px 0 8px; border: 0; border-radius: var(--r-full);
  background: none; color: var(--fg); font: var(--w-strong) var(--text-sm) / 1 var(--font-sans); cursor: pointer; }
.gp__back svg { width: 16px; height: 16px; transform: rotate(-135deg); }   /* the ↗ arrow, turned to point back */
.gp__back:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.gp__progress { margin-left: auto; font: 700 var(--text-xs) / 1.2 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-muted); }
.gp__progress:empty { display: none; }
.gp[data-step="done"] .gp__top { display: none; }                /* nothing to go back to, nothing to count */
.gp__bar { height: 4px; overflow: hidden; border-radius: var(--r-full); background: var(--line); }
.gp__bar i { display: block; height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--e-out); }
.gp:is([data-step="plan"], [data-step="contact"], [data-step="done"]) .gp__bar { display: none; }
.gp__reaction { padding: 12px 14px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--fg); font: var(--w-ui) var(--text-sm) / 1.45 var(--font-sans); }
.gp__back[hidden], .gp__reaction[hidden], .gp__continue[hidden] { display: none; }
.gp__stage { min-width: 0; }

.gp__step { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); min-width: 0; margin: 0; padding: 0; border: 0; }
.gp__q { float: left; width: 100%; padding: 0; font: 750 var(--text-h4) / 1.2 var(--font-sans); letter-spacing: -.018em; color: var(--fg); }   /* float: the legend becomes a plain grid item */
.gp__q:focus { outline: none; }                                   /* focused by script so readers hear the new question */
.gp__help { margin-top: calc(-1 * var(--space-2)); font-size: var(--text-sm); color: var(--fg-muted); }
.gp__opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.gp__opt { position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: opacity .15s; }   /* colour and ring snap: only opacity animates (the motion rule) */
.gp__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; font-size: 1rem; cursor: pointer; }   /* 16px: the page's input rule */
.gp__opt-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; flex: 1; min-width: 0; }
.gp__opt-label { font: var(--w-strong) 1rem / 1.3 var(--font-sans); color: var(--fg); }
.gp__opt-hint { font-size: var(--text-sm); line-height: 1.35; color: var(--fg-muted); }
.gp__tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: var(--r-full); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.gp__opt:has(input[type="checkbox"]) .gp__tick { border-radius: 6px; }
.gp__tick::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: rotate(-45deg); opacity: 0; }
.gp__opt:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.gp__opt:has(input:checked) .gp__tick { background: var(--brand); box-shadow: none; }
.gp__opt:has(input:checked) .gp__tick::after { opacity: 1; }
.gp__opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.gp__step.is-picked .gp__opt:not(:has(input:checked)) { opacity: .45; }   /* the tap is confirmed before the next question */
.gp__hint { font-size: var(--text-sm); line-height: 1.4; color: var(--fg); }
.gp__hint:empty { display: none; }
.gp__continue { width: 100%; justify-content: center; }

.gp__plan, .gp__done { display: grid; gap: var(--space-4); }
.gp__moves { display: grid; gap: var(--space-4); margin: 0; padding: 0; list-style: none; counter-reset: gp; }
.gp__moves li { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; column-gap: var(--space-3); row-gap: 2px; counter-increment: gp; }
.gp__moves li::before { content: counter(gp); grid-row: 1 / span 2; align-self: start; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-full);
  background: var(--grad-brand); color: var(--on-brand); font: 700 .75rem / 1 var(--font-mono); }   /* the How section's step number */
.gp__moves strong { font: var(--w-strong) 1rem / 1.3 var(--font-sans); color: var(--fg); }
.gp__moves span { font-size: var(--text-sm); line-height: 1.45; color: var(--fg-muted); }
.gp__case { padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: var(--text-sm); line-height: 1.45; color: var(--fg-muted); }
.gp__case-tag { display: block; margin-bottom: 6px; font: 700 var(--text-xs) / 1.2 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-muted); }   /* Arthur 30/09: says what the figure is (a real result, a similar client) */
.gp__case strong { display: block; margin-bottom: 2px; font: 800 var(--text-h4) / 1.1 var(--font-sans); letter-spacing: -.03em; color: var(--fg); }   /* the cases' figure */
.gp__offer { font: var(--w-ui) 1rem / 1.4 var(--font-sans); color: var(--fg); }
.gp__plan .btn { width: 100%; justify-content: center; }
/* the "thinking" moment (Arthur 30/09): the plan is already laid out at its final height and waits hidden; the status
   line sits over its top. Showing the plan = visibility + the usual rise, so nothing below ever moves. */
.gp__plan { position: relative; }
.gp__plan.is-thinking > :not(.gp__think) { visibility: hidden; }
.gp__think { position: absolute; inset: 0 0 auto; display: grid; justify-items: center; gap: var(--space-4); padding-top: var(--space-9); text-align: center; }
.gp__think:focus { outline: none; }                               /* focused by script while the plan builds (E10) */
.gp__think-line { font: var(--w-ui) 1rem / 1.4 var(--font-sans); color: var(--fg); }
.gp__think-dots { display: flex; gap: 8px; }
.gp__think-dots i { width: 10px; height: 10px; border-radius: var(--r-full); background: var(--brand); animation: gp-dot 1s var(--e-in-out) infinite; }
.gp__think-dots i:nth-child(2) { animation-delay: .15s; }
.gp__think-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes gp-dot { 0%, 100% { opacity: .35; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
.gp__done p { color: var(--fg-muted); }

.gp--in { animation: gp-in .22s var(--e-out) both; }
@keyframes gp-in { from { opacity: 0; transform: translateY(8px); } }   /* vertical: a sideways slide spilled past the sheet's width mid-way */
@media (prefers-reduced-motion: reduce) {
  .gp--in { animation: none; }
  .gp__think-dots i { animation: none; opacity: .7; }
  .gp__bar i, .gp__opt { transition: none; }
}

/* E06: the Services tiles are 7 — the odd last tile spans the row */
@media (max-width: 1023.98px) { .menu__tiles > li:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* the industry spotlight tag in the phone menu */
.menu-row__tag { margin-left: 8px; padding: 3px 8px; border-radius: var(--r-full); background: var(--brand-soft); color: var(--fg-accent); font: var(--w-strong) .6875rem / 1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
