/* =========================================================================
   SigmaFold — main stylesheet (assets/css/styles.css)
   Shared by every page: index, privacy, terms, thanks and 404.

   Design idea, "Data Cascade": the page acts out the tagline —
   complexity, folded into clarity. Noise resolves into the three-bar
   mark, weight moves from light (Fold, 300) to heavy (Sigma, 800),
   and paper folds into Void.

   Layers (later layers win):
     tokens · base · components · sections · pages · motion · a11y · print

   Colour: dark (Void) by default, light (paper) when the visitor picks it
   with the header switch — see the tokens layer.

   Everything is visible without JavaScript. All motion lives in the
   `motion` layer, behind prefers-reduced-motion: no-preference, and
   always ends on the static state defined in the other layers.
   ========================================================================= */

@layer tokens, base, components, sections, pages, motion, a11y, print;

/* FONTS — self-hosted, Latin subsets (SIL OFL) --------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

/* =========================================================================
   TOKENS — palette from logo/README.md. Keep text at 4.5:1 or better.
   ========================================================================= */
@layer tokens {
  :root {
    /* Paper (light) */
    --paper: #f0f0f4;         /* brand light background */
    --surface: #fbfbfd;       /* raised: form card, fields */
    --line: #d6d6de;          /* hairlines (decorative) */
    --line-strong: #7c7c88;   /* control edges, ≥ 3:1 on paper and surface */

    /* Ink on paper */
    --ink: #0d0d0f;
    --ink-2: #33333b;
    --muted: #595963;         /* ≥ 4.5:1 on paper (with its glow) and surface */

    /* Void (dark) */
    --void: #0a0a0c;
    --void-line: #2a2a31;
    --on-void: #f4f4f7;
    --on-void-2: #a4a4b0;     /* ≥ 4.5:1 on void (the footer) */
    --on-void-strong: #ffffff; /* footer emphasis and link hover */
    --void-sep: #5d5d68;      /* footer separators (decorative) */
    --void-focus: #7fb0ff;    /* focus ring on Void */

    /* Brand */
    --blue: #3b82f6;          /* shapes, and text on Void */
    --blue-ink: #1d4ed8;      /* links and focus on paper */
    --teal: #2dd4bf;          /* shapes only on paper; fine as text on Void */
    --accent-a: #1d4ed8;      /* section kickers: blue → */
    --accent-b: #0b6b62;      /* → deep teal, both ≥ 4.5:1 on paper and surface */

    /* Feedback */
    --success-bg: #e3f7f2;
    --success-ink: #075e4f;
    --error: #b91c1c;
    --error-bg: #fdecec;
    --focus: var(--blue-ink);
    --focus-halo: rgb(59 130 246 / 0.25); /* soft ring around focused fields */
    --on-accent: #ffffff;     /* text on the blue button hover */
    --link: var(--blue-ink);

    /* Component colours that change with the scheme */
    --field-bg: #ffffff;
    /* Ambient light: one wash over the whole page (body::after), and the
       Services row spotlight. Kept faint: text contrast is checked on paper
       tinted with them (tools/qa/contrast.py). */
    --glow-a: rgb(59 130 246 / 0.07);
    --glow-b: rgb(45 212 191 / 0.08);
    --spot: rgb(59 130 246 / 0.10);
    /* Cards: one language for the sheets, the form and a Services row's
       hover card. The lit edge is a hairline of the accent gradient. */
    --card-shadow: 0 1px 0 rgb(13 13 15 / 0.03), 0 24px 48px -32px rgb(13 13 15 / 0.30);
    --card-highlight: none;   /* an inset top highlight, dark only */
    --card-edge-opacity: 0.55;
    --mark-mid: #0d0d0f;      /* the mark's middle bar: #0d0d0f on light, #fff on dark */
    --noise: #b4b4c0;
    --noise-2: #8a8a96;
    --note-bg: #fff7e6;
    --note-line: #f3d9a4;
    --note-ink: #6b4a12;
    --logo-light: block;      /* which header logo shows */
    --logo-dark: none;
    --toggle-turn: 0deg;      /* the theme switch icon turns over on dark */
    --footer-edge: transparent; /* the footer's top edge: only needed on dark */
    --sheet-shadow: rgb(13 13 15 / 0.10); /* How we work: sheet drop shadow */

    /* Type */
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --text: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
    --text-sm: 0.9375rem;
    --text-xs: 0.8125rem;
    --h2: clamp(2.25rem, 1.45rem + 3.2vw, 4rem);
    --h3: 1.1875rem;

    /* Space & shape */
    --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
    --section-y: clamp(5rem, 3.5rem + 6vw, 9rem);
    --maxw: 1320px;
    --header-h: 68px;
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fold: cubic-bezier(0.7, 0, 0.2, 1);
    --t: 200ms;

    color-scheme: light dark;
  }

  /* Dark (Void) follows the visitor's system: the page itself becomes
     Void. Ink and paper swap roles, so components written against the
     tokens flip without extra rules. The header switch overrides the
     system (theme.js sets <html data-theme="light|dark">), so the dark
     values appear twice: once for a dark system that wasn't switched to
     light, once for a visitor who chose dark. Keep the two blocks identical
     (npm run contrast fails if they drift). Print always uses the light
     values above. */
  @media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #0e0e11;
      --surface: #16161b;
      --line: #2a2a31;
      --line-strong: #7a7a87;

      --ink: #f4f4f7;
      --ink-2: #c9c9d2;
      --muted: #9d9daa;
      --void-line: #2e2e36;
      --accent-a: #60a5fa;
      --accent-b: #2dd4bf;
      --glow-a: rgb(59 130 246 / 0.10);
      --glow-b: rgb(45 212 191 / 0.06);
      --spot: rgb(59 130 246 / 0.14);
      --card-shadow: 0 24px 48px -32px rgb(0 0 0 / 0.8);
      --card-highlight: inset 0 1px 0 rgb(255 255 255 / 0.04);
      --card-edge-opacity: 0.7;
      --mark-mid: #ffffff;
      --noise: #6a6a76;
      --noise-2: #8a8a96;

      --link: #8ab4ff;
      --focus: #7fb0ff;
      --field-bg: #0e0e11;
      --error: #ff9b9b;
      --error-bg: #2b1515;
      --note-bg: #231c0c;
      --note-line: #5c4a1f;
      --note-ink: #f3d9a4;
      --logo-light: none;
      --logo-dark: block;
      --toggle-turn: 180deg;
      --footer-edge: #26262d;
      --sheet-shadow: rgb(0 0 0 / 0.55);

      color-scheme: dark;
    }
  }
  @media screen {
    :root[data-theme="dark"] {
      --paper: #0e0e11;
      --surface: #16161b;
      --line: #2a2a31;
      --line-strong: #7a7a87;

      --ink: #f4f4f7;
      --ink-2: #c9c9d2;
      --muted: #9d9daa;
      --void-line: #2e2e36;
      --accent-a: #60a5fa;
      --accent-b: #2dd4bf;
      --glow-a: rgb(59 130 246 / 0.10);
      --glow-b: rgb(45 212 191 / 0.06);
      --spot: rgb(59 130 246 / 0.14);
      --card-shadow: 0 24px 48px -32px rgb(0 0 0 / 0.8);
      --card-highlight: inset 0 1px 0 rgb(255 255 255 / 0.04);
      --card-edge-opacity: 0.7;
      --mark-mid: #ffffff;
      --noise: #6a6a76;
      --noise-2: #8a8a96;

      --link: #8ab4ff;
      --focus: #7fb0ff;
      --field-bg: #0e0e11;
      --error: #ff9b9b;
      --error-bg: #2b1515;
      --note-bg: #231c0c;
      --note-line: #5c4a1f;
      --note-ink: #f3d9a4;
      --logo-light: none;
      --logo-dark: block;
      --toggle-turn: 180deg;
      --footer-edge: #26262d;
      --sheet-shadow: rgb(0 0 0 / 0.55);

      color-scheme: dark;
    }
  }
  :root[data-theme="light"] { color-scheme: light; }
}

