/* Commonhouse webfonts.
   Erode (display, Fontshare) · Atkinson Hyperlegible (UI + body — low-vision
   legibility is part of the trust story) · Martian Mono (annotations). */
@import url("https://api.fontshare.com/v2/css?f[]=erode@400,500,600,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Martian+Mono:wght@300;400;500&display=swap");

/* ---- Commonhouse color system ----
   Two surfaces, one house:
   NIGHT — the original 1c "Nightshift" blues. Where we sell. Default scope.
   DAY   — plaster daylight. Where we explain (case studies, audit, legal).
   Scope day pages with <body data-surface="day"> (or any wrapper).
   Rules: no dusk gradients (they drift purple). Amber belongs to light
   sources + the CTA only. Text never glows. */

:root {
  /* Base — night palette (1c) */
  --night-sky:        #0A1420; /* page ground */
  --night-deep:       #060D17; /* footers, far distance */
  --night-raised:     #0E1A2B; /* raised panels */
  --night-scene:      #0B1524; /* room-card scene strip */
  --night-well:       #081020; /* deepest wells (house cross-section) */
  --night-plaster:    #F4EDE0; /* warm-white text / line work */
  --night-mist:       #B9C5D9; /* ledes on dark scenes */
  --night-bluegrey:   #93A3BE; /* secondary text */
  --night-steel:      #7183A0; /* tertiary text, annotations */
  --night-faint:      #51617D; /* faintest wayfinding */
  --night-slate:      #5E6C82; /* furniture, quiet detail */
  --night-hairline:   #1E2F49; /* 1px structure */
  --night-frame:      #3A4C6B; /* stronger frames */
  --night-amber:      #F0A050; /* lamp / action — light sources + CTA only */
  --night-lamp:       #FFD9A0; /* hover warmth, lit windows */
  --night-star:       #C8D4E8; /* stars */
  --night-black:      #000000;

  /* Base — day palette */
  --day-plaster:      #F3EDE0;
  --day-paper:        #FAF5EA;
  --day-ink:          #211A10;
  --day-warmgrey:     #6F6551;
  --day-umber:        #8A7E66;
  --day-hairline:     #D9CFB9;
  --day-doororange:   #D9541E;
  --day-cream:        #FFF8EC;
  --day-hedge:        #2E6B4A; /* positive / confirmation (day only) */

  /* Semantic — night defaults */
  --surface-page:     var(--night-sky);
  --surface-sunken:   var(--night-deep);
  --surface-raised:   var(--night-raised);
  --text-primary:     var(--night-plaster);
  --text-secondary:   var(--night-bluegrey);
  --text-tertiary:    var(--night-steel);
  --text-faint:       var(--night-faint);
  --border-hairline:  var(--night-hairline);
  --border-frame:     var(--night-frame);
  --line-work:        var(--night-plaster);
  --accent:           var(--night-amber);
  --on-accent:        var(--night-sky);
  --interactive-hover:var(--night-lamp);
  --shadow-press:     var(--night-black);
  --annotation:       var(--night-steel);
  --annotation-accent:var(--night-amber);

  /* Lamplight — the only blur in the system */
  --glow-cta:         0 0 28px rgba(240, 160, 80, 0.30);
  --glow-cta-hover:   0 0 48px rgba(240, 160, 80, 0.55);
}

[data-surface="day"] {
  --surface-page:     var(--day-plaster);
  --surface-sunken:   var(--day-plaster);
  --surface-raised:   var(--day-paper);
  --text-primary:     var(--day-ink);
  --text-secondary:   var(--day-warmgrey);
  --text-tertiary:    var(--day-umber);
  --text-faint:       var(--day-umber);
  --border-hairline:  var(--day-hairline);
  --border-frame:     var(--day-ink);
  --line-work:        var(--day-ink);
  --accent:           var(--day-doororange);
  --on-accent:        var(--day-cream);
  --interactive-hover:var(--day-doororange);
  --shadow-press:     var(--day-ink);
  --annotation:       var(--day-umber);
  --annotation-accent:var(--day-doororange);
}

/* ---- Commonhouse type — one scale, both surfaces ----
   Erode 600    = the voice of the house. Display + room titles ONLY. Never paragraphs.
   Atkinson     = everything spoken plainly. UI 700, body 400 — low-vision
                  legibility as trust story.
   Martian Mono = annotations: room numbers, the night log, field labels.
                  Never body copy, never headlines — and NEVER an eyebrow kicker
                  above a heading (banned pattern). */

