/* BRON join portal. One stylesheet.
   Tokens are the app's own "lamplit study" (frontend/src/app/globals.css, .dark .chambers) and its paper
   palette (.chambers), radii from --radius 0.625rem, motion from --ease-out. Upright type only (owner, 2026-11-04). */

@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* app dark tokens */
  --ink: #18140F;            /* --background */
  --ink-2: #201A14;          /* --card */
  --ink-3: #2A2319;          /* --secondary */
  --ink-4: #251F17;          /* --muted */
  --line: #332B20;           /* --border */
  --line-2: #5b4e3c;         /* form-control edge: the app border, raised to a 3:1-ish edge on the page */
  --cream: #EDE5D8;          /* --foreground */
  --cream-2: #D9CFBF;        /* --secondary-foreground */
  --muted: #A79A85;          /* --muted-foreground */
  --faint: #8a7d69;
  --primary: #D9926F;        /* --primary */
  --primary-ink: #2A130A;    /* --primary-foreground */
  --accent: #E8A87E;         /* --accent-foreground (dark) */
  --accent-bg: #332318;      /* --accent (dark) */
  --ring: #D9926F;
  --destructive: #E5654E;
  --ok: #93B49E;             /* --chart-2 (dark) */
  /* app paper tokens */
  --paper: #FFFDF9;          /* --card (light) */
  --paper-bg: #FAF7F2;       /* --background (light) */
  --paper-ink: #1C1A17;
  --paper-muted: #6B6256;
  --paper-line: #E8E0D2;
  --paper-accent: #F7ECE6;
  --seal: #9E4A2C;           /* --accent-foreground (light) */
  --clay: #C56A4E;           /* BRON monogram clay */
  --clay-dark: #D9926F;      /* BRON monogram clay, dark */
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1); /* a settled spring: one small overshoot, used only for arrivals (dots, checks) */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease: var(--ease-out);
  /* radius scale: --radius 0.625rem */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --gutter: clamp(20px, 5vw, 56px);
  --max: 1120px;
  --header-h: 60px;
  color-scheme: dark;
}
@media (max-width: 560px) { :root { --header-h: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); background: var(--ink); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--cream);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* One soft pool of clay light at the top. Decorative only. */
body::before {
  content: "";
  position: fixed; inset: -20vh -10vw auto -10vw; height: 80vh;
  background: radial-gradient(55% 55% at 50% 0%, rgba(217, 146, 111, 0.1), transparent 70%);
  pointer-events: none; z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }
::selection { background: rgba(217, 146, 111, 0.35); color: var(--cream); }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
/* Upright type only: emphasis is colour, never slant. */
em, i, cite, dfn, var, address, blockquote { font-style: normal; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: var(--r-sm); }

/* ---------- The mark (bronlaw frontend/src/app/components/brand/symbol.ts + design-reference/identity/IdentityMotion.tsx) ----------
   The filled monogram. A drawn mark reveals each part through a mask whose trace is dashed; pathLength="1" normalises
   the dash. The resting state is the finished letter, so the mark is visible with no JS, paused animations or reduced
   motion; the draw animates FROM the hidden state. One constant-speed gesture, 1.05s, a frame of overlap per handoff. */
.mark { display: block; color: var(--clay-dark); flex: none; }
.mark mask path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark.draw mask path { animation: bronMarkDraw linear backwards; }
.mark.draw .t0 { animation-duration: .298s; animation-delay: .15s; }
.mark.draw .t1 { animation-duration: .364s; animation-delay: .433s; }
.mark.draw .t2 { animation-duration: .368s; animation-delay: .782s; }
@keyframes bronMarkDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.mark.loop mask path { animation: 2.5s linear infinite; }
.mark.loop .t0 { animation-name: bronMarkLoop0; }
.mark.loop .t1 { animation-name: bronMarkLoop1; }
.mark.loop .t2 { animation-name: bronMarkLoop2; }
@keyframes bronMarkLoop0 { 0% { stroke-dashoffset: 1; } 12%, 75% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 1; } }
@keyframes bronMarkLoop1 { 0%, 11% { stroke-dashoffset: 1; } 26%, 75% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 1; } }
@keyframes bronMarkLoop2 { 0%, 25% { stroke-dashoffset: 1; } 42%, 75% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 1; } }
.mark.on-paper { color: var(--clay); }
.hero-mark { display: grid; place-items: center; height: 72px; margin-bottom: 28px; }
.loader { display: grid; place-items: center; height: 72px; margin: 0 auto 36px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: rgba(24, 20, 15, 0.82);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; margin-left: -10px; color: var(--clay-dark); text-decoration: none; border-radius: var(--r-lg); }
.top-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.top-meta .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(217, 146, 111, 0.14); }
.top-meta .who { min-width: 0; max-width: min(46vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Progress rail ---------- */
.rail { border-bottom: 1px solid var(--line); background: rgba(24, 20, 15, 0.5); }
.rail ol {
  list-style: none; margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  max-width: var(--max); height: 52px;
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.rail ol::-webkit-scrollbar { display: none; }
.rail li { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: 13px; color: var(--faint); }
.rail li + li::before { content: ""; width: clamp(12px, 3vw, 36px); height: 1px; background: var(--line); margin-right: 6px; }
.rail .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.rail li.done { color: var(--cream-2); }
.rail li.done .n { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.rail li.now { color: var(--cream); font-weight: 500; }
.rail li.now .n { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(217, 146, 111, 0.12); position: relative; }
.rail li.now .n::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--primary); animation: ring-breathe 3.2s var(--ease-out) infinite; }
.rail li.done .n svg { animation: tc-check 360ms var(--ease-back) backwards; }
.rail-m .bars span { transform-origin: 0 50%; }
.rail-m .bars span.now { animation: bar-in 600ms var(--ease-out) 120ms backwards; }
@keyframes bar-in { from { transform: scaleX(0); } }
.rail-m { display: none; }
@media (max-width: 720px) {
  /* On phones the rail compresses to one line and a segmented bar. The list stays for assistive tech. */
  .rail ol { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .rail-m { display: block; max-width: var(--max); margin: 0 auto; padding: 10px max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left)); }
  .rail-m .line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
  .rail-m .line b { font-weight: 500; color: var(--cream); }
  .rail-m .line span { color: var(--muted); font-variant-numeric: tabular-nums; }
  .rail-m .bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 8px; }
  .rail-m .bars span { height: 3px; border-radius: 99px; background: var(--line); }
  .rail-m .bars span.done { background: var(--cream-2); }
  .rail-m .bars span.now { background: var(--primary); }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.stage { padding: clamp(40px, 9vh, 104px) 0 clamp(64px, 11vh, 128px); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s, 16px); }

/* ---------- Type ---------- */
.eyebrow {
  font: 500 12px/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--primary); }