/* =========================================================================
   BASE
   ========================================================================= */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  /* Ambient light: one wash, fixed to the window, behind every section,
     so the whole page reads as a single canvas with no seams. Opaque
     surfaces (cards, the Void footer) simply cover it. */
  body::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(70% 60% at 0% 0%, var(--glow-a), transparent 70%),
      radial-gradient(60% 60% at 100% 100%, var(--glow-b), transparent 70%);
  }

  img, svg { display: block; max-width: 100%; height: auto; }
  ul, ol { padding: 0; list-style: none; }
  button, input, select, textarea { font: inherit; color: inherit; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  [hidden] { display: none !important; }

  h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
  h2 { font-size: var(--h2); font-weight: 750; letter-spacing: -0.04em; line-height: 1.02; }
  h3 { font-size: var(--h3); letter-spacing: -0.015em; line-height: 1.3; }
  p { text-wrap: pretty; }
  strong { font-weight: 650; }

  a {
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: text-decoration-thickness var(--t) var(--ease), color var(--t) var(--ease);
  }
  a:hover { text-decoration-thickness: 2px; }

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

  :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
  main:focus { outline: none; }

  .container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

  .skip-link {
    position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
    padding: 0.7rem 1rem; border-radius: var(--r-sm);
    background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none;
  }
  .skip-link:focus { top: 0.75rem; }

  .visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .nowrap { white-space: nowrap; }
}

/* =========================================================================
   COMPONENTS
   ========================================================================= */
@layer components {
  /* Eyebrow: mono annotation above headings. In the hero it's a greeting;
     above a section heading it's a kicker — a short blue→teal bar, then
     the label in the same gradient. No numbers: the service rows and the
     How we work steps are the page's real sequences. */
  .eyebrow {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-family: var(--mono); font-size: var(--text-xs); font-weight: 500;
    letter-spacing: 0.01em; color: var(--muted);
  }
  .section .eyebrow { width: fit-content; font-size: var(--text-sm); letter-spacing: 0.02em; color: var(--accent-a); }
  .section .eyebrow::before {
    content: ""; flex: none; width: 20px; height: 3px; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  }
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .section .eyebrow {
      background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
      -webkit-background-clip: text; background-clip: text; color: transparent;
    }
  }

  .lead { font-size: var(--text-lg); color: var(--ink-2); line-height: 1.55; }

  /* Headline weight contrast, taken from the wordmark (Sigma 800 / Fold 300) */
  .w-heavy { font-weight: 800; }
  .w-light { font-weight: 300; }

  /* Buttons */
  .btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    min-height: 52px; padding: 0 1.5rem;
    border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: 1rem; line-height: 1.2; letter-spacing: -0.005em;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease),
                color var(--t) var(--ease), transform var(--t) var(--ease);
  }
  .btn:active { transform: scale(0.98); }
  .btn-primary { background: var(--ink); color: var(--paper); }
  .btn-primary:hover { background: var(--blue-ink); color: var(--on-accent); }
  .btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
  .btn-secondary:hover { border-color: var(--ink); background: var(--surface); }
  .btn-sm { min-height: 44px; padding: 0 1.1rem; font-size: var(--text-sm); }
  .btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }

  .arrow {
    width: 1.05em; height: 1.05em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    transition: transform var(--t) var(--ease-out);
  }
  .btn:hover .arrow, .service-cta:hover .arrow { transform: translateX(3px); }

  /* Text link with an arrow and an underline that draws in */
  .link-arrow {
    display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px;
    color: var(--ink); font-weight: 600; text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 calc(100% - 0.55rem) / 0 1.5px no-repeat;
    transition: background-size 320ms var(--ease-out);
  }
  .link-arrow:hover { background-size: 100% 1.5px; }
  .link-arrow:hover .arrow { transform: translateY(2px); }

  /* Cards (the How we work sheets, the contact form): a lit top edge,
     a hairline of the accent gradient that fades out at both ends */
  .sheet-card::before, .form-card::before {
    content: ""; position: absolute; top: -1px; left: var(--r-lg); right: var(--r-lg); height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-a) 30%, var(--accent-b) 70%, transparent);
    opacity: var(--card-edge-opacity); pointer-events: none;
  }

  /* Section scaffolding */
  .section { padding-block: var(--section-y); }
  .section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
  .section-head h2 { margin-bottom: 1.1rem; }
}

