/* ==========================================================================
   RZVDEV design system
   Concept: "Dock & Resolve". Scroll hands large typography to the interface
   frame (the wordmark docks into the header) and resolves rough drafts into
   finished statements. Strictly monochrome: warm paper, near-black ink, and the
   brand's text caret drawn in ink. No accent colour, no numbering.

   Layers of this file
     1  tokens        colour, type, spacing, grid, radii, motion, materials
     2  base
     3  materials     .glass (clear, frost, lift, live)
     4  frame         header, ruler, buttons
     5  opening       docking wordmark, hero
     6  sections      shared patterns, then one block per section
     7  responsive, print, reduced motion
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL 1.1) ----------
   Only Geist and Geist Mono are used. font-display: block means no substitute
   typeface is ever painted while they load (they are preloaded, so this is brief). */
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

/* ==========================================================================
   1 · Tokens
   ========================================================================== */
:root {
  /* colour: warm paper and ink, nothing else */
  --paper: #F4F2EC;
  --paper-2: #ECE9E1;
  --paper-3: #E2DFD5;
  --ink: #0E0E0D;
  --ink-2: #47453F;
  --ink-3: #6A685F;
  --draft: #8A877E;           /* unresolved text, 3.2:1 on paper: readable by design */
  --night: #0D0D0C;
  --night-2: #151513;
  --bone: #EFECE4;

  --bg: var(--paper);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --fg-draft: var(--draft);
  --stage-bg: var(--paper-2);
  --rule: rgb(14 14 13 / .16);
  --rule-strong: rgb(14 14 13 / .34);

  --hdr-bg: var(--paper);
  --hdr-fg: var(--ink);
  --hdr-line: rgb(14 14 13 / .14);

  /* no named system fonts: the bare generic keyword is only the browser's last resort if the files cannot load */
  --font-sans: "Geist", sans-serif;
  --font-mono: "Geist Mono", monospace;

  /* spacing: a 4 px base, an 8 px rhythm. Optical exceptions are made in place, never by inventing new steps. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  /* semantic spacing */
  --sp-icon: var(--s-2);                          /* icon to label */
  --sp-head-desc: clamp(var(--s-4), 1.5vw, var(--s-5));   /* heading to its description */
  --sp-group: clamp(var(--s-6), 3.6vw, var(--s-7));        /* between groups inside a section */
  --sp-block: clamp(var(--s-7), 6vw, var(--s-9));           /* between components */
  --sec-y: clamp(80px, 9vw, 144px);                         /* section padding, each side */
  --sec-gap: clamp(var(--s-8), 7vw, 112px);                 /* section head to first component */

  /* radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* page container: gutters follow the viewport, the container stops growing at --content-max */
  --content-max: 1320px;
  --gutter: clamp(16px, 1.2vw + 8px, 32px);                 /* column gap */
  --page-pad: clamp(20px, 4.4vw + 2px, 72px);
  --pad: max(var(--page-pad), calc((var(--vw, 100vw) - var(--content-max)) / 2));
  --hdr-h: 64px;

  /* wordmark geometry, in cap-height units (see tools/build_wordmark.py) */
  --wm-ratio: 5.6268;
  --wm-h: 1;
  --dock-cap: 16px;
  --dock-top: calc((var(--hdr-h) - var(--dock-cap)) / 2);
  --dock-gap: clamp(20px, 3.4vh, 40px);
  --F: calc((var(--vw, 100vw) - 2 * var(--pad)) / var(--wm-ratio));

  /* type scale (fluid, with hard floors and ceilings) */
  --fs-body: clamp(1.0625rem, 1rem + .2vw, 1.1875rem);
  --fs-lede: clamp(1.125rem, 1rem + .45vw, 1.4375rem);
  --fs-title: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  --fs-hero: clamp(2.75rem, 2.1rem + 6.4vw, 8.5rem);
  --fs-display: clamp(2.5rem, 1.4rem + 4.2vw, 6rem);
  --fs-statement: clamp(1.75rem, 1.15rem + 2.55vw, 4rem);
  --fs-statement-md: clamp(1.5rem, 1.05rem + 1.9vw, 2.875rem);
  --fs-area: clamp(1.875rem, 1.1rem + 2.3vw, 3.5rem);
  --fs-step: clamp(1.625rem, 1.15rem + 1.6vw, 2.75rem);
  --rl: .58;                  /* reading line, fraction of viewport height */

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --dur-1: 140ms;    /* press */
  --dur-2: 280ms;    /* hover, focus */
  --dur-3: 520ms;    /* state change */
  --dur-4: 800ms;    /* layout, section */

  /* materials (light). Four families built from the same parts: fill, blur, saturation, edge, shadow. */
  --glass-fill: rgb(255 255 255 / .46);
  --glass-fill-hi: rgb(255 255 255 / .7);
  --glass-solid: rgb(250 249 245 / .97);
  --glass-ring: rgb(14 14 13 / .09);
  --glass-spec: rgb(255 255 255 / .95);
  --glass-shade: rgb(14 14 13 / .12);
  --glass-light: rgb(255 255 255 / .6);
  --glass-shadow-1: 0 1px 1px rgb(14 14 13 / .04), 0 3px 8px -3px rgb(14 14 13 / .10);
  --glass-shadow-2: 0 1px 1px rgb(14 14 13 / .05), 0 10px 26px -12px rgb(14 14 13 / .22), 0 32px 56px -36px rgb(14 14 13 / .32);
}

@media (max-width: 700px) {
  :root {
    --hdr-h: 56px;
    --dock-cap: 14px;
    --wm-ratio: 2.931;       /* stacked wordmark: RZV / DEV| */
    --wm-h: 2.16;
  }
}

/* glass that sits on a dark surface inside a light section (the code panel of the first demonstration) */
.on-dark {
  --glass-fill: rgb(239 236 228 / .08);
  --glass-fill-hi: rgb(239 236 228 / .13);
  --glass-solid: rgb(32 32 30 / .97);
  --glass-ring: rgb(239 236 228 / .14);
  --glass-spec: rgb(255 255 255 / .38);
  --glass-shade: rgb(0 0 0 / .5);
  --glass-light: rgb(255 255 255 / .16);
  --glass-shadow-1: 0 1px 1px rgb(0 0 0 / .3), 0 4px 12px -4px rgb(0 0 0 / .5);
}

.theme-dark {
  --bg: var(--night);
  --fg: var(--bone);
  --fg-2: #B8B4AA;
  --fg-3: #8D8A80;
  --fg-draft: #6E6B63;
  --stage-bg: var(--night-2);
  --rule: rgb(239 236 228 / .17);
  --rule-strong: rgb(239 236 228 / .36);

  --glass-fill: rgb(239 236 228 / .07);
  --glass-fill-hi: rgb(239 236 228 / .12);
  --glass-solid: rgb(32 32 30 / .97);
  --glass-ring: rgb(239 236 228 / .12);
  --glass-spec: rgb(255 255 255 / .40);
  --glass-shade: rgb(0 0 0 / .5);
  --glass-light: rgb(255 255 255 / .16);
  --glass-shadow-1: 0 1px 1px rgb(0 0 0 / .3), 0 4px 12px -4px rgb(0 0 0 / .5);
  --glass-shadow-2: 0 1px 1px rgb(0 0 0 / .3), 0 14px 32px -14px rgb(0 0 0 / .7), 0 36px 64px -40px rgb(0 0 0 / .8);
}

html[data-hdr="dark"] {
  --hdr-bg: var(--night);
  --hdr-fg: var(--bone);
  --hdr-line: rgb(239 236 228 / .16);
}

/* ==========================================================================
   2 · Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-y: scroll;                 /* stable scrollbar → stable width → stable wordmark */
  scroll-padding-top: var(--hdr-h);      /* anchors land flush under the header; sections carry their own top padding */
  background: var(--paper);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }   /* form controls would otherwise fall back to the system font */

::selection { background: var(--ink); color: var(--paper); }
.theme-dark ::selection, .menu ::selection { background: var(--bone); color: var(--night); }
[tabindex="-1"]:focus { outline: none; }   /* sections receive focus after an in-page jump; they are not controls */

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 12px 18px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-size: .9375rem; font-weight: 500;
  transform: translateY(-160%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip:focus-visible { transform: none; outline-offset: 2px; }

/* RVL icons: 24 grid, 1.5 stroke, butt caps, mitre joins. Geometry comes from the sprite, style from here. */
.ic { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: butt; stroke-linejoin: miter; flex: none; }

.mono {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem; font-weight: 450; line-height: 1.4;
  letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3);
}

/* ==========================================================================
   3 · Materials
   Clear, Frost, Lift, Live: one construction, four settings.
     fill        translucent tint over what is behind
     blur + sat  diffusion, with the saturation lift that keeps it from going grey
     edge        a 1 px specular rim, bright on the lit corner and shaded opposite
     shadow      a tight contact shadow plus a long soft one (Lift)
     light       a soft highlight that follows the pointer (Live)
   ========================================================================== */