:root {
  --font-display: "Erode", "Iowan Old Style", serif;
  --font-display-weight: 600;
  --font-ui:      "Atkinson Hyperlegible", "Helvetica Neue", sans-serif;
  --font-mono:    "Martian Mono", "Courier New", monospace;

  /* Display — hero only */
  --type-hero-size:     clamp(72px, 7.5vw, 96px);
  --type-hero-leading:  1.02;

  /* H2 — room titles, still Erode */
  --type-h2-size:       clamp(32px, 3vw, 40px);
  --type-h2-leading:    1.15;

  /* H3 + UI — Atkinson 700 */
  --type-h3-size:       19px;   /* range 17–22 */
  --type-h3-leading:    1.3;

  /* Body — Atkinson 400 */
  --type-body-size:     16.5px; /* minimum, never smaller */
  --type-body-leading:  1.6;
  --measure-body:       66ch;   /* 60–70ch */

  /* Annotations — Martian Mono (already wide: keep tracking light) */
  --type-mono-size:     12px;   /* range 10–13 */
  --type-mono-tracking: 1px;    /* +0.5–1px — Martian is wide */

  /* Button / nav label */
  --type-label-size:    13px;
  --type-label-weight:  700;
  --type-label-tracking:1px;
}

/* ---- Commonhouse spacing & structure ----
   Everything sits on hard edges: radius 0 everywhere, 1px hairlines,
   1.5px structural frames, 2–2.5px logo line work. No rounded corners, ever
   (the only circles in the system are the doorknob and smoke dots). */

:root {
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  44px;   /* page gutter */
  --space-8:  72px;   /* section gap */
  --space-9:  88px;
  --space-10: 120px;

  --page-max:      1440px;
  --radius:        0px;
  --border-w-hair: 1px;
  --border-w-frame:1.5px;
  --border-w-mark: 2px;

  /* Hard press shadow (buttons) — offset, no blur, ever */
  --press-offset:        4px;
  --press-offset-active: 1px;
}

/* ---- Commonhouse motion — four verbs, nothing else ----
   SETTLE — parts land like placed hardware. One overshoot max.
   LIGHT  — windows/fields turn on when state is real.
   DRIFT  — chimney smoke while workflows run. One dot at a time.
   FLY    — scroll-scrubbed camera between rooms; 1200ms when teleporting.
   No idle loops anywhere on the real site (smoke = state, not decoration). */

:root {
  --ease-settle:   cubic-bezier(0.3, 0.7, 0, 1);
  --dur-settle:    500ms;
  --ease-light:    ease-out;
  --dur-light:     400ms;
  --dur-drift:     4s;
  --ease-fly:      cubic-bezier(0.16, 1, 0.3, 1); /* exponential */
  --dur-fly:       1200ms;
  --lamp-glow:     0 0 30px 6px rgba(240, 160, 80, 0.5);
}

@keyframes ch-drift {
  0%   { transform: translateY(0);      opacity: 0; }
  25%  { opacity: 0.85; }
  100% { transform: translateY(-16px);  opacity: 0; }
}

@keyframes ch-settle-in {
  0%   { transform: translateY(10px); opacity: 0; }
  70%  { transform: translateY(-2px); opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}

/* Window flicker for scenes — only while workflows actually run */
@keyframes ch-window {
  0% { opacity: 0.07; }
  10%, 90% { opacity: 1; }
  100% { opacity: 0.07; }
}

@keyframes ch-light-on {
  from { opacity: 0; box-shadow: none; }
  to   { opacity: 1; box-shadow: var(--lamp-glow); }
}

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

/* Base element defaults — both surfaces */
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--interactive-hover); }

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

/* Interactive state classes used by Commonhouse components.
   (Hover/press/focus can't be inline — these are the only class rules in the system.) */

/* Primary action. NIGHT: a lit window — flat amber, glow widens on hover
   (the only glow that isn't a window). DAY: hardware — hard press shadow. */
.ch-primary {
  box-shadow: var(--glow-cta);
  transition: box-shadow var(--dur-light) var(--ease-light);
}
.ch-primary:hover { box-shadow: var(--glow-cta-hover); }
[data-surface="day"] .ch-primary {
  box-shadow: var(--press-offset) var(--press-offset) 0 var(--shadow-press);
  transition: box-shadow var(--dur-settle) var(--ease-settle), transform var(--dur-settle) var(--ease-settle);
}
[data-surface="day"] .ch-primary:hover, [data-surface="day"] .ch-primary:active {
  box-shadow: var(--press-offset-active) var(--press-offset-active) 0 var(--shadow-press);
  transform: translate(3px, 3px);
}

/* Secondary — outline warms on hover. 1px at night, 1.5px ink by day. */
.ch-outline {
  border: 1px solid var(--line-work);
  color: var(--text-primary);
  transition: border-color var(--dur-light) var(--ease-light), color var(--dur-light) var(--ease-light);
}
[data-surface="day"] .ch-outline { border-width: 1.5px; }
.ch-outline:hover { border-color: var(--interactive-hover); color: var(--interactive-hover); }

