/* ==========================================================================
   SteinTecDev — CORE
   --------------------------------------------------------------------------
   One design system. Tokens → primitives → components.

   Art direction: "instrument grade", now shot like a film.
   The interface itself stays a quiet, precise, editorial dark surface —
   the documentation of a well-made tool, not a sci-fi HUD: hairlines carry
   the structure, one accent carries state, space carries the hierarchy.
   Since the cinematic layer (cinema.css, fx.js, cinema/) the *scenes*
   behind and between the text carry light, depth and motion — a 3D mark,
   a product stage, standing stones, an eclipse. The rule that survived:
   text is never decorated. Glow and grain live in the 3D picture (inside
   the canvases), not on top of the words; and all of it switches off
   (html[data-fx="off"]) back to exactly this stylesheet.

   Cascade layers keep specificity flat. Nothing in this file needs
   !important, and nothing that follows it should either.
   ========================================================================== */

@layer reset, base, layout, components, utilities;

/* ==========================================================================
   TOKENS
   ========================================================================== */
@layer base {
  :root {
    /* ---------------------------------------------------------------
       Neutral ramp — a single warm graphite hue (65°) at very low
       chroma. Every surface in the site is a stop on this one ramp,
       which is what makes unrelated components look related.
       --------------------------------------------------------------- */
    --n-00: oklch(0.108 0.005 65);
    --n-05: oklch(0.138 0.006 65);
    --n-10: oklch(0.163 0.007 65);
    --n-15: oklch(0.192 0.008 65);
    --n-20: oklch(0.225 0.009 65);
    --n-25: oklch(0.263 0.010 65);
    --n-30: oklch(0.312 0.011 65);
    --n-40: oklch(0.408 0.012 65);
    --n-50: oklch(0.505 0.012 65);
    --n-55: oklch(0.578 0.012 66);
    --n-60: oklch(0.612 0.012 68);
    --n-70: oklch(0.712 0.011 70);
    --n-80: oklch(0.808 0.010 72);
    --n-90: oklch(0.900 0.008 75);
    --n-97: oklch(0.963 0.006 78);

    /* ---------------------------------------------------------------
       Accent — ember. One hue, four stops. Used for state and for
       exactly one emphasis per view, never as decoration.
       --------------------------------------------------------------- */
    --a-30: oklch(0.330 0.105 42);
    --a-45: oklch(0.455 0.150 42);
    --a-60: oklch(0.605 0.178 44);
    --a-68: oklch(0.680 0.183 47);
    --a-80: oklch(0.800 0.130 58);

    /* Signals — deliberately desaturated so they read as instrument
       lamps rather than neon. */
    --sig-live: oklch(0.760 0.125 156);
    --sig-work: oklch(0.775 0.095 218);
    --sig-hold: oklch(0.815 0.125 84);
    --sig-stop: oklch(0.685 0.165 25);

    /* --------------------------------------------------- semantic ---- */
    --surface-deep: var(--n-00);
    --surface: var(--n-05);
    --surface-raised: var(--n-10);
    --surface-high: var(--n-15);
    --surface-inset: var(--n-00);

    --hair: color-mix(in oklab, var(--n-25) 62%, transparent);
    --hair-strong: var(--n-25);
    --hair-bright: var(--n-30);

    --ink: var(--n-97);
    --ink-2: var(--n-80);
    --ink-3: var(--n-60);
    /* n-55 rather than n-50: every micro-label in this system still
       clears 4.5:1 on the page surface. Small type is where dark UIs
       usually quietly fail WCAG. */
    --ink-faint: var(--n-55);

    --accent: var(--a-68);
    --accent-hi: var(--a-80);
    --accent-deep: var(--a-45);
    --accent-wash: color-mix(in oklab, var(--a-68) 12%, transparent);
    --accent-hair: color-mix(in oklab, var(--a-68) 38%, transparent);
    --on-accent: oklch(0.16 0.03 45);

    /* ------------------------------------------------------ type ---- */
    --face-display: "Fraunces", "Iowan Old Style", "Palatino Linotype",
      Palatino, Georgia, serif;
    --face-text: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI",
      "Helvetica Neue", Arial, sans-serif;
    --face-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono",
      "Roboto Mono", Menlo, Consolas, monospace;

    /* Fluid scale, 320px → 1600px viewport. Ratio ≈ 1.24 at the small
       end, ≈ 1.30 at the large end, so headlines open up faster than
       body copy does. */
    --t-2xs: 0.6875rem;                              /* 11px  */
    --t-xs: 0.75rem;                                 /* 12px  */
    --t-sm: 0.8125rem;                               /* 13px  */
    --t-ui: 0.875rem;                                /* 14px  */
    --t-base: clamp(1rem, 0.968rem + 0.16vw, 1.0625rem);
    --t-md: clamp(1.0625rem, 1.008rem + 0.27vw, 1.1875rem);
    --t-lg: clamp(1.1875rem, 1.086rem + 0.5vw, 1.4375rem);
    --t-xl: clamp(1.375rem, 1.176rem + 1vw, 1.875rem);
    --t-2xl: clamp(1.625rem, 1.25rem + 1.88vw, 2.5rem);
    --t-3xl: clamp(2rem, 1.375rem + 3.13vw, 3.5rem);
    /* Sized against the longest headline the site actually has to set —
       the French hero line — with roughly 10% of slack left over, so a
       translation can grow without breaking the three-line rhythm. */
    --t-4xl: clamp(2.25rem, 1.53rem + 3.6vw, 4.5rem);
    --t-5xl: clamp(2.75rem, 1.25rem + 7.5vw, 6.25rem);

    /* Fraunces axis presets. Optical size is set to roughly match the
       rendered size — that is the whole point of an opsz axis and the
       difference between type that is set and type that is scaled. */
    --fr-display: "opsz" 144, "SOFT" 24, "WONK" 1;
    --fr-title: "opsz" 72, "SOFT" 18, "WONK" 1;
    --fr-head: "opsz" 40, "SOFT" 12, "WONK" 0;
    --fr-sub: "opsz" 20, "SOFT" 6, "WONK" 0;
    --fr-text: "opsz" 12, "SOFT" 0, "WONK" 0;

    --lh-tight: 1.02;
    --lh-snug: 1.14;
    --lh-head: 1.24;
    --lh-body: 1.62;
    --lh-loose: 1.75;

    --track-display: -0.028em;
    --track-title: -0.022em;
    --track-label: 0.14em;
    --track-mono: 0.02em;

    /* ----------------------------------------------------- space ---- */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 2.5rem;
    --sp-8: 3rem;
    --sp-9: 4rem;
    --sp-10: 5rem;
    --sp-11: 6.5rem;
    --sp-12: 8rem;

    --section-y: clamp(4.5rem, 9vw, 9rem);
    --gutter: clamp(1.25rem, 5vw, 4rem);

    /* One vertical axis for the whole site. Section heads, manifesto
       rows and log entries all hang their aside column off the same
       two values, so every section shares a single alignment. */
    --col-aside: 12.5rem;
    --col-gap: clamp(1.5rem, 3.6vw, 3.5rem);
    --measure: 1320px;
    --measure-wide: 1460px;
    --measure-text: 66ch;

    /* ------------------------------------------------------ form ---- */
    --r-xs: 3px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Elevation is layered and shallow. Deep, soft, single-direction —
       objects sit on the page rather than float above it. */
    --edge: inset 0 1px 0 oklch(1 0 0 / 0.045);
    --edge-strong: inset 0 1px 0 oklch(1 0 0 / 0.07);
    --lift-1: 0 1px 2px oklch(0 0 0 / 0.32), 0 2px 6px -2px oklch(0 0 0 / 0.24);
    --lift-2: 0 2px 4px oklch(0 0 0 / 0.3), 0 12px 28px -10px oklch(0 0 0 / 0.45);
    --lift-3: 0 4px 10px oklch(0 0 0 / 0.32),
      0 28px 64px -20px oklch(0 0 0 / 0.6);
    --inset-well: inset 0 1px 3px oklch(0 0 0 / 0.5),
      inset 0 0 0 1px oklch(0 0 0 / 0.25);

    /* ---------------------------------------------------- motion ---- */
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-1: 120ms;
    --dur-2: 220ms;
    --dur-3: 380ms;
    --dur-4: 700ms;

    --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);

    color-scheme: dark;
  }

  /* ------------------------------------------------------------------
     Compatibility aliases.
     The legacy markup carries a handful of inline `var(--copper)` /
     `var(--text-soft)` references. Mapping them here means the old
     names resolve into the new system instead of being overridden by
     it — no !important, no dead values.
     ------------------------------------------------------------------ */
  :root {
    --bg: var(--surface);
    --bg-1: var(--surface-raised);
    --bg-2: var(--surface-high);
    --bg-3: var(--surface-inset);
    --bg-elev: var(--surface-raised);
    --bg-elev-2: var(--surface-high);
    --line: var(--hair-strong);
    --line-soft: var(--hair);
    --text: var(--ink);
    --text-2: var(--ink-2);
    --text-3: var(--ink-3);
    --text-soft: var(--ink-2);
    --text-muted: var(--ink-3);
    --copper: var(--accent);
    --copper-2: var(--accent-hi);
    --copper-d: var(--accent-deep);
    --copper-deep: var(--accent-deep);
    --copper-glow: var(--accent-hi);
    --gold: var(--sig-hold);
    --signal: var(--sig-work);
    --ok: var(--sig-live);
    --warn: var(--sig-hold);
    --amber: var(--sig-hold);
    --font-display: var(--face-display);
    --font-body: var(--face-text);
    --font-mono: var(--face-mono);
    --d: var(--face-display);
    --b: var(--face-text);
    --m: var(--face-mono);
    --container: var(--measure);
    --max: var(--measure);
    --gut: var(--gutter);
    --radius-sm: var(--r-sm);
    --radius: var(--r-md);
    --radius-lg: var(--r-lg);
    --r: var(--r-md);
  }
}