.glass, .btn:not(.btn--solid) {
  --gf: var(--glass-fill);
  --gb: 18px;
  --gs: 1.5;
  --gsh: var(--glass-shadow-1);
  position: relative;
  background-color: var(--gf);
  -webkit-backdrop-filter: blur(var(--gb)) saturate(var(--gs));
  backdrop-filter: blur(var(--gb)) saturate(var(--gs));
  box-shadow: var(--gsh), inset 0 0 0 1px var(--glass-ring);
}
.glass--clear { --gf: color-mix(in srgb, var(--glass-fill) 60%, transparent); --gb: 8px; --gs: 1.25; }
.glass--frost { --gf: var(--glass-fill-hi); --gb: 20px; --gs: 1.6; }
.glass--lift  { --gf: var(--glass-fill-hi); --gb: 26px; --gs: 1.7; --gsh: var(--glass-shadow-2); }
.glass--live  { transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out); }

/* specular edge: a gradient ring, masked to the 1 px border box */
.glass::before, .btn:not(.btn--solid)::before {
  content: ""; position: absolute; inset: 0; z-index: 1; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, var(--glass-spec) 0%, transparent 34%, transparent 62%, var(--glass-shade) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* pointer light: only on materials that respond (--mx / --my are written by js/glass.js) */
.glass--live::after, .btn::after {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(150px circle at var(--mx, 50%) var(--my, 0%), var(--glass-light), transparent 70%);
  opacity: 0; transition: opacity var(--dur-3) var(--ease-out);
}
@media (hover: hover) {
  .glass--live:hover { --gf: var(--glass-fill-hi); }
  .glass--live:hover::after, .btn:hover::after { opacity: 1; }
}
.glass--live:active { transform: scale(.985); }

/* graceful fallbacks: no backdrop-filter, or the user asked for less transparency */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass, .btn:not(.btn--solid), .hdr { background-color: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .btn:not(.btn--solid) { background-color: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hdr { background-color: var(--hdr-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ==========================================================================
   4 · Frame: header, ruler, chapter odometer, buttons
   ========================================================================== */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--hdr-h);
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  background-color: color-mix(in srgb, var(--hdr-bg) 80%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  color: var(--hdr-fg);
  transition: background-color var(--dur-3) var(--ease-io), color var(--dur-3) var(--ease-io);
}

.brand {
  grid-column: 1 / span 3;
  justify-self: start;
  display: block;
  width: calc(var(--dock-cap) * 5.6268);
  height: var(--dock-cap);
  padding-block: 14px; margin-block: -14px;
  box-sizing: content-box;
  line-height: 1;
}
.brand__t {
  display: block;
  font-size: calc(var(--dock-cap) / .71);
  font-weight: 620;
  letter-spacing: -.035em;
  line-height: var(--dock-cap);
  height: var(--dock-cap);
  white-space: nowrap;
}
html.dock-on .brand__t { opacity: 0; }

.hdr__chapter {
  grid-column: 4 / span 4;
  display: flex; align-items: center; gap: 1.1em;
  font-family: var(--font-mono);
  font-size: .75rem; font-weight: 450; line-height: 1.25;
  letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .45s var(--ease-out);
}
html:not(.is-top) .hdr__chapter { opacity: 1; }
.odo { position: relative; display: inline-grid; overflow: hidden; height: 1.25em; }
.odo__in { grid-area: 1 / 1; display: block; will-change: transform; }

.hdr__nav { grid-column: 7 / -1; justify-self: end; }
.hdr__nav ul { display: flex; align-items: center; gap: clamp(18px, 2.1vw, 32px); }
.hdr__nav a:not(.btn) {
  position: relative; display: block; padding-block: 10px;
  font-size: .875rem; font-weight: 450; line-height: 1; letter-spacing: -.005em;
  opacity: .66;
  transition: opacity var(--dur-2) var(--ease-out);
}
.hdr__nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform var(--dur-3) var(--ease-out);
}
.hdr__nav a[aria-current]:not(.btn) { opacity: 1; }
.hdr__nav a[aria-current]:not(.btn)::after { transform: scaleX(1); transform-origin: 0 50%; }
@media (hover: hover) {
  .hdr__nav a:not(.btn):hover { opacity: 1; }
  .hdr__nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
}
/* the header carries its own theme, independent of the section underneath */
.hdr, .menu { --glass-fill: rgb(255 255 255 / .46); }
html[data-hdr="dark"] .hdr {
  --fg: var(--hdr-fg);
  --glass-fill: rgb(239 236 228 / .08);
  --glass-fill-hi: rgb(239 236 228 / .14);
  --glass-ring: rgb(239 236 228 / .16);
  --glass-spec: rgb(255 255 255 / .38);
  --glass-shade: rgb(0 0 0 / .45);
  --glass-light: rgb(255 255 255 / .16);
}
.hdr .btn { --fg: var(--hdr-fg); --bg: var(--hdr-bg); }
.hdr__nav .btn[aria-current] { box-shadow: var(--gsh), inset 0 0 0 1px currentColor; }

.hdr__menu {
  display: none;
  grid-column: 9 / -1; justify-self: end;
  align-items: center; gap: 12px;
  height: 44px; padding-inline: 6px 0;
  font-size: .875rem; font-weight: 500; letter-spacing: -.005em;
}
.hdr__menu-bars { position: relative; width: 22px; height: 10px; }
.hdr__menu-bars i {
  position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 1px;
  transition: transform var(--dur-3) var(--ease-out), top var(--dur-3) var(--ease-out);
}
.hdr__menu-bars i:nth-child(1) { top: 1px; }
.hdr__menu-bars i:nth-child(2) { top: 8px; }
html.menu-open .hdr__menu-bars i:nth-child(1) { top: 4.5px; transform: rotate(45deg); }
html.menu-open .hdr__menu-bars i:nth-child(2) { top: 4.5px; transform: rotate(-45deg); }

.hdr__rule { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hdr-line); pointer-events: none; }
.hdr__fill {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: var(--hdr-fg);
  transform: scaleX(0); transform-origin: 0 50%;
}
.hdr__tick {
  position: absolute; bottom: 0; width: 1px; height: 6px;
  background: var(--hdr-line);
  transition: height var(--dur-3) var(--ease-out), background-color var(--dur-2);
}
.hdr__tick.is-on { height: 9px; background: var(--hdr-fg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  height: 52px; padding-inline: var(--s-5);
  border-radius: 999px;
  font-size: .9375rem; font-weight: 500; line-height: 1; letter-spacing: -.005em; white-space: nowrap;
  color: var(--fg);
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn--sm { height: 36px; padding-inline: var(--s-4); font-size: .8125rem; }
.btn--solid {
  background-color: var(--fg); color: var(--bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px rgb(255 255 255 / .06), 0 8px 18px -10px rgb(14 14 13 / .55);
}
.btn--solid::after { background: radial-gradient(150px circle at var(--mx, 50%) var(--my, 0%), rgb(255 255 255 / .26), transparent 70%); }
@media (hover: hover) {
  .btn:not(.btn--solid):hover { --gf: var(--glass-fill-hi); }
  .btn--solid:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(255 255 255 / .1), 0 12px 22px -10px rgb(14 14 13 / .6); }
}
.btn:active { transform: scale(.975); }
.btn .ic { transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) { .btn--solid:hover .ic { transform: translate(2px, -2px); } }

/* ==========================================================================
   5 · Opening: docking wordmark, hero
   ========================================================================== */
.dock {
  position: relative;
  height: 0;
  margin-bottom: calc(var(--F) * var(--wm-h) + var(--dock-gap));
  z-index: 90;                 /* above the header (80), hidden while the menu (70) is open */
  pointer-events: none;
}
html.dock-on .dock { position: sticky; top: var(--dock-top); }
html.menu-open .dock__wm { opacity: 0; }

.dock__wm {
  position: absolute; left: var(--pad); top: 0;
  width: calc(var(--F) * var(--wm-ratio));
  height: calc(var(--F) * var(--wm-h));
  color: var(--hdr-fg);
  clip-path: inset(calc(var(--F) * -.1));
}
/* the colour hand-off only animates once the mark is docked in the header; the big hero mark never fades */
html.docked .dock__wm { transition: color var(--dur-3) var(--ease-io); }
.dk {
  --lx: var(--x); --ly: 0;
  position: absolute;
  left: calc(var(--lx) * var(--F));
  top: calc(var(--ly) * var(--F));
  width: calc(var(--w) * var(--F));
  height: var(--F);
  transform-origin: 0 0;
  fill: currentColor;
  display: block;
}
@media (max-width: 700px) { .dk { --lx: var(--sx); --ly: var(--sy); } }
/* the caret overshoots the cap height by 6 % top and bottom, so it reads as a text cursor, never as a letter */
.dk--caret { top: calc((var(--ly) - .06) * var(--F)); height: calc(var(--F) * 1.12); }
.dk--caret::after {
  content: ""; position: absolute; inset: 0; background: currentColor;
  animation: caret 1.15s steps(1, end) infinite;
}
html:not(.is-top) .dk--caret::after { animation: none; }

@keyframes caret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .08; } }
@keyframes dk-in { from { translate: 0 118%; } to { translate: 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  html.js:not(.ready) .dk { translate: 0 118%; }
  html.js.ready .dk { animation: dk-in 1.15s var(--ease-out) both; animation-delay: calc(var(--i) * 75ms + 120ms); }
}

.hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(32px, 6vh, 72px);
  padding: calc(var(--hdr-h) + clamp(24px, 5vh, 64px)) var(--pad) clamp(20px, 3.4vh, 40px);
  min-height: max(440px, calc(100svh - var(--F) * var(--wm-h) - var(--dock-gap)));
}
.hero__meta { display: flex; justify-content: space-between; gap: var(--s-5); color: var(--fg-3); }
.mono--status { display: inline-flex; align-items: center; gap: .9em; color: var(--fg); }
.mark { display: block; width: 2px; height: 1.05em; background: var(--fg); }

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: .93;
  letter-spacing: -.052em;
  max-width: 11.2em;
  text-wrap: balance;
  margin-left: -.045em;       /* optical alignment of the “I” stem with the grid */
}
.wd { display: inline-block; vertical-align: top; clip-path: inset(-.12em -.1em -.22em -.1em); }
.wd > span { display: inline-block; }
@keyframes wd-in { from { transform: translateY(125%); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.ready) .wd > span { transform: translateY(125%); }
  html.js.ready .wd > span { animation: wd-in 1.2s var(--ease-out) both; animation-delay: calc(var(--n, 0) * 90ms + 200ms); }
  .wd:nth-child(2) > span { --n: 1; } .wd:nth-child(3) > span { --n: 2; } .wd:nth-child(4) > span { --n: 3; }
  html.js:not(.ready) .hero__meta, html.js:not(.ready) .hero__foot { opacity: 0; }
  html.js.ready .hero__meta, html.js.ready .hero__foot { animation: fade-in 1.2s var(--ease-out) .55s both; }
  html.js:not(.ready) .hdr > :not(.hdr__chapter) { opacity: 0; }
  html.js.ready .hdr > :not(.hdr__chapter) { animation: fade-in .9s var(--ease-out) .5s backwards; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hero__foot {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end;
  padding-top: clamp(20px, 3vh, 32px);
  border-top: 1px solid var(--rule);
}
.cue {
  grid-column: 1 / span 3; justify-self: start;
  display: inline-flex; align-items: center; gap: .8em;
  font-family: var(--font-mono); font-size: .75rem; font-weight: 450; letter-spacing: .05em; text-transform: uppercase;
  padding-block: var(--s-2); color: var(--fg);
}
.cue .ic { animation: cue 2.6s var(--ease-io) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.hero__lede { grid-column: 8 / -1; font-size: var(--fs-lede); line-height: 1.38; letter-spacing: -.018em; color: var(--fg-2); max-width: 31ch; text-wrap: pretty; }

/* ==========================================================================
   6 · Sections: shared patterns
   ========================================================================== */
.sec { position: relative; padding: var(--sec-y) var(--pad); }

/* section head: the heading sits on the grid's left, its supporting text on the right, both resting on one baseline */
.sec-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--sp-head-desc);
  align-items: end;
}
.sec-head .display { grid-column: 1 / span 8; }
.sec-head .lede { grid-column: 9 / -1; padding-bottom: .5em; max-width: 24em; }

.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.05em;
  text-wrap: balance;
  max-width: 12em;
}
.lede {
  font-size: var(--fs-lede);
  line-height: 1.42;
  letter-spacing: -.016em;
  color: var(--fg-2);
  max-width: 34em;
  text-wrap: pretty;
}

/* Reading line: a quiet instrument tick: where text resolves */
.reading-line {
  position: fixed; left: 0; top: calc(var(--rl) * 100svh); z-index: 55;
  width: 12px; height: 1px; background: var(--hdr-fg);
  opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease-out);
}
html.rl-on .reading-line { opacity: 1; }