/* Tertiary — underlined text link */
.ch-link {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-frame);
  transition: color var(--dur-light) var(--ease-light), border-color var(--dur-light) var(--ease-light);
}
.ch-link:hover { color: var(--interactive-hover); border-bottom-color: var(--interactive-hover); }

/* Nav link — wide-tracked wayfinding caps */
.ch-navlink { color: var(--text-secondary); text-decoration: none; transition: color var(--dur-light) var(--ease-light); }
.ch-navlink:hover { color: var(--interactive-hover); }
.ch-navlink[aria-current] { color: var(--text-primary); }

/* Nav CTA — outlined lamp; fills on hover */
.ch-ctacell {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: background var(--dur-light) var(--ease-light), color var(--dur-light) var(--ease-light);
}
.ch-ctacell:hover { background: var(--accent); color: var(--on-accent); }

/* Field — lights up when focused (the LIGHT verb) */
.ch-field {
  border: 1px solid var(--border-frame);
  transition: border-color var(--dur-light) var(--ease-light), box-shadow var(--dur-light) var(--ease-light);
}
[data-surface="day"] .ch-field { border-width: 1.5px; }
.ch-field:focus-within { border-color: var(--accent); box-shadow: 0 0 18px 2px rgba(240, 160, 80, 0.3); }
[data-surface="day"] .ch-field:focus-within { box-shadow: none; }
.ch-field input, .ch-field textarea, .ch-field select {
  background: transparent; border: 0; outline: 0; width: 100%;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-primary);
}
.ch-field input::placeholder, .ch-field textarea::placeholder { color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════════════
   Commonhouse shared page CSS. Import AFTER styles.css (tokens).
   Everything reusable across pages lives here: nav, footer, night
   scene, sections, buttons, FAQ, and the proof components.
   Page-specific one-offs stay in the page's own <style>.

   Two dialects share these tokens:
     BOXES AND ROOMS — cards, the house, the floorplan. Home speaks this.
     RULES AND ROWS  — hairlines running the full column with content
                       hanging off them, ordinals in the margin. The
                       ledger set at the bottom of this file.
   Pick one per page. Mixing them is how pages start looking alike.
   ═══════════════════════════════════════════════════════════════════ */

body { overflow-x: clip; }
a:focus-visible, button:focus-visible, summary:focus-visible, label:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
h1, h2, h3 { text-wrap: pretty; }

/* ── alive on scroll. Guarded by @supports so that where the scroll timeline
   is unsupported, content is simply visible. Never gates content. ── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ch-rise { animation: ch-rise-in linear both; animation-timeline: view(); animation-range: entry 5% cover 26%; }
    @keyframes ch-rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  }
}

/* ── layout rhythm ── */
.ch-wrap { max-width: 1200px; margin: 0 auto; padding-left: clamp(16px, 4vw, 44px); padding-right: clamp(16px, 4vw, 44px); }
.ch-sec { padding-bottom: clamp(80px, 9vw, 120px); }
.ch-h2 { margin: 0 0 14px 0; font-family: var(--font-display); font-weight: 600; font-size: var(--type-h2-size); line-height: var(--type-h2-leading); color: var(--text-primary); text-align: center; }
.ch-lede { margin: 0 auto 40px auto; max-width: var(--measure-body); font-size: var(--type-body-size); line-height: var(--type-body-leading); color: var(--night-mist); text-align: center; }
.ch-note { margin: 16px 0 0 0; font-size: 14px; line-height: 1.6; color: var(--text-tertiary); text-align: center; }
.ch-lab { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--annotation); }

/* ── nav: collapses under 780px, CTA never hides ── */
.ch-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding: 12px 18px; border: 1px solid var(--border-hairline); background: var(--surface-page); }
.ch-navlinks { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 26px; }
.ch-navlinks a { font-size: 13px; font-weight: 700; padding: 12px 0; }
.ch-navend { display: flex; align-items: center; gap: 12px; }
.ch-navtoggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.ch-burger { display: none; }
.ch-navtoggle:focus-visible ~ .ch-navend .ch-burger { outline: 2px solid var(--accent); outline-offset: 3px; }
.ch-mark { position: relative; display: inline-block; width: 27px; height: 20px; border: 2px solid var(--line-work); box-sizing: border-box; flex: none; }
.ch-mark i { position: absolute; top: -6px; right: 4px; width: 6px; height: 5px; background: var(--line-work); }
.ch-mark b { position: absolute; bottom: 0; left: 4px; width: 7px; height: 9px; border: 2px solid var(--line-work); border-bottom: 0; box-sizing: border-box; }