/* =========================================================================
   SECTIONS
   ========================================================================= */
@layer sections {

  /* HEADER --------------------------------------------------------------- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t) var(--ease), transform 360ms var(--ease-out);
  }
  /* The blur lives on a pseudo-element: backdrop-filter on the header itself
     would become the containing block for the fixed mobile-menu panel. */
  .site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--paper); /* fallback where color-mix() isn't supported */
    background: color-mix(in srgb, var(--paper) 84%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
  }
  .site-header.is-scrolled { border-bottom-color: var(--line); }
  .site-header.is-hidden { transform: translateY(-100%); }
  .header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }

  .brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
  .brand-logo { display: block; height: 34px; width: auto; }
  .logo-light { display: var(--logo-light); }
  .logo-dark { display: var(--logo-dark); }

  .header-end { display: flex; align-items: center; gap: 0.75rem; }

  /* Theme switch: a half-filled disc that turns over with the theme.
     Shown only when JavaScript runs (theme.js sets <html class="js"> before
     the first paint), so it's there from the first frame. */
  .theme-toggle {
    display: none; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
    border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
    color: var(--ink); cursor: pointer;
    transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
  }
  .js .theme-toggle { display: grid; }
  .theme-toggle:hover { border-color: var(--ink); }
  .theme-toggle svg { width: 20px; height: 20px; transform: rotate(var(--toggle-turn)); transition: transform 600ms var(--ease-out); }
  .theme-toggle circle { fill: none; stroke: currentColor; stroke-width: 1.75; }
  .theme-toggle path { fill: currentColor; }

  .nav-desktop { display: none; align-items: center; gap: 1.5rem; }
  .nav-desktop ul { display: flex; gap: 0.25rem; }
  .nav-desktop ul a {
    position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem;
    color: var(--ink-2); font-weight: 500; font-size: var(--text-sm); text-decoration: none;
    transition: color var(--t) var(--ease);
  }
  .nav-desktop ul a::after {
    content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 8px; height: 2px;
    background: var(--ink); transform: scaleX(0); transform-origin: left;
    transition: transform 320ms var(--ease-out);
  }
  .nav-desktop ul a:hover { color: var(--ink); }
  .nav-desktop ul a:hover::after { transform: scaleX(1); }
  .nav-desktop ul a.is-active { color: var(--ink); }
  .nav-desktop ul a.is-active::after { transform: scaleX(1); background: var(--blue); }

  /* Mobile menu: native <details>, so it works without JavaScript */
  .nav-mobile summary {
    list-style: none; cursor: pointer;
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface);
    position: relative; z-index: 2;
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  /* Three offset bars that straighten into a cross when open */
  .burger { position: relative; display: block; width: 20px; height: 14px; }
  .burger span {
    position: absolute; left: 0; height: 2px; border-radius: 2px; background: var(--ink);
    transition: transform 280ms var(--ease-out), width 280ms var(--ease-out), opacity 180ms var(--ease);
  }
  .burger span:nth-child(1) { top: 0; width: 14px; }
  .burger span:nth-child(2) { top: 6px; width: 20px; }
  .burger span:nth-child(3) { top: 12px; width: 10px; left: 5px; }
  .nav-mobile[open] .burger span:nth-child(1) { width: 20px; transform: translateY(6px) rotate(45deg); }
  .nav-mobile[open] .burger span:nth-child(2) { opacity: 0; }
  .nav-mobile[open] .burger span:nth-child(3) { width: 20px; left: 0; transform: translateY(-6px) rotate(-45deg); }

  .nav-mobile nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 1;
    display: flex; flex-direction: column;
    padding: 1rem var(--gutter) 2rem;
    background: var(--paper); overflow-y: auto;
    border-top: 1px solid var(--line);
  }
  html.menu-open { overflow: hidden; }
  .nav-mobile nav ul { display: grid; margin-bottom: 2rem; }
  .nav-mobile nav ul a {
    display: flex; align-items: baseline; gap: 1rem; min-height: 64px; padding-block: 0.75rem;
    color: var(--ink); font-size: clamp(1.75rem, 1.2rem + 3vw, 2.5rem); font-weight: 750;
    letter-spacing: -0.035em; text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .nav-mobile nav .btn { width: 100%; }
  .menu-foot { margin-top: auto; padding-top: 2rem; font-family: var(--mono); font-size: var(--text-sm); }
  .menu-foot a { color: var(--ink-2); }

  @media (min-width: 900px) {
    .nav-desktop { display: flex; }
    .nav-mobile { display: none; }
  }

  /* HERO ----------------------------------------------------------------- */
  .hero { display: flex; flex-direction: column; padding-block: clamp(1.5rem, 0.5rem + 4vw, 5rem) clamp(2rem, 1.5rem + 2vw, 3rem); overflow: hidden; }
  .hero-grid { flex: 1; display: grid; gap: clamp(1.25rem, 0.5rem + 3vw, 3rem); align-items: center; }
  /* The headline is sized to its own column and held to four lines,
     "A software studio / that makes / technology / feel simple▮",
     whatever the viewport, so the noise behind it (in em) always lines up. */
  .hero-copy { position: relative; z-index: 1; container-type: inline-size; }
  .hero .eyebrow { color: var(--ink-2); }
  .hero .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }
  .hero h1 {
    font-size: clamp(2.25rem, 12cqi, 6rem); line-height: 0.98; letter-spacing: -0.05em;
    max-width: 8.6em; text-wrap: wrap; /* greedy, not balanced: fixed breaks */
    margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem);
  }
  .hero h1 .w-light { display: block; letter-spacing: -0.045em; }
  .hero .lead { max-width: 34rem; margin-bottom: 2.25rem; }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; }

  /* The fold: the mark is the headline's full stop. Static state here is
     the FINAL state (see the motion layer): the noise is gone. */
  .fold { white-space: nowrap; }
  .fold-stop { position: relative; display: inline-block; margin-left: 0.07em; }
  .fold-mark, .fold-noise { display: block; width: calc(0.74em * 40 / 60); height: 0.74em; overflow: visible; }
  .fold-noise { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
  .fold-mark rect { transform-box: fill-box; transform-origin: 50% 50%; }
  .fold-mark .m1 { fill: var(--blue); }
  .fold-mark .m2 { fill: var(--mark-mid); }
  .fold-mark .m3 { fill: var(--teal); }
  .fold-noise rect { fill: var(--noise); opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
  .fold-noise rect:nth-child(3n) { fill: var(--noise-2); }
  .fold-noise rect:nth-child(5n) { fill: var(--ink); }

  .meta-line {
    display: flex; flex-wrap: wrap; gap: 0.25rem 0;
    padding-top: 1.25rem; border-top: 1px solid var(--line);
    font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-2);
    letter-spacing: 0.01em;
  }
  .local-time time { font-variant-numeric: tabular-nums; }
  .meta-line li:not(:last-child)::after { content: "/"; margin-inline: 0.9rem; color: var(--line-strong); }
  /* Phones: the three facts stack, so no line ends on a dangling separator */
  @media (max-width: 559px) {
    .meta-line { flex-direction: column; gap: 0.3rem; }
    .meta-line li:not(:last-child)::after { content: none; }
  }

  @media (min-width: 720px) {
    .meta-line { margin-top: clamp(1rem, 3vw, 3rem); align-self: end; }
  }
  @media (min-width: 900px) {
    /* Fill the first screen, with the meta line resting on its bottom edge */
    .hero { min-height: min(calc(100svh - var(--header-h)), 1000px); }
    .hero-grid { grid-template-rows: 1fr auto; }
  }
  /* Poster: the lead and actions sit in the space the two short last
     lines leave on the right, level with the bottom of the headline. */
  @media (min-width: 1100px) {
    /* Column 1 is as wide as "technology" / "feel simple▮" (5.55 × the
       headline size, which is min(12% of the column, 7rem)), so the aside
       never reaches into them. */
    .hero-copy { display: grid; grid-template-columns: min(66.6%, 38.85rem) 1fr; column-gap: 3rem; }
    .hero .eyebrow { grid-column: 1 / -1; }
    .hero h1 { grid-column: 1 / -1; grid-row: 2; font-size: clamp(2.25rem, 12cqi, 7rem); margin-bottom: 0; }
    .hero-aside { grid-column: 2; grid-row: 2; align-self: end; justify-self: end; max-width: 30rem; padding-bottom: 0.4rem; }
    .hero .lead { margin-bottom: 1.75rem; }
  }

  /* ABOUT ---------------------------------------------------------------- */
  .about h2 { max-width: 16ch; }
  .manifesto {
    margin-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
    max-width: 22ch;
    font-size: clamp(2rem, 1.1rem + 3.6vw, 4.25rem); font-weight: 300;
    line-height: 1.08; letter-spacing: -0.04em; color: var(--ink);
    text-wrap: balance;
  }
  .about-grid { display: grid; gap: clamp(2rem, 1.5rem + 3vw, 4rem); padding-top: 2rem; border-top: 1px solid var(--line); }
  .about-copy p { max-width: 36rem; color: var(--ink-2); font-size: var(--text-lg); }
  .about-copy p + p { margin-top: 1rem; }

  .name-note { max-width: 30rem; color: var(--ink-2); font-size: var(--text-lg); }
  .name-note strong { color: var(--ink); font-weight: 650; }

  .mission {
    margin-block: clamp(3rem, 2rem + 4vw, 5rem);
    padding: clamp(1.75rem, 1rem + 3vw, 3rem) 0;
    border-block: 1.5px solid var(--ink);
    display: grid; gap: 1rem;
  }
  .mission-label { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.01em; color: var(--muted); }
  .mission-text {
    font-size: clamp(1.625rem, 1.1rem + 2.2vw, 2.75rem); font-weight: 650;
    line-height: 1.15; letter-spacing: -0.035em; max-width: 26ch;
  }

  /* Values: "Clarity over complexity", the losing word struck through */
  .values { display: grid; }
  .values li {
    display: grid; gap: 0.5rem 2rem; padding-block: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    border-bottom: 1px solid var(--line);
  }
  .values h3 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem); letter-spacing: -0.045em; line-height: 1.05; font-weight: 800; }
  .values .over { font-weight: 300; color: var(--muted); }
  .values .lose { position: relative; font-weight: 300; color: var(--muted); white-space: nowrap; }
  .values .lose::after {
    content: ""; position: absolute; left: -0.04em; right: -0.04em; top: 55%; height: 0.07em;
    background: var(--ink); transform-origin: left;
  }
  .values p { color: var(--ink-2); max-width: 26rem; }

  @media (min-width: 900px) {
    .about-grid { grid-template-columns: 1.1fr 0.9fr; }
    .values li { grid-template-columns: 1fr minmax(16rem, 24rem); align-items: end; }
    .values p { justify-self: end; text-align: right; }
  }

  /* SERVICES -------------------------------------------------------------
     An editorial list on the page canvas. Each row lifts into a card on
     hover or focus, with a spotlight that follows the pointer (--mx/--my,
     set by main.js) and an accent bar down its left edge. The link comes
     after the bullets in the markup, so narrow screens read description,
     bullets, then link; wide screens put it back under the description. */
  .services { container-type: inline-size; border-top: 1px solid var(--line); }
  .service {
    position: relative;
    display: grid; gap: 1rem 2rem;
    grid-template-columns: 1fr;
    padding-block: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
    border-bottom: 1px solid var(--line);
    --card-inset: calc(-1 * clamp(0.5rem, 1.5vw, 1.25rem));
  }
  /* The whole row answers hover and keyboard focus, since each has a link */
  .service::before {
    content: ""; position: absolute; inset: 0 var(--card-inset);
    border: 1px solid var(--line); border-radius: var(--r-md);
    background:
      radial-gradient(360px circle at var(--mx, 30%) var(--my, 40%), var(--spot), transparent 65%),
      var(--surface);
    box-shadow: var(--card-shadow), var(--card-highlight);
    opacity: 0; transition: opacity 320ms var(--ease);
  }
  /* The accent bar: a fourth bar, grown on hover */
  .service::after {
    content: ""; position: absolute; top: 1.25rem; bottom: 1.25rem; left: var(--card-inset);
    width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(to bottom, var(--accent-a), var(--accent-b));
    transform: scaleY(0); transform-origin: top;
    transition: transform 420ms var(--ease-out);
  }
  .service > * { position: relative; }
  .service:hover::before, .service:focus-within::before { opacity: 1; }
  .service:hover::after, .service:focus-within::after { transform: scaleY(1); }
  .service h3 { transition: transform 420ms var(--ease-out); }
  .service:hover h3, .service:focus-within h3 { transform: translateX(4px); }
  .service:hover .service-cta, .service:focus-within .service-cta { border-bottom-color: var(--accent-a); }
  .service-idx { font-family: var(--mono); font-size: var(--text-sm); color: var(--accent-a); width: fit-content; height: fit-content; }
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .service-idx {
      background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
      -webkit-background-clip: text; background-clip: text; color: transparent;
    }
  }
  .service-main { display: grid; gap: 0.75rem; align-content: start; }
  .service h3 { font-size: clamp(1.625rem, 1.1rem + 2vw, 2.5rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.05; }
  .service-main > p { color: var(--ink-2); max-width: 30rem; }
  .service-list { display: grid; gap: 0.1rem; align-content: start; }
  .service-list li {
    display: flex; gap: 0.75rem; align-items: baseline;
    padding-block: 0.4rem; border-bottom: 1px dashed var(--line);
    font-size: var(--text-sm); color: var(--ink);
  }
  .service-list li::before {
    content: ""; width: 6px; height: 6px; flex: none; transform: translateY(-2px); border-radius: 1px;
    background: var(--ink-2); transition: background-color var(--t) var(--ease);
  }
  .service:hover .service-list li::before, .service:focus-within .service-list li::before { background: var(--accent-a); }
  .service-cta {
    display: inline-flex; align-items: center; gap: 0.45rem; width: fit-content; min-height: 44px;
    color: var(--ink); font-weight: 600; font-size: var(--text-sm); text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
  }
  .service-cta:hover { border-bottom-color: var(--accent-a); }
  .glyph { display: none; }

  @container (min-width: 760px) {
    .service { grid-template-columns: 4rem minmax(0, 1.25fr) minmax(0, 1fr) 72px; grid-template-rows: auto 1fr; }
    .service-idx { padding-top: 0.55rem; }
    .service-list { grid-column: 3; grid-row: 1 / span 2; padding-top: 0.5rem; }
    .service-cta { grid-column: 2; grid-row: 2; margin-top: -0.25rem; } /* the 0.75rem gap .service-main uses */
    .glyph { display: block; grid-column: 4; grid-row: 1; width: 64px; height: 64px; justify-self: end; margin-top: 0.4rem; }
    .glyph rect { fill: var(--line); transition: fill 300ms var(--ease), transform 420ms var(--ease-out); transform-box: fill-box; }
    .glyph .hi { fill: var(--ink-2); }
    .service:hover .glyph rect, .service:focus-within .glyph rect { fill: color-mix(in srgb, var(--ink-2) 35%, var(--surface)); }
    .service:hover .glyph .hi, .service:focus-within .glyph .hi { fill: var(--teal); }
    .service:hover .glyph rect:nth-child(odd) { transform: translateY(-3px); }
    .service:hover .glyph rect:nth-child(even) { transform: translateY(3px); }
  }

  /* HOW WE WORK: stacking sheets ---------------------------------------
     Each step is a paper sheet that pins under the header; the next one
     slides over it, leaving a sliver of every earlier sheet showing. The
     covered sheets ease back (--recede, set by main.js). Pure CSS sticky
     does the stacking, so it still works without JavaScript. */
  /* Equal rows: a taller sheet must never peek out below the one covering it */
  .sheets { display: grid; grid-auto-rows: 1fr; gap: 1.25rem; }
  .sheet {
    position: sticky; top: calc(var(--header-h) + 1rem + var(--i, 0) * 0.9rem);
    transform-origin: 50% 0; transform: scale(calc(1 - 0.05 * var(--recede, 0)));
    will-change: transform;
    filter: drop-shadow(0 -8px 24px var(--sheet-shadow));
  }
  .sheet:nth-child(2) { --i: 1; }
  .sheet:nth-child(3) { --i: 2; }
  .sheet:nth-child(4) { --i: 3; }

  /* The sheet: a card with a lit top edge (see Cards, components layer) */
  .sheet-card {
    position: relative; display: grid; align-items: baseline; height: 100%; align-content: start;
    grid-template-columns: auto 1fr;
    grid-template-areas: "num title" "text text";
    gap: 0.5rem 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--card-highlight);
  }

  /* Weight contrast from the wordmark: a light numeral, a heavy name */
  .sheet-num {
    grid-area: num;
    font-size: clamp(2.75rem, 2rem + 3vw, 3.25rem); font-weight: 200; line-height: 0.85;
    letter-spacing: -0.06em; font-variant-numeric: tabular-nums; color: var(--ink);
  }
  .sheet-label { grid-area: label; display: none; font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); }
  .sheet-card h3 {
    grid-area: title;
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1;
  }
  .sheet-card p { grid-area: text; color: var(--ink-2); font-size: var(--text-lg); max-width: 34rem; }

  /* Wide screens: a big numeral on the left, the step beside it */
  @media (min-width: 760px) {
    .sheet-card {
      align-items: center;
      grid-template-columns: clamp(7rem, 4rem + 8vw, 12rem) 1fr;
      grid-template-areas: "num label" "num title" "num text";
      gap: 0.4rem 2rem;
      padding: clamp(1.25rem, 0.9rem + 1vw, 1.875rem) clamp(1.75rem, 1rem + 2.5vw, 3rem);
    }
    .sheet-num { font-size: clamp(4.5rem, 2rem + 6vw, 7.5rem); align-self: center; }
    .sheet-label { display: block; align-self: end; }
    .sheet-card h3 { margin-top: 0.1rem; }
    .sheet-card p { align-self: start; }
  }

  /* Heading with the promises beside it on wide screens */
  .how-head { display: grid; gap: 2rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
  .how-head h2 { max-width: 16ch; }
  @media (min-width: 900px) {
    .how-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 3rem; }
  }

  /* Short screens: a sheet could be taller than the space left, so just list them */
  @media (max-height: 619px) {
    .sheet { position: static; transform: none; filter: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .sheet { transform: none; }
  }

  .expect { padding-top: 1.25rem; border-top: 1.5px solid var(--ink); }
  .expect h3 { margin-bottom: 0.5rem; font-family: var(--mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.01em; color: var(--muted); }
  .expect ul { display: grid; gap: 0 2rem; }
  .expect li {
    display: flex; align-items: center; gap: 0.75rem; padding-block: 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem); font-weight: 650; letter-spacing: -0.02em; line-height: 1.3;
  }
  .expect li::before { content: ""; width: 0.45em; height: 0.45em; flex: none; border-radius: 2px; background: var(--teal); }
  @media (min-width: 360px) {
    .expect ul { grid-template-columns: 1fr 1fr; }
  }

  /* CONTACT -------------------------------------------------------------- */
  .contact-grid { display: grid; gap: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); align-items: start; }
  .contact h2 { font-size: clamp(3rem, 1.6rem + 6vw, 7rem); letter-spacing: -0.055em; line-height: 0.95; margin-bottom: 1.25rem; }
  .contact-intro .lead { max-width: 30rem; }

  .contact-info { display: grid; gap: 1.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-strong); }
  .contact-info h3 { font-family: var(--mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.01em; color: var(--muted); margin-bottom: 0.35rem; }
  .contact-info p { color: var(--ink-2); }
  .email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
  .email-link { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); font-weight: 650; letter-spacing: -0.03em; color: var(--ink); }
  .email-link:hover { color: var(--link); }
  .copy-btn {
    min-height: 36px; padding: 0 0.85rem; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--surface);
    font-family: var(--mono); font-size: var(--text-xs); color: var(--ink);
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
  }
  .copy-btn:hover { border-color: var(--ink); }
  .copy-btn.is-done { background: var(--ink); color: var(--paper); border-color: var(--ink); }

  .form-card {
    padding: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem); border-radius: var(--r-lg);
    position: relative;
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--card-shadow), var(--card-highlight);
  }
  .form-card form { display: grid; gap: 1.5rem; }
  .field-row { display: grid; gap: 1.5rem; }
  .field { display: grid; gap: 0.5rem; align-content: start; } /* start: an error beside it mustn't stretch a paired field */
  .field label, .field legend { font-weight: 600; font-size: var(--text-sm); padding: 0; }
  .field legend { margin-bottom: 0.6rem; }
  .optional { color: var(--muted); font-weight: 400; }
  .field input:not([type="radio"]), .field textarea {
    width: 100%; min-height: 52px; padding: 0.75rem 1rem;
    border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--field-bg); color: var(--ink); font-size: 1rem;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  }
  .field input:not([type="radio"]):hover, .field textarea:hover { border-color: var(--ink-2); }
  .field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
  .field input:focus-visible, .field textarea:focus-visible {
    outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--focus-halo);
  }
  .field [aria-invalid="true"] { border-color: var(--error); }
  .field-error { font-size: var(--text-sm); color: var(--error); font-weight: 500; }
  .field-error:empty { display: none; }
  .botcheck { display: none !important; }

  /* Topic chips: real radio buttons, styled */
  .topic-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .chip { position: relative; display: inline-flex; cursor: pointer; }
  .chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .chip span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--field-bg);
    font-size: var(--text-sm); font-weight: 500; color: var(--ink-2);
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
  }
  .chip:hover span { border-color: var(--ink); color: var(--ink); }
  .chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

  .form-foot { display: grid; gap: 1rem; justify-items: start; }

  .form-status:empty { display: none; }
  .form-status { margin-top: 1.25rem; padding: 1rem 1.25rem; border-radius: var(--r-sm); line-height: 1.5; }
  .form-status:focus { outline: none; }
  .form-status.is-success { background: transparent; color: var(--ink); margin-top: 0; padding: 0.5rem 0; }
  .form-status.is-success strong { display: block; font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem); letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 0.5rem; }
  .form-status.is-error { background: var(--error-bg); color: var(--error); }
  .sent-mark { width: 72px; height: auto; margin-bottom: 1.5rem; }
  .sent-mark rect { transform-box: fill-box; }
  .sent-mark .m1 { fill: var(--blue); }
  .sent-mark .m2 { fill: var(--mark-mid); }
  .sent-mark .m3 { fill: var(--teal); }

  @media (min-width: 640px) {
    .field-row { grid-template-columns: 1fr 1fr; }
  }
  @media (min-width: 1000px) {
    .contact-grid { grid-template-columns: 0.9fr 1.1fr; }
    .contact-intro { position: sticky; top: calc(var(--header-h) + 2rem); }
  }

  /* FOOTER --------------------------------------------------------------- */
  .site-footer { background: var(--void); color: var(--on-void-2); border-top: 1px solid var(--footer-edge); padding-block: clamp(4rem, 3rem + 4vw, 7rem) 1.5rem; font-size: var(--text-sm); --focus: var(--void-focus); }
  .site-footer a { color: var(--on-void); text-decoration: none; }
  .site-footer a:hover { color: var(--on-void-strong); text-decoration: underline; text-underline-offset: 3px; }
  .footer-tagline {
    max-width: 14ch; margin-bottom: clamp(3rem, 2rem + 4vw, 5.5rem);
    color: var(--on-void); font-size: clamp(2.5rem, 1.2rem + 5.4vw, 6rem);
    line-height: 0.98; letter-spacing: -0.05em;
  }
  .footer-tagline .w-heavy { color: var(--on-void-strong); }
  .footer-top { display: grid; gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--void-line); }
  .footer-top .brand { width: fit-content; }
  .footer-nav ul { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 2.5rem; }
  .footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-bottom {
    padding-top: 1rem;
    display: flex; flex-direction: column; gap: 0.25rem;
    font-family: var(--mono); font-size: 0.75rem; color: var(--on-void-2);
  }
  .footer-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.6rem; }
  .footer-meta a { display: inline-block; padding-block: 0.5rem; }
  .footer-meta .sep { color: var(--void-sep); }

  @media (min-width: 760px) {
    .footer-top { grid-template-columns: 1fr auto; align-items: center; }
    .footer-nav ul { display: flex; column-gap: 2rem; }
    .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; }
  }
}