/* scroll-written text: draft until the caret reaches it */
.statement {
  font-size: var(--fs-statement);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.034em;
  position: relative;
  text-wrap: pretty;
  max-width: 21em;
}
.statement--md { font-size: var(--fs-statement-md); line-height: 1.16; letter-spacing: -.03em; max-width: 25em; }
.statement .w, .mailbig__t .w { color: var(--fg-draft); transition: color .4s var(--ease-out); }
.statement .w.on, .mailbig__t .w.on { color: var(--fg); }
.caret {
  position: absolute; left: 0; top: 0; width: .07em; height: .82em;
  background: var(--fg);
  opacity: 0;
  transition: transform .26s var(--ease-out), opacity .25s linear;
  pointer-events: none;
}
.caret.is-on { opacity: 1; }
.caret.is-blink { animation: caret 1.15s steps(1, end) infinite; }

/* dark sections rise out of the page as a rounded surface and square off (js/scenes.js writes the variables) */
html.curtain [data-curtain] {
  clip-path: inset(0 calc(var(--cx, 0) * 1px) round calc(var(--cr-t, 0) * 1px) calc(var(--cr-t, 0) * 1px) calc(var(--cr-b, 0) * 1px) calc(var(--cr-b, 0) * 1px));
}

/* ==========================================================================
   Philosophy
   ========================================================================== */
.sec--phil { padding-top: clamp(40px, 5vw, 80px); }
.sec--phil .eyebrow { margin-bottom: var(--sp-group); }

.phil {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: center;
  margin-top: var(--sec-gap);
}
.tiers { grid-column: 1 / span 6; display: grid; row-gap: var(--sp-group); }
.tier { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--s-4); }
.tier__ic { margin-top: .5em; color: var(--fg-3); transition: color var(--dur-3) var(--ease-out); }
.tier__t { font-size: var(--fs-title); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
.tier__d { grid-column: 2; margin-top: var(--s-3); max-width: 32em; color: var(--fg-2); text-wrap: pretty; }

@media (prefers-reduced-motion: no-preference) {
  html.js .tier__t { color: var(--fg-draft); transition: color var(--dur-3) var(--ease-out); }
  html.js .tier.is-active .tier__t { color: var(--fg); }
  html.js .tier.is-active .tier__ic { color: var(--fg); }
}

/* The RZVDEV stack: engineering at the base, intelligence over it, human intent on top.
   The layers pull apart (--e) as the section is read, and the one being described lifts. */
.stack {
  grid-column: 8 / -1;
  --e: 1;
  position: relative; container-type: inline-size;
  aspect-ratio: 1 / .95;
}
.stack__plane {
  position: absolute; left: calc(var(--k) * 11cqw); top: calc(var(--k) * (13cqw + var(--e) * 9cqw));
  width: 76cqw; height: 42cqw; border-radius: 5cqw;
  display: grid; align-content: end; row-gap: 2.2cqw;
  padding: 5cqw;
  transition: translate var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.stack__plane--human { --k: 0; z-index: 3; }
.stack__plane--ai    { --k: 1; z-index: 2; }
.stack__plane--eng   { --k: 2; z-index: 1; background: var(--night); color: var(--bone); box-shadow: var(--glass-shadow-2); }
.stack__ic { position: absolute; left: 5cqw; top: 5cqw; }
.stack__plane--human { color: var(--ink); }
.stack__plane--ai { color: var(--ink); }
.sl { display: block; height: .9cqw; min-height: 2px; border-radius: 1cqw; background: currentColor; opacity: .62; }
.sl--1 { width: 46cqw; } .sl--2 { width: 34cqw; } .sl--3 { width: 40cqw; } .sl--4 { width: 22cqw; }
.sl--ghost { background: none; border-top: 1.5px dashed currentColor; border-radius: 0; opacity: .5; height: 0; }
.stack__caret { position: absolute; left: calc(5cqw + 46cqw + 1.4cqw); bottom: 4.2cqw; width: .7cqw; min-width: 2px; height: 5.4cqw; background: currentColor; animation: caret 1.15s steps(1, end) infinite; }
.stack[data-hot] .stack__plane { opacity: .5; }
.stack[data-hot="human"] .stack__plane--human,
.stack[data-hot="ai"] .stack__plane--ai,
.stack[data-hot="eng"] .stack__plane--eng { opacity: 1; translate: 0 -2.2cqw; }

/* ==========================================================================
   Exploring: four compositions, four demonstrations
   ========================================================================== */
.areas { display: grid; row-gap: var(--sec-gap); margin-top: var(--sec-gap); }
.area {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--sp-group);
  align-items: center;
}
.area__t {
  font-size: var(--fs-area);
  font-weight: 500; line-height: 1; letter-spacing: -.045em;
  color: var(--fg);
  text-wrap: balance;
}
.area__d { margin-top: var(--sp-head-desc); max-width: 30em; color: var(--fg-2); text-wrap: pretty; }

/* one: text left, a wide stage right */
.area--dev .area__text { grid-column: 1 / span 4; align-self: start; padding-top: var(--s-5); }
.area--dev .stage { grid-column: 5 / -1; }
/* two: the stage on the left, text sits low on the right */
.area--tool .area__text { grid-column: 9 / -1; grid-row: 1; align-self: end; }
.area--tool .stage { grid-column: 1 / span 8; grid-row: 1; }
/* three: heading and description share a line above a full-width stage */
.area--ux .area__text {
  grid-column: 1 / -1; display: grid; align-items: end;
  grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);   /* fallback for engines without subgrid */
  grid-template-columns: subgrid;
}
.area--ux .area__t { grid-column: 1 / span 8; }
.area--ux .area__d { grid-column: 9 / -1; margin-top: 0; padding-bottom: .4em; }
.area--ux .stage { grid-column: 1 / -1; }
/* four: a tall stage on the left, text centred on the right */
.area--lab .area__text { grid-column: 8 / -1; grid-row: 1; }
.area--lab .stage { grid-column: 1 / span 6; grid-row: 1; }