/* ── the night ── */
.ch-night { position: relative; overflow: hidden; }
.ch-star { position: absolute; width: 2px; height: 2px; background: var(--night-star); opacity: .5; }
.ch-star.big { width: 3px; height: 3px; opacity: .75; }
.ch-far { position: absolute; bottom: 0; border: 1px solid #16263c; border-bottom: 0; background: var(--night-deep); }
.ch-far::before {
  content: ""; position: absolute; top: -13px; left: -1px; right: -1px; height: 14px;
  background:
    linear-gradient(to top left,  transparent calc(50% - .5px), #16263c calc(50% - .5px), #16263c 50%, transparent 50%) left / 50% 100% no-repeat,
    linear-gradient(to top right, transparent calc(50% - .5px), #16263c calc(50% - .5px), #16263c 50%, transparent 50%) right / 50% 100% no-repeat;
}
.ch-far.lit > i { position: absolute; bottom: 34%; left: 32%; width: 22%; height: 26%; background: var(--night-lamp); opacity: 0; animation: ch-far-on 22s ease-in-out infinite; }
@keyframes ch-far-on { 0%,6% {opacity:0} 14%,40% {opacity:.55} 50%,100% {opacity:0} }
.ch-horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--night-frame); opacity: .55; }
.ch-lamp-live { box-shadow: 0 0 46px 10px rgba(240,160,80,.5); animation: ch-breathe 6.5s ease-in-out infinite; }
@keyframes ch-breathe {
  0%,100% { box-shadow: 0 0 40px 8px rgba(240,160,80,.42); }
  50%     { box-shadow: 0 0 58px 14px rgba(240,160,80,.62); }
}
/* a roof. Hard-stop gradients draw a line PERPENDICULAR to their direction,
   so the left slope needs `to top left`. Getting this backwards makes a valley. */
.ch-roof {
  background:
    linear-gradient(to top left,  transparent calc(50% - 2px), var(--line-work) calc(50% - 2px), var(--line-work) 50%, transparent 50%) left / 50% 100% no-repeat,
    linear-gradient(to top right, transparent calc(50% - 2px), var(--line-work) calc(50% - 2px), var(--line-work) 50%, transparent 50%) right / 50% 100% no-repeat;
}

/* ── buttons ── */
.ch-cta { display: inline-flex; align-items: center; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14.5px; line-height: 1; padding: 16px 26px; min-height: 44px; box-sizing: border-box; }

/* ── before / after ── */
.ch-ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0 clamp(20px, 3vw, 44px); align-items: center; }
.ch-col > h3 { margin: 0 0 18px 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--annotation); }
/* FIX 2026-08-10: this carried `opacity: .72` on top of --text-faint, which
   compounded to roughly 2:1 against the night sky and failed AA. The dashed
   border already says "the old way", so the fade survives without it. */
.ch-scrap { border: 1px dashed var(--night-frame); padding: 14px 16px; margin-bottom: 12px; }
.ch-scrap b { display: block; font-size: 14.5px; color: var(--text-secondary); font-weight: 700; }
.ch-scrap span { display: block; margin-top: 3px; font-size: 13px; color: var(--text-tertiary); font-style: italic; }
.ch-arrow { align-self: center; display: grid; gap: 6px; justify-items: center; color: var(--accent); }
.ch-arrow span:first-child { font-family: var(--font-mono); font-size: 20px; line-height: 1; }
.ch-arrow span:last-child { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.2px; color: var(--annotation); }
.ch-file { border: 1.5px solid var(--line-work); background: var(--night-well); margin-bottom: 14px; transition: border-color var(--dur-light) var(--ease-light); }
.ch-file:hover { border-color: var(--night-lamp); }
.ch-filetab { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--night-hairline); background: var(--night-raised); }
.ch-filetab b { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.ch-fileline { display: flex; gap: 11px; padding: 9px 14px; border-bottom: 1px solid var(--night-hairline); font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.ch-fileline:last-child { border-bottom: 0; }
.ch-fileline::before { content: ""; flex: none; width: 5px; height: 5px; margin-top: 7px; background: var(--annotation-accent); }

/* ── the machine ── */
.ch-rig { border: 1px solid var(--border-hairline); background: var(--night-well); padding: clamp(24px, 3.5vw, 44px); }
.ch-chain { --pad: clamp(8px, 1.2vw, 16px); position: relative; display: grid; grid-template-columns: repeat(5, 1fr); }
.ch-chain::before {
  content: ""; position: absolute; top: 15px; height: 1px;
  left: calc(var(--pad) + 15px); right: calc(20% + var(--pad) - 15px);
  background: repeating-linear-gradient(to right, var(--night-frame) 0 6px, transparent 6px 12px);
  background-size: 12px 1px; animation: ch-flow 1.4s linear infinite;
}
@keyframes ch-flow { to { background-position: 12px 0; } }
/* FIX 2026-08-10: `align-content: start` let the shortest step's divider ride
   above the others. The 1fr paragraph row absorbs the slack instead, so every
   parallel row sits on a shared baseline whatever the copy length. */
.ch-node { position: relative; display: grid; gap: 10px; grid-template-rows: auto auto 1fr auto; padding: 0 var(--pad); }
.ch-dot { width: 30px; height: 30px; border: 1.5px solid var(--night-frame); background: var(--night-well);
  display: grid; place-items: center; position: relative; z-index: 1; font-family: var(--font-mono); font-size: 10px; color: var(--annotation); }
.ch-node.gate .ch-dot { border-color: var(--accent); color: var(--accent); }
.ch-node.done .ch-dot { border-color: var(--night-lamp); background: var(--night-lamp); color: var(--night-sky); }
.ch-node h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.35; min-height: 2.7em; }
.ch-node p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-tertiary); }
.ch-see { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--night-hairline); }
.ch-see em { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--annotation); font-style: normal; margin-bottom: 5px; }
.ch-see span { font-size: 13px; line-height: 1.45; color: var(--text-secondary); }