/* ==========================================================================
   RESET
   ========================================================================== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-block-start: 6rem;
    background: var(--surface);
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  body {
    min-height: 100svh;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--face-text);
    font-size: var(--t-base);
    font-weight: 380;
    line-height: var(--lh-body);
    font-feature-settings: "ss01", "ss02", "cv11";
    font-variant-ligatures: common-ligatures contextual;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
  }

  img,
  svg,
  video,
  canvas {
    display: block;
    max-width: 100%;
  }

  img,
  video {
    height: auto;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  ul[class],
  ol[class] {
    list-style: none;
    padding: 0;
  }

  :where(p, li, dd) {
    text-wrap: pretty;
  }

  :where(h1, h2, h3, h4) {
    text-wrap: balance;
  }

  ::selection {
    background: var(--accent);
    color: var(--on-accent);
  }

  /* One focus treatment for the entire site. Visible on every surface,
     never shown for mouse users who did not ask for it. */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-xs);
  }

  :focus:not(:focus-visible) {
    outline: none;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ==========================================================================
   BASE TYPOGRAPHY
   ========================================================================== */
@layer base {
  .display,
  .t-display {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-display);
    font-weight: 300;
    font-size: var(--t-5xl);
    line-height: var(--lh-tight);
    letter-spacing: var(--track-display);
  }

  .t-title {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-title);
    font-weight: 350;
    font-size: var(--t-3xl);
    line-height: var(--lh-snug);
    letter-spacing: var(--track-title);
  }

  .t-head {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-head);
    font-weight: 400;
    font-size: var(--t-xl);
    line-height: var(--lh-head);
    letter-spacing: -0.015em;
  }

  .t-sub {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-sub);
    font-weight: 450;
    font-size: var(--t-lg);
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  /* The italic in a display line is the one flourish this design
     allows itself. It gets the accent, so emphasis and colour always
     travel together instead of competing. */
  .display em,
  .t-display em,
  .t-title em,
  .t-head em,
  .t-sub em {
    font-style: italic;
    font-weight: inherit;
    color: var(--accent);
  }

  .lead {
    font-size: var(--t-md);
    line-height: var(--lh-loose);
    color: var(--ink-2);
    max-width: 58ch;
    font-weight: 350;
  }

  /* -------------------------------------------------- micro type ---- */
  .label,
  .eyebrow {
    font-family: var(--face-text);
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-3);
    line-height: 1.4;
  }

  /* Mono is reserved for real machine data: versions, timestamps,
     counts, identifiers, code. Using it for every label is the tic
     that makes a studio site read as a template. */
  .mono,
  .num {
    font-family: var(--face-mono);
    font-size: var(--t-sm);
    letter-spacing: var(--track-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "zero" 1;
  }

  code,
  kbd,
  samp,
  pre {
    font-family: var(--face-mono);
    font-size: 0.9em;
    font-variant-numeric: tabular-nums;
  }

  :not(pre) > code {
    padding: 0.15em 0.4em;
    border-radius: var(--r-xs);
    background: color-mix(in oklab, var(--accent) 11%, transparent);
    color: var(--accent-hi);
    white-space: nowrap;
  }

  hr {
    border: 0;
    border-top: 1px solid var(--hair);
  }
}

