/* =========================================================================
   Boostwyze — design system
   Built from the logo: hexagon geometry, deep teal → mint, isometric depth.
   ========================================================================= */

/* ---------- 1. Tokens ---------- */

:root {
  /* Brand — pulled from the live logo + Divi global colors */
  --deep:        #00A380;
  --mint:        #01EAB7;
  --mint-soft:   #7BF3D8;
  --electric:    #326BFF;

  /* Ink scale — near-black with a teal cast so the brand feels intentional
     even in the neutrals. Pure #000 always looks cheap. */
  --ink-900:     #04100C;
  --ink-850:     #061713;
  --ink-800:     #0A1F19;
  --ink-700:     #113029;
  --ink-600:     #1B453B;
  --ink-500:     #2F6153;

  /* Paper scale for the light sections */
  --paper-000:   #FFFFFF;
  --paper-050:   #F4F7F5;
  --paper-100:   #E8EEEB;
  --paper-200:   #D5E0DB;

  /* Semantic — remapped per-section by .band-* below */
  --bg:          var(--ink-900);
  --bg-raise:    var(--ink-850);
  --fg:          #EAF5F1;
  --fg-muted:    #8FA9A1;
  --fg-faint:    #5C766E;
  --line:        rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.20);
  --accent:      var(--mint);

  /* Type */
  --f-sans:  'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --f-mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Fluid scale — clamp everywhere so there are no dead zones between breakpoints */
  --t-eyebrow: clamp(.68rem, .62rem + .18vw, .78rem);
  --t-body:    clamp(1rem, .96rem + .2vw, 1.125rem);
  --t-lead:    clamp(1.125rem, 1.02rem + .5vw, 1.45rem);
  --t-h4:      clamp(1.15rem, 1.05rem + .45vw, 1.45rem);
  --t-h3:      clamp(1.5rem, 1.25rem + 1.1vw, 2.25rem);
  --t-h2:      clamp(2rem, 1.45rem + 2.4vw, 3.5rem);
  --t-h1:      clamp(2.6rem, 1.5rem + 4.4vw, 5.4rem);
  --t-mega:    clamp(4rem, 1rem + 13vw, 16rem);

  /* Space */
  --gut:       clamp(1.25rem, .8rem + 2.2vw, 3rem);
  --sec-y:     clamp(4.5rem, 3rem + 7vw, 10rem);
  --maxw:      82rem;
  --maxw-text: 42rem;

  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 26px;

  --ease:     cubic-bezier(.22, 1, .36, 1);
  --ease-in:  cubic-bezier(.55, 0, .35, 1);
}

/* Band themes. Swapping the semantic tokens lets every component below stay
   theme-agnostic — one card definition works on dark and paper alike. */
.band-paper {
  --bg: var(--paper-050);
  --bg-raise: var(--paper-000);
  --fg: var(--ink-900);
  --fg-muted: #4B635A;
  --fg-faint: #7D9089;
  --line: rgba(4,16,12,.12);
  --line-strong: rgba(4,16,12,.26);
  --accent: var(--deep);
}
.band-deep {
  --bg: var(--ink-800);
  --bg-raise: var(--ink-700);
}

/* ---------- 2. Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  /* NOT overflow-x: hidden here, even though that's the standard iOS-Safari
     fix for horizontal bleed (mesh blobs, marquee track) that body alone
     sometimes misses — Chrome/WebKit have a long-standing bug where
     position: sticky stops working entirely once the document's actual
     scrolling element (html, confirmed via document.scrollingElement) gets
     a non-visible overflow-x. That's what silently broke the motion
     section's pin the one time this was tried: the stage stopped sticking
     altogether, so the whole spin got crammed into one screen-height of
     scroll instead of holding through the intended distance. If mobile
     horizontal scroll turns up again, fix it by containing the specific
     bleeding element (.mesh, .marquee-track) directly, not by touching
     overflow here. */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  background: var(--ink-900);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--mint); color: var(--ink-900); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100%; left: var(--gut); z-index: 200;
  background: var(--mint); color: var(--ink-900);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ---------- 3. Typography ---------- */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); letter-spacing: -.025em; line-height: 1.1; }
h4 { font-size: var(--t-h4); letter-spacing: -.02em; line-height: 1.2; }

p { text-wrap: pretty; }

/* The serif italic is the single biggest anti-template move in this system.
   Used only on emphasis phrases inside headings — never for body copy. */
.ital {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--accent);
}
.band-paper .ital { color: var(--deep); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: '';
  width: 9px; height: 10px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  flex: none;
}
.eyebrow.is-plain::before { display: none; }

.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: var(--maxw-text);
}

.mono-meta {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ---------- 4. Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.wrap-wide { max-width: 96rem; }

.section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--sec-y);
  /* Isolate so mesh blobs inside don't bleed into neighbouring bands */
  isolation: isolate;
}