/* ── the tape player ── */
.ch-player { border: 1px solid var(--border-hairline); background: var(--night-well); }
.ch-playbar { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 12px 14px; border-bottom: 1px solid var(--border-hairline); background: var(--night-raised); }
.ch-tab { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 8px 14px; border: 1px solid var(--night-hairline); color: var(--annotation);
  cursor: pointer; user-select: none; min-height: 34px; display: inline-flex; align-items: center;
  transition: border-color var(--dur-light) var(--ease-light), color var(--dur-light) var(--ease-light); }
.ch-tab:hover { border-color: var(--night-lamp); color: var(--night-lamp); }
.ch-pick { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.ch-screen { display: grid; }
.ch-tape { grid-area: 1 / 1; padding: clamp(20px, 2.6vw, 34px); opacity: 0; pointer-events: none; }
/* content is visible at rest: `backwards` means the final state is the natural one */
@keyframes ch-step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ch-step { animation: ch-step-in 520ms var(--ease-settle) backwards; }
.ch-step.d1 { animation-delay: .08s } .ch-step.d2 { animation-delay: .24s }
.ch-step.d3 { animation-delay: .40s } .ch-step.d4 { animation-delay: .56s }
.ch-step.d5 { animation-delay: .72s }
.ch-in { border-left: 2px solid var(--night-frame); padding: 4px 0 4px 14px; margin: 8px 0 22px 0; }
.ch-in p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--text-secondary); font-style: italic; }
.ch-opened { display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0 22px 0; }
.ch-chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--night-frame);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); background: var(--night-raised); }
.ch-chip::before { content: ""; width: 7px; height: 9px; border: 1px solid var(--annotation-accent); flex: none; }

/* ── the traceable reply ── */
.ch-draft { border: 1px solid var(--night-frame); background: var(--night-raised); padding: 22px 26px 18px 26px; margin: 8px 0 0 0; }
.ch-draft p { margin: 0 0 13px 0; font-size: 15.5px; line-height: 1.75; color: var(--text-primary); max-width: 62ch; }
.ch-draft p:last-of-type { margin-bottom: 0; }
.ch-src { background: rgba(240,160,80,.10); border-bottom: 1px solid rgba(240,160,80,.55); padding: 1px 2px 2px 2px; }
.ch-src sup { font-family: var(--font-mono); font-size: 9px; line-height: 0; vertical-align: super; color: var(--annotation-accent); margin-left: 3px; }
.ch-legend { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--night-hairline); display: flex; flex-wrap: wrap; gap: 6px 20px; }
.ch-legend span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .3px; color: var(--text-tertiary); }
.ch-legend b { color: var(--annotation-accent); font-weight: 400; margin-right: 5px; }

/* ── your call: real controls, they actually resolve ── */
.ch-call { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--night-hairline); }
.ch-callrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 10px; }
.ch-btn { font-size: 13.5px; font-weight: 700; padding: 11px 17px; min-height: 42px; display: inline-flex; align-items: center;
  cursor: pointer; user-select: none; border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
  transition: background var(--dur-light) var(--ease-light), color var(--dur-light) var(--ease-light); }
.ch-btn:hover { background: var(--accent); color: var(--on-accent); }
.ch-btn.ghost { border-color: var(--night-frame); color: var(--text-secondary); font-weight: 400; }
.ch-btn.ghost:hover { background: transparent; border-color: var(--night-lamp); color: var(--night-lamp); }
.ch-act { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.ch-result { display: none; margin-top: 10px; padding: 13px 16px; border-left: 2px solid var(--night-lamp); background: var(--night-raised); }
.ch-result.no { border-left-color: var(--night-frame); }
.ch-result b { display: block; font-size: 14.5px; color: var(--text-primary); margin-bottom: 3px; }
.ch-result span { display: block; font-size: 13.5px; line-height: 1.5; color: var(--text-tertiary); }
.ch-redo { margin-top: 12px; display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--annotation); border-bottom: 1px solid var(--night-frame); cursor: pointer; padding-bottom: 2px; }
.ch-redo:hover { color: var(--night-lamp); border-bottom-color: var(--night-lamp); }
.ch-act.y:checked ~ .ch-call .ch-result.yes,
.ch-act.n:checked ~ .ch-call .ch-result.no { display: block; }
.ch-act.y:checked ~ .ch-call .ch-callrow,
.ch-act.n:checked ~ .ch-call .ch-callrow { display: none; }