/* ==========================================================================
   LAYOUT PRIMITIVES
   ========================================================================== */
@layer layout {
  .container {
    width: 100%;
    max-width: var(--measure);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .container--wide {
    max-width: var(--measure-wide);
  }

  .container--text {
    max-width: 78ch;
  }

  .section {
    position: relative;
    padding-block: var(--section-y);
  }

  .section--tight {
    padding-block: clamp(3rem, 6vw, 5.5rem);
  }

  /* A section change is marked by a hairline, not by a different
     background colour. Fewer values, more structure. */
  .section--ruled {
    border-top: 1px solid var(--hair);
  }

  .section--sunk {
    background: var(--surface-deep);
    border-block: 1px solid var(--hair);
  }

  /* ------------------------------------------------------------------
     THE INDEX RULE — the site's signature device.

     Every section opens with a hairline that carries its number and a
     short machine-readable label at the left, and the human title at
     the right. It is the same move a technical drawing or a spec sheet
     makes, and it does the job that decorative HUD ornament was doing
     before: it says "this was measured", using structure instead of
     effects.
     ------------------------------------------------------------------ */
  .sec-head {
    display: grid;
    gap: var(--sp-5);
    grid-template-columns: 1fr;
    padding-top: var(--sp-5);
    border-top: 1px solid var(--hair-strong);
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
    position: relative;
  }

  .sec-head::before {
    content: "";
    position: absolute;
    inset-block-start: -1px;
    inset-inline-start: 0;
    width: 56px;
    height: 1px;
    background: var(--accent);
  }

  @media (min-width: 62rem) {
    .sec-head {
      grid-template-columns: var(--col-aside) minmax(0, 1fr);
      gap: var(--col-gap);
    }
  }

  .sec-head__id {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    font-family: var(--face-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
  }

  .sec-head__id b {
    font-weight: 500;
    color: var(--accent);
  }

  .sec-head__title {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-title);
    font-weight: 350;
    font-size: var(--t-3xl);
    line-height: var(--lh-snug);
    letter-spacing: var(--track-title);
    color: var(--ink);
    max-width: 20ch;
  }

  .sec-head__title em {
    font-style: italic;
    color: var(--accent);
  }

  .sec-head__lead {
    margin-top: var(--sp-4);
    font-size: var(--t-md);
    line-height: var(--lh-loose);
    color: var(--ink-2);
    max-width: 54ch;
    font-weight: 350;
  }

  /* A quiet full-bleed hairline used between blocks inside a section */
  .rule {
    border: 0;
    border-top: 1px solid var(--hair);
    margin-block: var(--sp-7);
  }

  .stack > * + * {
    margin-block-start: var(--flow, var(--sp-4));
  }
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
@layer components {
  /* ------------------------------------------------------- skip link */
  .skip-link {
    position: fixed;
    top: var(--sp-3);
    left: var(--sp-3);
    z-index: 200;
    padding: 0.7em 1.1em;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--r-sm);
    font-size: var(--t-ui);
    font-weight: 600;
    transform: translateY(-160%);
    transition: transform var(--dur-2) var(--ease-out);
  }

  .skip-link:focus-visible {
    transform: none;
  }

  /* ============================================================ NAV = */
  .nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 90;
    padding-block: var(--sp-4);
    transition: padding var(--dur-3) var(--ease),
      background-color var(--dur-3) var(--ease),
      border-color var(--dur-3) var(--ease);
    border-bottom: 1px solid transparent;
  }

  .nav.is-scrolled {
    padding-block: var(--sp-3);
    background: color-mix(in oklab, var(--surface) 82%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom-color: var(--hair);
  }

  .nav__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
  }

  /* ---------------------------------------------------------- brand */
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-inline-end: auto;
    min-width: 0;
  }

  .brand__mark {
    inline-size: 2.125rem;
    block-size: 2.125rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--accent);
    transition: color var(--dur-2) var(--ease);
  }

  .brand__mark svg {
    inline-size: 100%;
    block-size: 100%;
  }

  /* Fallback for the legacy `<span class="brand__mark">S</span>` markup:
     a letter, not an inline SVG. Still deliberate, never a boxed glyph. */
  .brand__mark:not(:has(svg)) {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-head);
    font-style: italic;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1;
    border: 1px solid var(--accent-hair);
    border-radius: var(--r-sm);
  }

  .brand:hover .brand__mark {
    color: var(--accent-hi);
  }

  .brand__name {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-sub);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
    white-space: nowrap;
  }

  .brand__name em {
    font-style: italic;
    font-weight: 350;
    color: var(--accent);
  }

  .brand__sub {
    font-family: var(--face-text);
    font-size: var(--t-2xs);
    font-weight: 500;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-faint);
    padding-inline-start: 0.7rem;
    margin-inline-start: 0.1rem;
    border-inline-start: 1px solid var(--hair-strong);
    white-space: nowrap;
  }

  @media (max-width: 68rem) {
    .brand__sub {
      display: none;
    }
  }

  /* ---------------------------------------------------------- links */
  .nav__links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.2vw, 2rem);
  }

  .nav__links > a {
    position: relative;
    font-size: var(--t-ui);
    font-weight: 450;
    color: var(--ink-3);
    padding-block: 0.35rem;
    transition: color var(--dur-2) var(--ease);
    white-space: nowrap;
  }

  .nav__links > a::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-2) var(--ease-out);
  }

  .nav__links > a:hover,
  .nav__links > a[aria-current="page"] {
    color: var(--ink);
  }

  .nav__links > a:hover::after,
  .nav__links > a[aria-current="page"]::after {
    transform: scaleX(1);
  }

  .nav__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.62em 1.15em;
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-pill);
    font-size: var(--t-ui);
    font-weight: 500;
    color: var(--ink);
    background: var(--surface-raised);
    box-shadow: var(--edge);
    transition: border-color var(--dur-2) var(--ease),
      background-color var(--dur-2) var(--ease),
      color var(--dur-2) var(--ease);
    white-space: nowrap;
  }

  .nav__cta:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
  }

  .nav__cta .arrow,
  .btn .arrow {
    transition: transform var(--dur-2) var(--ease-out);
  }

  .nav__cta:hover .arrow,
  .btn:hover .arrow {
    transform: translateX(0.22em);
  }

  /* --------------------------------------------------- burger + drawer */
  /* 44px — the smallest touch target that is comfortable to hit. */
  .nav__toggle {
    display: none;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    place-items: center;
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-sm);
    background: var(--surface-raised);
    color: var(--ink);
    box-shadow: var(--edge);
    transition: border-color var(--dur-2) var(--ease);
  }

  .nav__toggle:hover {
    border-color: var(--accent);
  }

  /* The drawer CTA lives inside .nav__links, whose `> a` rules (0,1,1)
     outrank every bare .btn class (0,1,0). Restate the button's own
     appearance at matching specificity, or it renders as a plain nav
     link painted on the accent fill — unreadable. */
  .nav__links > .nav__drawer-cta {
    display: none;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: var(--r-pill);
    padding: 0.85em 1.4em;
  }

  .nav__links > .nav__drawer-cta::after {
    display: none;
  }

  .nav__links > .nav__drawer-cta:hover {
    color: var(--on-accent);
    background: var(--accent-hi);
  }

  @media (max-width: 56rem) {
    .nav__toggle {
      display: grid;
    }

    .nav__cta {
      display: none;
    }

    .nav__links {
      position: absolute;
      inset-inline: var(--gutter);
      inset-block-start: calc(100% + 0.5rem);
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: var(--sp-2);
      background: var(--surface-high);
      border: 1px solid var(--hair-strong);
      border-radius: var(--r-md);
      box-shadow: var(--lift-3), var(--edge);
      opacity: 0;
      visibility: hidden;
      transform: translateY(-0.5rem);
      transition: opacity var(--dur-2) var(--ease),
        transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
    }

    .nav__links.is-open {
      opacity: 1;
      visibility: visible;
      transform: none;
    }

    .nav__links > a {
      padding: 0.8rem 0.85rem;
      border-radius: var(--r-sm);
      font-size: var(--t-md);
      color: var(--ink-2);
    }

    .nav__links > a::after {
      display: none;
    }

    .nav__links > a:hover,
    .nav__links > a[aria-current="page"] {
      background: var(--surface-raised);
      color: var(--ink);
    }

    /* The header CTA is hidden on small screens, so the drawer carries
       its own copy — a menu without a primary action is a dead end. */
    .nav__links > .nav__drawer-cta {
      display: inline-flex;
      justify-content: center;
      margin-block-start: var(--sp-2);
    }
  }

  /* ============================================== language switcher = */
  .lang {
    position: relative;
    display: flex;
    align-items: center;
  }

  .lang__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45em 0.7em;
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink-3);
    font-family: var(--face-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.08em;
    transition: color var(--dur-2) var(--ease),
      border-color var(--dur-2) var(--ease);
  }

  .lang__toggle:hover {
    color: var(--ink);
    border-color: var(--hair-bright);
  }

  .lang__chevron {
    transition: transform var(--dur-2) var(--ease-out);
  }

  .lang.is-open .lang__chevron {
    transform: rotate(180deg);
  }

  .lang__menu {
    position: absolute;
    inset-block-start: calc(100% + 0.5rem);
    inset-inline-end: 0;
    min-width: 11.5rem;
    padding: var(--sp-1);
    display: flex;
    flex-direction: column;
    background: var(--surface-high);
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-md);
    box-shadow: var(--lift-3), var(--edge);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem);
    transition: opacity var(--dur-2) var(--ease),
      transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
    z-index: 10;
  }

  .lang.is-open .lang__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .lang__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: 0.55rem 0.7rem;
    border-radius: var(--r-sm);
    font-size: var(--t-ui);
    color: var(--ink-2);
    text-align: start;
    transition: background-color var(--dur-1) var(--ease),
      color var(--dur-1) var(--ease);
  }

  .lang__option:hover {
    background: var(--surface-raised);
    color: var(--ink);
  }

  .lang__option.is-active {
    color: var(--accent);
  }

  /* ink-3, not ink-faint: this label sits on --surface-high (the menu
     panel), where the fainter step only reaches 4.25:1. */
  .lang__option-code {
    font-family: var(--face-mono);
    font-size: var(--t-2xs);
    letter-spacing: 0.1em;
    color: var(--ink-3);
  }

  .lang__option.is-active .lang__option-code {
    color: var(--accent);
  }

  @media (max-width: 56rem) {
    .lang {
      margin-block-start: var(--sp-2);
      padding-block-start: var(--sp-2);
      border-block-start: 1px solid var(--hair);
    }

    .lang__toggle {
      width: 100%;
      justify-content: flex-start;
      padding: 0.7rem 0.85rem;
      border: 0;
    }

    .lang__menu {
      inset-inline: 0;
    }
  }

  /* ========================================================= BUTTONS = */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    padding: 0.85em 1.4em;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    font-family: var(--face-text);
    font-size: var(--t-ui);
    font-weight: 550;
    letter-spacing: 0.005em;
    line-height: 1.2;
    text-align: center;
    transition: background-color var(--dur-2) var(--ease),
      border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
      transform var(--dur-2) var(--ease-out),
      box-shadow var(--dur-2) var(--ease);
  }

  .btn:active {
    transform: translateY(1px);
  }

  .btn--primary,
  .btn--solid {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--lift-1);
  }

  .btn--primary:hover,
  .btn--solid:hover {
    background: var(--accent-hi);
    border-color: var(--accent-hi);
    box-shadow: var(--lift-2);
  }

  /* The secondary button gets a real surface, not just a hairline. A
     1px border dark enough to be tasteful is not, on its own, enough
     to read as a control. */
  .btn--ghost {
    background: var(--surface-raised);
    border-color: var(--hair-bright);
    color: var(--ink);
    box-shadow: var(--edge);
  }

  .btn--ghost:hover {
    border-color: var(--ink-faint);
    background: var(--surface-high);
  }

  .btn--quiet {
    padding-inline: 0;
    color: var(--ink-2);
    border-radius: var(--r-xs);
  }

  .btn--quiet:hover {
    color: var(--accent);
  }

  .btn[disabled],
  .btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
  }

  /* ======================================================== SURFACES = */
  .card {
    position: relative;
    background: linear-gradient(
      180deg,
      var(--surface-raised),
      var(--surface) 65%
    );
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--edge);
    transition: border-color var(--dur-3) var(--ease),
      translate var(--dur-3) var(--ease-out),
      box-shadow var(--dur-3) var(--ease);
  }

  /* A single hairline lights up along the top edge on hover. It reads
     as an instrument acknowledging input — far quieter, and far more
     expensive-looking, than a glow. */
  .card--interactive::before {
    content: "";
    position: absolute;
    inset-block-start: -1px;
    inset-inline: 1.25rem;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      var(--accent),
      transparent
    );
    opacity: 0;
    transition: opacity var(--dur-3) var(--ease);
  }

  /* `translate`, not `transform`: the transform property is left free for the
     pointer tilt (fx.js), and the two compose instead of overwriting. */
  .card--interactive:hover {
    border-color: var(--hair-bright);
    translate: 0 -2px;
    box-shadow: var(--edge), var(--lift-2);
  }

  .card--interactive:hover::before {
    opacity: 1;
  }

  /* A recessed well for screens, media and code output */
  .well {
    background: var(--surface-inset);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
    box-shadow: var(--inset-well);
  }

  /* ---------------------------------------------------------- status */
  .status {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-family: var(--face-text);
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .status::before {
    content: "";
    inline-size: 0.4rem;
    block-size: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
  }

  .status--live {
    color: var(--sig-live);
  }

  .status--work {
    color: var(--sig-work);
  }

  .status--hold {
    color: var(--sig-hold);
  }

  /* The one looping animation in the system, on the one element whose
     job is to say "this is live right now". */
  .status--live::before {
    animation: pulse 3.2s var(--ease-in-out) infinite;
  }

  @keyframes pulse {
    0%,
    100% {
      opacity: 1;
      box-shadow: 0 0 0 0 color-mix(in oklab, var(--sig-live) 55%, transparent);
    }
    55% {
      opacity: 0.72;
      box-shadow: 0 0 0 0.28rem
        color-mix(in oklab, var(--sig-live) 0%, transparent);
    }
  }

  /* ------------------------------------------------------------ chip */
  .chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28em 0.6em;
    border: 1px solid var(--hair);
    border-radius: var(--r-sm);
    background: var(--surface-raised);
    font-family: var(--face-mono);
    font-size: var(--t-2xs);
    letter-spacing: 0.03em;
    color: var(--ink-2);
    transition: border-color var(--dur-2) var(--ease),
      color var(--dur-2) var(--ease);
  }

  .chip:hover {
    border-color: var(--hair-bright);
    color: var(--ink);
  }

  /* ============================================================ FORM = */
  .form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
  }

  .form__row {
    display: grid;
    gap: var(--sp-5);
    grid-template-columns: 1fr;
  }

  @media (min-width: 34rem) {
    .form__row {
      grid-template-columns: 1fr 1fr;
    }
  }

  .form__group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .form__label {
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .form__input,
  .form__textarea,
  select.form__input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface-inset);
    border: 1px solid var(--hair-strong);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-size: var(--t-base);
    box-shadow: var(--inset-well);
    transition: border-color var(--dur-2) var(--ease),
      background-color var(--dur-2) var(--ease);
  }

  .form__textarea {
    min-height: 11rem;
    resize: vertical;
    line-height: var(--lh-body);
  }

  select.form__input {
    appearance: none;
    padding-inline-end: 2.5rem;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%;
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
    color: var(--ink);
  }

  select.form__input option {
    background: var(--surface-high);
    color: var(--ink);
  }

  .form__input::placeholder,
  .form__textarea::placeholder {
    color: var(--ink-faint);
  }

  .form__input:focus-visible,
  .form__textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: var(--inset-well),
      0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
  }

  .form__input:user-invalid,
  .form__textarea:user-invalid {
    border-color: color-mix(in oklab, var(--sig-stop) 60%, var(--hair-strong));
  }

  .form__check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    font-size: var(--t-ui);
    line-height: 1.55;
    color: var(--ink-2);
    cursor: pointer;
  }

  .form__check input[type="checkbox"] {
    inline-size: 1.15rem;
    block-size: 1.15rem;
    margin-block-start: 0.15rem;
    accent-color: var(--accent);
    cursor: pointer;
  }

  .form__check a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
  }

  .form__submit {
    align-self: flex-start;
  }

  .form__status {
    font-size: var(--t-ui);
    line-height: 1.55;
    padding: 0.9rem 1.1rem;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    display: none;
  }

  .form__status.is-loading,
  .form__status.is-success,
  .form__status.is-error {
    display: block;
  }

  .form__status.is-loading {
    color: var(--ink-3);
    border-color: var(--hair);
  }

  .form__status.is-success {
    color: var(--sig-live);
    border-color: color-mix(in oklab, var(--sig-live) 40%, transparent);
    background: color-mix(in oklab, var(--sig-live) 8%, transparent);
  }

  .form__status.is-error {
    color: var(--sig-stop);
    border-color: color-mix(in oklab, var(--sig-stop) 40%, transparent);
    background: color-mix(in oklab, var(--sig-stop) 8%, transparent);
  }

  /* ========================================================== FOOTER = */
  .footer {
    padding-block: clamp(3.5rem, 7vw, 6rem) var(--sp-6);
    border-top: 1px solid var(--hair-strong);
    background: var(--surface-deep);
  }

  .footer__grid {
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    grid-template-columns: 1fr;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
  }

  @media (min-width: 40rem) {
    .footer__grid {
      grid-template-columns: repeat(3, 1fr);
    }

    .footer__brand,
    .footer__grid > div:first-child {
      grid-column: 1 / -1;
    }
  }

  @media (min-width: 62rem) {
    .footer__grid {
      grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
    }

    .footer__brand,
    .footer__grid > div:first-child {
      grid-column: auto;
    }
  }

  .footer__tagline {
    margin-block-start: var(--sp-4);
    font-size: var(--t-ui);
    line-height: var(--lh-body);
    color: var(--ink-3);
    max-width: 32ch;
  }

  .footer__col :is(h2, h3, h4) {
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: var(--sp-4);
  }

  .footer__col ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .footer__col a {
    font-size: var(--t-ui);
    color: var(--ink-2);
    transition: color var(--dur-2) var(--ease);
  }

  .footer__col a:hover {
    color: var(--accent);
  }

  .footer__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3) var(--sp-5);
    justify-content: space-between;
    align-items: baseline;
    padding-top: var(--sp-5);
    border-top: 1px solid var(--hair);
    font-family: var(--face-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.04em;
    color: var(--ink-faint);
  }

  /* ============================================================ PROSE =
     Long-form legal and documentation pages. These are three quarters
     of the site's actual page count, so they get real typographic
     attention rather than a leftover default.
     ==================================================================== */
  .prose,
  .legal-content {
    max-width: var(--measure-text);
    color: var(--ink-2);
    font-size: var(--t-base);
    line-height: var(--lh-loose);
  }

  .prose > * + *,
  .legal-content > * + * {
    margin-block-start: var(--sp-4);
  }

  .prose h2,
  .legal-content h2 {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-head);
    font-weight: 400;
    font-size: var(--t-xl);
    line-height: var(--lh-head);
    letter-spacing: -0.015em;
    color: var(--ink);
    margin-block-start: var(--sp-8);
    padding-block-start: var(--sp-4);
    border-block-start: 1px solid var(--hair);
  }

  .prose h3,
  .legal-content h3 {
    font-family: var(--face-display);
    font-variation-settings: var(--fr-sub);
    font-weight: 500;
    font-size: var(--t-lg);
    line-height: 1.32;
    color: var(--ink);
    margin-block-start: var(--sp-6);
  }

  .prose h4,
  .legal-content h4 {
    font-size: var(--t-ui);
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-block-start: var(--sp-5);
  }

  /* Same guard as .legal a in styles.css: never restyle a .btn. */
  .prose a:not(.btn),
  .legal-content a:not(.btn) {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
    transition: text-decoration-color var(--dur-2) var(--ease);
  }

  .prose a:not(.btn):hover,
  .legal-content a:not(.btn):hover {
    text-decoration-color: currentColor;
  }

  .prose strong,
  .legal-content strong {
    color: var(--ink);
    font-weight: 600;
  }

  .prose ul,
  .prose ol,
  .legal-content ul,
  .legal-content ol {
    padding-inline-start: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .prose li::marker,
  .legal-content li::marker {
    color: var(--accent);
  }

  .prose table,
  .legal-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-ui);
    margin-block: var(--sp-5);
  }

  .prose :is(th, td),
  .legal-content :is(th, td) {
    text-align: start;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--hair);
    vertical-align: top;
  }

  .prose th,
  .legal-content th {
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-faint);
    border-bottom-color: var(--hair-strong);
  }

  .prose blockquote,
  .legal-content blockquote {
    padding-inline-start: var(--sp-5);
    border-inline-start: 2px solid var(--accent-hair);
    color: var(--ink-3);
  }
}