.center .eyebrow::after { content: ""; width: 18px; height: 1px; background: var(--primary); }
.display {
  font: 400 clamp(36px, 6vw, 64px)/1.04 var(--serif); letter-spacing: 0; margin: 20px 0 0;
  text-wrap: balance; overflow-wrap: anywhere;
}
.display span { font-style: normal; color: var(--accent); }
.h2 { font: 400 clamp(28px, 3.6vw, 42px)/1.1 var(--serif); letter-spacing: 0.005em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.h3 { font: 500 21px/1.3 var(--serif); margin: 0; letter-spacing: 0.01em; }
.lede { font-size: clamp(16.5px, 1.5vw, 19px); line-height: 1.6; color: var(--cream-2); max-width: 36em; margin: 20px 0 0; text-wrap: pretty; overflow-wrap: break-word; }
.center .lede { margin-left: auto; margin-right: auto; }
.small { font-size: 14px; color: var(--muted); line-height: 1.55; }
.fine { font-size: 12.5px; color: var(--faint); line-height: 1.55; }
.mono { font-family: var(--mono); }
.fine .mono, .hash { overflow-wrap: anywhere; word-break: break-all; }

/* ---------- Buttons (app Button: rounded-lg, font-medium, press = translate/scale on ease-out) ---------- */
.btn {
  --h: 48px;
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; height: var(--h); padding: 0 24px; border-radius: var(--r-lg);
  font: 500 15px/1 var(--sans);
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: color-mix(in srgb, var(--primary) 90%, #fff 10%); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.btn .arr { transition: transform 200ms var(--ease-out); }
.btn:hover .arr { transform: translateX(2px); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--ink-3); color: var(--faint); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--accent-bg); color: var(--accent); }
.btn.ghost:focus-visible { box-shadow: inset 0 0 0 1px var(--ring), 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.btn.light { background: var(--cream); color: var(--ink); }
.btn.light:hover { background: #fff; }
.btn.sm { --h: 36px; padding: 0 16px; font-size: 14px; }
@media (pointer: coarse), (max-width: 720px) { .btn.sm { --h: 44px; } }
.btn.block { width: 100%; }
.link { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(232, 168, 126, 0.35); transition: border-color 160ms var(--ease-out); }
.link:hover { border-color: var(--accent); }
.linkbtn { appearance: none; background: none; border: 0; border-bottom: 1px solid rgba(232, 168, 126, 0.35); color: var(--accent); font: inherit; padding: 0; margin: 0; cursor: pointer; position: relative; }
.linkbtn::after { content: ""; position: absolute; inset: -14px -8px; } /* a 44px hit area inside a sentence */
.linkbtn:hover { border-color: var(--accent); }

/* ---------- Surfaces (app Card: rounded-xl, border, bg-card, no drop shadow) ---------- */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(20px, 3vw, 32px);
}
.card.tight { padding: 20px; }
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: var(--r-xl);
  border: 1px solid var(--paper-line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 32px 80px -40px rgba(0, 0, 0, 0.7);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font: 500 12px/1 var(--sans); white-space: nowrap;
  background: var(--ink-4); color: var(--cream-2); border: 1px solid var(--line);
}
.pill.ok { background: rgba(147, 180, 158, 0.1); color: var(--ok); border-color: rgba(147, 180, 158, 0.28); }
.pill.go { background: var(--accent-bg); color: var(--accent); border-color: rgba(232, 168, 126, 0.3); }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hr { height: 1px; background: var(--line); border: 0; margin: 32px 0; }

/* ---------- Motion: content is visible by default; the animation starts FROM the offset state ---------- */
.rise { animation: rise 0.64s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms + 40ms); will-change: transform, opacity; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.reveal-on-scroll { transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal-on-scroll.pre { opacity: 0; transform: translateY(16px); } /* added by app.js only to sections below the fold */
.reveal-on-scroll.pre.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal-on-scroll { animation: none; transition: none; }
  .reveal-on-scroll.pre { opacity: 1; transform: none; }
  .mark mask path { animation: none !important; stroke-dashoffset: 0; }
  *, *::before, *::after { transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Welcome letter ---------- */
.letter { max-width: 680px; margin: 48px auto 0; padding: clamp(28px, 6vw, 60px) clamp(24px, 6vw, 60px) clamp(32px, 6vw, 60px); position: relative; text-align: left; }
.letter::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--paper-line); border-radius: var(--r-lg); pointer-events: none;
}
.letter .salute { font: 400 26px/1.3 var(--serif); margin: 0 0 18px; }
.letter p { font: 400 clamp(18px, 2.4vw, 20px)/1.62 var(--serif); margin: 0 0 18px; color: #2b2720; text-wrap: pretty; }
.letter .sig { font: 400 32px/1 var(--serif); margin-top: 28px; color: var(--paper-ink); letter-spacing: 0.01em; }
.letter .sig-role { font: 500 11px/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-muted); margin-top: 10px; }
.draft-flag {
  display: inline-flex; gap: 8px; align-items: center; margin-top: 20px; font-size: 12.5px; color: var(--accent); max-width: 100%;
  border: 1px dashed rgba(232, 168, 126, 0.45); padding: 8px 14px; border-radius: 999px;
}

/* ---------- Code entry: six equal columns that scale down with the screen ---------- */
.code { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 12px repeat(3, minmax(0, 1fr)); gap: clamp(6px, 1.6vw, 12px); max-width: 440px; margin: 36px auto 8px; }
.code input {
  width: 100%; min-width: 0; height: clamp(56px, 15vw, 76px); text-align: center; padding: 0;
  font: 400 clamp(26px, 6vw, 36px)/1 var(--serif); color: var(--cream); caret-color: var(--primary);
  background: color-mix(in srgb, var(--line) 30%, var(--ink)); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.code input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.code .gap { width: 12px; }

/* ---------- Forms (app Input: rounded-lg, dark:bg-input/30, ring-[3px] ring/50) ---------- */
.field { position: relative; display: block; }
.field input, .field select, .field textarea {
  width: 100%; height: 58px; padding: 24px 16px 8px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--line) 30%, var(--ink)); border: 1px solid var(--line-2); color: var(--cream);
  font: 400 16px/1.2 var(--sans); transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out);
  appearance: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.field textarea { height: auto; min-height: 128px; padding-top: 30px; resize: vertical; line-height: 1.5; }
.field label {
  position: absolute; left: 17px; top: 19px; right: 17px; font-size: 16px; line-height: 1.2; color: var(--muted); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform-origin: left top; transition: transform 200ms var(--ease-out), color 160ms var(--ease-out);
}
.field textarea + label { white-space: normal; line-height: 1.25; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select + label { transform: translateY(-11px) scale(0.78); color: var(--cream-2); }
.field input[readonly] { color: var(--cream-2); }
.field.fixed input { background: transparent; border-style: dashed; cursor: default; pointer-events: none; }
.field .hint { display: block; font-size: 13px; color: var(--faint); margin: 8px 4px 0; line-height: 1.45; }
.field .err { display: block; font-size: 13px; margin: 8px 4px 0; line-height: 1.45; }
.field.prefilled input { border-color: rgba(217, 146, 111, 0.4); }
.field .tag { position: absolute; right: 14px; top: 8px; font-size: 11px; font-weight: 500; color: var(--accent); letter-spacing: 0.04em; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 640px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset + .fieldset { margin-top: 44px; }
.legend { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.legend .num { font: 400 16px/1 var(--serif); color: var(--accent); min-width: 1.6em; }
.legend .h3 { font-size: 24px; }
.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-size: 14.5px; line-height: 1.55; color: var(--cream-2); min-height: 44px; padding: 4px 0; }
.check input { appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin: 2px 0 0; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--line) 30%, var(--ink)); display: grid; place-items: center; cursor: pointer; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--primary-ink); border-bottom: 2px solid var(--primary-ink); transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.seg { display: inline-flex; padding: 3px; background: var(--ink-4); border: 1px solid var(--line); border-radius: var(--r-lg); gap: 2px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 14px/1 var(--sans); min-width: 72px; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); cursor: pointer; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); touch-action: manipulation; }
.seg button[aria-pressed="true"] { background: var(--cream); color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- Agreement ---------- */
.nda { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; margin-top: 48px; }
@media (max-width: 920px) { .nda { grid-template-columns: minmax(0, 1fr); margin-top: 36px; } }
.summary { position: sticky; top: calc(var(--header-h) + 52px + 24px); }
@media (max-width: 920px) { .summary { position: static; } }
.summary ol { list-style: none; padding: 0; margin: 18px 0 0; counter-reset: s; }
.summary li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 10px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.55; color: var(--cream-2); }
.summary li::before { content: counter(s, decimal-leading-zero); font: 400 15px/1.5 var(--serif); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.summary li b { color: var(--cream); font-weight: 600; }
/* Review: what was agreed with Daniel (clay) and what the hire typed (sage, dashed). Shape differs as well as colour. */
.paper mark.hl { color: inherit; border-radius: 3px; padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.paper mark.hl.term { background: color-mix(in srgb, var(--clay) 20%, transparent); }
.paper mark.hl.you { background: color-mix(in srgb, #6F8F7A 18%, transparent); border-bottom: 1.5px dashed #5E7D69; }
.review-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--cream); }
.review-list { margin: 8px 0 0; }
.review-list div { padding: 10px 0; border-top: 1px solid var(--line); }
.review-list dt { font-size: 12.5px; color: var(--muted); }
.review-list dd { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--cream-2); overflow-wrap: anywhere; }
.review-list dd .sw { display: none; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.term { background: color-mix(in srgb, var(--clay) 55%, transparent); }
.sw.you { background: color-mix(in srgb, #6F8F7A 45%, transparent); border-bottom: 2px dashed #8FB09A; }
.doc { padding: clamp(24px, 5vw, 64px) clamp(20px, 5.5vw, 72px); }
.doc-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding-bottom: 20px; border-bottom: 1px solid var(--paper-line); margin-bottom: 32px; font: 600 10.5px/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-muted); }
.doc h1 { font: 500 clamp(24px, 3vw, 32px)/1.2 var(--serif); text-align: center; letter-spacing: 0.04em; margin: 0 0 28px; overflow-wrap: anywhere; }
.doc h2 { font: 600 12.5px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; margin: 32px 0 10px; color: var(--paper-ink); }
.doc p { font: 400 clamp(16.5px, 2vw, 17.5px)/1.7 var(--serif); margin: 0 0 14px; color: #2b2720; hyphens: auto; overflow-wrap: break-word; text-wrap: pretty; }
.doc p strong { font-weight: 500; color: var(--paper-ink); }
.doc .blank { background: var(--paper-accent); color: var(--seal); padding: 1px 7px; border-radius: var(--r-sm); border-bottom: 1px dashed var(--seal); font-family: var(--sans); font-size: 0.8em; white-space: nowrap; }
.doc-scroll { max-height: min(76vh, 880px); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; border-radius: var(--r-xl) var(--r-xl) 0 0; mask-image: linear-gradient(180deg, #000 calc(100% - 56px), transparent); -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 56px), transparent); }
@media (max-width: 720px) { .doc-scroll { max-height: 64dvh; } }
.doc-scroll.end { mask-image: none; -webkit-mask-image: none; }
.doc-scroll:focus-visible { outline-offset: -3px; }
.doc-progress { height: 3px; background: var(--paper-line); border-radius: 0 0 var(--r-xl) var(--r-xl); overflow: hidden; }
.doc-progress span { display: block; height: 100%; width: 0; background: var(--seal); transition: width 0.15s linear; }
.hash { font: 500 11px/1.5 var(--mono); color: var(--muted); }
.paper .hash { color: var(--paper-muted); }

/* ---------- Signature ---------- */
.sign { margin-top: 32px; }
.sigbox { position: relative; height: 160px; border-radius: var(--r-lg); background: var(--paper); overflow: hidden; margin-top: 16px; }
.sigbox .typed { position: absolute; inset: 0 24px 40px 46px; display: flex; align-items: flex-end; font: 400 clamp(30px, 5vw, 46px)/1.05 var(--serif); letter-spacing: 0.01em; color: var(--paper-ink); overflow: hidden; overflow-wrap: anywhere; }
.sigbox .typed:empty::before { content: "Your signature"; color: #c9bfae; }
.sigbox .baseline { position: absolute; left: 24px; right: 24px; bottom: 34px; height: 1px; background: #cfc5b3; }
.sigbox .x { position: absolute; left: 24px; bottom: 40px; font: 400 18px/1 var(--serif); color: #b4a68f; }
.sigbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigbox .under { position: absolute; left: 24px; right: 24px; bottom: 10px; display: flex; justify-content: space-between; gap: 12px; font: 500 10.5px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: #8d8068; }
.sign-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 24px; margin-top: 24px; }
.sign-actions .fine { min-width: 0; flex: 1 1 280px; }
@media (max-width: 720px) {
  .sign-actions { flex-direction: column-reverse; align-items: stretch; }
  .sign-actions .btn { width: 100%; }
}

/* ---------- Call ---------- */
.event { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: center; }
@media (max-width: 560px) { .event { grid-template-columns: minmax(0, 1fr); } }
.cal { width: 112px; border-radius: var(--r-xl); overflow: hidden; background: var(--paper); color: var(--paper-ink); text-align: center; border: 1px solid var(--paper-line); }
.cal .m { background: var(--seal); color: var(--paper); font: 600 12px/1 var(--sans); letter-spacing: 0.2em; padding: 10px 0 9px 0.2em; text-transform: uppercase; }
.cal .d { font: 400 52px/1 var(--serif); padding: 12px 0 2px; font-variant-numeric: lining-nums; }
.cal .w { font: 500 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-muted); padding: 0 0 14px 0.14em; }
.event .when { font: 400 clamp(24px, 3.2vw, 32px)/1.2 var(--serif); }
.event .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.event-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 560px) { .event-actions .btn { width: 100%; } }
.cover { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
@media (max-width: 720px) { .cover { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Waiting ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li:last-child { padding-bottom: 0; }
.steps .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font: 400 15px/1 var(--serif); color: var(--muted); font-variant-numeric: lining-nums; }
.steps li.done .ic { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.steps li.now .ic { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 5px rgba(217, 146, 111, 0.1); }
.steps .t { font-size: 15.5px; color: var(--cream); overflow-wrap: anywhere; }
.steps .s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.steps li:not(.done):not(.now) .t { color: var(--cream-2); }
@media (max-width: 380px) { .steps li { grid-template-columns: 34px minmax(0, 1fr); } .steps li > .pill, .steps li > span:last-child { grid-column: 2; justify-self: start; } .steps li > span:empty { display: none; } }
.note { margin: 0; border-left: 2px solid var(--primary); padding: 4px 0 4px 20px; font: 400 clamp(19px, 2.4vw, 21px)/1.55 var(--serif); color: var(--cream); overflow-wrap: anywhere; }
.note cite { display: block; font: 500 11px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }

/* ---------- Offer documents ---------- */
.docs { display: grid; gap: 12px; margin-top: 32px; }
.docrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--ink-2);
  text-decoration: none; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
/* The icon: one page for every row, a badge for what is true of it. The kind sits as a small label above the title, so it never overflows. */
.dicon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(250, 247, 242, 0.045); border: 1px solid var(--line); color: var(--cream-2); align-self: start; }
.dicon svg { width: 24px; height: 24px; display: block; }
.dicon .bb { fill: var(--ink-2); stroke: var(--ink-2); stroke-width: 2; }
.dicon .bd { stroke-width: 1.6; }
.dicon.todo .bd { stroke: var(--primary); }
.dicon.signed .bd { stroke: var(--cream); }
.dicon.countersigned .bd { stroke: var(--ok); }
.dicon.board .bd { stroke: var(--clay); }
.dicon.countersigned, .dicon.signed { color: var(--cream-2); }
.dicon.todo { border-color: rgba(232, 168, 126, 0.28); background: rgba(232, 168, 126, 0.06); color: var(--cream); }
.dtext { min-width: 0; }
.dkind { display: block; font: 600 10.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.dicon.todo + .dtext .dkind { color: var(--accent); }
.docrow.quiet .dkind { color: var(--clay); }
a.docrow:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--ink-2) 80%, var(--ink-3)); }
a.docrow:active { transform: scale(0.99); }
.docrow .tile { width: 48px; height: 60px; border-radius: var(--r-sm); background: var(--paper); position: relative; }
.docrow .tile::before { content: ""; position: absolute; left: 9px; right: 9px; top: 12px; height: 28px; background: repeating-linear-gradient(180deg, #d8ccb8 0 2px, transparent 2px 7px); opacity: 0.8; }
.docrow .tile b { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font: 600 9px/1 var(--sans); letter-spacing: 0.1em; color: var(--seal); }
.docrow .name { font: 400 clamp(18px, 2.4vw, 21px)/1.25 var(--serif); overflow-wrap: anywhere; text-wrap: pretty; color: var(--cream); }
.docrow .sub { font-size: 13.5px; line-height: 1.4; color: var(--muted); margin-top: 3px; text-wrap: pretty; }
@media (max-width: 480px) {
  .docrow { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px; align-items: start; }
  .dicon { width: 40px; height: 40px; border-radius: 11px; }
  .dicon svg { width: 22px; height: 22px; }
  .docrow .name { font-size: 18px; }
  .docrow > .pill, .docrow > .dl { grid-column: 2; justify-self: start; margin-top: 6px; }
}
.meter { height: 6px; border-radius: 99px; background: var(--ink-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

/* ---------- Reveal ---------- */
.reveal-hero { text-align: center; padding-top: clamp(40px, 8vh, 80px); }
.monogram {
  width: 84px; height: 84px; margin: 0 auto 32px; border-radius: var(--r-xl); display: grid; place-items: center;
  background: var(--ink-2); border: 1px solid var(--line);
}
.creds { max-width: 620px; margin: 48px auto 0; text-align: left; }
.cred { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.cred:first-of-type { border-top: 0; padding-top: 0; }
.cred .k { font: 500 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); grid-column: 1 / -1; }
.cred .v { font: 400 clamp(20px, 3.2vw, 24px)/1.3 var(--serif); overflow-wrap: anywhere; min-width: 0; }
.cred .v.mono { font: 500 clamp(15px, 2.4vw, 18px)/1.4 var(--mono); letter-spacing: 0.03em; color: var(--accent); word-break: break-all; }
.warn { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-bg); border: 1px solid rgba(232, 168, 126, 0.22); padding: 14px 16px; border-radius: var(--r-lg); font-size: 14px; color: var(--cream-2); line-height: 1.5; margin-top: 18px; }
.warn svg { flex: 0 0 18px; margin-top: 2px; color: var(--accent); }
.access { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 14px; }
.access .card { padding: 22px; }
.access .ic2 { width: 40px; height: 40px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); margin-bottom: 16px; }
.access .h3 { font-size: 20px; }
.access p { margin: 8px 0 0; font-size: 14px; color: var(--cream-2); line-height: 1.55; }
.access a.card { text-decoration: none; display: block; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.access a.card:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--ink-2) 80%, var(--ink-3)); }
.copy { appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--cream-2); border-radius: var(--r-lg); min-height: 44px; min-width: 76px; padding: 0 16px; font: 500 14px/1 var(--sans); cursor: pointer; transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), background-color 160ms var(--ease-out); touch-action: manipulation; }
.copy:hover { background: var(--accent-bg); color: var(--accent); }
.copy.done { color: var(--ok); border-color: rgba(147, 180, 158, 0.4); }
.copy:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }

/* ---------- Tour ---------- */
.chapter { padding: clamp(64px, 12vh, 136px) 0 0; }
.chapter-head { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 24px; align-items: baseline; }
@media (max-width: 640px) { .chapter-head { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.chapter-num { font: 400 clamp(44px, 6vw, 60px)/0.9 var(--serif); color: var(--accent); font-variant-numeric: lining-nums; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 40px; }
.point { padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--ink-2); }
.point .h3 { font-size: 20px; margin-bottom: 10px; }
.point p { margin: 0; font-size: 14.5px; color: var(--cream-2); line-height: 1.6; }
.quote { margin: 0; font: 400 clamp(26px, 4vw, 46px)/1.18 var(--serif); letter-spacing: 0; text-wrap: balance; overflow-wrap: anywhere; }
.quote span { font-style: normal; color: var(--accent); }
.map { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.map > div { background: var(--ink); padding: 22px; min-width: 0; }
.map code { font: 500 13px/1.4 var(--mono); color: var(--accent); overflow-wrap: anywhere; }
.map p { margin: 8px 0 0; font-size: 14px; color: var(--cream-2); line-height: 1.55; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 36px; }
.flow span:not([aria-hidden]) { padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: var(--cream); background: var(--ink-2); }
.flow span[aria-hidden] { width: 20px; height: 1px; background: var(--primary); opacity: 0.6; }
.tour-end { text-align: center; padding: clamp(80px, 14vh, 160px) 0 32px; }
.tour-end .lede { margin-left: auto; margin-right: auto; }
.points:has(> :nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
@media (min-width: 760px) { .points:has(> :nth-child(4):last-child) { grid-template-columns: 1fr 1fr; } }
.tour-sig { font: 400 32px/1 var(--serif); color: var(--cream); letter-spacing: 0.01em; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0 calc(40px + env(safe-area-inset-bottom)); margin-top: 24px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * clamp(0px, 1vw, 12px)); -webkit-overflow-scrolling: touch; }
.table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0 14px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
@media (max-width: 720px) {
  .table-wrap { overflow: visible; margin: 0; }
  .table, .table tbody, .table tr, .table td { display: block; min-width: 0; width: 100%; }
  .table thead { display: none; }
  .table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 4px 0; border: 0; }
  .table td:first-child { font: 400 20px/1.3 var(--serif); }
  .table td .row { margin-top: 8px; }
}
.table tr:hover td { background: rgba(237, 229, 216, 0.02); }

/* ---------- Preview index ---------- */
.pv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-top: 36px; }
.pv a { display: block; padding: 20px; min-height: 44px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--ink-2); text-decoration: none; transition: border-color 160ms var(--ease-out); }
.pv a:hover { border-color: var(--primary); }
.pv .n2 { font: 400 14px/1 var(--serif); color: var(--accent); }
.pv .t2 { font: 400 20px/1.25 var(--serif); margin-top: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Helpers (no inline styles: CSP forbids them) ---------- */
.d1 { --i: 1; } .d2 { --i: 2; } .d3 { --i: 3; } .d4 { --i: 4; } .d5 { --i: 5; } .d6 { --i: 6; } .d7 { --i: 7; } .d8 { --i: 8; }
.mt-s { margin-top: 16px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 44px; } .mt-xl { margin-top: 72px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.centered { justify-content: center; }
@media (max-width: 720px) { .row.between.stack-m { flex-direction: column-reverse; align-items: stretch; } .row.between.stack-m .btn { width: 100%; } }
.hidden { display: none !important; }
.err { color: var(--destructive); font-size: 14px; margin-top: 12px; }
.code-form { max-width: 560px; margin: 0 auto; }
.sign-card .h3 { margin-bottom: 4px; }
.sign-card .grid { margin-top: 20px; }
.consent { margin-top: 20px; }
.sig-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.sig-clear { appearance: none; background: none; border: 0; color: var(--muted); font: 500 14px/1 var(--sans); cursor: pointer; min-height: 44px; min-width: 56px; padding: 0 8px; border-radius: var(--r-md); }
.sig-clear:hover { color: var(--cream); }
.signed-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; text-align: left; }
@media (max-width: 480px) { .signed-doc { grid-template-columns: minmax(0, 1fr); } .signed-doc .btn { width: 100%; } }
.prov li.now .ic { animation: pulse 1.6s var(--ease-out) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(217, 146, 111, 0); } }
.left { text-align: left; }
.pill-line { display: flex; justify-content: center; }
.mt-xs { margin-top: 8px; }
.grid > .span-all { grid-column: 1 / -1; }
.field.bad input, .field.bad textarea { border-color: var(--destructive); }
.field input:disabled, .field textarea:disabled { color: var(--cream-2); opacity: 0.8; cursor: default; }
.fieldset.card { padding: clamp(20px, 3vw, 32px); }
.fieldset.card + .fieldset.card { margin-top: 20px; }

/* Arrival: the BRON mark signs, then the reveal page. Created by app.js only. */
.arrival { position: fixed; inset: 0; z-index: 100; background: #17140f; display: grid; place-items: center; opacity: 1; transition: opacity 360ms cubic-bezier(0.23, 1, 0.32, 1); }
.arrival.out { opacity: 0; pointer-events: none; }
.arrival video { width: min(100vw, 177.78vh); height: auto; max-height: 100vh; object-fit: cover; }
.arrival-enter { position: absolute; left: 50%; bottom: clamp(48px, 14vh, 140px); transform: translate(-50%, 6px); min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid rgba(250, 247, 242, 0.28); background: transparent; color: #faf7f2; font: inherit; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0; cursor: pointer; transition: opacity 250ms cubic-bezier(0.23, 1, 0.32, 1), transform 250ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms; }
.arrival-enter.on { opacity: 1; transform: translate(-50%, 0); }
.arrival-enter:hover, .arrival-enter:focus-visible { border-color: #c47f5f; outline: none; }
body.arriving .reveal-hero .rise { animation-play-state: paused; }

/* Status chips: small glyph + two or three words. Done = clay check, now = soft pulse, next = muted. */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; }
.chips.mid { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px 0 5px; border-radius: 999px; background: rgba(250, 247, 242, 0.05); border: 1px solid rgba(250, 247, 242, 0.09); color: var(--cream-2); font-size: 13px; letter-spacing: 0.005em; white-space: nowrap; }
.chip .cg { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(250, 247, 242, 0.08); color: var(--cream-2); }
.chip.done .cg { background: rgba(196, 127, 95, 0.18); color: #e0a283; }
.chip.now { color: var(--cream); border-color: rgba(196, 127, 95, 0.32); }
.chip.now .cg { background: rgba(196, 127, 95, 0.9); color: #17140f; position: relative; }
.chip.now .cg::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(196, 127, 95, 0.7); animation: ring-breathe 2.6s var(--ease-out) infinite; }
.chip.next { opacity: 0.62; }
@keyframes ring-breathe { 0% { opacity: 0.7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.7); } }
@media (prefers-reduced-motion: reduce) { .chip.now .cg { animation-duration: 4.8s; } }
/* Stack map: fixed 1 / 2 / 3 columns so six cells never leave an empty one. */
.map { grid-template-columns: 1fr; }
@media (min-width: 640px) { .map { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .map { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Proposed terms (views/terms.ts) ----------
   Radio inputs and :checked / :has() carry the whole review with no script: the segmented control, the change box that
   opens under it, the progress count (CSS counters) and the label on the send button. Where :has() is missing the
   change box is simply always open and the button says "Send my answers". Upright type only. */
.narrow.terms { max-width: calc(680px + 2 * var(--gutter)); }
html:has(.t-form) { scroll-padding-bottom: 120px; }
.terms .t-head .display { margin-top: 16px; letter-spacing: -0.012em; }
.t-meta { display: grid; gap: 4px; list-style: none; margin: 18px 0 0; padding: 0; font-size: 14px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .t-meta { display: flex; flex-wrap: wrap; gap: 6px 0; }
  .t-meta li + li::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 12px; border-radius: 50%; background: var(--faint); vertical-align: middle; }
}
.t-intro { margin: 24px 0 0; max-width: 34em; font-size: 17px; line-height: 1.6; color: var(--cream-2); text-wrap: pretty; }
.t-prev { margin: 20px 0 0; padding: 12px 16px; border-radius: var(--r-lg); background: var(--ink-4); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.55; color: var(--cream-2); }

/* Daniel's note, set as a short letter */
.t-letter { margin-top: 32px; padding: clamp(20px, 4vw, 30px); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); }
.t-letter-k { margin: 0 0 14px; font: 600 11.5px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.t-letter p:not(.t-letter-k) { margin: 0; font: 400 clamp(18px, 2.3vw, 20px)/1.6 var(--serif); color: var(--cream); text-wrap: pretty; overflow-wrap: anywhere; }
.t-letter p:not(.t-letter-k) + p { margin-top: 12px; }

/* At a glance: derived from the proposal's own headlines */
.t-glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 20px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.t-glance > div { background: var(--ink-2); padding: 14px 16px 16px; min-width: 0; }
.t-glance > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.t-glance dt { font: 600 11px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.t-glance dd { margin: 8px 0 0; font: 500 15.5px/1.35 var(--sans); letter-spacing: -0.01em; color: var(--cream); font-variant-numeric: tabular-nums; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .t-glance.tg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .t-glance.tg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .t-glance > div:last-child:nth-child(odd) { grid-column: auto; }
}

/* Group label: small, spaced, upright, with a hairline running out */
.t-group { display: flex; align-items: center; gap: 14px; margin: 44px 0 14px; font: 600 12px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.t-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* A term */
.tcard { position: relative; padding: clamp(20px, 4vw, 28px); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.22); scroll-margin-top: calc(var(--header-h) + 16px); transition: border-color 220ms var(--ease-out); }
.tcard + .tcard { margin-top: 12px; }
.tcard.bad { border-color: rgba(229, 101, 78, 0.55); }
.tc-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.tc-group { font: 600 11px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tc-title { margin: 0; font: 600 clamp(20px, 2.8vw, 23px)/1.25 var(--sans); letter-spacing: -0.02em; color: var(--cream); text-wrap: balance; overflow-wrap: anywhere; }
.tc-headline { margin: 8px 0 0; font: 500 17px/1.45 var(--sans); letter-spacing: -0.005em; color: var(--accent); font-variant-numeric: tabular-nums; text-wrap: pretty; overflow-wrap: anywhere; }
.tc-body { margin-top: 14px; }
.tc-body p { margin: 0; font-size: 16.5px; line-height: 1.65; color: var(--cream-2); text-wrap: pretty; overflow-wrap: anywhere; }
.tc-body p + p { margin-top: 12px; }
.tc-points { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.tc-points li { position: relative; padding-left: 20px; font-size: 16px; line-height: 1.55; color: var(--cream-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tc-points li::before { content: ""; position: absolute; left: 3px; top: 0.66em; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.tc-example { margin: 18px 0 0; padding: 14px 16px 16px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent-bg) 72%, var(--ink-2)); border: 1px solid rgba(232, 168, 126, 0.16); font-variant-numeric: tabular-nums; }
.tc-example-k { margin: 0 0 8px; font: 600 11px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tc-example p:not(.tc-example-k) { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--cream); overflow-wrap: anywhere; }
.tc-example p:not(.tc-example-k) + p { margin-top: 8px; }
.tc-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; }
.tc-docs-k { font-size: 12.5px; color: var(--faint); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tc-chips li { padding: 5px 10px; border-radius: 999px; background: var(--ink-4); border: 1px solid var(--line); font: 500 12px/1.2 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.tcard.compact .tc-title { font-size: 18px; }
.tc-result { margin-top: 12px; }
.tc-quote { margin-top: 12px; padding: 2px 0 2px 16px; border-left: 2px solid var(--primary); }
.tc-quote p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--cream); overflow-wrap: anywhere; }
.tc-quote p + p { margin-top: 8px; }

/* Your answer: a segmented control (44px+ targets) and the change box that opens under it */
.tc-ans { border: 0; margin: 22px 0 0; padding: 20px 0 0; min-width: 0; border-top: 1px solid var(--line); }
.tc-seg { display: grid; grid-template-columns: 2fr 3fr; gap: 2px; padding: 3px; background: var(--ink-4); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tc-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.tc-seg label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 6px 10px; border-radius: calc(var(--r-lg) - 3px); font: 500 15px/1.2 var(--sans); text-align: center; color: var(--muted); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 120ms var(--ease-out); }
.tc-seg label:hover { color: var(--cream); }
.tc-seg label:active { transform: scale(0.98); }
.tc-seg input:checked + label { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.tc-seg .a:checked + label { background: var(--cream); color: var(--ink); }
.tc-seg .a:checked + label::before { content: ""; width: 10px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.tc-seg .c:checked + label { background: var(--accent-bg); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(232, 168, 126, 0.5); }
.tc-seg input:focus-visible + label { outline: 2px solid var(--ring); outline-offset: 2px; }
.tc-change { display: grid; grid-template-rows: 1fr; margin-top: 14px; }
.tc-change-in { min-height: 0; padding: 4px; margin: -4px; overflow: hidden; }
@supports selector(:has(*)) {
  .tc-ans:not(:has(.c:checked)) .tc-change { grid-template-rows: 0fr; margin-top: 0; visibility: hidden; transition: grid-template-rows 260ms var(--ease-out), margin-top 260ms var(--ease-out), visibility 0s linear 260ms; }
  .tc-ans:has(.c:checked) .tc-change { transition: grid-template-rows 260ms var(--ease-out), margin-top 260ms var(--ease-out), visibility 0s; }
  .tcard:has(.tc-seg .a:checked) { border-color: rgba(147, 180, 158, 0.34); }
  .tcard:has(.tc-seg .c:checked) { border-color: rgba(232, 168, 126, 0.42); }
  .tcard.bad:has(.tc-seg input) { border-color: rgba(229, 101, 78, 0.55); }
}

/* Fields: a visible label above, a hint, the input, an inline error; all linked by aria-describedby */
.q-label { display: block; margin: 0 0 4px; padding: 0; font: 600 16px/1.4 var(--sans); letter-spacing: -0.005em; color: var(--cream); }
.q-opt { font-weight: 400; font-size: 13px; color: var(--faint); margin-left: 4px; }
.q-hint { display: block; margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.q-in { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--line) 30%, var(--ink)); border: 1px solid var(--line-2); color: var(--cream); font: 400 16px/1.5 var(--sans); appearance: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
textarea.q-in { min-height: 112px; resize: vertical; }
.q-in:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.q-in[aria-invalid="true"] { border-color: var(--destructive); }
input[type="date"].q-in { min-width: 0; max-width: 100%; }
.q-err { display: flex; gap: 8px; margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--destructive); }
.q-err::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid currentColor; font: 700 11px/15px var(--sans); text-align: center; }

/* The questions */
.tq { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 0 clamp(20px, 4vw, 28px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.22); }
.tq-item { display: block; border: 0; margin: 0; min-width: 0; padding: 24px 0; }
.tq-item + .tq-item { border-top: 1px solid var(--line); }
.tq-choice .q-label { float: left; width: 100%; }
.tq-choice .q-hint, .tq-choice .tq-opts { clear: both; }
.tq-opts { display: grid; gap: 8px; margin-top: 4px; }
.tq-opt { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: color-mix(in srgb, var(--line) 30%, var(--ink)); color: var(--cream-2); font-size: 16px; line-height: 1.4; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.tq-opt:hover { border-color: var(--faint); }
.tq-opt input { appearance: none; flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 0; border-radius: 50%; border: 1.5px solid var(--faint); background: transparent; cursor: pointer; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.tq-opt input::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-ink); transform: scale(0); transition: transform 160ms var(--ease-out); }
.tq-opt input:checked { background: var(--primary); border-color: var(--primary); }
.tq-opt input:checked::after { transform: scale(1); }
.tq-opt input:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
@supports selector(:has(*)) { .tq-opt:has(input:checked) { border-color: var(--primary); background: var(--accent-bg); color: var(--cream); } }

/* Errors: a summary at the top, each message again beside its field */
.t-alert { margin-top: 24px; padding: 16px 18px; border-radius: var(--r-lg); background: rgba(229, 101, 78, 0.08); border: 1px solid rgba(229, 101, 78, 0.45); }
.t-alert-t { margin: 0; font: 600 15.5px/1.4 var(--sans); color: var(--cream); }
.t-alert ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; font-size: 14.5px; line-height: 1.45; }
.t-alert a { display: block; padding: 8px 0; color: var(--cream-2); text-decoration: none; border-top: 1px solid rgba(229, 101, 78, 0.22); }
.t-alert li:first-child a { border-top: 0; }
.t-alert a:hover { color: var(--cream); }

/* Closing line and the sticky bar */
.t-fine { margin: 24px 4px 0; font-size: 13.5px; line-height: 1.55; color: var(--faint); max-width: 36em; }
.t-bar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 10px 10px 10px 18px; border-radius: 18px; background: rgba(32, 26, 20, 0.86); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.05) inset; }
.t-prog { display: grid; gap: 3px; flex: none; line-height: 1; font-variant-numeric: tabular-nums; }
.t-prog-n { font: 600 20px/1 var(--sans); letter-spacing: -0.02em; color: var(--cream); }
.t-prog > span { font-size: 12px; color: var(--muted); }
.t-count { display: none; }
.t-send { flex: 1; min-width: 0; height: auto; min-height: 48px; padding: 8px 18px; line-height: 1.2; text-align: center; }
.t-send .la, .t-send .ld, .t-send .lp { display: none; }
@supports selector(:has(*)) {
  .t-form { counter-reset: tdone 0 tleft 0; }
  .t-form .tcard:has(.tc-seg input:checked) { counter-increment: tdone; }
  .t-form .tcard:not(:has(.tc-seg input:checked)) { counter-increment: tleft; }
  .t-static { display: none; }
  .t-count { display: inline; }
  .t-count::before { content: counter(tdone); }
}
/* "Accept all and continue" only when no term is left unanswered and none is a change; a counter style picks the words,
   so the label can never say it ahead of the facts. Browsers without both features keep "Send my answers". */
@counter-style t-label-all { system: cyclic; symbols: "Accept all and continue"; range: 0 0; fallback: t-label-some; }
@counter-style t-label-some { system: cyclic; symbols: "Send my answers"; }
@supports selector(:has(*)) and (text-wrap: balance) {
  .t-send .ls { display: none; }
  .t-send .la { display: inline; }
  .t-send .la::before { content: counter(tleft, t-label-all); }
  .t-form:has(.tc-seg .c:checked) .t-send .la { display: none; }
  .t-form:has(.tc-seg .c:checked) .t-send .ld { display: inline; }
  /* While any term is unanswered (both radios of a seg unchecked), the button reads as progress, "3 of 10 answered",
     and sits quiet; it only becomes the send once the last term is answered. CSS-only, so the no-JS path agrees. */
  .t-form:has(.tc-seg .a:not(:checked) ~ .c:not(:checked)) .t-send .la,
  .t-form:has(.tc-seg .a:not(:checked) ~ .c:not(:checked)) .t-send .ld { display: none; }
  .t-form:has(.tc-seg .a:not(:checked) ~ .c:not(:checked)) .t-send .lp { display: inline; }
  .t-form:has(.tc-seg .a:not(:checked) ~ .c:not(:checked)) .t-send { background: var(--ink-3); color: var(--cream-2); box-shadow: inset 0 0 0 1px var(--line-2); }
  .t-send .lpn::before { content: counter(tdone); }
}
.t-tot { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* Lapsed, and the read-only pages */
.t-quiet { margin-top: 32px; padding: clamp(22px, 4vw, 32px); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); }
.t-quiet p { margin: 0; font-size: 16.5px; line-height: 1.65; color: var(--cream-2); max-width: 34em; text-wrap: pretty; }
.t-quiet .t-quiet-t { margin-bottom: 8px; font: 600 19px/1.3 var(--sans); letter-spacing: -0.015em; color: var(--cream); }
.t-status { margin-top: 32px; padding: clamp(20px, 3vw, 28px); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); }
.t-dl { margin: 0; padding: 0 clamp(20px, 4vw, 28px); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-xl); }
.t-dl > div { padding: 18px 0; }
.t-dl > div + div { border-top: 1px solid var(--line); }
.t-dl dt { font-size: 14px; line-height: 1.45; color: var(--muted); }
.t-dl dd { margin: 4px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--cream); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.t-status li { grid-template-columns: 34px minmax(0, 1fr); }

/* Desktop: the column opens up. Each term reads on the left with its answer held beside it, sticky while the term
   scrolls; on phones and tablets everything above stays one column. */
@media (min-width: 1080px) {
  .narrow { max-width: calc(860px + 2 * var(--gutter)); }
  .narrow.terms { max-width: calc(1080px + 2 * var(--gutter)); }
  .t-head .display { max-width: 18em; }
  .t-letter p:not(.t-letter-k) { max-width: 38em; }
  .tcard:has(> .tc-ans) { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 48px; align-items: start; padding: 36px 40px; }
  .tcard:has(> .tc-ans) > :not(.tc-ans) { grid-column: 1; }
  .tcard:has(> .tc-ans) .tc-body, .tcard:has(> .tc-ans) .tc-points { max-width: 38em; }
  .tcard > .tc-ans { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: calc(var(--header-h) + 24px); margin: 0; padding: 0 0 0 40px; border-top: 0; border-left: 1px solid var(--line); }
  .tq { padding: 0 40px; }
  .tq-opts { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .tq-item .q-in:not(textarea) { max-width: 520px; }
  .t-bar { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* ---------- What happens next: a copper thread, drawn once, with each beat landing on it in turn ---------- */
.nx { --step: 130ms; }
.nx-list { list-style: none; margin: 6px 0 0; padding: 0 0 0 34px; position: relative; }
.nx-list::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 18px; width: 1px; transform-origin: 50% 0;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(232, 168, 126, 0.45) 62%, rgba(232, 168, 126, 0) 100%); }
.nx-beat { position: relative; padding: 0 0 30px; }
.nx-beat:last-child { padding-bottom: 4px; }
.nx-dot { position: absolute; left: -34px; top: 5px; width: 13px; height: 13px; border-radius: 50%; background: #18140f;
  border: 1px solid rgba(232, 168, 126, 0.75); box-shadow: 0 0 0 5px rgba(232, 168, 126, 0.06); }
.nx-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.nx-beat:first-child .nx-dot { box-shadow: 0 0 0 5px rgba(232, 168, 126, 0.1), 0 0 18px rgba(232, 168, 126, 0.35); }
.nx-when { font: 600 11px/1.35 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-variant-numeric: tabular-nums; }
.nx-when span { display: inline; white-space: nowrap; }
.nx-when span + span::before { content: " · "; color: rgba(232, 168, 126, 0.55); }
.nx-t { margin-top: 7px; font: 400 23px/1.22 var(--serif); letter-spacing: -0.01em; color: var(--cream); text-wrap: balance; }
.nx-b { margin: 7px 0 0; max-width: 60ch; font-size: 15px; line-height: 1.62; color: var(--cream-2); text-wrap: pretty; }
@media (min-width: 1080px) {
  .nx-list { padding-left: 0; }
  .nx-list::before { left: 206px; }
  .nx-beat { display: grid; grid-template-columns: 176px 1fr; column-gap: 54px; }
  .nx-when { grid-row: 1 / span 2; text-align: right; padding-top: 7px; text-wrap: balance; }
  .nx-when span { display: block; white-space: normal; }
  .nx-when span + span::before { content: none; }
  .nx-when span + span { color: rgba(232, 168, 126, 0.78); font-weight: 500; margin-top: 2px; }
  .nx-dot { left: 200px; top: 9px; }
  .nx-t { margin-top: 0; }
}
/* The motion: only when app.js has marked it ".pre" (motion allowed); it plays as it comes into view. */
.nx.pre .nx-list::before { transform: scaleY(0); }
.nx.pre .nx-beat { opacity: 0; transform: translateY(12px); }
.nx.pre .nx-dot { opacity: 0; transform: scale(0.6); }
.nx.pre.in .nx-list::before { transform: scaleY(1); transition: transform calc(var(--n, 4) * var(--step) + 520ms) var(--ease-in-out) 60ms; }
.nx.pre.in .nx-beat { opacity: 1; transform: none; transition: opacity 520ms var(--ease-out), transform 680ms var(--ease-out);
  transition-delay: calc(var(--i) * var(--step) + 180ms); }
.nx.pre.in .nx-dot { opacity: 1; transform: none; transition: opacity 220ms var(--ease-out), transform 560ms var(--ease-back);
  transition-delay: calc(var(--i) * var(--step) + 140ms); }
/* The landing ring: a pseudo-element that scales and fades (transform + opacity only, never a shadow repaint) */
.nx-dot::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; transform: scale(1); }
.nx.pre.in .nx-dot::before { animation: nx-ring 1100ms var(--ease-out) calc(var(--i) * var(--step) + 200ms) 1 backwards; }
@keyframes nx-ring { 0% { opacity: 0.6; transform: scale(0.9); } 100% { opacity: 0; transform: scale(2.6); } }

/* ---------- Page transitions: the chrome stays, the page crossfades and rises (cross-document view transitions, where supported) ---------- */
@view-transition { navigation: auto; }
.top { view-transition-name: bron-top; }
.rail { view-transition-name: bron-rail; }
::view-transition-old(root) { animation: 120ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 280ms var(--ease-out) both vt-in; }
::view-transition-group(bron-top), ::view-transition-group(bron-rail) { animation-duration: 0s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Desktop: more air between 1280 and 1680 ---------- */
@media (min-width: 1280px) {
  :root { --max: 1200px; --gutter: clamp(40px, 5vw, 72px); }
  .stage { padding-top: clamp(64px, 10vh, 120px); }
  .letter { max-width: 760px; }
  .letter p { font-size: 21px; }
}

/* ---------- Progressive disclosure on the terms (app.js; without it every card is open, as before) ----------
   One term in focus; the ones ahead are quiet until he gets there and brighten under the pointer; an accepted term
   settles into its title and headline. Hover and focus always restore a card, so nothing is trapped. */
.tc-detail { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 280ms var(--ease-out); }
.tc-detail-in { min-height: 0; overflow: hidden; transition: opacity 240ms var(--ease-out) 60ms; }
.tc-detail-in > :first-child { margin-top: 14px; }
.tcard.settled .tc-detail { grid-template-rows: 0fr; }
.tcard.settled .tc-detail-in { opacity: 0; transition-delay: 0s; visibility: hidden; }
.tcard.settled { background: color-mix(in srgb, var(--ink-2) 82%, var(--ink)); }
.tcard.settled .tc-title { font-size: 19px; }
.tcard.settled .tc-headline { font-size: 15.5px; color: var(--cream-2); }
.tcard.settled .tc-ans { margin-top: 14px; padding-top: 14px; }
.tcard.ahead { opacity: 0.58; transition: opacity 320ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tcard.ahead:hover { opacity: 1; } }
.tcard.ahead:focus-within { opacity: 1; }
.tcard.focus { border-color: rgba(232, 168, 126, 0.38); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(217, 146, 111, 0.07), 0 24px 60px -36px rgba(0, 0, 0, 0.8); }
.tcard.just-settled::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1.5px solid var(--ok); pointer-events: none; animation: tc-ring 760ms var(--ease-out) 1 both; }
@keyframes tc-ring { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.012); } }
.tc-open { appearance: none; background: none; border: 0; padding: 0; margin: 10px 0 0; font: 500 13.5px/1 var(--sans); color: var(--muted); cursor: pointer; min-height: 32px; display: none; align-items: center; gap: 6px; border-radius: var(--r-sm); }
.tc-open::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform 200ms var(--ease-out); }
.tc-open:hover { color: var(--cream); }
.tcard.settled .tc-open, .tcard[data-open="1"] .tc-open { display: inline-flex; }
.tcard[data-open="1"] .tc-open::before { transform: rotate(225deg) translate(-2px, -1px); }
/* The check draws in when a term is accepted */
.tc-seg .a:checked + label::before { animation: tc-check 340ms var(--ease-back) backwards; }
@keyframes tc-check { from { opacity: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0.6); } }
/* Progress under the count: a hairline that fills (app.js sets the scale) */
.t-meter { display: block; width: 92px; height: 2px; margin-top: 6px; border-radius: 99px; background: rgba(250, 247, 242, 0.1); overflow: hidden; }
.t-meter i { display: block; height: 100%; width: 100%; background: var(--primary); transform: scaleX(0); transform-origin: 0 50%; transition: transform 420ms var(--ease-out); }
.t-prog.done .t-prog-n { color: var(--ok); }
.t-prog.done .t-meter i { background: var(--ok); }
.t-next { display: none; }
@media (min-width: 640px) { .t-bar:has(.t-next:not(:empty)) .t-next { display: block; flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .t-bar:has(.t-next:not(:empty)) .t-send { flex: 0 0 auto; } }
.t-next b { font-weight: 500; color: var(--cream-2); }

/* ---------- Open until: the exact close, set quietly ---------- */
.t-until { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink-2); font-size: 13.5px; color: var(--cream-2); font-variant-numeric: tabular-nums; }
.t-until::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(217, 146, 111, 0.14); }