/* ── one room lit ── */
.ch-mini { display: grid; grid-template-columns: repeat(3, 46px); grid-auto-rows: 38px; gap: 9px; }
.ch-minicell { border: 1px solid var(--night-frame); }
.ch-minicell.lit { background: var(--night-lamp); border-color: var(--night-lamp); box-shadow: 0 0 26px 5px rgba(240,160,80,.42); }

/* ── FAQ ── */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
details[open] .faq-arrow { transform: rotate(90deg); }
.ch-faq { flex: 1 1 480px; min-width: 0; border-top: 1px solid var(--border-hairline); }
.ch-faq details { border-bottom: 1px solid var(--border-hairline); }
.ch-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 4px;
  font-size: 17px; font-weight: 700; color: var(--text-primary); min-height: 44px; box-sizing: border-box; }
.ch-faq p { margin: 0; padding: 0 4px 22px 4px; max-width: var(--measure-body); font-size: var(--type-body-size); line-height: var(--type-body-leading); color: var(--night-mist); }
.faq-arrow { font-family: var(--font-mono); color: var(--annotation-accent); transition: transform var(--dur-light) var(--ease-light); flex: none; }

/* ── footer ── */
.ch-foot { background: var(--surface-sunken); border-top: 1px solid var(--border-hairline); }
.ch-footcols { display: flex; flex-wrap: wrap; gap: 32px 64px; }
.ch-footcol { display: grid; gap: 12px; align-content: start; }
.ch-footcol > span { font-size: 13px; font-weight: 700; color: var(--text-tertiary); }
.ch-footcol div { display: grid; gap: 9px; }
.ch-footcol a { font-size: 13.5px; }
.ch-footbar { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between;
  padding: 13px clamp(16px, 4vw, 44px); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--annotation); }


/* ═══════════════════════════════════════════════════════════════════
   THE LEDGER SET (added 2026-08-10)

   The second dialect. Hairlines running the full column with content
   hanging off them, ordinals in the margin, no card ever. Use this on
   pages that argue or compare (/ai-automation-agency, /pricing) and
   leave the boxes-and-rooms set to pages that show the product working.
   ═══════════════════════════════════════════════════════════════════ */

/* the structural signature: a rule that content hangs from */
.ch-rule { border: 0; border-top: 1px solid var(--border-frame); margin: 0 0 26px 0; }

/* hero: two columns, bottom-aligned, no scene. Put an instrument in the
   right column, not a picture, or this is just the other hero again. */
.ch-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px 64px; align-items: end;
  padding-top: clamp(44px, 5vw, 76px); padding-bottom: clamp(56px, 6vw, 84px); }

/* spine: the claim stays put on the left, the evidence scrolls past it */
.ch-spine { display: grid; grid-template-columns: 300px 1fr; gap: 40px 72px; align-items: start; }
.ch-rail { position: sticky; top: 28px; }
.ch-rail .ch-h2 { margin-bottom: 0; text-align: left; }
.ch-rail p { margin: 14px 0 0 0; font-size: 15px; line-height: 1.6; color: var(--night-mist); }
.ch-row { display: grid; grid-template-columns: 128px 1fr; gap: 6px 24px; padding: 18px 0;
  border-bottom: 1px solid var(--border-hairline); }
.ch-row:first-child { border-top: 1px solid var(--border-frame); }
.ch-row > b { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--annotation); font-weight: 400; padding-top: 4px; }
.ch-row > span { font-size: 15.5px; line-height: 1.55; color: var(--text-secondary); }
.ch-row > span strong { color: var(--text-primary); font-weight: 700; }

/* steps as a ledger. Two shapes:
     .ch-steps         ordinals in the margin, for a sequence you count
     .ch-steps.plain   no ordinals, sentence titles. PREFER THIS. Home never
                       numbers its steps, and stacked 01/02/03 ladders are the
                       loudest machine-made tell we have. Number only when the
                       count is the point. */