/* ==========================================================================
   MOTION UTILITIES
   ========================================================================== */
@layer utilities {
  /* One reveal, one curve, used everywhere. The distance is small on
     purpose — content that flies in from far away reads as a template
     effect; content that settles by a few pixels reads as craft. */
  .reveal,
  .reveal-stagger > * {
    opacity: 0;
    translate: 0 0.75rem;
    transition: opacity var(--dur-4) var(--ease-out),
      translate var(--dur-4) var(--ease-out);
  }

  .reveal.is-in,
  .reveal-stagger.is-in > * {
    opacity: 1;
    translate: none;
  }

  .reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
  .reveal-stagger.is-in > *:nth-child(2) { transition-delay: 70ms; }
  .reveal-stagger.is-in > *:nth-child(3) { transition-delay: 140ms; }
  .reveal-stagger.is-in > *:nth-child(4) { transition-delay: 210ms; }
  .reveal-stagger.is-in > *:nth-child(5) { transition-delay: 280ms; }
  .reveal-stagger.is-in > *:nth-child(6) { transition-delay: 350ms; }

  @media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-stagger > * {
      opacity: 1;
      translate: none;
    }
  }

  /* Without JavaScript nothing would ever add .is-in: show the content. */
  @media (scripting: none) {
    .reveal,
    .reveal-stagger > * {
      opacity: 1;
      translate: none;
    }
  }

  .visually-hidden:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .text-accent { color: var(--accent); }
  .text-muted { color: var(--ink-3); }
  .flow-lg { --flow: var(--sp-6); }
}

/* ==========================================================================
   PRINT — the legal pages are the ones people actually print.
   ========================================================================== */
@media print {
  :root {
    --surface: #fff;
    --surface-deep: #fff;
    --surface-raised: #fff;
    --surface-high: #fff;
    --ink: #000;
    --ink-2: #1a1a1a;
    --ink-3: #444;
    --ink-faint: #666;
    --accent: #8a3a12;
    --hair: #ccc;
    --hair-strong: #bbb;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  .nav,
  .footer__grid,
  .skip-link,
  .scroll-progress,
  .lang,
  .nav__toggle,
  [data-decor] {
    display: none !important;
  }

  .section {
    padding-block: 1.2rem;
  }

  .prose a::after,
  .legal-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
    word-break: break-all;
  }

  .prose h2,
  .legal-content h2,
  .prose h3,
  .legal-content h3 {
    break-after: avoid;
  }
}