.sec-head {
  display: grid;
  gap: clamp(1rem, .5rem + 1.6vw, 2.25rem);
  margin-bottom: clamp(2.5rem, 1.5rem + 3.5vw, 5rem);
}
@media (min-width: 62rem) {
  .sec-head.is-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    gap: 3rem;
  }
}
.sec-head h2 { margin-top: .6rem; }

/* Hairline rule that reads as a deliberate detail rather than a <hr> */
.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  border: 0;
}

/* ---------- 5. Texture: grain + mesh ---------- */

/* Fixed grain over the whole document. Very low opacity — you should feel it,
   not see it. This is what kills the "flat AI gradient" look more than anything. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 7s steps(6) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

.mesh {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.mesh-a { width: 46vw; height: 46vw; background: radial-gradient(circle, var(--deep), transparent 68%); }
.mesh-b { width: 38vw; height: 38vw; background: radial-gradient(circle, var(--mint), transparent 68%); opacity: .28; }
.mesh-c { width: 34vw; height: 34vw; background: radial-gradient(circle, var(--electric), transparent 70%); opacity: .18; }

/* ---------- 6. Buttons ---------- */

.btn {
  --btn-bg: var(--mint);
  --btn-fg: var(--ink-900);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.01em;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: transform .5s var(--ease), background-color .3s, color .3s, border-color .3s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* Arrow that slides out and a duplicate that slides in — small, cheap, and
   reads as considered. */
.btn .ico {
  display: inline-block;
  transition: transform .45s var(--ease);
}
.btn:hover .ico { transform: translateX(4px); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  --btn-bg: var(--fg);
  --btn-fg: var(--bg);
}

.btn-solid-ink {
  --btn-bg: var(--ink-900);
  --btn-fg: #fff;
}

.btn-lg { padding: 1.15rem 2rem; font-size: 1.02rem; }

/* Text link with a rule that wipes in from the left */
.link-u {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 500;
  padding-bottom: 3px;
}
.link-u::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.link-u:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 7. Header ---------- */

.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 1.1rem;
  transition: background-color .4s, backdrop-filter .4s, border-color .4s, padding .4s;
  border-bottom: 1px solid transparent;
}
.hdr.is-stuck {
  background: rgba(4,16,12,.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
  padding-block: .7rem;
}
.hdr-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* The wordmark is the real logo file, not typeset text — the brand face is
   its own geometry and Instrument Sans is not a stand-in for it. */
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.brand img {
  width: clamp(128px, 11vw, 152px);
  height: auto;
  transition: opacity .3s var(--ease);
}
.brand:hover img { opacity: .82; }
.ftr .brand img { width: clamp(140px, 12vw, 168px); }

.nav { display: none; }
@media (min-width: 60rem) {
  .nav { display: flex; align-items: center; gap: 2rem; }
}
.nav a {
  font-size: .93rem;
  font-weight: 500;
  color: rgba(234,245,241,.72);
  transition: color .3s;
  position: relative;
}
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -7px;
  translate: -50% 0;
  width: 7px; height: 8px;
  background: var(--mint);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hdr-cta { display: none; }
@media (min-width: 60rem) { .hdr-cta { display: inline-flex; } }

/* Mobile menu */
.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}
@media (min-width: 60rem) { .burger { display: none; } }
.burger span {
  display: block; height: 1.5px; width: 100%;
  background: #fff; border-radius: 2px;
  transition: transform .4s var(--ease), opacity .25s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--ink-900);
  padding: 7rem var(--gut) 2rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease);
  overflow-y: auto;
}
.drawer.is-open { clip-path: inset(0 0 0 0); }
.drawer a {
  font-size: clamp(1.9rem, 1.2rem + 3.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -.04em;
  padding-block: .5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(18px);
}
.drawer.is-open a {
  animation: drawer-in .55s var(--ease) forwards;
  animation-delay: calc(var(--i) * 55ms + 120ms);
}
@keyframes drawer-in { to { opacity: 1; transform: none; } }
.drawer a span { font-family: var(--f-mono); font-size: .7rem; color: var(--fg-faint); }
.drawer .btn { margin-top: 2rem; align-self: flex-start; }
body.is-locked { overflow: hidden; }

/* ---------- 8. Hero ---------- */

.hero {
  position: relative;
  min-height: min(100svh, 60rem);
  display: flex;
  align-items: center;
  padding-block: clamp(7rem, 5.5rem + 3vw, 9rem) clamp(3rem, 2rem + 2vw, 4.5rem);
  background: var(--ink-900);
  overflow: hidden;
  isolation: isolate;
}
#hexfield {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
}
.hero .mesh-a { top: -18%; right: -12%; }
.hero .mesh-c { bottom: -22%; left: -14%; }