html.js .area__t { color: var(--fg-draft); transition: color var(--dur-3) var(--ease-out); }
html.js .area.is-active .area__t { color: var(--fg); }
@media (prefers-reduced-motion: reduce) { html.js .area__t { color: var(--fg); } }

/* ---------- stages ---------- */
.stage { position: relative; container-type: inline-size; }
.stage__tag {
  position: absolute; top: var(--s-4); left: var(--s-4); z-index: 6;
  padding: 7px 12px; border-radius: 999px; color: var(--fg-2);
}
.stage__cap { margin-top: var(--s-4); font-size: .875rem; line-height: 1.45; color: var(--fg-3); max-width: 46ch; }
.stage__cap--dark { color: var(--fg-3); }

/* range input shared by the demos */
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
  --p: 100%;
}
.range:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 14px; }
.range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--fg) var(--p), var(--rule-strong) var(--p)); }
.range::-moz-range-track { height: 2px; border-radius: 2px; background: var(--rule-strong); }
.range::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--fg); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; border: 0;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgb(14 14 13 / .16), 0 3px 8px rgb(14 14 13 / .28), inset 0 1px 0 #fff;
  transition: transform var(--dur-1) var(--ease-out);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgb(14 14 13 / .16), 0 3px 8px rgb(14 14 13 / .28), inset 0 1px 0 #fff;
}
.range:active::-webkit-slider-thumb { transform: scale(1.08); }

/* ---------- 1 · code to interface ---------- */
.dv {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr auto;
  border-radius: var(--r-xl); background: var(--stage-bg);
  min-height: clamp(380px, 54cqw, 520px);
}
.dv::before {   /* a faint measuring ring behind the interface */
  content: ""; position: absolute; z-index: -1; right: -12cqw; top: 50%; width: 56cqw; aspect-ratio: 1; translate: 0 -50%;
  border-radius: 50%; border: 1px solid rgb(14 14 13 / .1);
  box-shadow: 0 0 0 7cqw rgb(14 14 13 / .035);
}
.dv__code {
  grid-column: 1 / span 8; grid-row: 1 / span 2;
  display: grid; align-content: center;
  padding: clamp(24px, 5cqw, 52px) clamp(20px, 5cqw, 56px) clamp(72px, 11cqw, 96px);
  background: var(--night); color: var(--bone);
  font-family: var(--font-mono); font-size: clamp(.8125rem, 1.85cqw, 1.0625rem); line-height: 1.95; letter-spacing: 0; font-weight: 420;
  white-space: normal; overflow: hidden;      /* the source newlines collapse; each line is its own block */
}
.dv__code code { font: inherit; display: block; }
.dv__ln { display: block; white-space: pre; padding-inline: 10px; margin-inline: -10px; border-radius: 6px; transition: opacity var(--dur-3) var(--ease-out), background-color var(--dur-2); }
.t-k { color: #fff; } .t-n { color: #C9C5BA; } .t-p { color: #7F7C73; } .t-s { color: var(--bone); }
.dv__ln.is-ghost { opacity: .34; }
.dv__ln.is-off { opacity: 0; }

.dv__ui {
  grid-column: 7 / span 6; grid-row: 1; align-self: center; justify-self: stretch;
  position: relative; z-index: 2;
  margin-right: clamp(20px, 4.4cqw, 52px);
  padding: clamp(20px, 3.4cqw, 36px);
  border-radius: var(--r-lg);
  display: grid; gap: var(--s-3); justify-items: start;
  transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out), background-color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.dv__ui.is-off { opacity: 0; translate: 0 14px; }
.dv[data-flat] .dv__ui { background-color: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px var(--glass-ring); }
.dv__title { font-size: clamp(1.5rem, 4cqw, 2.5rem); font-weight: 500; line-height: 1; letter-spacing: -.04em; transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out); }
.dv__note { color: var(--fg-2); font-size: clamp(.9375rem, 1.9cqw, 1.0625rem); line-height: 1.4; transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out); }
.dv__btn {
  margin-top: var(--s-2); display: inline-flex; align-items: center; height: 40px; padding-inline: var(--s-5); border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: .9375rem; font-weight: 500;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 8px 16px -10px rgb(14 14 13 / .6);
  transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out);
}
.dv__title.is-off, .dv__note.is-off, .dv__btn.is-off { opacity: 0; translate: 0 8px; }

/* cross-highlight: a code line and the part of the interface it describes light up together */
.dv[data-hot="title"] [data-part="title"],
.dv[data-hot="note"] [data-part="note"],
.dv[data-hot="btn"] [data-part="btn"] { outline: 1.5px solid var(--ink); outline-offset: 6px; border-radius: 6px; }
.dv[data-hot="card"] .dv__ui,
.dv[data-hot="material"] .dv__ui { outline: 1.5px solid var(--ink); outline-offset: 6px; }
.dv[data-hot] .dv__ln[data-part] { background-color: rgb(239 236 228 / .06); }
.dv[data-hot="title"] .dv__ln[data-part="title"],
.dv[data-hot="note"] .dv__ln[data-part="note"],
.dv[data-hot="btn"] .dv__ln[data-part="btn"],
.dv[data-hot="card"] .dv__ln[data-part="card"],
.dv[data-hot="material"] .dv__ln[data-part="material"] { background-color: rgb(239 236 228 / .14); }

.stage--dev .stage__tag { color: #B8B4AA; }   /* it sits on the dark code panel */
.dv__scrub {
  grid-column: 1 / span 8; grid-row: 2; z-index: 3;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-4);
  margin: 0 clamp(16px, 4cqw, 40px) clamp(16px, 3cqw, 28px);
  padding: 6px var(--s-5); border-radius: 999px;
  --fg: var(--ink); --rule-strong: rgb(14 14 13 / .24);
  color: var(--ink);
}
.dv__end { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
/* wide: the scrubber lives inside the dark code panel, so it takes the dark material */
@container (min-width: 621px) {
  .dv__scrub {
    --fg: var(--bone); --rule-strong: rgb(239 236 228 / .3); color: var(--bone);
    --glass-fill: rgb(239 236 228 / .08); --glass-fill-hi: rgb(239 236 228 / .13); --glass-solid: rgb(32 32 30 / .97);
    --glass-ring: rgb(239 236 228 / .14); --glass-spec: rgb(255 255 255 / .38); --glass-shade: rgb(0 0 0 / .5);
    --glass-light: rgb(255 255 255 / .16); --glass-shadow-1: 0 1px 1px rgb(0 0 0 / .3), 0 4px 12px -4px rgb(0 0 0 / .5);
  }
  .dv__end { color: #B8B4AA; }
}

/* ---------- 2 · an intelligent interface that answers differently ---------- */
.tl {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-4); row-gap: var(--s-4);
  grid-template-rows: auto auto 1fr;
  padding: clamp(56px, 8cqw, 76px) clamp(20px, 5cqw, 48px) clamp(24px, 5cqw, 48px);
  border-radius: var(--r-xl); background: var(--stage-bg);
  min-height: clamp(420px, 62cqw, 560px);
}
.tl__art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.tl__disc { position: absolute; right: -16cqw; bottom: -20cqw; width: 66cqw; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.tl__ring { position: absolute; right: -30cqw; bottom: -34cqw; width: 94cqw; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgb(14 14 13 / .14); }
.tl__ask {
  grid-column: 1 / span 9; grid-row: 1;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 56px; padding: var(--s-3) var(--s-5); border-radius: 999px;
}
.tl__ask .ic { color: var(--fg-3); }
.tl__q { font-size: clamp(.9375rem, 2.2cqw, 1.125rem); letter-spacing: -.01em; line-height: 1.3; min-width: 0; }
.tl__caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -.2em; background: var(--fg); animation: caret 1.15s steps(1, end) infinite; }
.tl__modes {
  grid-column: 1 / span 5; grid-row: 2; align-self: start;
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px; border-radius: 999px;
}
.tl__modes label { position: relative; z-index: 2; display: block; cursor: pointer; }
.tl__modes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }   /* a real radio, visually replaced by the label text */
.tl__modes span {
  display: grid; place-items: center; height: 40px; border-radius: 999px;
  font-size: .875rem; font-weight: 500; letter-spacing: -.005em; color: var(--fg-2);
  transition: color var(--dur-2) var(--ease-out);
}
.tl__modes input:checked + span { color: var(--fg); }
.tl__modes input:focus-visible + span { outline: 2px solid currentColor; outline-offset: -2px; }
.tl__thumb {
  position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px;
  background: var(--paper); box-shadow: 0 0 0 1px rgb(14 14 13 / .08), 0 2px 8px -2px rgb(14 14 13 / .25), inset 0 1px 0 #fff;
  transition: transform var(--dur-3) var(--ease-out);
}
.tl[data-mode="explain"] .tl__thumb { transform: translateX(100%); }
.tl[data-mode="sketch"] .tl__thumb { transform: translateX(200%); }