/* =========================================================================
   PAGES — privacy, terms, thanks, 404
   ========================================================================= */
@layer pages {
  .page { padding-block: clamp(3.5rem, 2rem + 5vw, 7rem); }
  .page-inner { max-width: 46rem; }
  .page h1 { font-size: var(--h2); font-weight: 750; letter-spacing: -0.045em; line-height: 1.02; margin-bottom: 1.25rem; }
  .page .lead { margin-bottom: 1.75rem; }
  .page-mark { width: 88px; margin-bottom: 2rem; }
  .page-mark .m1 { fill: var(--blue); }
  .page-mark .m2 { fill: var(--mark-mid); }
  .page-mark .m3 { fill: var(--teal); }
  .page-mark rect { transform-box: fill-box; }
  .draft-banner {
    margin-bottom: 2.25rem; padding: 1rem 1.25rem; border-radius: var(--r-sm);
    background: var(--note-bg); border: 1px solid var(--note-line); color: var(--note-ink); font-size: var(--text-sm);
  }
  .prose h2 { font-size: 1.375rem; font-weight: 700; margin: 2.75rem 0 0.75rem; letter-spacing: -0.02em; line-height: 1.25; }
  .prose p, .prose li { color: var(--ink-2); }
  .prose p + p, .prose ul + p { margin-top: 0.9rem; }
  .prose ul { list-style: disc; padding-left: 1.25rem; margin-top: 0.6rem; display: grid; gap: 0.35rem; }
  .prose strong { color: var(--ink); }

  /* 404: the noise with nothing to fold into */
  .lost { width: 100%; max-width: 360px; margin-bottom: 0.75rem; overflow: visible; }
  .lost-grid path { stroke: var(--line); stroke-width: 0.35; stroke-dasharray: 1 1.5; fill: none; }
  .lost rect { fill: var(--noise); opacity: 0.55; transform-box: fill-box; transform-origin: 50% 100%; }
  .lost rect:nth-child(3n) { fill: var(--noise-2); opacity: 0.7; }
  .lost-caption { display: flex; gap: 0.75rem; margin-bottom: 2rem; font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); }
  .lost-caption span { color: var(--ink); }
}

