/* ==========================================================================
   cedra.css - shared stylesheet for the Cedra draft site (v1, 2026-10-05)
   Based on proposal/cedra.css (v0). Changes in v1:
   - light theme only (dark tokens and theme toggle removed);
   - no hero gradient, no "Mac window" chrome: code and previews use .figure;
   - pills (.status) only for statuses: In development / Planned / Built in;
     section eyebrows use .label (no background);
   - new section patterns from research/site-review/ui-designer.md:
     spec rows (.rows + .split-grid), stat strip (.stats), spend ledger (.ledger);
   - two-step early access form, privacy page prose, mobile fixes (44px targets,
     no horizontal scroll at 390px, code scroll hint).
   Layers: reset < tokens < base < layout < components < utilities.
   Unlayered page styles win over all layers.
   ========================================================================== */

/* Self-hosted fonts (fonts/README.md, SIL OFL 1.1). Variable woff2, latin + latin-ext. */
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('fonts/newsreader-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('fonts/newsreader-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: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/geist-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: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('fonts/geist-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('fonts/geist-mono-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; }

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

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
@layer tokens {
  :root {
    --bg: #FBFBFA;
    --surface: #FFFFFF;
    --sunk: #F7F6F3;

    --text: #2F3437;
    --strong: #111111;
    --muted: #6B6A66;

    --line: #EAEAEA;
    --line-strong: #C9C8C3;

    --btn: #111111;
    --btn-text: #FFFFFF;
    --btn-hover: #333333;

    /* Semantic pairs. Color = meaning, never decoration:
       blue = in development (logo dot color), yellow = planned,
       green = built in / works today, red = stop or error only. */
    --blue-bg: #E1F3FE;   --blue: #1F6C9F;
    --green-bg: #EDF3EC;  --green: #346538;
    --yellow-bg: #FBF3DB; --yellow: #956400;
    --red-bg: #FDEBEC;    --red: #9F2F2D;

    --accent: var(--blue);
    --focus: var(--blue);

    --sans: 'Geist', 'Helvetica Neue', sans-serif;
    --serif: 'Newsreader', Georgia, serif;
    --mono: 'Geist Mono', 'SF Mono', monospace;

    --fs-xs: 12px;
    --fs-sm: 14px;
    --fs-ui: 15px;
    --fs-body: 17px;
    --fs-md: 18px;
    --fs-lead: clamp(18px, 2vw, 21px);
    --fs-d3: 30px;
    --fs-h2: clamp(32px, 4.5vw, 48px);
    --fs-num: clamp(44px, 5vw, 56px);
    --fs-h1: clamp(40px, 6.4vw, 72px);
    --lh-body: 1.6;
    --lh-tight: 1.08;
    --tracking-display: -0.025em;

    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --space-12: 48px; --space-14: 56px; --space-16: 64px; --space-24: 96px;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-pill: 999px;

    --ease: .2s;
    --tap: 44px;

    --container: 1080px;
    --container-text: 68ch;
    --gutter: 20px;
    --nav-h: 60px;
    --section-y: var(--space-24);

    color-scheme: light;
  }
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; }
  img, svg { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
@layer base {
  html { background: var(--bg); }
  body { background: var(--bg); color: var(--text); font: 400 var(--fs-body)/var(--lh-body) var(--sans); overflow-x: clip; }
  a { color: inherit; }

  h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--strong);
           letter-spacing: var(--tracking-display); line-height: var(--lh-tight); }
  h1 { font-size: var(--fs-h1); }
  h2 { font-size: var(--fs-h2); }
  h3 { font: 600 var(--fs-md)/1.3 var(--sans); color: var(--strong); letter-spacing: -0.01em; }
  h1, h2, h3 { text-wrap: balance; }
  p, li { text-wrap: pretty; }

  section { padding: var(--section-y) 0; border-top: 1px solid var(--line); }
  [id] { scroll-margin-top: 80px; }

  pre { margin: 0; overflow-x: auto; font: 14px/1.75 var(--mono); color: var(--text); }
  code { font-family: var(--mono); }

  table { font-variant-numeric: tabular-nums; }

  :where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  @media (max-width: 820px) {
    section { padding: 72px 0; }
    pre { font-size: 13px; }
  }
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
@layer layout {
  .wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
  .narrow { max-width: var(--container-text); }

  /* Bento: at most one per page */
  .bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); }
  .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }

  .stack, .paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }

  /* Split: narrow head left (sticky on desktop), content right */
  .split-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-12); align-items: start; }
  .split-head { position: sticky; top: 96px; margin-bottom: 0; }

  .form-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-12); align-items: start; }
  .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

  @media (max-width: 820px) {
    .bento, .stack, .paths { grid-template-columns: minmax(0, 1fr); }
    .span-2, .span-3, .span-4 { grid-column: auto; }
    .split-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
    .split-head { position: static; }
    .form-wrap, .row2 { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  }
}