.tl__out {
  grid-column: 6 / -1; grid-row: 2 / span 2; align-self: start;
  display: grid; padding: clamp(20px, 3.6cqw, 32px); border-radius: var(--r-lg);
  min-height: clamp(200px, 30cqw, 270px);
  color: var(--ink);
  --glass-fill-hi: rgb(255 255 255 / .72);   /* light enough that ink text keeps its contrast over the dark disc */
}
.tl__pane { grid-area: 1 / 1; display: grid; align-content: start; gap: var(--s-4); visibility: hidden; opacity: 0; transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3); }
.tl[data-mode="plan"] .tl__pane--plan,
.tl[data-mode="explain"] .tl__pane--explain,
.tl[data-mode="sketch"] .tl__pane--sketch { visibility: visible; opacity: 1; transition: opacity var(--dur-3) var(--ease-out), visibility 0s; }

.tl__list { display: grid; gap: var(--s-4); }
.tl__list li { display: flex; align-items: center; gap: var(--s-3); font-size: clamp(.9375rem, 2.3cqw, 1.125rem); letter-spacing: -.01em; }
.tl__box { position: relative; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgb(14 14 13 / .5); transition: background-color var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out); }
.tl__box::after { content: ""; position: absolute; left: 5px; top: 2px; width: 6px; height: 11px; border: solid var(--paper); border-width: 0 1.5px 1.5px 0; rotate: 45deg; opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.tl__list li.is-done .tl__box { background: var(--ink); border-color: var(--ink); }
.tl__list li.is-done .tl__box::after { opacity: 1; }
.tl__list li span { transition: color var(--dur-3) var(--ease-out); }
.tl__list li.is-done span { color: var(--ink-2); }
.tl:not([data-live]) .tl__list li:nth-child(-n+2) .tl__box { background: var(--ink); border-color: var(--ink); }
.tl:not([data-live]) .tl__list li:nth-child(-n+2) .tl__box::after { opacity: 1; }

.tl__code { display: grid; font-family: var(--font-mono); font-size: clamp(.75rem, 1.9cqw, .9375rem); line-height: 1.8; white-space: pre; color: var(--ink-2); }
.tl__code span { padding-inline: 8px; margin-inline: -8px; border-radius: 6px; }
.tl__code .is-hot { color: var(--ink); background: rgb(14 14 13 / .09); }
.tl__note { display: flex; gap: var(--s-3); align-items: flex-start; font-size: clamp(.875rem, 2cqw, 1rem); line-height: 1.45; color: var(--ink-2); }
.tl__note i { flex: none; width: 2px; height: 1.2em; margin-top: .15em; background: var(--ink); }

.sk { display: grid; gap: var(--s-2); width: min(100%, 220px); padding: var(--s-3); border: 1.5px solid rgb(14 14 13 / .4); border-radius: var(--r-sm); }
.sk i { display: block; border-radius: 4px; background: rgb(14 14 13 / .22); }
.sk__bar { height: 8px; width: 40%; }
.sk__img { height: 54px; background: rgb(14 14 13 / .1) !important; }
.sk__ln { height: 6px; } .sk__ln--s { width: 62%; }
.sk__btn { height: 18px; width: 46%; border-radius: 999px !important; background: var(--ink) !important; }
.tl[data-mode="sketch"] .sk i { animation: sk-in var(--dur-4) var(--ease-out) both; }
.tl[data-mode="sketch"] .sk i:nth-child(2) { animation-delay: 90ms; } .tl[data-mode="sketch"] .sk i:nth-child(3) { animation-delay: 160ms; }
.tl[data-mode="sketch"] .sk i:nth-child(4) { animation-delay: 220ms; } .tl[data-mode="sketch"] .sk i:nth-child(5) { animation-delay: 300ms; }
@keyframes sk-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 3 · weight answers the pointer ---------- */
.ux { position: relative; display: grid; place-items: center; min-height: clamp(260px, 36cqw, 440px); padding: var(--s-9) 0 var(--s-8); }
.ux__word { text-align: center; }
.ux__letters {
  position: relative;      /* the letters' offsetLeft is measured from here (js/demos/ux.js) */
  display: inline-flex; justify-content: center;
  font-size: clamp(3.25rem, 15.2cqw, 12.5rem); line-height: 1; letter-spacing: -.05em; font-weight: 500;
  white-space: nowrap; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair;
}
.ux__letters span { display: inline-block; font-weight: var(--w, 500); }
.ux__ctl {
  position: absolute; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-5); border-radius: 999px;
  --fg: var(--ink); --rule-strong: rgb(14 14 13 / .24);
}
.ux__field { display: flex; align-items: center; gap: var(--s-3); font-size: .875rem; font-weight: 500; }
.ux__field .range { width: 120px; }
.ux__sw { display: inline-flex; align-items: center; gap: var(--s-3); height: 40px; padding-inline: var(--s-3) var(--s-2); border-radius: 999px; font-size: .875rem; font-weight: 500; }
.ux__sw i { position: relative; width: 38px; height: 24px; border-radius: 999px; background: rgb(14 14 13 / .2); transition: background-color var(--dur-2) var(--ease-out); }
.ux__sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgb(14 14 13 / .35); transition: transform var(--dur-2) var(--ease-out); }
.ux__sw[aria-checked="true"] i { background: var(--ink); }
.ux__sw[aria-checked="true"] i::after { transform: translateX(14px); }