/* =========================================================================
   MOTION — progressive enhancement only. Every animation ends on the
   static state defined above, so reduced motion or an older browser
   simply sees the finished page.
   ========================================================================= */
@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    /* Cross-page transitions (index ⇄ privacy / terms / thanks / 404) */
    @view-transition { navigation: auto; }
    /* Named on .header-inner, not the header: a named element is a backdrop
       root, so .site-header::before could no longer blur the page behind. */
    .header-inner { view-transition-name: site-header; }

    /* Theme switch: the new theme spreads out in a circle from the button
       (theme.js sets --vt-x/--vt-y/--vt-r and the .theming class) */
    html.theming .header-inner { view-transition-name: none; }
    html.theming::view-transition-old(root),
    html.theming::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
    html.theming::view-transition-new(root) { animation: theme-reveal 650ms var(--ease-out); }
    @keyframes theme-reveal {
      from { clip-path: circle(0 at var(--vt-x) var(--vt-y)); }
      to { clip-path: circle(var(--vt-r) at var(--vt-x) var(--vt-y)); }
    }

    /* Hero fold: the noise behind the headline clears in reading order,
       then "feel simple" and its full stop (the mark) resolve together. */
    .fold-noise rect { animation: noise-fold 650ms var(--ease-fold) backwards; }
    .fold-noise rect:nth-child(1) { animation-delay: 150ms; }
    .fold-noise rect:nth-child(2) { animation-delay: 180ms; }
    .fold-noise rect:nth-child(3) { animation-delay: 210ms; }
    .fold-noise rect:nth-child(4) { animation-delay: 240ms; }
    .fold-noise rect:nth-child(5) { animation-delay: 270ms; }
    .fold-noise rect:nth-child(6) { animation-delay: 300ms; }
    .fold-noise rect:nth-child(7) { animation-delay: 330ms; }
    .fold-noise rect:nth-child(8) { animation-delay: 360ms; }
    .fold-noise rect:nth-child(9) { animation-delay: 420ms; }
    .fold-noise rect:nth-child(10) { animation-delay: 450ms; }
    .fold-noise rect:nth-child(11) { animation-delay: 480ms; }
    .fold-noise rect:nth-child(12) { animation-delay: 510ms; }
    .fold-noise rect:nth-child(13) { animation-delay: 540ms; }
    .fold-noise rect:nth-child(14) { animation-delay: 600ms; }
    .fold-noise rect:nth-child(15) { animation-delay: 630ms; }
    .fold-noise rect:nth-child(16) { animation-delay: 660ms; }
    .fold-noise rect:nth-child(17) { animation-delay: 690ms; }
    .fold-noise rect:nth-child(18) { animation-delay: 720ms; }
    .fold-noise rect:nth-child(19) { animation-delay: 780ms; }
    .fold-noise rect:nth-child(20) { animation-delay: 810ms; }
    .fold-noise rect:nth-child(21) { animation-delay: 840ms; }
    .fold-noise rect:nth-child(22) { animation-delay: 870ms; }

    .fold-mark rect { animation: mark-settle 1000ms var(--ease-out) backwards; }
    .fold-mark .m1 { --from: translateY(22px) scaleY(0.55); animation-delay: 760ms; }
    .fold-mark .m2 { --from: translateY(-26px) scaleY(1.35); animation-delay: 820ms; }
    .fold-mark .m3 { --from: translateY(10px) scaleY(0.8); animation-delay: 880ms; }
    .hero h1 .w-light { animation: resolve 650ms var(--ease) 1150ms backwards; }

    @keyframes noise-fold {
      from { opacity: 0.5; transform: scaleY(1); }
    }
    @keyframes mark-settle {
      from { fill: var(--noise); transform: var(--from); }
      45% { fill: var(--noise); }
    }
    @keyframes resolve {
      from { color: var(--noise-2); }
    }

    /* Hover the full stop (mouse only): the headline falls back into noise,
       then folds into clarity again when the pointer leaves. Only the stop
       is a trigger, so reading or selecting the headline never sets it off. */
    @media (hover: hover) and (pointer: fine) {
      .fold-noise rect { transition: opacity 600ms var(--ease-fold), transform 700ms var(--ease-fold); }
      .fold-noise rect:nth-child(2n) { transition-delay: 80ms; }
      .fold-noise rect:nth-child(3n) { transition-delay: 160ms; }
      .fold-mark rect { transition: transform 800ms var(--ease-out), fill 500ms var(--ease); }
      .fold-mark .m2 { transition-delay: 60ms; }
      .fold-mark .m3 { transition-delay: 120ms; }
      .hero h1 .w-light { transition: color 500ms var(--ease); }
      .fold-stop:hover .fold-noise rect { opacity: 0.5; transform: scaleY(1); }
      .fold-stop:hover .fold-mark rect { transform: var(--from); fill: var(--noise); }
      .hero h1:has(.fold-stop:hover) .w-light { color: var(--noise-2); }
    }

    /* 404: the noise rises and stays unresolved (one shot, no loop) */
    .lost rect { animation: lost-in 900ms var(--ease-out) backwards; }
    .lost rect:nth-child(2n) { animation-delay: 80ms; }
    .lost rect:nth-child(3n) { animation-delay: 160ms; }
    .lost rect:nth-child(5n) { animation-delay: 240ms; }
    @keyframes lost-in { from { opacity: 0; transform: scaleY(0.1); } }

    /* Burger menu panel: links slide up in sequence */
    .nav-mobile[open] nav li { animation: rise 520ms var(--ease-out) both; }
    .nav-mobile[open] nav li:nth-child(2) { animation-delay: 50ms; }
    .nav-mobile[open] nav li:nth-child(3) { animation-delay: 100ms; }
    .nav-mobile[open] nav li:nth-child(4) { animation-delay: 150ms; }
    @keyframes rise { from { opacity: 0; transform: translateY(14px); } }

    /* Form success: the three bars fall into place */
    .sent-mark rect { animation: drop 700ms var(--ease-out) both; }
    .sent-mark .m2 { animation-delay: 90ms; }
    .sent-mark .m3 { animation-delay: 180ms; }
    .page-mark rect { animation: drop 800ms var(--ease-out) 150ms both; }
    .page-mark .m2 { animation-delay: 240ms; }
    .page-mark .m3 { animation-delay: 330ms; }
    @keyframes drop { from { opacity: 0; transform: translateY(-60%); } }

    /* Scroll-driven details, where the browser supports them */
    @supports (animation-timeline: view()) {
      /* Manifesto: ink fills the sentence in reading order, finishing as it
         fully enters, so a sentence at rest on screen is never half-filled */
      .manifesto span {
        color: transparent;
        background: linear-gradient(90deg, var(--ink) 0 50%, var(--muted) 50% 100%) 100% 0 / 200% 100% no-repeat;
        -webkit-background-clip: text; background-clip: text;
        animation: ink-in linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 85%;
      }
      @keyframes ink-in { to { background-position: 0 0; } }

      /* Values: the losing word is struck through as it scrolls in */
      .values .lose::after {
        animation: strike linear both;
        animation-timeline: view();
        animation-range: entry 30% entry 100%;
      }
      @keyframes strike { from { transform: scaleX(0); } }

      /* Service glyphs rise into place */
      .glyph rect {
        animation: glyph-in linear both;
        animation-timeline: view();
        animation-range: entry 40% cover 35%;
      }
      .glyph rect:nth-child(2) { animation-range: entry 55% cover 40%; }
      .glyph rect:nth-child(3) { animation-range: entry 70% cover 45%; }
      .glyph rect:nth-child(n+4) { animation-range: entry 85% cover 50%; }
      @keyframes glyph-in { from { opacity: 0; transform: translateY(40%); } }
    }

    /* Reading progress: a hairline across the top of the window */
    @supports (animation-timeline: scroll()) {
      body::before {
        content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 2px;
        background: linear-gradient(90deg, var(--blue), var(--teal));
        transform-origin: 0 50%; pointer-events: none;
        animation: progress linear both;
        animation-timeline: scroll(root);
      }
      @keyframes progress { from { transform: scaleX(0); } }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; }
  }
}