/* Vignette pulls focus to the type and hides the canvas edges */
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 30%, rgba(4,16,12,.75) 100%),
    linear-gradient(to bottom, transparent 60%, var(--ink-900) 100%);
  pointer-events: none;
}

.hero-grid { display: grid; gap: clamp(2.5rem, 1rem + 5vw, 5rem); }
@media (min-width: 68rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .78fr);
    align-items: end;
  }
}

.hero h1 { margin-block: 1.4rem 1.75rem; }
.hero h1 .l { display: block; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2.25rem;
}

/* Right rail — the "receipts" panel. Concrete facts beat another stock icon. */
.hero-rail {
  border-left: 1px solid var(--line);
  padding-left: clamp(1.25rem, .8rem + 1.4vw, 2rem);
  display: grid;
  gap: 1.6rem;
}
@media (max-width: 67.99rem) {
  .hero-rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 2rem; }
}
.rail-row { display: grid; gap: .3rem; }
.rail-row dt {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.rail-row dd {
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--fg);
}
.rail-row dd b { color: var(--mint); font-weight: 600; }

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 1.75rem;
  translate: -50% 0;
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
.scroll-hint::after {
  content: '';
  width: 1px; height: 34px;
  background: linear-gradient(var(--mint), transparent);
  animation: hint 2.2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes hint {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(34px); opacity: 0; }
}
@media (max-width: 68rem) { .scroll-hint { display: none; } }

/* ---------- 9. Marquee ---------- */

.marquee {
  --speed: 42s;
  position: relative;
  overflow: hidden;
  padding-block: 1.4rem;
  border-block: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  padding-right: 3.5rem;
  flex: none;
  min-width: 100%;
  animation: slide var(--speed) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-100%); } }
.marquee-track li {
  font-size: clamp(1rem, .85rem + .7vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--fg-faint);
  white-space: nowrap;
  transition: color .3s;
  display: flex;
  align-items: center;
  gap: 3.5rem;
}
.marquee-track li:hover { color: var(--fg); }
.marquee-track li::after {
  content: '';
  width: 8px; height: 9px;
  background: var(--deep);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  flex: none;
}

/* ---------- 10. Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
@media (min-width: 56rem) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat {
  background: var(--bg);
  padding: clamp(1.5rem, 1rem + 1.8vw, 2.5rem);
  display: grid;
  gap: .4rem;
  transition: background-color .4s;
}
.stat:hover { background: var(--bg-raise); }
.stat-n {
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.stat-n .suf { color: var(--accent); }
.stat-l {
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ---------- 11. Services — numbered rows, not a card grid ---------- */

.svc-list { border-top: 1px solid var(--line); }

.svc {
  position: relative;
  display: grid;
  gap: .5rem 2rem;
  padding-block: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  border-bottom: 1px solid var(--line);
  transition: padding-inline .5s var(--ease);
}
@media (min-width: 60rem) {
  .svc {
    grid-template-columns: 4rem minmax(0, 15rem) minmax(0, 1fr) auto;
    align-items: start;
  }
  .svc:hover { padding-inline: 1.25rem; }
}

/* Mint wash that wipes up on hover — reads as physical, costs one pseudo-element */
.svc::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .5s var(--ease);
}
.svc:hover::before { transform: scaleY(1); }

.svc-n {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--fg-faint);
  padding-top: .45rem;
  transition: color .4s;
}
.svc:hover .svc-n { color: var(--accent); }

.svc-t {
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.08;
}
.svc-d { color: var(--fg-muted); max-width: 40ch; }

.svc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}
.tag {
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.svc-go {
  align-self: center;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  flex: none;
  transition: background-color .4s, color .4s, border-color .4s, transform .5s var(--ease);
}
.svc:hover .svc-go {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-900);
  transform: rotate(-45deg);
}
@media (max-width: 59.99rem) { .svc-go { display: none; } }

/* ---------- 12. Work ---------- */

.work-grid {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}
@media (min-width: 48rem) { .work-grid { grid-template-columns: repeat(2, 1fr); } }

/* Offset every other card on desktop — asymmetry is what a template won't do.
   Uses margin, not transform: .reveal.is-in resets transform, which would
   silently cancel the offset. */
@media (min-width: 62rem) {
  .work-grid:not(.is-compact) > :nth-child(even) { margin-block-start: clamp(2rem, 4vw, 4.5rem); }
}

/* Compact variant: a small proof strip (logo + thumb only, no blurb) so a
   full case-study grid doesn't stretch the single-page layout. */