/* ---------- 4 · a letter is a set of coordinates ---------- */
.lb { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); background: var(--stage-bg); aspect-ratio: 6 / 5.7; }
.lb__svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.lb__guides path { fill: none; stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 2 4; }
.lb__guides text { fill: var(--fg-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.lb__ghost { fill: none; stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.lb__shape { fill: var(--ink); }
.lb__anchors rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; cursor: grab; transition: fill var(--dur-1); }
.lb__anchors rect:hover, .lb__anchors rect.is-drag { fill: var(--ink); stroke: var(--paper); }
.lb__anchors rect.is-drag { cursor: grabbing; }
.lb__guides text { text-anchor: end; }
.lb__insp {
  position: absolute; bottom: var(--s-4); left: var(--s-4); z-index: 6;
  display: grid; gap: 2px; min-width: 132px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .02em; color: var(--fg-2);
}
.lb__insp span { text-transform: uppercase; letter-spacing: .05em; font-size: .6875rem; color: var(--fg-3); }
.lb__insp b { font-weight: 450; color: var(--fg); }
.lb__ctl { position: absolute; right: var(--s-4); bottom: var(--s-4); z-index: 6; display: flex; gap: 2px; padding: 4px; border-radius: 999px; --fg: var(--ink); }
.lb__btn { display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding-inline: var(--s-4) var(--s-5); border-radius: 999px; font-size: .875rem; font-weight: 500; transition: background-color var(--dur-2) var(--ease-out); }
@media (hover: hover) { .lb__btn:hover { background-color: rgb(255 255 255 / .6); } }
.lb__btn:active { background-color: rgb(255 255 255 / .8); }

/* scroll-linked depth: layers of one composition drift by slightly different amounts as it crosses the viewport */
.dv__ui { translate: 0 calc(var(--sp, 0) * -10px); }
.dv__scrub { translate: 0 calc(var(--sp, 0) * 6px); }
.tl__out { translate: 0 calc(var(--sp, 0) * -14px); }
.tl__ask { translate: 0 calc(var(--sp, 0) * 4px); }
.tl__disc { translate: 0 calc(var(--sp, 0) * 22px); }
.ux__ctl { translate: 0 calc(var(--sp, 0) * -8px); }
.lb__insp { translate: 0 calc(var(--sp, 0) * 6px); }
.lb__ctl { translate: 0 calc(var(--sp, 0) * -6px); }
.dv__ui.is-off { translate: 0 14px; }

/* ==========================================================================
   Approach: a loop you can step through
   ========================================================================== */
.sec--approach { background: var(--bg); color: var(--fg); }
.sec--approach .sec-head .display { grid-column: 1 / span 7; }

.ap {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: center;
  margin-top: var(--sec-gap);
}
.ap__steps { grid-column: 1 / span 5; display: grid; }
.ap__btn {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; column-gap: var(--s-4);
  width: 100%; padding-block: var(--s-3); text-align: left;
  color: var(--fg-draft);
  transition: color var(--dur-2) var(--ease-out);
}
.ap__btn .ic { color: inherit; }
.ap__t { font-size: var(--fs-step); font-weight: 500; line-height: 1.05; letter-spacing: -.045em; }
@media (hover: hover) { .ap__btn:hover { color: var(--fg-2); } }
.ap__step.is-on .ap__btn, .ap__btn[aria-current] { color: var(--fg); }
.ap__btn:focus-visible { outline-offset: 2px; border-radius: var(--r-sm); }

.ap__more { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--dur-4) var(--ease-out), visibility 0s linear var(--dur-4); }
.ap__step.is-on .ap__more { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--dur-4) var(--ease-out), visibility 0s; }
.ap__in { min-height: 0; overflow: hidden; padding-left: calc(26px + var(--s-4)); }
.ap__box { min-height: var(--ap-h, 0px); }   /* js/demos/approach.js reserves the height of the tallest step */
.ap__d { padding-top: var(--s-2); max-width: 30em; color: var(--fg-2); text-wrap: pretty; }
.ap__r { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); align-items: baseline; margin-top: var(--s-3); font-size: .9375rem; line-height: 1.4; color: var(--fg-2); }
.ap__r:last-child { padding-bottom: var(--s-5); }
.ap__r b { font-family: var(--font-mono); font-size: .6875rem; font-weight: 450; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.ap__d + .ap__r { margin-top: var(--s-4); }

/* without JavaScript every step is open */
html:not(.js) .ap__more { grid-template-rows: 1fr; visibility: visible; }
html:not(.js) .ap__btn { color: var(--fg); }
html:not(.js) .ap__stage { align-self: start; position: sticky; top: calc(var(--hdr-h) + var(--s-5)); }

.ap__stage { grid-column: 6 / -1; position: relative; container-type: inline-size; }
.sg {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 7 / 6; border-radius: var(--r-xl);
  background:
    radial-gradient(60cqw 44cqw at 18% 8%, rgb(239 236 228 / .13), transparent 70%),
    radial-gradient(48cqw 40cqw at 92% 100%, rgb(239 236 228 / .09), transparent 70%),
    var(--night-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.sg__ask {
  position: absolute; left: 5cqw; right: 5cqw; top: 5cqw; z-index: 4;
  display: flex; align-items: center; gap: 2cqw;
  height: 11.5cqw; padding-inline: 3.6cqw; border-radius: 999px;
  font-size: clamp(.8125rem, 2.3cqw, 1.125rem);
  transition: translate var(--dur-4) var(--ease-io);
}
.sg__ask .ic { color: var(--fg-3); }
.sg__q { min-width: 0; white-space: nowrap; letter-spacing: -.01em; }
.sg__caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -.2em; background: var(--fg); animation: caret 1.15s steps(1, end) infinite; }
.ap[data-state="intent"] .sg__ask { translate: 0 31cqw; }

.sg__opts {
  position: absolute; left: 5cqw; right: 5cqw; top: 22cqw; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqw;
  opacity: 0; translate: 0 3cqw; transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-4) var(--ease-out);
}
.ap[data-state="assist"] .sg__opts { opacity: 1; translate: 0 0; }
.sg__opt {
  aspect-ratio: 3 / 3.6; display: grid; align-content: start; gap: 1.6cqw; padding: 2.8cqw;
  border: 1.5px dashed rgb(239 236 228 / .32); border-radius: 2.6cqw;
  transition: opacity var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out), background-color var(--dur-3) var(--ease-out);
}
.sg__opt i { display: block; height: 1.5cqw; border-radius: 1cqw; background: rgb(239 236 228 / .22); }
.sg__opt i:nth-child(1) { width: 52%; } .sg__opt i:nth-child(2) { width: 100%; height: 6cqw; background: rgb(239 236 228 / .1); } .sg__opt i:nth-child(3) { width: 70%; }
.sg__opt--b i:nth-child(2) { height: 3cqw; } .sg__opt--b i:nth-child(3) { width: 84%; }
.ap[data-state="assist"] .sg__opt { animation: opt-fade var(--dur-4) var(--ease-out) 1.4s both; }
.ap[data-state="assist"] .sg__opt--b { animation: opt-pick var(--dur-4) var(--ease-out) 1.4s both; }
@keyframes opt-fade { to { opacity: .35; } }
@keyframes opt-pick { to { border-style: solid; border-color: var(--bone); background-color: rgb(239 236 228 / .07); } }

.sg__ghosts i {
  position: absolute; left: 27cqw; top: 19cqw; width: 46cqw; height: 60cqw; border-radius: 3.4cqw; z-index: 1;
  border: 1px solid rgb(239 236 228 / .2); background: rgb(239 236 228 / .035);
  opacity: 0; transition: opacity var(--dur-4) var(--ease-out), translate var(--dur-4) var(--ease-out);
}
.ap[data-pass="1"] .sg__ghosts i:nth-child(1), .ap[data-pass="2"] .sg__ghosts i:nth-child(-n+2), .ap[data-pass="3"] .sg__ghosts i { opacity: 1; }
.sg__ghosts i:nth-child(1) { translate: -4.4cqw 2.2cqw; }
.sg__ghosts i:nth-child(2) { translate: -8.8cqw 4.4cqw; }
.sg__ghosts i:nth-child(3) { translate: -13.2cqw 6.6cqw; }

.sg__screen {
  position: absolute; left: 27cqw; top: 19cqw; z-index: 3; width: 46cqw; height: 60cqw;
  display: grid; grid-template-rows: auto 1fr auto; row-gap: 3cqw;
  padding: 3.8cqw; border-radius: 3.4cqw;
  transform-origin: 50% 50%;
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out), border-radius var(--dur-4) var(--ease-out), background-color var(--dur-4) var(--ease-out), box-shadow var(--dur-4) var(--ease-out);
}
.sg__screen::before { transition: opacity var(--dur-4); }
.ap[data-state="intent"] .sg__screen, .ap[data-state="assist"] .sg__screen { opacity: 0; transform: scale(.72); pointer-events: none; }
.ap[data-state="iterate"] .sg__screen { transform: translate(4cqw, 1cqw) scale(.92); }
.sg__title { font-size: 4.6cqw; font-weight: 500; line-height: 1; letter-spacing: -.04em; transition: color var(--dur-4) var(--ease-out); }
.sg__rows { display: grid; align-content: start; gap: 2.2cqw; }
.sg__rows li { display: flex; align-items: center; gap: 2.2cqw; height: 6cqw; }
.sg__rows i { flex: none; width: 3.4cqw; height: 3.4cqw; border-radius: 1cqw; border: 1.5px solid currentColor; opacity: .7; transition: border-radius var(--dur-4) var(--ease-out), background-color var(--dur-4) var(--ease-out), border-style var(--dur-4); }
.sg__rows b { flex: 1; height: 1.4cqw; border-radius: 1cqw; background: currentColor; opacity: .5; }
.sg__rows li:nth-child(2) b { flex: .8; } .sg__rows li:nth-child(3) b { flex: .62; }
.sg__btn {
  display: inline-flex; align-items: center; justify-content: center; justify-self: start;
  height: 7.4cqw; padding-inline: 4.4cqw; border-radius: 999px;
  font-size: 2.5cqw; font-weight: 500; line-height: 1;
  background: var(--bone); color: var(--night); border: 1.5px solid var(--bone);
  transition: height var(--dur-4) var(--ease-out), padding var(--dur-4) var(--ease-out), background-color var(--dur-4) var(--ease-out), color var(--dur-4) var(--ease-out), border-radius var(--dur-4) var(--ease-out), scale var(--dur-2);
}
/* draft: a dashed sketch of the same screen */
.ap[data-state="prototype"] .sg__screen, .ap[data-state="test"] .sg__screen {
  background-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 1.2cqw;
  box-shadow: inset 0 0 0 1.5px rgb(239 236 228 / .4); color: var(--fg-3);
}
.ap[data-state="prototype"] .sg__screen::before, .ap[data-state="test"] .sg__screen::before { opacity: 0; }
.ap[data-state="prototype"] .sg__title, .ap[data-state="test"] .sg__title { color: var(--fg-3); }
.ap[data-state="prototype"] .sg__rows i, .ap[data-state="test"] .sg__rows i { border-radius: .4cqw; border-style: dashed; }
.ap[data-state="prototype"] .sg__btn, .ap[data-state="test"] .sg__btn { height: 4.6cqw; padding-inline: 2.4cqw; border-radius: .6cqw; background: transparent; color: var(--fg-3); border-color: rgb(239 236 228 / .4); border-style: dashed; }
/* resolved */
.ap[data-state="refine"] .sg__rows i, .ap[data-state="iterate"] .sg__rows i { background: currentColor; opacity: .85; }
.ap[data-state="refine"] .sg__rows b, .ap[data-state="iterate"] .sg__rows b { opacity: .62; }

