  :root {
    /* ---------- LIGHT PAGE: paper surfaces ---------- */
    --paper:    #F3F1EA;   /* base cream canvas */
    --paper-2:  #F7F5EF;   /* lifted: cards, nav fill, raised rows */
    --paper-3:  #EBE8DF;   /* recessed: wells, inset panels, CTA bg, footer */

    /* ---------- LIGHT PAGE: warm ink text ---------- */
    --ink:    #1C1B17;     /* display + primary text */
    --ink-2:  #44423A;     /* secondary body, ledes */
    --ink-3:  #6C6959;     /* muted: eyebrows, captions, meta */

    /* ---------- ONE NAVY ACCENT (~5% usage) ---------- */
    --accent:        #2B4C63;
    --accent-2:      #36617F;                  /* link hover only */
    --accent-soft:   rgba(43,76,99,0.08);      /* faint active fill / ::selection */
    --accent-line:   rgba(43,76,99,0.28);      /* accent hairline / focus ring */

    /* ---------- LIGHT lines / hairlines ---------- */
    --line:    #E0DCCF;    /* default hairline on paper, grid lattice */
    --line-2:  #D2CDBD;    /* stronger divider, button border, hover border */

    /* ---------- SHADOWS (warm, low) ---------- */
    --sh-sm:  0 1px 2px rgba(28,27,23,0.04);
    --sh-md:  0 8px 24px -8px rgba(28,27,23,0.10);
    --sh-lg:  0 24px 60px -18px rgba(28,27,23,0.16);
    --sh-frame: 0 1px 0 rgba(255,255,255,0.04) inset,
                0 40px 120px -24px rgba(28,27,23,0.32),
                0 0 0 1px rgba(28,27,23,0.04);

    /* ---------- RADII ---------- */
    --r-frame: 18px;
    --r-card:  14px;
    --r-sm:    9px;
    --r-pill:  999px;

    /* ---------- FONTS ---------- */
    --serif: 'Instrument Serif', 'Times New Roman', serif;
    --sans:  'Geist', system-ui, -apple-system, sans-serif;
    --mono:  'JetBrains Mono', ui-monospace, monospace;

    --nav-h: 64px;

    /* ---------- HERO PROGRESS (written by JS) ---------- */
    --hp: 0;
  }

  /* ===== DARK PRODUCT FRAME: the ONLY dark surfaces. =====
     Re-declares the OLD token names so the product UI CSS works unchanged. */
  .frame {
    --bg:    #0B0C0E;
    --bg-2:  #101216;
    --bg-3:  #15171C;
    --line:    #1E2129;
    --line-2:  #2A2E37;
    --text:    #ECECE6;
    --text-2:  #A9AEB6;
    --text-3:  #6B7079;
    --accent:        #5B93B8;              /* LIFTED navy — reads on near-black */
    --accent-soft:   rgba(91,147,184,0.14);
    --accent-line:   rgba(91,147,184,0.40);
    --warn:          #C9A24B;
    --good:          #4FB477;
  }

  /* ===== DARK SECTION SCOPE: inverts the LIGHT tokens so a whole section
     reads light-on-dark while its existing CSS (var(--ink)/--line/--accent) is unchanged.
     Used by the Proof "proof room" band. Product .frame still re-scopes within itself. */
  .section-dark {
    --paper:    #1A1711;
    --paper-2:  #221E16;
    --paper-3:  #14110B;
    --ink:    #F4F1E9;
    --ink-2:  #BAB6A8;
    --ink-3:  #8A8674;
    --accent:        #5B93B8;              /* lifted navy reads on dark */
    --accent-2:      #6FA8C9;
    --accent-soft:   rgba(91,147,184,0.16);
    --accent-line:   rgba(91,147,184,0.38);
    --line:    rgba(244,241,233,0.13);
    --line-2:  rgba(244,241,233,0.22);
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;   /* clip (not hidden) so body is NOT a scroll container — keeps position:sticky working */
    line-height: 1.55;
    letter-spacing: -0.005em;
  }

  /* ---------- smooth scroll (Lenis) — drives NATIVE scroll, so position:sticky still works ---------- */
  html.lenis, html.lenis body { height: auto; }
  .lenis.lenis-smooth { scroll-behavior: auto !important; }
  .lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
  .lenis.lenis-stopped { overflow: hidden; }
  .lenis.lenis-smooth iframe { pointer-events: none; }

  /* warm grain — multiply reads warm on cream (overlay reads gray) */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.035;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  }

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

  /* type */
  h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.02em; }
  .serif { font-family: var(--serif); font-weight: 400; }
  .mono { font-family: var(--mono); letter-spacing: 0; font-weight: 400; }
  .uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
  a { color: inherit; text-decoration: none; }
  em { font-style: italic; }

  /* layout */
  .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
  }
  @media (max-width: 720px) {
    .container { padding: 0 20px; }
  }

  /* utility: mono eyebrow with one navy dot (no glow) */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 500;
  }
  .eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
  }

  /* buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--r-pill);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--line-2);
    background: var(--paper-2);
    color: var(--ink);
    letter-spacing: -0.005em;
    transition: transform 0.25s cubic-bezier(0.2,0.7,0.2,1), border-color 0.25s, background 0.25s, color 0.25s;
  }
  .btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
  .btn-primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
  .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn-ghost { background: transparent; border-color: var(--line-2); }
  .btn-ghost:hover { border-color: var(--accent-line); }
  .btn .arrow { transition: transform 0.25s; }
  .btn:hover .arrow { transform: translateX(3px); }

  /* scroll reveal */
  .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(0.2,0.7,0.2,1), transform 0.9s cubic-bezier(0.2,0.7,0.2,1); }
  .reveal.in { opacity: 1; transform: none; }
  .reveal-delay-1 { transition-delay: 0.08s; }
  .reveal-delay-2 { transition-delay: 0.16s; }
  .reveal-delay-3 { transition-delay: 0.24s; }
  .reveal-delay-4 { transition-delay: 0.32s; }

  /* section */
  section { position: relative; padding: 160px 0; }
  .section-title {
    font-family: var(--serif);
    font-size: clamp(40px, 5.6vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
  }
  .section-title em { font-style: italic; color: var(--ink-2); }
  .section-lede {
    color: var(--ink-2);
    font-size: 17px;
    line-height: 1.6;
    max-width: 52ch;
    text-wrap: pretty;
  }

  /* THE REPEATING PRIMITIVE: editorial-left / dark-frame-right */
  .stage {
    display: grid;
    grid-template-columns: minmax(360px, 5fr) 7fr;
    gap: 72px;
    align-items: center;
  }

  /* ===== DARK ROOM: warm-dark "sheet" that rises over the cream page =====
     Shared by Proof + Trevi so each dark section reads as stepping into a
     different surface. Same palette, smooth 4-stop gradient + grain texture. */
  .dark-room {
    position: relative;
    z-index: 1;
    margin-top: -34px;                 /* slide up over the previous light band */
    border-top-left-radius: 38px;
    border-top-right-radius: 38px;
    box-shadow: 0 -30px 70px -34px rgba(0,0,0,0.45);
    overflow: hidden;
    /* two faint glows for depth + a smooth 4-colour warm-dark gradient */
    background:
      radial-gradient(118% 78% at 80% 6%, rgba(91,147,184,0.12), transparent 56%),
      radial-gradient(112% 86% at 10% 102%, rgba(201,162,75,0.09), transparent 56%),
      linear-gradient(158deg, #15120B 0%, #221A11 34%, #1A150D 67%, #110F09 100%);
  }
  /* (the old .room-fade bottom gradient was removed — both dark rooms (Proof, Trevi)
     now finish with rounded bottom corners on the cream instead of a soft melt) */
  /* fine grain — the "texture feel", scoped to the dark sheet */
  .dark-room::after {
    content: "";
    position: absolute; inset: 0;
    z-index: 0; pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='dn'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23dn)'/></svg>");
  }
  /* scene entrance: the whole room enters at ~76% and GROWS to full-bleed as you
     scroll in — a deliberate "step into a new room" reveal. --enter (0..1) is
     written by each section's scroll effect; defaults to 1 so the room is NEVER
     stuck shrunk/hidden if JS doesn't run. */
  .dark-room {
    transform: scale(calc(0.76 + 0.24 * var(--enter, 1)));
    transform-origin: top center;
    opacity: calc(0.4 + 0.6 * var(--enter, 1));
    will-change: transform, opacity;
  }
  .dark-room > .container { position: relative; z-index: 1; }
  body.no-motion .dark-room { transform: none; opacity: 1; }
  @media (max-width: 900px) {
    .dark-room { margin-top: 0; border-top-left-radius: 26px; border-top-right-radius: 26px; transform: none; opacity: 1; }
  }

  /* ===== GRID FIELD: faint lattice + a few glowing lines that travel across it.
     Used behind the hero + the vision band. Lines fade out under no-motion. ===== */
  .gridfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .gridfield::before {
    content: ""; position: absolute; inset: -2px;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(132% 120% at 50% 36%, #000 28%, transparent 80%);
            mask-image: radial-gradient(132% 120% at 50% 36%, #000 28%, transparent 80%);
    opacity: 0.55;
  }
  /* a few grid lines come alive: a glowing segment RUNS ALONG the line
     (horizontals left→right, verticals bottom→up). Sits on a 60px grid coord. */
  .gridfield i { position: absolute; display: block; opacity: 0; }
  .gridfield .gl-h { top: var(--y, 178px); width: 220px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent); filter: drop-shadow(0 0 9px var(--accent)); }
  .gridfield .gl-v { left: var(--x, 358px); width: 2px; height: 220px; background: linear-gradient(180deg, transparent, var(--accent) 50%, transparent); filter: drop-shadow(0 0 9px var(--accent)); }
  .gridfield .gl-h1 { --y: 178px; animation: runH 8s linear infinite; }
  .gridfield .gl-h2 { --y: 418px; animation: runH 10.5s linear infinite 3.2s; }
  .gridfield .gl-v1 { --x: 358px; animation: runV 11s linear infinite 1.6s; }
  .gridfield .gl-v2 { --x: 718px; animation: runV 13.5s linear infinite 5.4s; }
  @keyframes runH { 0% { left: -220px; opacity: 0; } 10% { opacity: 0.95; } 90% { opacity: 0.95; } 100% { left: 100%; opacity: 0; } }
  @keyframes runV { 0% { top: 100%; opacity: 0; } 10% { opacity: 0.9; } 90% { opacity: 0.9; } 100% { top: -220px; opacity: 0; } }
  body.no-motion .gridfield i { animation: none; opacity: 0; }

  /* nav */
  .nav {
    position: fixed;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 100%;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: color-mix(in oklab, var(--paper) 80%, transparent);
    border: 1px solid transparent;
    border-radius: 0;
    transition: top 0.42s cubic-bezier(0.2,0.7,0.2,1), width 0.42s cubic-bezier(0.2,0.7,0.2,1),
                border-radius 0.42s cubic-bezier(0.2,0.7,0.2,1), border-color 0.35s, box-shadow 0.42s, background 0.35s;
  }
  /* on scroll the bar detaches from the top edge and shrinks into a floating rounded pill */
  .nav.scrolled {
    top: 12px;
    width: min(1120px, calc(100% - 28px));
    border-color: var(--line);
    border-radius: 999px;
    box-shadow: 0 16px 42px -18px rgba(0,0,0,0.28);
    background: color-mix(in oklab, var(--paper) 88%, transparent);
  }
  .nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); transition: height 0.42s cubic-bezier(0.2,0.7,0.2,1), padding 0.42s cubic-bezier(0.2,0.7,0.2,1); }
  .nav.scrolled .nav-inner { height: 58px; padding-left: 26px; padding-right: 18px; }
  .logo { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 500; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); }
  .logo-mark {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--ink);
    position: relative;
    overflow: hidden;
  }
  .logo-mark::after {
    content: "";
    position: absolute; inset: 3px;
    border-radius: 3px;
    background: var(--paper);
  }
  .logo-mark::before {
    content: "";
    position: absolute; inset: 7px;
    border-radius: 2px;
    background: var(--ink);
    z-index: 1;
  }
  .nav-links { display: flex; gap: 30px; }
  .nav-links a { font-size: 13px; color: var(--ink-3); transition: color 0.25s; display: inline-flex; align-items: center; position: relative; padding: 4px 1px; }
  .nav-links a .nav-dot { display: none; }
  .nav-links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
    height: 1.5px; border-radius: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left center;
    transition: transform 0.32s cubic-bezier(0.2,0.7,0.2,1);
  }
  .nav-links a:hover { color: var(--ink); }
  .nav-links a:hover::after { transform: scaleX(1); }
  .nav-links a.active { color: var(--ink); }
  .nav-links a.active::after { transform: scaleX(1); }
  @media (max-width: 860px) { .nav-links { display: none; } }

  /* footer — lifted rounded slab rising over the recessed CTA below it */
  footer {
    position: relative;
    z-index: 1;
    margin-top: -42px;
    padding: 78px 0 48px;
    background: var(--paper-2);
    border-top-left-radius: 38px;
    border-top-right-radius: 38px;
    /* cream-on-cream: a crisp dark hairline traces the rounded top (follows the curve at the
       corners), a tight cast shadow lifts the slab, and an inset light lip bevels the edge */
    box-shadow:
      0 -1px 0 rgba(28,27,23,0.14),
      0 -12px 26px -10px rgba(28,27,23,0.16),
      inset 0 1.5px 0 rgba(255,255,255,0.6);
  }
  @media (max-width: 900px) {
    footer { border-top-left-radius: 26px; border-top-right-radius: 26px; }
  }
  .footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--ink-3); }
  .footer-links { display: flex; gap: 24px; }
  .footer-links a:hover { color: var(--ink); }

  @keyframes pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
  }
  @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

  /* ---------- motion off (reduced-motion / mobile / toggle) ---------- */
  body.no-motion .reveal { opacity: 1; transform: none; transition: none; }
  body.no-motion .pulse-dot { animation: none !important; }

  /* ---------- preloader (cream) ---------- */
  body.preloading { overflow: hidden; }

  .preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
  }
  .preloader-panel {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--paper);
    transition: transform 0.7s cubic-bezier(0.86, 0, 0.07, 1);
    will-change: transform;
  }
  .preloader-top { top: 0; }
  .preloader-bot { bottom: 0; }

  .preloader-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ink);
    border: 0 solid var(--ink);
    border-radius: 1px;
    box-sizing: border-box;
    transform: translate(-50%, -50%) rotate(0deg);
    z-index: 2;
    opacity: 0;
    animation: preloader-mark 2.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    will-change: width, height, transform, border-width, border-radius, background;
  }

  .preloader-word {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 64px));
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
    z-index: 2;
    opacity: 0;
    animation: preloader-word 2.6s ease forwards;
  }
  .preloader-word em {
    font-family: var(--serif);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    font-size: 18px;
    margin-left: 4px;
  }

  @keyframes preloader-mark {
    0%   { width: 0;     height: 2px;  border-width: 0; border-radius: 1px;  background: var(--ink); transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
    6%   { opacity: 1; }
    16%  { width: 120px; height: 2px;  border-width: 0; border-radius: 1px;  background: var(--ink); transform: translate(-50%, -50%) rotate(0deg); }
    28%  { width: 56px;  height: 56px; border-width: 2px; border-radius: 12px; background: transparent; transform: translate(-50%, -50%) rotate(0deg); }
    52%  { width: 56px;  height: 56px; border-width: 2px; border-radius: 12px; background: transparent; transform: translate(-50%, -50%) rotate(360deg); }
    78%  { width: 56px;  height: 56px; border-width: 2px; border-radius: 12px; background: transparent; transform: translate(-50%, -50%) rotate(360deg); opacity: 1; }
    90%  { width: 100vw; height: 2px;  border-width: 0; border-radius: 0;    background: var(--ink); transform: translate(-50%, -50%) rotate(360deg); opacity: 1; }
    100% { width: 100vw; height: 2px;  border-width: 0; border-radius: 0;    background: var(--ink); transform: translate(-50%, -50%) rotate(360deg); opacity: 0; }
  }

  @keyframes preloader-word {
    0%, 52%   { opacity: 0; transform: translate(-50%, calc(-50% + 72px)); }
    62%       { opacity: 1; transform: translate(-50%, calc(-50% + 64px)); }
    76%       { opacity: 1; transform: translate(-50%, calc(-50% + 64px)); }
    84%, 100% { opacity: 0; transform: translate(-50%, calc(-50% + 60px)); }
  }

  .preloader.split .preloader-top { transform: translateY(-100%); }
  .preloader.split .preloader-bot { transform: translateY(100%); }
  .preloader.done { display: none; }

  @media (prefers-reduced-motion: reduce) {
    .preloader { display: none; }
  }

  /* ---------- responsive (AFTER base rules) ---------- */
  @media (max-width: 1024px) {
    .stage { grid-template-columns: 1fr; gap: 40px; }
  }
  @media (max-width: 900px) {
    section { padding: 96px 0; }
  }