/* =========================================================================
   A11Y — Windows High Contrast / forced colours
   ========================================================================= */
@layer a11y {
  @media (forced-colors: active) {
    .manifesto span { color: CanvasText; background: none; }
    .burger span { forced-color-adjust: none; background: CanvasText; }
    .theme-toggle { forced-color-adjust: none; color: CanvasText; border-color: CanvasText; background: Canvas; }
    .chip input:checked + span { border-width: 3px; border-color: Highlight; }
    .values .lose::after { forced-color-adjust: none; background: CanvasText; }
    .sheet { filter: none; }
    .sheet-card { border-color: CanvasText; }
    .sheet-card::before, .form-card::before, body::before, body::after { display: none; }
    .service-idx { background: none; color: CanvasText; }
    .service::after { display: none; }
    .section .eyebrow { background: none; color: CanvasText; }
    .section .eyebrow::before { forced-color-adjust: none; background: CanvasText; }
  }
}

/* =========================================================================
   PRINT
   ========================================================================= */
@layer print {
  @media print {
    .site-header, .form-card, .skip-link, .fold-noise, .copy-btn { display: none !important; }
    body { background: #fff; color: #000; }
    .site-footer { background: #fff; color: #000; }
    .site-footer * { color: #000 !important; }
    body::after, .service::before, .service::after, .sheet-card::before, .form-card::before { display: none; }
    .service-idx { background: none; }
    .section .eyebrow { background: none; color: #000; }
    .section .eyebrow::before { background: #000; }
    .sheet { position: static !important; transform: none !important; filter: none !important; break-inside: avoid; }
  }
}