.sg__ptr {
  position: absolute; left: 36cqw; top: 70cqw; z-index: 5; width: 5cqw; height: 5cqw;
  fill: var(--bone); stroke: var(--night); stroke-width: 1.2; stroke-linejoin: round;
  opacity: 0; translate: 14cqw 6cqw; transition: opacity var(--dur-3) var(--ease-out), translate 1.3s var(--ease-io);
  pointer-events: none;
}
.ap[data-state="test"] .sg__ptr { opacity: 1; translate: 0 0; }
.ap[data-state="test"] .sg__btn { animation: press .5s var(--ease-out) 1.5s both; }
@keyframes press { 40% { scale: .92; } 100% { scale: 1; } }

.sg__note {
  position: absolute; left: 55cqw; top: 58cqw; z-index: 5;
  display: inline-flex; align-items: center; gap: 1.6cqw;
  height: 8cqw; padding-inline: 3cqw; border-radius: 999px; font-size: clamp(.75rem, 2.1cqw, 1rem); white-space: nowrap;
  opacity: 0; translate: 0 2cqw; transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-4) var(--ease-out);
  pointer-events: none;
}
.sg__note .ic { color: var(--bone); }
.ap[data-state="test"] .sg__note { opacity: 1; translate: 0 0; transition-delay: 1.9s; }
.ap[data-state="refine"] .sg__note { opacity: 1; translate: 0 0; transition-delay: .5s; }
/* statically (no JavaScript) the note reads "fixed and checked" next to the resolved screen */

.sg-wrap { position: relative; }
/* play / pause: moving content can always be stopped */
.pp {
  position: absolute; right: var(--s-4); bottom: var(--s-4); z-index: 6;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
}
.pp[hidden] { display: none; }
.pp .ic--play, .pp[aria-pressed="true"] .ic--pause { display: none; }
.pp[aria-pressed="true"] .ic--play { display: block; }
.tl .pp { top: var(--s-4); bottom: auto; }
.ap__stage .stage__cap { margin-top: var(--s-4); }

/* ==========================================================================
   Independent by design
   ========================================================================== */
.sec--indep { padding-bottom: var(--sec-y); }
.sec--indep .display { max-width: 9.5em; }
.sec--indep .statement--md { margin-top: var(--sp-group); }

.terms {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--sp-group);
  margin-top: var(--sec-gap);
}
.term dt { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-title); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
.term dt::before { content: ""; flex: none; width: 2px; height: .95em; background: currentColor; }
.term dd { margin-top: var(--s-3); max-width: 24em; color: var(--fg-2); text-wrap: pretty; }

.qs { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--s-5); margin-top: var(--sec-gap); align-items: start; }
.qs__h { grid-column: 1 / span 3; padding-top: .9em; font-family: var(--font-mono); font-size: .75rem; font-weight: 450; line-height: 1.4; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.qs__list { grid-column: 4 / -1; display: grid; row-gap: var(--sp-group); }
.q { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.375rem); font-weight: 500; line-height: 1.14; letter-spacing: -.032em; text-wrap: balance; max-width: 22em; }
@media (prefers-reduced-motion: no-preference) {
  html.js .q { color: var(--fg-draft); transition: color var(--dur-3) var(--ease-out); }
  html.js .q.is-active { color: var(--fg); }
}

/* ==========================================================================
   About: principles as a diff, and the founder's note
   ========================================================================== */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--sp-block); margin-top: var(--sec-gap); align-items: start; }
.diff { grid-column: 1 / span 9; }
.diff__cap { display: flex; justify-content: space-between; gap: var(--s-4); padding-bottom: var(--s-4); color: var(--fg-3); }
.diff__pair { position: relative; padding-block: clamp(18px, 2.2vw, 28px); border-top: 1px solid var(--rule); }
.diff__pair:last-child { border-bottom: 1px solid var(--rule); }
.diff__ln {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); align-items: baseline;
  font-size: clamp(1.25rem, .95rem + 1.4vw, 2.125rem);
  line-height: 1.2; letter-spacing: -.028em; font-weight: 500;
  padding-block: .14em;
}
.diff__sg { font-size: 1.125rem; font-weight: 400; letter-spacing: 0; color: var(--fg-3); line-height: 1; transform: translateY(-.08em); }
.diff__tx { display: block; }
.diff__st {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 56%; background-size: 0% 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .7s var(--ease-out);
}
.diff__ln--del { color: var(--fg); }
.diff__ln--add { color: var(--fg); }
@media (prefers-reduced-motion: no-preference) {
  html.js .diff__ln--del, html.js .diff__ln--add { transition: color .6s var(--ease-out); }
  html.js .diff__ln--add { color: var(--fg-3); }
  html.js .diff__pair.is-edited .diff__ln--del { color: var(--fg-3); }
  html.js .diff__pair.is-edited .diff__ln--del .diff__st { background-size: 100% 2px; }
  html.js .diff__pair.is-edited .diff__ln--add { color: var(--fg); transition-delay: .25s; }
  html.js .diff__pair.is-edited .diff__ln--add .diff__sg { color: var(--fg); }
}
html:not(.js) .diff__ln--del .diff__st, .no-motion .diff__ln--del .diff__st { background-size: 100% 2px; }
html:not(.js) .diff__ln--del { color: var(--fg-3); }

.founder { grid-column: 10 / -1; padding-top: calc(.75rem * 1.4 + var(--s-4)); }
.founder__t { font-size: var(--fs-title); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
.founder__d { margin-top: var(--s-3); font-size: .9375rem; line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.link { display: inline-flex; align-items: center; gap: var(--sp-icon); margin-top: var(--s-5); padding-block: var(--s-2); font-weight: 500; letter-spacing: -.01em; position: relative; }
.link::after { content: ""; position: absolute; left: 0; right: 26px; bottom: 6px; height: 1px; background: currentColor; transform-origin: 0 50%; transition: transform var(--dur-3) var(--ease-out); }
.link .ic { transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) {
  .link:hover .ic { transform: translate(2px, -2px); }
  .link:hover::after { transform: scaleX(.0); transform-origin: 100% 50%; }
}

/* ==========================================================================
   Contact and footer
   ========================================================================== */
.sec--contact { background: var(--bg); color: var(--fg); padding-bottom: clamp(72px, 9vw, 128px); }
.mailbig {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: .3em;
  margin-top: var(--sec-gap);
  padding-bottom: clamp(18px, 2vw, 28px);
  font-size: clamp(2.2rem, 7.7vw, 9.5rem);
  font-weight: 500; line-height: .95; letter-spacing: -.055em;
  border-bottom: 1px solid var(--rule-strong);
}
.mailbig::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--dur-4) var(--ease-out);
}
.mailbig__t { position: relative; display: block; min-width: 0; }
.mailbig__a, .mailbig__b { white-space: nowrap; }
.mailbig__ic { width: .42em; height: .42em; stroke-width: 1.25; margin-bottom: .1em; transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) {
  .mailbig:hover::after { transform: scaleX(1); }
  .mailbig:hover .mailbig__ic { transform: translate(.06em, -.06em); }
}
.mailbig:focus-visible { outline-offset: 10px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--sp-group); }
.ic--done { display: none; }
[data-copy].is-done .ic--copy { display: none; }
[data-copy].is-done .ic--done { display: block; }

.foot { background: var(--bg); color: var(--fg); padding: 0 var(--pad) clamp(28px, 3vw, 44px); }
.foot__row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center;
  padding-block: var(--s-5); border-top: 1px solid var(--rule);
  font-size: .875rem;
}
.foot__brand { grid-column: 1 / span 3; display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 500; }
.foot__sym { fill: currentColor; }
.foot__tag { grid-column: 4 / span 6; color: var(--fg-3); }
.foot__top { grid-column: 10 / -1; justify-self: end; display: inline-flex; align-items: center; gap: var(--s-2); padding-block: var(--s-3); }
.foot__top .ic--up { transform: rotate(180deg); transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) { .foot__top:hover .ic--up { transform: rotate(180deg) translateY(3px); } }
.foot__colophon { color: var(--fg-3); padding-top: var(--s-1); text-transform: none; letter-spacing: .01em; font-size: .75rem; }