/* --------------------------------------------------------------------------
   5. Components
   -------------------------------------------------------------------------- */
@layer components {

  /* --- Skip link --- */
  .skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 30; background: var(--btn); color: var(--btn-text);
               padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); text-decoration: none; }
  .skip-link:focus { top: var(--space-3); }

  /* --- Site header --- */
  .site-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; backdrop-filter: blur(10px);
              -webkit-backdrop-filter: blur(10px);
              background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); }
  .site-nav > .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: var(--space-4); }
  .logo { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--strong); text-decoration: none; }
  .logo svg { display: block; height: 24px; width: auto; }
  .nav-links { display: flex; gap: var(--space-6); align-items: center; font-size: var(--fs-ui); }
  .nav-links a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; color: var(--muted); }
  .nav-links a:not(.btn):hover,
  .nav-links a[aria-current="page"] { color: var(--strong); }

  .menu-toggle { display: none; align-items: center; min-height: var(--tap); background: none; border: 1px solid var(--line-strong);
                 border-radius: var(--radius-sm); padding: 0 var(--space-4); font: 500 var(--fs-ui) var(--sans);
                 color: var(--strong); cursor: pointer; }
  .mobile-menu { border-top: 1px solid var(--line); background: var(--bg); }
  .mobile-menu .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: var(--space-2); padding-bottom: var(--space-5); }
  .mobile-menu a { display: flex; align-items: center; min-height: 48px; font-size: var(--fs-body); color: var(--strong);
                   text-decoration: none; border-bottom: 1px solid var(--line); }
  .mobile-menu a[aria-current="page"] { font-weight: 500; }
  .mobile-menu a.btn { margin-top: var(--space-4); border-bottom: 0; justify-content: center; color: var(--btn-text); }
  @media (max-width: 820px) {
    .nav-links a:not(.btn), .nav-links .btn { display: none; }
    .menu-toggle { display: inline-flex; }
  }
  @media (min-width: 821px) { .mobile-menu { display: none !important; } }

  /* --- Buttons --- */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--tap);
         white-space: nowrap; text-decoration: none; font: 500 var(--fs-ui) var(--sans); padding: 0 18px;
         border-radius: var(--radius-sm); transition: background var(--ease), border-color var(--ease), transform .1s; }
  .btn-primary { background: var(--btn); color: var(--btn-text); }
  .btn-primary:hover { background: var(--btn-hover); }
  .btn-ghost { border: 1px solid var(--line-strong); color: var(--strong); background: var(--surface); }
  .btn-ghost:hover { border-color: var(--muted); }
  .btn:active { transform: scale(0.98); }
  button.btn { border: 0; cursor: pointer; }
  button.btn-ghost { border: 1px solid var(--line-strong); }
  button.btn:disabled { opacity: .55; cursor: progress; }
  .btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
  .cta-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-8); }
  @media (max-width: 480px) { .cta-row .btn { flex: 1 1 100%; } }

  /* --- Label (eyebrow without background) and status pills --- */
  .label { display: block; font: 500 var(--fs-xs)/1 var(--mono); color: var(--muted); letter-spacing: .06em;
           text-transform: uppercase; margin-bottom: var(--space-4); }
  .status { display: inline-block; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
            padding: 5px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
  .status.build   { background: var(--blue-bg);   color: var(--blue); }   /* In development */
  .status.planned { background: var(--yellow-bg); color: var(--yellow); } /* Planned */
  .status.live    { background: var(--green-bg);  color: var(--green); }  /* Built in */

  /* --- Hero --- */
  .lead { font-size: var(--fs-lead); color: var(--muted); }
  .hero { padding: 88px 0 var(--space-24); border-top: 0; }
  .hero h1 { max-width: 20ch; margin: var(--space-5) 0 var(--space-6); }
  .hero .lead { max-width: 56ch; }
  .hero .figure { margin-top: var(--space-12); }
  @media (max-width: 820px) { .hero { padding: 48px 0 64px; } .hero .figure { margin-top: 40px; } }

  /* --- Section head --- */
  .section-head { margin-bottom: var(--space-12); }
  .section-head p { margin-top: var(--space-4); }
  .split-head p { margin-top: var(--space-4); }
  .split-head .more { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: var(--space-3);
                      font: 500 var(--fs-sm) var(--mono); color: var(--strong); }

  /* --- Figure: plain bordered box for code and previews, caption below --- */
  .figure { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
  .figure-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
                 padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line);
                 font: 500 var(--fs-xs) var(--mono); color: var(--muted); }
  .figure-body { padding: var(--space-5) var(--space-6); min-width: 0; }
  .figure figcaption { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--sunk);
                       border-radius: 0 0 var(--radius-md) var(--radius-md); font-size: var(--fs-sm); color: var(--muted); }
  .code-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .code-scroll pre { padding: var(--space-5) var(--space-6); width: max-content; min-width: 100%; }
  .scroll-hint { display: none; }
  @media (max-width: 600px) {
    .figure-body { padding: var(--space-4); }
    .code-scroll pre { padding: var(--space-4); }
    /* visual hint that the code continues to the right */
    .code-scroll { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
                   mask-image: linear-gradient(90deg, #000 85%, transparent); }
    .code-scroll.at-end { -webkit-mask-image: none; mask-image: none; }
    .scroll-hint { display: block; padding: var(--space-2) var(--space-4) 0; font: var(--fs-xs) var(--mono); color: var(--muted); }
  }
  .c, .tok-comment { color: var(--muted); }
  .k, .tok-key     { color: var(--blue); }
  .s, .tok-str     { color: var(--green); }
  .h, .tok-mark    { background: var(--yellow-bg); color: var(--yellow); border-radius: 3px; padding: 1px 3px; }

  /* --- Usage table (index hero) --- */
  .usage { width: 100%; border-collapse: collapse; font: var(--fs-sm)/1.5 var(--mono); font-variant-numeric: tabular-nums; }
  .usage th { text-align: left; font-weight: 500; color: var(--muted); padding: 0 var(--space-4) 10px 0;
              border-bottom: 1px solid var(--line); white-space: nowrap; }
  .usage td { padding: 10px var(--space-4) 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text); }
  .usage th:last-child, .usage td:last-child { padding-right: 0; }
  .usage tr:last-child td { border-bottom: 0; }
  .usage .num { text-align: right; }
  .state { display: inline-block; font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .05em;
           padding: 2px var(--space-2); border-radius: var(--radius-pill); white-space: nowrap; }
  .state.ok   { background: var(--green-bg);  color: var(--green); }
  .state.warn { background: var(--yellow-bg); color: var(--yellow); }
  .state.stop { background: var(--red-bg);    color: var(--red); }
  .route { margin-top: var(--space-4); font: var(--fs-sm)/1.7 var(--mono); color: var(--muted); }
  .route b { color: var(--strong); font-weight: 500; white-space: nowrap; }
  @media (max-width: 600px) {
    /* keep Agent / Spent / Status, hide Key and Limit */
    .usage .col-key, .usage .col-limit { display: none; }
    .usage td, .usage th { padding-right: var(--space-2); }
  }

  /* --- Ledger (agents hero): spend per agent + fallback log --- */
  .ledger { list-style: none; font: var(--fs-sm)/1.5 var(--mono); font-variant-numeric: tabular-nums; }
  .ledger li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; align-items: center;
               gap: var(--space-2) var(--space-5); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
  .ledger li.ledger-head { padding-top: 0; color: var(--muted); font-weight: 500; }
  .ledger .agent { color: var(--strong); overflow-wrap: anywhere; }
  .ledger .amt { display: grid; gap: 6px; color: var(--text); }
  .meter { display: block; height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
  .meter i { display: block; height: 100%; background: var(--strong); }
  .meter.warn i { background: var(--yellow); }
  .meter.stop i { background: var(--red); }
  .ledger .state { justify-self: end; }
  .log { list-style: none; margin-top: var(--space-5); font: var(--fs-sm)/1.6 var(--mono); color: var(--muted); }
  .log li { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: var(--space-3); padding: 6px 0; }
  .log time { color: var(--muted); }
  .log span { overflow-wrap: anywhere; }
  .log b { color: var(--strong); font-weight: 500; }
  .log .bad { color: var(--red); }
  .log .good { color: var(--green); }
  @media (max-width: 600px) {
    .ledger li { grid-template-columns: minmax(0, 1fr) auto; }
    .ledger li.ledger-head { display: none; }
    .ledger .amt { grid-column: 1 / -1; grid-row: 2; }
    .log li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  }

  /* --- Spec rows --- */
  .rows { list-style: none; counter-reset: r; }
  .rows > li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: var(--space-5); row-gap: var(--space-2);
               padding: var(--space-6) 0; border-top: 1px solid var(--line); }
  .rows > li:last-child { border-bottom: 1px solid var(--line); }
  .rows > li::before { counter-increment: r; content: counter(r, decimal-leading-zero);
                       font: 400 var(--fs-sm)/2.1 var(--mono); color: var(--muted); grid-row: span 2; }
  .rows h3 { font: 400 var(--fs-d3)/1.15 var(--serif); letter-spacing: -0.02em; }
  .rows p { grid-column: 2; color: var(--muted); max-width: 56ch; }
  .rows .status { grid-column: 3; grid-row: 1; align-self: start; margin-top: 6px; }
  @media (max-width: 820px) {
    .rows > li { grid-template-columns: 32px minmax(0, 1fr); }
    .rows .status { grid-column: 2; grid-row: auto; justify-self: start; margin-top: var(--space-1); }
    .rows h3 { font-size: 24px; }
  }

  /* --- Stat strip --- */
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--strong); border-bottom: 1px solid var(--line); }
  .stats > div { padding: var(--space-8) var(--space-5) var(--space-8) 0; min-width: 0; }
  .stats > div + div { padding-left: var(--space-5); border-left: 1px solid var(--line); }
  .stats dt { font: 500 var(--fs-xs)/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .stats dd { margin-top: var(--space-4); font: 400 var(--fs-num)/1 var(--serif); letter-spacing: -0.03em; color: var(--strong);
              font-variant-numeric: tabular-nums lining-nums; }
  .stats dd span { font: 400 var(--fs-sm) var(--mono); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
  .stats dd.word { font-size: clamp(30px, 3.4vw, 40px); }
  .stats-note { margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--muted); }
  @media (max-width: 820px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .stats > div, .stats > div + div { padding: var(--space-5) 0; border-left: 0; }
    .stats > div + div { border-top: 1px solid var(--line); }
  }

  /* --- Card --- */
  .card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-8); }
  .card p { margin-top: 10px; color: var(--muted); font-size: 16px; }
  .card .num { font: 400 var(--fs-num)/1 var(--serif); color: var(--strong); letter-spacing: -0.03em; margin-bottom: var(--space-4);
               font-variant-numeric: tabular-nums lining-nums; }
  .card .status { margin-bottom: var(--space-4); }
  a.card { transition: border-color var(--ease), box-shadow var(--ease); }
  a.card:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
  a.card:focus-visible { outline-offset: 4px; border-radius: var(--radius-md); }
  @media (max-width: 820px) { .card { padding: var(--space-6); } }

  /* Paths band */
  .band { background: var(--sunk); }
  .path { display: flex; flex-direction: column; text-decoration: none; padding: var(--space-10); }
  .path h3 { font: 400 var(--fs-d3)/1.15 var(--serif); letter-spacing: -0.02em; margin-bottom: 10px; }
  .path .go { margin-top: auto; padding-top: var(--space-5); font: 500 14px var(--mono); color: var(--strong); }
  .path:hover .go { text-decoration: underline; }
  @media (max-width: 820px) { .path { padding: var(--space-6); } }

  /* --- Stack (before / after) --- */
  .stack .card h3 { margin-bottom: var(--space-4); }
  .stack ul { list-style: none; }
  .stack li { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0;
              border-bottom: 1px solid var(--line); font-size: var(--fs-ui); }
  .stack li:last-child { border-bottom: 0; }
  .stack li span:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }
  .stack li span.yes { color: var(--strong); }
  .stack .after { background: var(--sunk); }
  @media (max-width: 600px) {
    .stack li { flex-direction: column; gap: 2px; }
    .stack li span:last-child { text-align: left; }
  }

  /* --- FAQ (aside layout via .split-grid) --- */
  details { border-bottom: 1px solid var(--line); }
  details:first-child { border-top: 1px solid var(--line); }
  summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-6);
            min-height: var(--tap); padding: var(--space-5) 0; font: 500 var(--fs-md)/1.4 var(--sans); color: var(--strong); }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; font: 400 22px var(--mono); color: var(--muted); }
  details[open] summary::after { content: "-"; }
  details p { padding: 0 0 var(--space-6); color: var(--muted); max-width: 64ch; }

  /* --- Early access form --- */
  .early-sec { background: var(--sunk); }
  .perks { list-style: none; display: grid; gap: var(--space-3); margin-top: var(--space-6); }
  .perks li { padding-left: 22px; position: relative; color: var(--text); }
  .perks li::before { content: "+"; position: absolute; left: 0; font-family: var(--mono); color: var(--accent); }
  .perks-note { margin-top: var(--space-5); font-size: var(--fs-sm); color: var(--muted); max-width: 46ch; }
  form.early { display: grid; gap: var(--space-5); }
  .step-label { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .field { display: grid; gap: 6px; min-width: 0; }
  fieldset.field { border: 0; padding: 0; margin: 0; }
  .field label, .field legend { font: 500 var(--fs-ui) var(--sans); color: var(--strong); }
  .field legend { margin-bottom: 6px; }
  .field .hint { font-size: var(--fs-sm); color: var(--muted); }
  .field input[type=text], .field input[type=email], .field textarea {
    width: 100%; min-height: var(--tap); font: 400 16px var(--sans); color: var(--strong); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px var(--space-3); }
  .field textarea { min-height: 76px; resize: vertical; }
  .field [aria-invalid="true"] { border-color: var(--red); }
  .choices { display: grid; gap: 0; }
  .choice { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--tap); padding: 10px 0;
            font-size: var(--fs-ui); line-height: 1.45; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--line); }
  .choice:last-child { border-bottom: 0; }
  .choice input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--strong); }
  .form-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
  .consent { font-size: var(--fs-sm); color: var(--muted); }
  .consent a { color: var(--strong); }
  .form-status { font-size: var(--fs-ui); padding: var(--space-3) 14px; border-radius: var(--radius-sm); }
  .form-status.ok  { background: var(--green-bg); color: var(--green); }
  .form-status.err { background: var(--red-bg);   color: var(--red); }
  .form-status.info { background: var(--blue-bg); color: var(--blue); }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  @media (max-width: 480px) { form.early .btn { width: 100%; } }

  /* --- Prose (privacy and other long text) --- */
  .prose { max-width: var(--container-text); }
  .prose > * + * { margin-top: var(--space-4); }
  .prose h2 { font-size: clamp(26px, 3vw, 32px); margin-top: var(--space-12); }
  .prose h3 { margin-top: var(--space-8); }
  .prose ul, .prose ol { padding-left: var(--space-6); }
  .prose li + li { margin-top: var(--space-2); }
  .prose code { font: 0.9em var(--mono); background: var(--sunk); border-radius: 4px; padding: 1px 4px; }
  .ph { background: var(--yellow-bg); color: var(--yellow); border-radius: 3px; padding: 0 3px; font-family: var(--mono); font-size: .9em; }

  /* --- Callout --- */
  .callout { border: 1px solid var(--line); border-left: 3px solid var(--yellow); background: var(--surface);
             border-radius: var(--radius-sm); padding: 14px var(--space-4); font-size: var(--fs-ui); }

  /* --- Projects on Cedra (projects.html, built by build-projects.py) --- */
  .proj-sec { padding-top: 0; }
  .proj-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-8); }
  .proj-filter input { position: absolute; opacity: 0; pointer-events: none; }
  .proj-filter label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; cursor: pointer;
                       border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
                       font: 500 var(--fs-sm) var(--sans); color: var(--text); transition: border-color var(--ease), background var(--ease); }
  .proj-filter label span { font: 500 var(--fs-xs) var(--mono); color: var(--muted); }
  .proj-filter label:hover { border-color: var(--line-strong); }
  .proj-filter input:checked + label { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
  .proj-filter input:checked + label span { color: rgba(255,255,255,.7); }
  .proj-filter input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
  .proj-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
  .proj-card { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; padding: var(--space-6);
               background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
  .proj-head { display: flex; gap: var(--space-3); align-items: center; }
  .proj-logo { width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: contain; background: var(--sunk); border: 1px solid var(--line); }
  .proj-mono { display: inline-grid; place-items: center; font: 500 13px var(--mono); color: var(--strong); }
  .proj-card h2 { font: 600 var(--fs-md)/1.25 var(--sans); letter-spacing: -0.01em; margin: 0; }
  .proj-card h2 a { color: var(--strong); text-decoration: none; } .proj-card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .proj-cat { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .proj-desc { font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .proj-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--space-4); font: 500 var(--fs-xs) var(--mono); }
  .proj-links a { color: var(--text); min-height: 32px; display: inline-flex; align-items: center; } .proj-links a:hover { color: var(--strong); }
  .proj-note { margin-top: var(--space-10); font-size: var(--fs-sm); color: var(--muted); max-width: var(--container-text); }
  .proj-note a { color: var(--text); }
  /* Home strip */
  .built-on { padding-top: 0; }
  .built-on-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); margin-bottom: var(--space-5);
                   padding-top: var(--space-8); border-top: 1px solid var(--line); }
  .built-on-head h2.label { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
  .built-on-head .go { font: 500 var(--fs-sm) var(--sans); color: var(--strong); }
  .built-on-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
  .built-on-list a { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-3);
                     border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none;
                     color: var(--strong); font: 500 var(--fs-sm) var(--sans); transition: border-color var(--ease); }
  .built-on-list a:hover { border-color: var(--line-strong); }
  .built-logo { width: 28px; height: 28px; flex: none; border-radius: 6px; object-fit: contain; }
  .built-logo.proj-mono { background: var(--sunk); font-size: 11px; }
  @media (max-width: 820px) { .built-on-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .proj-grid { grid-template-columns: 1fr; } }

  /* --- Blog (built by build-blog.py) --- */
  .crumbs { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; gap: var(--space-2); }
  .crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--strong); }
  .blog-post.hero-doc h1 { margin-top: var(--space-5); }
  .post-meta { font: var(--fs-xs)/1.5 var(--mono); color: var(--muted); }
  .blog-post .post-meta { margin-top: var(--space-5); font-size: var(--fs-sm); }
  .post-body { margin-top: var(--space-10); }
  .post-body > * + * { margin-top: var(--space-4); }
  .post-body h2 { font-size: clamp(26px, 3vw, 32px); margin-top: var(--space-12); }
  .post-body h3 { margin-top: var(--space-8); }
  .post-body ul, .post-body ol { padding-left: var(--space-6); }
  .post-body li + li { margin-top: var(--space-2); }
  .post-body img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--line); margin: var(--space-8) 0; }
  .post-body a { color: var(--strong); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
  .post-body blockquote { border-left: 3px solid var(--line-strong); padding-left: var(--space-4); color: var(--muted); }
  .post-back { margin-top: var(--space-12); font-size: var(--fs-sm); } .post-back a { color: var(--strong); }
  .post-list { list-style: none; border-top: 1px solid var(--line); }
  .post-item { border-bottom: 1px solid var(--line); }
  .post-item > a { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-6); align-items: start; padding: var(--space-6) 0; text-decoration: none; }
  .post-item h2 { font: 500 var(--fs-md)/1.35 var(--sans); color: var(--strong); letter-spacing: -0.01em; margin: var(--space-2) 0 0; }
  .post-item > a:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
  .post-desc { margin-top: var(--space-2); font-size: var(--fs-ui); color: var(--muted); max-width: var(--container-text);
               display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .post-thumb { width: 200px; height: 125px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--sunk); }
  .post-item > a > div:only-child { grid-column: 1 / -1; }
  @media (max-width: 820px) { .post-item > a { grid-template-columns: 1fr; gap: var(--space-3); } .post-thumb { width: 100%; height: auto; aspect-ratio: 16 / 10; } }

  /* --- Consent bar (analytics.js): compact, bottom, Accept and Decline equal weight --- */
  .consent-bar { position: fixed; z-index: 20; left: var(--space-4); bottom: var(--space-4); max-width: 440px;
                 background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
                 box-shadow: 0 2px 8px rgba(0,0,0,.04); padding: var(--space-4) var(--space-5);
                 display: grid; gap: var(--space-3); font-size: var(--fs-sm); color: var(--text);
                 transition: transform var(--ease), opacity var(--ease); }
  .consent-bar[hidden] { display: none; }
  .consent-text a { color: var(--strong); }
  .consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .consent-actions .btn { min-height: var(--tap); padding: 0 var(--space-3); }
  .consent-bar.consent-away { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
  @media (max-width: 820px) {
    .consent-bar { left: var(--space-3); right: var(--space-3); bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
                   max-width: none; padding: var(--space-3) var(--space-4); }
    body.has-consent-bar { padding-bottom: 150px; }
  }
  @media (prefers-reduced-motion: reduce) { .consent-bar { transition: none; } }
  .link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer;
              display: inline-flex; align-items: center; min-height: var(--tap); }
  .link-btn:hover { color: var(--strong); text-decoration: underline; }

  /* --- Footer --- */
  .site-foot { border-top: 1px solid var(--line); padding: var(--space-8) 0; font-size: var(--fs-sm); color: var(--muted); }
  .site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
  .foot-logo { display: inline-flex; align-items: center; min-height: var(--tap); }
  .foot-logo svg { display: block; height: 18px; width: auto; }
  .foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
  .foot-links a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; color: var(--text); }
  .foot-links a:hover { color: var(--strong); text-decoration: underline; }

  .foot-social { list-style: none; display: flex; gap: var(--space-1); margin: var(--space-3) 0 0 -12px; } /* -12px: optical align of 20px icons in 44px tap areas */
  .foot-social a { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--radius-sm);
                   color: var(--muted); transition: color var(--ease), background var(--ease); }
  .foot-social a:hover { color: var(--strong); background: var(--sunk); }
  .foot-social svg { display: block; }

  /* Spacing between combined patterns */
  .stats-note + .rows { margin-top: var(--space-12); }
  .faq { min-width: 0; }

  /* Document pages (privacy) */
  .hero-doc { padding-top: 56px; }
  .hero-doc h1 { font-size: clamp(36px, 5vw, 56px); margin: 0; max-width: none; }
  .hero-doc .callout { margin-bottom: var(--space-8); }
}


/* --------------------------------------------------------------------------
   6. Utilities
   -------------------------------------------------------------------------- */
@layer utilities {
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [hidden] { display: none !important; }
}