.ch-steps { border-top: 1px solid var(--border-frame); }
.ch-stepr { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px 32px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--border-hairline); }
.ch-steps.plain .ch-stepr { grid-template-columns: 1fr 1fr; }
.ch-steps.plain .ch-stepr.gate { border-left: 2px solid var(--accent); padding-left: 20px; }
.ch-stepr > em { font-family: var(--font-mono); font-size: 11px; font-style: normal; color: var(--annotation); }
.ch-stepr.gate > em { color: var(--annotation-accent); }
.ch-stepr h3 { margin: 0 0 5px 0; font-size: 16.5px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.ch-stepr h3 + p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-tertiary); }
.ch-stepr .ch-got { font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); }
.ch-stepr .ch-got b { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--annotation); font-weight: 400; margin-bottom: 5px; }

/* a price stated as a line item rather than sold from a card */
.ch-item { border-top: 1.5px solid var(--line-work); border-bottom: 1px solid var(--border-hairline); }
.ch-itemtop { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; padding: 20px 0 6px 0; }
.ch-itemtop b { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); color: var(--text-primary); }
.ch-itemtop span { font-family: var(--font-mono); font-size: 20px; letter-spacing: 1px; color: var(--annotation-accent); }
.ch-itembody { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; padding: 0 0 26px 0; }
.ch-itembody p { margin: 0; max-width: 58ch; font-size: 15.5px; line-height: 1.6; color: var(--night-mist); }

/* FAQ, ledger variant: the answer gets a field label in the margin.
   Wrap the answer in .faq-a instead of leaving a bare <p>. */
.ch-faq.ledger { flex: none; border-top: 1px solid var(--border-frame); }
.ch-faq summary { padding-right: 4px; }
.ch-faq .faq-a { display: grid; grid-template-columns: 128px 1fr; gap: 24px; padding: 0 0 24px 0; }
.ch-faq .faq-a b { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--annotation); font-weight: 400; }
.ch-faq .faq-a p { margin: 0; padding: 0; max-width: var(--measure-body); font-size: var(--type-body-size); line-height: var(--type-body-leading); color: var(--night-mist); }

/* the closer: light under a door you own. The doorknob is one of the only
   two circles the system allows, so this is where a circle is earned. */
.ch-close { background: var(--surface-sunken); border-top: 1px solid var(--border-hairline); }
.ch-closegrid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 48px 72px;
  padding-top: clamp(72px, 8vw, 108px); padding-bottom: clamp(72px, 8vw, 108px); }
.ch-door { position: relative; flex: none; width: 124px; height: 232px;
  border: 2px solid var(--line-work); border-bottom: 0; background: var(--night-well); }
.ch-door i { position: absolute; left: 18px; right: 18px; height: 62px; border: 1px solid var(--night-frame); }
.ch-door i:nth-of-type(1) { top: 24px; }
.ch-door i:nth-of-type(2) { top: 104px; }
.ch-knob { position: absolute; right: 13px; top: 54%; width: 7px; height: 7px; border-radius: 50%; background: var(--line-work); }
.ch-spill { position: absolute; left: -14px; right: -14px; bottom: -3px; height: 3px; background: var(--accent);
  box-shadow: 0 10px 38px 9px rgba(240, 160, 80, .45); }
/* LIGHT: the spill turns on as you reach it, then stops. Not an idle loop. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ch-spill { animation: ch-spill-on linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    @keyframes ch-spill-on { from { opacity: 0; } to { opacity: 1; } }
  }
}


/* ═══ responsive ═══ */
@media (max-width: 1000px) {
  .ch-hero { grid-template-columns: 1fr; align-items: start; gap: 40px; }
  .ch-spine { grid-template-columns: 1fr; gap: 26px; }
  .ch-rail { position: static; }
  .ch-stepr { grid-template-columns: 44px 1fr; }
  .ch-stepr .ch-got { grid-column: 2; padding-top: 4px; }
  .ch-steps.plain .ch-stepr { grid-template-columns: 1fr; }
  .ch-steps.plain .ch-stepr .ch-got { grid-column: 1; }
}
@media (max-width: 900px) {
  .ch-ba { grid-template-columns: 1fr; }
  .ch-arrow { justify-self: start; padding: 6px 0 22px 0; }
  .ch-arrow span:first-child { transform: rotate(90deg); display: block; }
  .ch-chain { grid-template-columns: 1fr; gap: 22px; }
  .ch-chain::before { display: none; }
  .ch-node h3 { min-height: 0; }
}
@media (max-width: 780px) {
  .ch-burger { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 44px; height: 44px; flex: none; cursor: pointer; border: 1px solid var(--border-frame); }
  .ch-burger span { display: block; width: 18px; height: 1.5px; background: var(--text-primary); }
  .ch-navtoggle:checked ~ .ch-navend .ch-burger { border-color: var(--accent); }
  .ch-navlinks { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 0;
    margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--border-hairline); }
  .ch-navtoggle:checked ~ .ch-navlinks { display: flex; }
  .ch-navlinks a { padding: 13px 2px; border-bottom: 1px solid var(--night-hairline); }
  .ch-navlinks a:last-child { border-bottom: 0; }
  .ch-foot .ch-navlink { display: inline-block; padding: 8px 0; }
  /* FIX 2026-08-10: was 3px, which left inline links at 29-30px on a phone. */
  .ch-link { display: inline-block; padding: 6px 0; }
  .ch-row { grid-template-columns: 1fr; gap: 4px; }
  .ch-faq .faq-a { grid-template-columns: 1fr; gap: 8px; }
  .ch-door { width: 96px; height: 180px; }
  .ch-door i { left: 14px; right: 14px; height: 46px; }
  .ch-door i:nth-of-type(2) { top: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-chain::before, .ch-lamp-live, .ch-far.lit > i { animation: none; }
  .ch-step, .ch-spill { animation: none; }
}