/* ==========================================================================
   Mobile menu
   ========================================================================== */
.menu {
  position: fixed; inset: 0; z-index: 70;
  background: var(--night); color: var(--bone);
  display: flex; flex-direction: column;
  padding: calc(var(--hdr-h) + 20px) var(--pad) max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  --fg: var(--bone); --fg-3: #8D8A80; --rule: rgb(239 236 228 / .17);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .7s var(--ease-io), visibility 0s linear .7s;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .7s var(--ease-io), visibility 0s; }
.menu[hidden] { display: none; }
.menu__inner { display: flex; flex-direction: column; flex: 1; min-height: min-content; }
.menu__wm { position: absolute; left: var(--pad); top: var(--dock-top); height: var(--dock-cap); width: calc(var(--dock-cap) * 5.6268); fill: var(--bone); overflow: visible; }
.menu__list { margin-top: clamp(8px, 4vh, 40px); }
.menu__list li { border-top: 1px solid var(--rule); overflow: hidden; }
.menu__list li:last-child { border-bottom: 1px solid var(--rule); }
.menu__list a { display: flex; align-items: baseline; gap: 1rem; padding-block: .16em .1em; font-size: clamp(2.4rem, 11.5vw, 4.5rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.12; }
.menu__t { display: block; }
.menu__foot { margin-top: auto; padding-top: var(--s-6); display: grid; gap: var(--s-2); }
.menu__mail { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; padding-block: 6px; }
.menu__foot p { color: var(--fg-3); font-size: .875rem; }
@media (prefers-reduced-motion: no-preference) {
  .menu__t { transform: translateY(105%); transition: transform .8s var(--ease-out); }
  .menu.is-open .menu__t { transform: none; transition-delay: calc(var(--k, 0) * 55ms + 250ms); }
  .menu__list li:nth-child(1) { --k: 0; } .menu__list li:nth-child(2) { --k: 1; } .menu__list li:nth-child(3) { --k: 2; }
  .menu__list li:nth-child(4) { --k: 3; } .menu__list li:nth-child(5) { --k: 4; } .menu__list li:nth-child(6) { --k: 5; }
}
html.menu-open { --hdr-bg: transparent; --hdr-fg: var(--bone); --hdr-line: transparent; overflow: hidden; }
html.menu-open .hdr { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.menu-open .hdr__chapter { opacity: 0 !important; }
html.menu-open .hdr__rule { opacity: 0; }

/* ==========================================================================
   7 · Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .founder { grid-column: 1 / span 8; padding-top: 0; }
  .diff { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .hdr__nav { display: none; }
  .hdr__menu { display: inline-flex; }
  .hdr__chapter { grid-column: 4 / span 5; }
  .brand { grid-column: 1 / span 3; }

  .sec-head { display: block; }
  .sec-head .lede { margin-top: var(--sp-head-desc); padding-bottom: 0; max-width: 32em; }

  .phil { display: block; }
  .tiers { margin-bottom: var(--sp-block); }
  .stack { max-width: 460px; margin-inline: auto; }

  .area { display: block; }
  .area__text, .area--ux .area__text { display: block; }
  .area--ux .area__d { margin-top: var(--sp-head-desc); padding-bottom: 0; }
  .area .stage { margin-top: var(--sp-group); }
  .area--dev .area__text { padding-top: 0; }

  .ap { display: flex; flex-direction: column; align-items: stretch; row-gap: var(--sp-group); }
  .ap__stage { order: -1; }
  .ap__steps { order: 2; }
  .ap__t { font-size: clamp(1.5rem, 5vw, 2.25rem); }

  .terms { grid-template-columns: minmax(0, 1fr); }
  .qs { display: block; }
  .qs__h { padding-top: 0; margin-bottom: var(--s-5); }

  .about { display: block; }
  .founder { margin-top: var(--sp-block); max-width: 34em; }

  .foot__row { grid-template-columns: 1fr auto; row-gap: var(--s-2); }
  .foot__brand { grid-column: 1; }
  .foot__tag { grid-column: 1 / -1; grid-row: 2; }
  .foot__top { grid-column: 2; grid-row: 1; }
}

@media (max-width: 700px) {
  .hero { gap: 28px; }
  .hero__title { max-width: 8.4em; }
  .hero__foot { display: block; }
  .hero__lede { max-width: 28ch; }
  .cue { margin-top: 20px; display: inline-flex; }
  .hero__meta { flex-direction: column; gap: 6px; }

  .mailbig { display: block; font-size: clamp(2.4rem, 12.8vw, 5rem); }
  .mailbig__a, .mailbig__b { display: block; }
  .mailbig__ic { position: absolute; right: 0; bottom: 20px; width: 34px; height: 34px; }
  .ap__r { grid-template-columns: 3rem minmax(0, 1fr); }
  .contact__actions .btn { flex: 1 1 100%; }
}

/* component-level responsiveness: each demonstration recomposes itself from the width of its own stage */
@container (max-width: 620px) {
  .dv { grid-template-rows: auto auto auto; min-height: 0; }
  .dv__code { grid-column: 1 / -1; grid-row: 1; padding-top: 68px; padding-bottom: clamp(56px, 14cqw, 72px); }
  .dv__ui { grid-column: 2 / -1; grid-row: 2; margin: -44px 16px 0 0; }
  .dv__scrub { grid-column: 1 / -1; grid-row: 3; margin: 16px; }
  .dv::before { display: none; }

  .tl { grid-template-rows: auto auto auto; padding-top: 64px; }
  .tl__ask { grid-column: 1 / -1; }
  .tl__modes { grid-column: 1 / -1; }
  .tl__out { grid-column: 1 / -1; grid-row: 3; }
  .tl__disc { right: -26cqw; bottom: -30cqw; }

  .ux { padding-bottom: 0; row-gap: var(--s-5); }
  .ux__ctl { position: static; justify-self: center; flex-wrap: wrap; border-radius: var(--r-lg); padding: var(--s-2) var(--s-4); }
  /* the lab: the drawing on top, its controls in a row beneath it, nothing overlapping the letter */
  .lb { aspect-ratio: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); padding: 0 var(--s-4) var(--s-4); }
  .lb__svg { position: static; grid-column: 1 / -1; width: calc(100% + 2 * var(--s-4)); height: auto; margin-inline: calc(-1 * var(--s-4)); aspect-ratio: 600 / 560; }
  .lb__insp, .lb__ctl { position: static; translate: none; }
  .lb__insp { min-width: 0; }
}
@container (max-width: 420px) {
  .ux__field .range { width: 88px; }
  .ux__ctl { gap: var(--s-3); }
}

@media (min-width: 1001px) and (max-width: 1180px) {
  .hdr__nav ul { gap: 16px; }
  .hdr__nav a:not(.btn) { font-size: .8125rem; }
}

@media (min-width: 1001px) {
  .hdr__menu, .menu { display: none !important; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 420px; }
}

/* No-JS: the header stays usable, everything is plain content */
html:not(.js) .hdr { position: absolute; height: auto; min-height: var(--hdr-h); }
html:not(.js) .hdr__menu, html:not(.js) .hdr__chapter, html:not(.js) .hdr__rule { display: none; }
@media (max-width: 1000px) {
  html:not(.js) .hdr__nav { display: block; grid-column: 1 / -1; padding-block: 8px; }
  html:not(.js) .hdr__nav ul { flex-wrap: wrap; gap: 4px 18px; }
  html:not(.js) .hero { padding-top: 120px; }
}

/* ==========================================================================
   Print: plain, readable, no frame
   ========================================================================== */
@media print {
  .hdr, .reading-line, .menu, .skip, .dock, .cue, .stack, .ap__stage, .stage, .ap__play { display: none !important; }
  html, body { background: #fff; }
  .theme-dark { --bg: #fff; --fg: #0E0E0D; --fg-2: #47453F; --fg-3: #6A685F; --rule: rgb(14 14 13 / .25); }
  html.curtain [data-curtain] { clip-path: none; }
  .sec { padding-block: 32px; break-inside: avoid-page; }
  .hero { min-height: 0; padding-top: 24px; }
  .ap__more { grid-template-rows: 1fr; visibility: visible; }
  a { text-decoration: underline; }
}

/* ==========================================================================
   Reduced motion: stable, fully readable, no motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .cue .ic, .dk--caret::after, .caret, .tl__caret, .sg__caret, .stack__caret { animation: none !important; }
  .reading-line { display: none; }
  .dv__ui, .dv__scrub, .tl__out, .tl__ask, .tl__disc, .ux__ctl, .lb__insp, .lb__ctl { translate: none; }
}