/* ---------- The moment of signing ---------- */
.sigbox .seal-line { position: absolute; left: 24px; right: 24px; bottom: 34px; height: 2px; background: var(--clay); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; }
.sigbox .typed:not(:empty) { animation: sig-ink 420ms var(--ease-out) backwards; }
@keyframes sig-ink { from { opacity: 0; transform: translateY(6px); } }
.sigbox .draw-hint { position: absolute; left: 0; right: 0; bottom: 56px; text-align: center; font: 400 15px/1 var(--sans); color: #b4a68f; pointer-events: none; opacity: 0; transition: opacity 200ms var(--ease-out); }
.sigbox[data-mode="draw"]:not(.inked) .draw-hint { opacity: 1; }
.sigbox[data-mode="draw"] .x, .sigbox[data-mode="draw"] .typed { opacity: 0; }
.sign-card.signing .sigbox .seal-line { opacity: 1; transform: scaleX(1); transition: transform 520ms var(--ease-in-out), opacity 120ms linear; }
.sign-card.signing .sigbox .typed, .sign-card.signing .sigbox canvas { animation: sig-settle 600ms var(--ease-out) both; }
@keyframes sig-settle { 0% { transform: scale(1); } 40% { transform: scale(0.985); } 100% { transform: scale(1); } }
.sigbox::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px rgba(197, 106, 78, 0.45); opacity: 0; pointer-events: none; transition: opacity 360ms var(--ease-out); }
.sign-card.signing .sigbox::after { opacity: 1; }
.sign-card.signing .seg, .sign-card.signing .sig-clear { pointer-events: none; opacity: 0.5; transition: opacity 200ms var(--ease-out); }
.doc-read { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 24px; }
.doc-read .cg { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); color: transparent; transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out), color 240ms var(--ease-out); }
.doc-read.end { color: var(--cream-2); }
.doc-read.end .cg { background: var(--ok); border-color: var(--ok); color: var(--ink); }
.doc-read.end .cg svg { animation: tc-check 320ms var(--ease-out) backwards; }