/* ═══════════════════════════════════════════════════════════════════
   DAY SURFACE (added 2026-08-17, first day page: /audit)

   Scoped fixes for shared components that hardcode night-* colors.
   Every rule is gated on [data-surface="day"], so night pages cannot
   be affected. The day press/hover behaviour itself lives in
   tokens/states.css (ch-primary, ch-outline, ch-field). If a shared
   component gains a night-* literal, its day override belongs here.
   ═══════════════════════════════════════════════════════════════════ */

[data-surface="day"] .ch-lede { color: var(--day-warmgrey); }
[data-surface="day"] .ch-faq p,
[data-surface="day"] .ch-faq .faq-a p { color: var(--day-warmgrey); }
[data-surface="day"] .ch-rail p { color: var(--day-warmgrey); }
[data-surface="day"] .ch-itembody p { color: var(--day-warmgrey); }
/* the closer door by day: paper and ink, and the spill goes door-orange */
[data-surface="day"] .ch-door { background: var(--day-paper); }
[data-surface="day"] .ch-door i { border-color: var(--day-hairline); }
[data-surface="day"] .ch-spill { box-shadow: 0 10px 38px 9px rgba(217, 84, 30, .35); }
/* mobile nav dividers picked up the night hairline literal */
@media (max-width: 780px) {
  [data-surface="day"] .ch-navlinks a { border-bottom-color: var(--day-hairline); }
  [data-surface="day"] .ch-navlinks a:last-child { border-bottom: 0; }
}


/* ═══════════════════════════════════════════════════════════════════
   PROSE PAGES (added 2026-08-20: the blog and the legal pages)

   Long-form reading on the day surface. One measured column, Erode for
   the title and section headings, Atkinson for everything else. Links
   inside prose take .ch-link. Surface-agnostic via the semantic tokens.
   ═══════════════════════════════════════════════════════════════════ */

.ch-prose { max-width: 720px; }
.ch-prose h1 { margin: 10px 0 0 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; color: var(--text-primary); }
.ch-prose h2 { margin: 44px 0 10px 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(22px, 2.4vw, 29px); line-height: 1.2; color: var(--text-primary); }
.ch-prose p { margin: 0 0 16px 0; font-size: 16.5px; line-height: 1.7; color: var(--text-secondary); }
.ch-prose ul { margin: 0 0 16px 0; padding-left: 20px; }
.ch-prose li { margin: 0 0 10px 0; font-size: 16.5px; line-height: 1.7; color: var(--text-secondary); }
.ch-prose li::marker { color: var(--accent); }
.ch-prose strong, .ch-prose b { color: var(--text-primary); }
.ch-postmeta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--annotation); }
.ch-postlede { margin: 18px 0 0 0; font-size: 18px; line-height: 1.6; color: var(--text-secondary); }
/* the article's closing ask, framed like paperwork */
.ch-postcta { margin-top: 48px; border: 1.5px solid var(--border-frame); background: var(--surface-raised);
  padding: 24px 26px; }
.ch-postcta p { margin: 0 0 18px 0; max-width: 54ch; font-size: 15.5px; line-height: 1.6; color: var(--text-secondary); }
.ch-postcta .row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.ch-postcta .fine { margin: 12px 0 0 0; font-size: 13.5px; color: var(--text-tertiary); }

/* the index: posts hanging off rules */
.ch-postrow { display: block; padding: 22px 0; border-bottom: 1px solid var(--border-hairline); }
.ch-postrow:first-of-type { border-top: 1px solid var(--border-frame); }
.ch-postrow em { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; font-style: normal; color: var(--annotation); margin-bottom: 7px; }
.ch-postrow b { display: block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 2.2vw, 26px); line-height: 1.25; color: var(--text-primary); }
.ch-postrow span { display: block; margin-top: 6px; max-width: 64ch; font-size: 15px; line-height: 1.6;
  color: var(--text-secondary); }
.ch-postrow:hover b { color: var(--interactive-hover); }