.work-grid.is-compact { gap: clamp(.9rem, .6rem + 1vw, 1.5rem); }
@media (min-width: 34rem) { .work-grid.is-compact { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .work-grid.is-compact { grid-template-columns: repeat(5, 1fr); } }
.work-grid.is-compact .work { gap: .6rem; }
.work-grid.is-compact .work-thumb { aspect-ratio: 4 / 3; }
.work-grid.is-compact .work-meta h3 { font-size: .88rem; }
.work-grid.is-compact .work-meta .mono-meta,
.work-grid.is-compact .work > p { display: none; }

.work {
  position: relative;
  display: grid;
  gap: 1.1rem;
  isolation: isolate;
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  display: grid;
  place-items: center;
  transition: transform .7s var(--ease), border-color .4s;
}
.work:hover .work-thumb { transform: translateY(-6px); border-color: var(--line-strong); }

/* Placeholder art: brand-tinted gradient + hex lattice. Swap for real
   screenshots by dropping an <img> inside .work-thumb. */
.work-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 80% at 22% 18%, color-mix(in srgb, var(--tint, #00A380) 62%, transparent), transparent 62%),
    radial-gradient(80% 90% at 82% 88%, color-mix(in srgb, var(--tint2, #01EAB7) 40%, transparent), transparent 60%),
    var(--ink-800);
}
.work-thumb::after {
  content: '';
  position: absolute; inset: 0;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 1 55 16.5v31L28 63 1 47.5v-31z' fill='none' stroke='%23fff' stroke-opacity='.5'/%3E%3C/svg%3E");
  background-size: 56px 64px;
  mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
}
.work-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }

.work-initial {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 2rem + 5vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -.06em;
  color: rgba(255,255,255,.9);
  mix-blend-mode: overlay;
}

.work-badge {
  position: absolute;
  z-index: 3;
  top: .9rem; left: .9rem;
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(4,16,12,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  padding: .35rem .7rem;
  border-radius: 999px;
}

.work-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.work-meta h3 { font-size: var(--t-h4); }
.work-meta .mono-meta { flex: none; }
.work p { color: var(--fg-muted); font-size: .96rem; }

/* ---------- 13. Process ---------- */

.steps { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
@media (min-width: 54rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  background: var(--bg);
  padding: clamp(1.75rem, 1.2rem + 2vw, 2.75rem) clamp(1.25rem, 1rem + 1.2vw, 2rem);
  display: grid;
  gap: .7rem;
  align-content: start;
  position: relative;
  transition: background-color .45s;
}
.step:hover { background: var(--bg-raise); }
.step-n {
  width: 34px; height: 38px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--accent);
  margin-bottom: .3rem;
}
.step h3 { font-size: var(--t-h4); }
.step p { color: var(--fg-muted); font-size: .95rem; }

/* ---------- 14. Pricing ---------- */

.tiers { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 76rem) { .tiers { grid-template-columns: repeat(4, 1fr); } }

/* Flex column rather than grid so the CTA can be pushed to the bottom with
   margin-top:auto — otherwise cards with different feature counts end up with
   their buttons at different heights, which reads as a mistake. */
.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform .5s var(--ease), border-color .4s;
}
.tier:hover { transform: translateY(-5px); border-color: var(--line-strong); }

.tier.is-featured {
  border-color: var(--accent);
  background:
    linear-gradient(var(--bg-raise), var(--bg-raise)) padding-box,
    linear-gradient(160deg, var(--mint), var(--deep) 55%, transparent) border-box;
  border: 1px solid transparent;
}
.tier-flag {
  position: absolute;
  top: -1px; right: 1.25rem;
  transform: translateY(-50%);
  font-family: var(--f-mono);
  font-size: .6rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  background: var(--mint);
  color: var(--ink-900);
  padding: .3rem .65rem;
  border-radius: 999px;
  font-weight: 600;
}

.tier-name { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.tier-price { display: flex; align-items: baseline; gap: .3rem; }
.tier-price b { font-size: clamp(2.1rem, 1.6rem + 1.9vw, 2.9rem); font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.tier-price span { font-family: var(--f-mono); font-size: .72rem; color: var(--fg-faint); }
.tier-note { font-size: .9rem; color: var(--fg-muted); min-height: 2.6em; }

.tier-feats { display: grid; gap: .55rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* Bullet via absolute position + padding-left, not display: flex — flex
   was breaking any item that mixes plain text with a <b>: a flex container
   wraps each top-level run of inline content into its own anonymous flex
   item, so "<b>Custom website design</b>, no upfront fee" became two
   separate flex items side by side instead of one line of text, and wrapped
   with a ragged, misaligned second line instead of a normal hanging indent. */
.tier-feats li { position: relative; padding-left: 1.15rem; font-size: .89rem; color: var(--fg-muted); line-height: 1.45; }
.tier-feats li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .42rem;
  width: 8px; height: 9px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.tier-feats li.is-off { color: var(--fg-faint); opacity: .55; }
.tier-feats li.is-off::before { background: var(--fg-faint); }
.tier-feats li b { color: var(--fg); font-weight: 600; }
.tier .btn { margin-top: auto; justify-content: center; }
/* The aside "Direct" card reuses .tier but isn't a pricing column — it should
   not stretch its CTA to the bottom of a tall sticky rail. */
.sticky-aside .tier .btn { margin-top: .5rem; }

/* Shared-across-all-tiers strip */
.tier-common {
  margin-top: 1.5rem;
  padding: 1.25rem clamp(1.25rem, 1rem + 1vw, 2rem);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
}
.tier-common strong { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); }
.tier-common ul { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.tier-common li { font-size: .84rem; color: var(--fg-muted); }

/* ---------- 15. Testimonials ---------- */

.quotes { display: grid; gap: 1.25rem; }
@media (min-width: 52rem) { .quotes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 74rem) { .quotes { grid-template-columns: repeat(4, 1fr); } }

.quote {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-raise);
  position: relative;
  transition: transform .5s var(--ease), border-color .4s;
}
.quote:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.quote blockquote {
  font-size: 1.02rem;
  line-height: 1.55;
  letter-spacing: -.012em;
}
.quote figcaption { display: grid; gap: .1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.quote figcaption b { font-weight: 600; font-size: .92rem; }
.stars { color: var(--accent); font-size: .8rem; letter-spacing: .18em; }

/* ---------- 16. Big CTA ---------- */

.cta { position: relative; overflow: hidden; text-align: center; }
.cta .mesh-b { top: -30%; left: 50%; translate: -50% 0; }
.cta-inner { display: grid; gap: 1.5rem; justify-items: center; }
.cta h2 { max-width: 18ch; }
.cta .lead { text-align: center; }

/* Oversized ghost wordmark behind the CTA */
.cta-ghost {
  position: absolute;
  left: 50%; bottom: -.22em;
  translate: -50% 0;
  z-index: -1;
  font-size: var(--t-mega);
  font-weight: 600;
  letter-spacing: -.06em;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ---------- 17. Forms ---------- */

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field label {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg);
  transition: border-color .3s, background-color .3s;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-faint); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--bg);
}
.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }

.form-note { font-size: .82rem; color: var(--fg-faint); }
.form-status {
  padding: .85rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: .92rem;
}
.form-status[hidden] { display: none; }

/* Budget picker as chips instead of a <select> */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
/* width: auto overrides .field input's width: 100% — the fieldset wrapping
   these chips carries class="field" too, so that rule reaches these hidden
   radios and stretches them to the fieldset's full width. Invisible, but
   still real layout box: on some viewport widths that box's right edge
   landed past the viewport, causing a genuine (if invisible) horizontal
   scrollbar — a plausible real cause of "horizontal scroll on mobile"
   independent of the decorative bleed elements blamed for it earlier. */
.chips input { position: absolute; opacity: 0; pointer-events: none; width: auto; }
.chips label {
  font-family: var(--f-sans);
  font-size: .87rem;
  letter-spacing: normal;
  text-transform: none;
  padding: .5rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background-color .3s, color .3s, border-color .3s;
}
.chips label:hover { border-color: var(--accent); color: var(--fg); }
.chips input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--ink-900); font-weight: 600; }
.chips input:focus-visible + label { outline: 2px solid var(--mint); outline-offset: 3px; }

/* ---------- 18. FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
  cursor: pointer;
  list-style: none;
  font-size: var(--t-h4);
  font-weight: 600;
  letter-spacing: -.02em;
  transition: color .3s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary::after {
  content: '';
  flex: none;
  width: 13px; height: 13px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  rotate: 45deg;
  transition: rotate .4s var(--ease);
  margin-bottom: 5px;
}
.faq details[open] summary::after { rotate: -135deg; margin-bottom: -3px; }
.faq details p { padding-bottom: 1.5rem; color: var(--fg-muted); max-width: 62ch; }
.faq details[open] p { animation: fade-up .5s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- 19. Footer ---------- */

.ftr {
  background: var(--ink-900);
  color: #EAF5F1;
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 2rem + 3vw, 5rem) 2rem;
}
.ftr-grid { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) {
  .ftr-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 3rem; }
  .ftr-grid.is-compact { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); }
}
.ftr h4 {
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 1.1rem;
}
.ftr-links { display: grid; gap: .6rem; }
.ftr-links a { color: rgba(234,245,241,.65); font-size: .93rem; transition: color .3s; width: fit-content; }
.ftr-links a:hover { color: #fff; }
.ftr-blurb { color: rgba(234,245,241,.6); max-width: 34ch; margin-top: 1rem; font-size: .95rem; }

.ftr-base {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  color: rgba(234,245,241,.42);
}

/* ---------- 20. Scroll reveal ---------- */

/* Opt-in only, and disabled wholesale under reduced-motion via the block in §2.
   No-JS safety: .reveal only gets its hidden state once JS adds .js to <html>. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 21. Page header (interior pages) ---------- */

.phead {
  position: relative;
  padding-block: clamp(8rem, 6rem + 8vw, 12rem) clamp(3rem, 2rem + 3vw, 5rem);
  background: var(--ink-900);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.phead .mesh-a { top: -40%; right: -10%; opacity: .35; }
.phead h1 { margin-block: 1.2rem .9rem; }
.phead .lead { max-width: 52ch; }

.crumbs { display: flex; gap: .5rem; align-items: center; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }
.crumbs a:hover { color: var(--mint); }

/* ---------- 22. Misc content blocks ---------- */

.two-col { display: grid; gap: clamp(2rem, 1.2rem + 3vw, 4rem); }
@media (min-width: 62rem) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.two-col.is-narrow-left { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 61.99rem) { .two-col.is-narrow-left { grid-template-columns: 1fr; } }

.prose { display: grid; gap: 1.1rem; max-width: var(--maxw-text); }
.prose p { color: var(--fg-muted); }
.prose h3 { margin-top: 1rem; color: var(--fg); }
.prose strong { color: var(--fg); font-weight: 600; }

.checklist { display: grid; gap: .7rem; }
/* Same fix as .tier-feats above: absolute + padding-left instead of flex,
   so a <strong>/<b> mixed with trailing plain text flows and wraps as one
   normal line instead of splitting into separate flex items. */
.checklist li { position: relative; padding-left: 1.3rem; color: var(--fg-muted); }
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .45rem;
  width: 9px; height: 10px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* Sticky aside for long pages */
@media (min-width: 62rem) {
  .sticky-aside { position: sticky; top: 7rem; }
}

/* Logo wall */
/* Cell separators are drawn with outlines rather than the usual
   gap-over-a-tinted-background trick: the item count rarely fills the last
   row, and that technique paints the leftover tracks as a solid slab. */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.logo-wall li {
  outline: 1px solid var(--line);
  background: var(--bg);
  padding: 1.6rem 1rem;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: -.02em;
  color: var(--fg-faint);
  min-height: 5.5rem;
  transition: background-color .4s, color .4s;
}
.logo-wall li:hover { background: var(--bg-raise); color: var(--fg); }

/* ---------- 23. Motion showcase — scroll-scrubbed device reveal ---------- */
/* Rev. 1 used a two-face backface-visibility flip that depends on how a
   browser composites 3D layers. It rendered correctly in every tool
   available to check it and still shipped broken in the wild, twice, in two
   different ways. Rev. 2 played it safe with a ±25° tilt and a crossfade,
   which was robust but read as a squeeze-and-fade rather than a spin. Rev. 3
   got the spin right (`scaleX(|cos(θ)|)`, a plain 2D horizontal scale that
   traces the same width profile a real flat card rotating on its vertical
   axis would show a camera) but pinned the section to a full 100vh viewport
   to drive it — a mostly-empty frame around a modest device, with nothing
   moving until the pin had fully engaged. Rev. 4 dropped the pin entirely,
   which fixed the empty frame but lost the "hold and watch it spin" beat —
   it read as a normal image scrolling past, over almost as soon as it
   started.

   Rev. 5: a short pin, sized to the device rather than the viewport, that
   the spin runs through on both sides of. `.device-fade` is a normal
   content-width image — no forced viewport-height sizing, no empty frame
   around it at rest. `.motion-stage` pins at its own natural (auto) height,
   not 100vh, so most of the viewport is free to show whatever comes next.
   `.motion-pin` adds a modest fixed amount of extra scroll distance beyond
   that for the pin to hold through. The spin (in js/main.js) starts the
   moment the section's top edge appears at the bottom of the viewport —
   well before the pin engages — carries on through the hold, and finishes
   right as it releases, so it's never static and never gated behind
   "fully pinned yet."

   The squeeze itself: full width, a sliver at 90°, full width at 180° (the
   "back"), a sliver again at 270°, full width at 360°. No 3D anywhere, so
   no backface and nothing for a compositor to resolve differently. The
   three images swap at the two zero-width instants, invisible by
   construction, so one turn shows three sites and ends on the third, not
   back on the first. No CSS transition on the scrubbed properties — 1:1
   correspondence with scroll position, not eased lag. */

.motion-pin {
  position: relative;
  /* How long a position: sticky child stays pinned is (this element's
     height minus the STAGE's own height) — not the viewport height, which
     only happens to be the same thing when the stage happens to be ~100vh
     tall. The stage is (100vh - 6rem) tall below, so this is that same
     expression plus a fixed 48rem hold, giving a screen-size-independent
     pin duration (js/main.js measures the stage's real height each frame
     rather than assuming this number, so the two can't drift apart).

     48rem, not the 16rem this started at: the hold is what most of the
     spin plays out over, and at 16rem the whole 360° turn was crammed into
     ~435px of scroll — fast enough that the pin never registered as a
     pause. */
  height: calc(100vh - 6rem + 48rem);
}
.motion-stage {
  /* top: 6rem clears the fixed header (js/main.js's approach/pinned split
     uses this same offset, so the two agree on the instant it "arrives" —
     a bigger offset here, tried previously, made it stick noticeably
     before js/main.js thought it had, and the device overlapped the copy
     above it). Height (100vh - 6rem) fills essentially the whole space
     below the header rather than a short box floating inside it, so
     centering the device with justify-content happens inside a box that's
     already most of the viewport — leftover space above/below the device
     is modest and symmetric, not a large empty region under a small card. */
  position: sticky;
  top: 6rem;
  height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(1.5rem, 1rem + 2vw, 3rem);
}

/* A normal content-width image, not sized off viewport height — there's no
   full-bleed frame to fill. Kept at the source screenshots' native 16:10
   ratio so object-fit: cover crops nothing. */
.device-fade {
  width: min(70vw, 720px);
  aspect-ratio: 16 / 10;
  opacity: 1; /* no-JS / reduced-motion default: fully visible, static */
  will-change: opacity, transform;
}

/* Mobile-only (not tablet — matches the <picture> breakpoint in index.html
   and the site's existing 48rem tablet-and-up cutoff): real phone
   screenshots instead of the desktop 16:10 crops, so the frame switches to
   their native portrait ratio. Width is also capped by the available
   height so a long screenshot on a short phone can't outgrow the stage. */
@media (max-width: 47.99rem) {
  .device-fade {
    aspect-ratio: 1080 / 2280;
    width: min(58vw, calc((100vh - 6rem - 10rem) * (1080 / 2280)));
  }
}

/* Tablet (48rem–61.99rem, matching the <picture> breakpoint in index.html
   and the site's own tablet band — desktop rules start at 62rem): real
   tablet screenshots, closer to square than the phone shots, so the frame
   gets their native ratio here too instead of falling through to the
   desktop 16:10 crop. */
@media (min-width: 48rem) and (max-width: 61.99rem) {
  .device-fade {
    aspect-ratio: 1200 / 1827;
    width: min(46vw, 560px, calc((100vh - 6rem - 10rem) * (1200 / 1827)));
  }
}

.device {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line-strong);
  border-radius: clamp(10px, 1.4vw, 18px);
  padding: clamp(10px, 1.2vw, 16px) clamp(10px, 1.2vw, 16px) clamp(26px, 3vw, 40px);
  /* Soft and fully clear of the box before it fades to nothing — no hard
     edge for .motion-stage to clip (it no longer clips at all; see above)
     and not dark/wide enough to visibly dim nearby text even where it
     does overlap something briefly during the approach. */
  box-shadow: 0 40px 90px -10px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
  will-change: transform;
}

.device-notch {
  position: absolute;
  top: clamp(10px, 1.2vw, 16px);
  left: 50%;
  translate: -50% 0;
  width: 46%;
  height: 3px;
  border-radius: 999px;
  background: var(--ink-900);
  opacity: .6;
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: max(2px, calc(clamp(10px, 1.4vw, 18px) - 8px));
  overflow: hidden;
  background: var(--ink-900);
}
.device-screen picture { display: contents; }
.device-screen img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
/* First image is the resting state for no-JS / reduced-motion; JS drives
   all three images' opacity directly once it's running. Each image is now
   wrapped in a <picture> (for the mobile source swap), so "first" has to
   be judged by the <picture>'s position, not the <img>'s — inside a
   <picture>, the <source> comes before the <img>, so the <img> itself is
   never :first-child. */
.device-screen picture:not(:first-child) img { opacity: 0; }
.device-screen picture:first-child img { opacity: 1; }

.motion-caption {
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

/* Reduced motion: no rotation, just the first image sitting still. This
   matches the .reveal fallback elsewhere: a missing animation is fine, a
   stuck/hidden section is not. */
@media (prefers-reduced-motion: reduce) {
  .device, .js .device { transform: none !important; }
}

/* ---------- 24. Labs: motion-section background effects ---------- */
/* labs.html only — index.html's .motion-pin has no .motion-bg inside it,
   so none of this touches production. Each variant is one absolutely
   positioned layer sitting behind the device, driven by the exact same
   scroll progress already computed in js/main.js (search "Labs-only
   background effects" there) instead of duplicating the scroll math once
   per effect. */
/* Rotating .is-hex's axis-aligned bounding box grows wider than the
   stage past a few degrees (a 55° turn on a full-width layer overflows a
   typical tablet width by 200px+) — this wrapper clips just that box,
   not .motion-stage itself, so the device's own shadow can still bleed
   past its edges instead of getting cut into a hard-edged rectangle. */
.motion-bg-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.motion-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Glow, hex and beams get their opacity set per-frame in js/main.js (tied
   to the spin); dots doesn't (it's plain scroll-rate parallax, no spin
   tie-in), so it needs a static value here instead. These starting values
   also cover no-JS and reduced-motion, where nothing ever overrides them. */
.motion-bg.is-glow,
.motion-bg.is-hex,
.motion-bg.is-beams { opacity: .3; }
.motion-bg.is-dots { opacity: .4; }

/* Glow: a big soft blob, the same species as the .mesh elements used
   elsewhere on the site, that drifts and grows as the spin plays out. */
.motion-bg.is-glow {
  background: radial-gradient(circle at 50% 50%, var(--mint), transparent 68%);
  filter: blur(90px);
}

/* Hex: the brand's hexagon, tiled and barely-there, drifting and rotating
   a few degrees over the scroll — the hero's canvas field is pointer-
   reactive and redraws every frame, which this doesn't need since it only
   has to move, not respond to a cursor, so it's a static tiled SVG.

   A single hexagon per tile, repeated plainly, can only ever stack rows
   touching tip-to-tip — a true honeycomb needs alternating rows offset by
   half a hex-width, which a flat W×H repeat can't express on its own. The
   tile below instead encodes one full *period* of that offset grid (width
   = one hex-spacing, height = two row-spacings, matching the hero's own
   R=34 grid math exactly) and contains all 9 hexagon instances — full
   ones plus the edge fragments of their neighbors — needed for the tile's
   own edges to line up with the next copy of itself. Verified seamless by
   rendering it tiled at 1x and 2x before wiring it in here: full edge-
   sharing hexagons, no seams, same look as the hero's grid. */
.motion-bg.is-hex {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58.89' height='102.00' viewBox='0 0 58.89 102.00'%3E%3Cpath d='M-58.89 -34.00 L-29.44 -17.00 L-29.44 17.00 L-58.89 34.00 L-88.33 17.00 L-88.33 -17.00 Z M0.00 -34.00 L29.44 -17.00 L29.44 17.00 L0.00 34.00 L-29.44 17.00 L-29.44 -17.00 Z M58.89 -34.00 L88.33 -17.00 L88.33 17.00 L58.89 34.00 L29.44 17.00 L29.44 -17.00 Z M-29.44 17.00 L0.00 34.00 L0.00 68.00 L-29.44 85.00 L-58.89 68.00 L-58.89 34.00 Z M29.44 17.00 L58.89 34.00 L58.89 68.00 L29.44 85.00 L-0.00 68.00 L0.00 34.00 Z M88.33 17.00 L117.78 34.00 L117.78 68.00 L88.33 85.00 L58.89 68.00 L58.89 34.00 Z M-58.89 68.00 L-29.44 85.00 L-29.44 119.00 L-58.89 136.00 L-88.33 119.00 L-88.33 85.00 Z M0.00 68.00 L29.44 85.00 L29.44 119.00 L0.00 136.00 L-29.44 119.00 L-29.44 85.00 Z M58.89 68.00 L88.33 85.00 L88.33 119.00 L58.89 136.00 L29.44 119.00 L29.44 85.00 Z' fill='none' stroke='%237ED6BE' stroke-opacity='.6'/%3E%3C/svg%3E");
  background-size: 58.89px 102px;
  mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent);
  /* This is the only variant that rotates. A layer sized exactly to its
     box (inset: 0, the shared default above) still covers the box at
     rotate(0) — but rotating a rectangle that exactly fits its container
     swings the container's own corners outside the rotated shape, so two
     of them go uncovered. Tripling the layer's size in both dimensions
     (inset: -100% — 300% width/height, still centered) keeps every corner
     covered through the full 0-55° sweep for any realistic aspect ratio
     this section renders at; .motion-bg-clip still clips it to the box's
     actual edges, so this doesn't reopen the overflow this was already
     fixed for. */
  inset: -100%;
}

/* Beams: a few diagonal light bars that sweep sideways as you scroll. */
.motion-bg.is-beams {
  background: repeating-linear-gradient(
    115deg,
    transparent 0 12%,
    color-mix(in srgb, var(--mint) 55%, transparent) 13%,
    transparent 15% 32%
  );
}

/* Dots: a tiled dot grid that moves at its own rate as the page scrolls —
   parallax depth, not tied to the spin the way the other three are. */
.motion-bg.is-dots {
  background-image: radial-gradient(circle, color-mix(in srgb, var(--mint) 70%, transparent) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}

@media (prefers-reduced-motion: reduce) {
  .motion-bg { transform: none !important; }
}