/* ---------- Documents readying: three sheets being written, while Daniel prepares them ---------- */
.readying { display: flex; justify-content: center; align-items: flex-end; gap: 0; height: 96px; margin: 0 auto 28px; }
.readying .sheet { position: relative; width: 58px; height: 74px; border-radius: 5px; background: var(--paper); border: 1px solid var(--paper-line); box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.8); padding: 14px 10px 0; display: grid; align-content: start; gap: 6px; transform-origin: 50% 100%; animation: sheet-rise 800ms var(--ease-out) backwards; }
.readying .sheet:nth-child(1) { transform: rotate(-9deg) translate(8px, 4px); animation-delay: 120ms; z-index: 1; }
.readying .sheet:nth-child(2) { transform: translateY(-6px); animation-delay: 260ms; z-index: 2; }
.readying .sheet:nth-child(3) { transform: rotate(9deg) translate(-8px, 4px); animation-delay: 400ms; z-index: 1; }
@keyframes sheet-rise { from { opacity: 0; translate: 0 18px; } }
.readying .sheet i { display: block; height: 2px; border-radius: 2px; background: #d8ccb8; transform: scaleX(0); transform-origin: 0 50%; animation: write 3.6s var(--ease-in-out) infinite; }
.readying .sheet i:nth-child(2) { width: 78%; animation-delay: 300ms; }
.readying .sheet i:nth-child(3) { width: 88%; animation-delay: 600ms; }
.readying .sheet i:nth-child(4) { width: 60%; animation-delay: 900ms; }
.readying .sheet:nth-child(2) i { animation-delay: calc(var(--d, 0ms) + 1200ms); }
.readying .sheet:nth-child(3) i { animation-delay: calc(var(--d, 0ms) + 2400ms); }
.readying .sheet i:nth-child(2) { --d: 300ms; } .readying .sheet i:nth-child(3) { --d: 600ms; } .readying .sheet i:nth-child(4) { --d: 900ms; }
.readying .sheet:nth-child(1) i { animation-delay: var(--d, 0ms); }
.readying .sheet i:last-child { background: var(--clay); width: 34%; }
@keyframes write { 0% { transform: scaleX(0); } 22%, 78% { transform: scaleX(1); } 92%, 100% { transform: scaleX(0); transform-origin: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .readying .sheet { animation: none; } .readying .sheet i { animation: none; transform: none; } }

/* ---------- Countersigned: the seal closes, then the signed set ---------- */
.seal { position: relative; width: 96px; height: 96px; margin: 0 auto 28px; display: grid; place-items: center; }
.seal svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--clay-dark); }
.seal .ring circle { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50% 50%; }
.seal .ring .halo { stroke-width: 0.6; opacity: 0.35; }
.seal .mark { position: relative; }
.seal.draw .ring circle { animation: ring-draw 1100ms var(--ease-in-out) backwards; }
.seal.draw .ring .halo { animation-delay: 160ms; animation-duration: 1300ms; }
.seal.draw .mark.draw .t0 { animation-delay: .75s; } .seal.draw .mark.draw .t1 { animation-delay: 1.033s; } .seal.draw .mark.draw .t2 { animation-delay: 1.382s; }
@keyframes ring-draw { from { stroke-dashoffset: 1; } }
.signed-set { margin-top: 36px; text-align: left; }
.btn.sm { --h: 38px; min-height: 38px; padding: 0 16px; font-size: 13.5px; gap: 6px; }
.docrow:has(> .dl) { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
.docrow.quiet { background: color-mix(in srgb, var(--ink-2) 70%, var(--ink)); border-style: dashed; }
.docrow.quiet .dicon { background: transparent; border-style: dashed; }
@media (max-width: 480px) { .docrow:has(> .dl) { grid-template-columns: 44px minmax(0, 1fr); } .docrow > .dl { grid-column: 2; justify-self: start; } }
.signed-set .docrow { grid-template-columns: 44px minmax(0, 1fr) auto; }
.signed-set .docrow .btn { justify-self: end; }
.signed-set .docrow.rise { animation-delay: calc(var(--i, 0) * 90ms + 900ms); }
@media (max-width: 480px) { .signed-set .docrow { grid-template-columns: 40px minmax(0, 1fr); } .signed-set .docrow .btn { grid-column: 2; justify-self: start; } }
.n1 { --n: 1; } .n2 { --n: 2; } .n3 { --n: 3; } .n4 { --n: 4; } .n5 { --n: 5; } .n6 { --n: 6; } .n7 { --n: 7; } .n8 { --n: 8; } .n9 { --n: 9; } .n10 { --n: 10; }
.d0 { --i: 0; } .d9 { --i: 9; } .d10 { --i: 10; }

@media (prefers-reduced-motion: reduce) {
  .tc-detail, .tc-detail-in, .tcard.ahead, .t-meter i { transition: none; }
  .tcard.just-settled, .tc-seg .a:checked + label::before, .sigbox .typed:not(:empty), .sign-card.signing .sigbox .typed, .sign-card.signing .sigbox canvas, .doc-read.end .cg svg, .seal.draw .ring circle { animation: none; }
  .sign-card.signing .sigbox .seal-line { transition: opacity 120ms linear; }
  .signed-set .docrow.rise { animation: none; }
  .chip.now .cg::after, .rail li.now .n::after, .rail li.done .n svg, .rail-m .bars span.now, .tcard.just-settled::after, .nx-dot::before { animation: none; }
  .nx.pre.in .nx-beat, .nx.pre.in .nx-dot, .nx.pre.in .nx-list::before { transition-duration: 1ms; transition-delay: 0s; }
}

/* ---------- Header link to the hire's updates (src/updates.ts) ---------- */
.top-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top-link { font-size: 13px; color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.top-link:hover, .top-link:focus-visible { color: var(--primary); }
.top-link .count { font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); }
.updates { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; text-align: left; }
.updates .u-when { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.updates .u-title { margin: 6px 0 10px; }
.updates .u-body p { margin: 0 0 10px; }
.updates .u-body p:last-child { margin-bottom: 0; }
.updates .u-new { margin-left: 8px; }
@media (max-width: 520px) { .top-right { gap: 12px; } .top-right .top-meta .who { max-width: 34vw; } }

/* Code review page (views/screens.ts review) */
.rv-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.rv-list li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.6; color: var(--cream-2); }
.rv-list li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); opacity: 0.85; }
.rv-stop { padding-top: clamp(48px, 8vh, 88px); }
.rv-files { margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rv-files > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px 28px; padding: 18px 22px; }
.rv-files > div + div { border-top: 1px solid var(--line); }
.rv-files code { font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }
.rv-files p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--cream-2); overflow-wrap: anywhere; }
@media (max-width: 720px) { .rv-files > div { grid-template-columns: 1fr; padding: 16px 18px; } }
