/* ═══════════════════════════════════════════════════════════════════════
   Landing site — the app's own material: vellum on midnight, gilt hairlines,
   carmine rubric. Tokens follow pocus-app/docs/DESIGN_SYSTEM_v2.md §(b);
   the light scheme is the same page printed on vellum (inks darkened to keep
   every text pair at or above 4.5:1). Literal hex/rgba only, no color-mix().
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg:        #0B1330;
  --bg-deep:   #060A1C;
  --glow-top:  #17224F;
  --leaf:      #121B3F;
  --leaf-2:    #18234F;
  --text:      #F1E7CF;
  --text-2:    rgba(241,231,207,.72);
  --text-3:    rgba(241,231,207,.55);
  --gilt:      #C9A55A;   /* gold TEXT and rules on midnight (7.8:1) */
  --gilt-rule: #C9A55A;
  --gilt-bright: #EFD9A0;
  --gilt-ink:  #1B1406;   /* text on the gold button */
  --line:        rgba(201,165,90,.22);
  --line-strong: rgba(201,165,90,.48);
  --line-faint:  rgba(201,165,90,.12);
  --gilt-tint:   rgba(201,165,90,.14);
  --gilt-wash:   rgba(201,165,90,.06);
  --rubric:     #E8607C;
  --rubric-ink: #C4405C;
  --beam:       #7FC4FF;
  --beam-tint:  rgba(127,196,255,.14);
  --ember:      #F0705F;
  --m-aaa:   #F0665A;
  --m-efast: #F2994A;
  --m-fels:  #63C77A;
  --m-lung:  #B39BFF;
  --m-proc:  #4FC8BE;
  --edge-leaf: inset 0 1px 0 rgba(239,217,160,.10), 0 1px 0 rgba(0,0,0,.35);
  --edge-gold: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.18), 0 8px 24px rgba(201,165,90,.22);
  --grain-opacity: .06;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Alegreya Sans', 'Gill Sans', 'Segoe UI', system-ui, sans-serif;
  --sc:    'Alegreya Sans SC', 'Alegreya Sans', 'Gill Sans', system-ui, sans-serif;
  --gutter: 20px;
  --r-1: 6px;
  --r-2: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg:        #F3EAD3;
    --bg-deep:   #E9DDBF;
    --glow-top:  #FBF5E6;
    --leaf:      #FBF5E6;
    --leaf-2:    #FFFDF6;
    --text:      #1B1406;
    --text-2:    rgba(27,20,6,.74);
    --text-3:    rgba(27,20,6,.66);
    --gilt:      #6E5322;   /* gold text on vellum (5.9:1) */
    --gilt-rule: #B08D45;
    --gilt-bright: #5E4419;   /* link hover on vellum (7.5:1) */
    --line:        rgba(110,83,34,.30);
    --line-strong: rgba(110,83,34,.55);
    --line-faint:  rgba(110,83,34,.14);
    --gilt-tint:   rgba(201,165,90,.22);
    --gilt-wash:   rgba(201,165,90,.14);
    --rubric:     #B4304C;
    --rubric-ink: #B4304C;
    --beam:       #17609F;
    --beam-tint:  rgba(23,96,159,.10);
    --ember:      #B93C2C;
    --m-aaa:   #B0362B;
    --m-efast: #8F5210;
    --m-fels:  #1F6F35;
    --m-lung:  #5B42B0;
    --m-proc:  #176E67;
    --edge-leaf: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 0 rgba(110,83,34,.18);
    --edge-gold: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.18), 0 6px 18px rgba(110,83,34,.22);
    --grain-opacity: .05;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(640px 420px at 50% -140px, var(--glow-top), var(--bg) 62%) no-repeat, var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 .5 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.55'/></svg>");
}
body > * { position: relative; z-index: 1; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--gilt); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--gilt-bright); }
:focus-visible { outline: 2px solid var(--beam); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--leaf); color: var(--text); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-1); }
.skip:focus { left: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), 1080px); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums lining-nums; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: .3em 0; }
strong, b { font-weight: 700; }
em { font-style: italic; }
hr.rule, .rule { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--gilt-rule) 18%, var(--gilt-rule) 82%, transparent); opacity: .7; }

/* ── Type ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.08; margin: 0 0 .4em; letter-spacing: -.005em; }
h1 { font-size: clamp(42px, 9vw, 66px); }
h2 { font-size: clamp(31px, 5vw, 42px); }
h3 { font-size: 25px; line-height: 1.15; }
h4 { font-size: 21px; }
.kicker { display: block; font: 700 12px/1.2 var(--sc); letter-spacing: .2em; color: var(--gilt); margin-bottom: 14px; }
.kicker.rubric { color: var(--rubric); }
.kicker.beam { color: var(--beam); }
.voice { font: italic 600 clamp(20px, 2.4vw, 24px)/1.4 var(--serif); color: var(--text); }
.lead { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--text-2); max-width: 36em; }
.muted { color: var(--text-2); }
.hint { font: italic 400 15px/1.45 var(--sans); color: var(--text-2); }
.roman { font: 600 22px/1 var(--serif); letter-spacing: .3em; color: var(--gilt); }

/* ── Header ───────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font: italic 600 23px/1 var(--serif); }
.nav { display: flex; align-items: center; gap: 4px 18px; }
.nav a { font: 700 12.5px/1 var(--sc); letter-spacing: .14em; text-decoration: none; color: var(--gilt); padding: 14px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--gilt-bright); }
.nav .sm-hide { display: none; }
@media (min-width: 720px) { .nav .sm-hide { display: inline-flex; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
.btn-gold {
  min-height: 56px; padding: 10px 30px; border-radius: var(--r-2);
  background: linear-gradient(180deg, #EFD9A0 0%, #C9A55A 55%, #B8944B 100%);
  color: var(--gilt-ink); box-shadow: var(--edge-gold);
  font: italic 600 22px/1 var(--serif);
}
.btn-gold small { font: 700 11px/1 var(--sc); letter-spacing: .2em; margin-top: 6px; color: var(--gilt-ink); }
.btn-gold:hover { color: var(--gilt-ink); filter: brightness(1.04); }
.btn-gold:active { transform: translateY(1px); }
.btn-ghost {
  min-height: 48px; padding: 0 22px; border-radius: var(--r-2);
  border: 1px solid var(--line-strong); background: transparent; color: var(--gilt);
  font: 700 12.5px/1 var(--sc); letter-spacing: .14em;
}
.btn-ghost:hover { background: var(--gilt-wash); color: var(--gilt-bright); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; }
.cta-row .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .cta-row .btn { flex: 0 0 auto; } }

/* ── Leaf ─────────────────────────────────────────────────────────────── */
.leaf { position: relative; background: var(--leaf); border: 1px solid var(--line); border-radius: var(--r-2); padding: 20px 20px 18px; box-shadow: var(--edge-leaf); }
.leaf::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--line-faint); border-radius: 7px; pointer-events: none; }
.leaf > :last-child { margin-bottom: 0; }
.leaf.rubric-rule { border-left: 2px solid var(--rubric-ink); }
.leaf.beam-rule { border-left: 2px solid var(--beam); }
.leaf.gilt-rule { border-left: 2px solid var(--gilt-rule); }

/* ── Sections ─────────────────────────────────────────────────────────── */
section { padding: 52px 0; }
.section-head { max-width: 42em; margin-bottom: 28px; }
.section-head p { color: var(--text-2); font-size: 18px; }
@media (min-width: 900px) { section { padding: 84px 0; } .section-head { margin-bottom: 36px; } }

/* Hero */
.hero { padding: 28px 0 56px; }
.hero-grid { display: grid; gap: 22px; align-items: center; }
.hero-mark { width: 120px; height: 120px; border-radius: 26px; box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0,0,0,.35); }
.hero h1 { margin-top: 4px; }
.hero .lead { margin: 12px 0 26px; }
@media (min-width: 900px) {
  .hero { padding: 48px 0 84px; }
  .hero-grid { grid-template-columns: 1.2fr .8fr; gap: 48px; }
  .hero-mark { order: 2; width: 300px; height: 300px; border-radius: 66px; justify-self: end; }
}
@media (prefers-color-scheme: light) { .hero-mark { box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(110,83,34,.28); } }

/* Steps */
.steps { display: grid; gap: 14px; }
.step .roman { display: block; margin-bottom: 12px; }
.step h3 { margin-bottom: .45em; }
.step p { color: var(--text-2); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

/* Rules figure + table */
.rules { display: grid; gap: 26px; margin-top: 30px; align-items: center; }
.rules > * { min-width: 0; }
@media (min-width: 900px) { .rules { grid-template-columns: 1.1fr .9fr; gap: 40px; margin-top: 44px; } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--leaf); box-shadow: var(--edge-leaf); }
table { border-collapse: collapse; width: 100%; min-width: 700px; font-size: 15.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 11.5px/1.2 var(--sc); letter-spacing: .14em; color: var(--gilt); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-weight: 500; }
td.mod { font-weight: 500; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; background: currentColor; }
.aaa { color: var(--m-aaa); } .efast { color: var(--m-efast); } .fels { color: var(--m-fels); } .lung { color: var(--m-lung); } .proc { color: var(--m-proc); }
.table-note { margin-top: 12px; }

figure { margin: 0; }
.orrery { display: grid; justify-items: center; gap: 14px; }
.orrery svg { width: min(100%, 320px); height: auto; }
.orrery .orbit { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.orrery .tick { stroke: var(--line-strong); stroke-width: 1; }
.orrery .arc { fill: none; stroke-width: 4; stroke-linecap: round; }
.orrery .hub { fill: var(--leaf); stroke: var(--gilt-rule); stroke-width: 2; }
.orrery .hub2 { fill: none; stroke: var(--gilt-rule); stroke-width: 1.2; stroke-dasharray: 3 5; }
.orrery .hub-num { font: 700 30px var(--serif); fill: var(--gilt); }
.orrery .hub-lab { font: 700 10.5px var(--sc); letter-spacing: .18em; fill: var(--gilt); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; font-weight: 500; }
.legend li { display: inline-flex; align-items: center; }
figcaption { text-align: center; font: italic 400 15px/1.45 var(--sans); color: var(--text-2); max-width: 30em; }

/* Departments */
.dept { display: grid; gap: 14px; }
.dept .leaf { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.dept svg { width: 30px; height: 30px; stroke: var(--gilt); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-top: 4px; }
.dept h3 { font-size: 23px; margin-bottom: .35em; }
.dept p { color: var(--text-2); }
@media (min-width: 900px) { .dept { grid-template-columns: repeat(3, 1fr); gap: 18px; } .dept .leaf { grid-template-columns: 1fr; } }
.dept-foot { margin-top: 26px; }
.dept-foot .voice { display: block; margin-bottom: 18px; max-width: 30em; }

/* Privacy */
.split { display: grid; gap: 14px; }
.split .leaf ul { margin: 0; padding-left: 1.15em; }
.split .leaf li { margin: .35em 0; }
@media (min-width: 900px) { .split { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.facts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.facts b { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.15; }
.facts span { color: var(--text-2); }
@media (min-width: 720px) { .facts li { grid-template-columns: 15em 1fr; gap: 24px; align-items: baseline; } }

/* Form */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; gap: 16px 20px; } .form-grid .full { grid-column: 1 / -1; } }
label { display: block; }
.lab { display: block; font: 700 12px/1.2 var(--sc); letter-spacing: .16em; color: var(--gilt); margin-bottom: 7px; }
.lab i { font: italic 400 14px/1 var(--sans); letter-spacing: 0; color: var(--text-2); margin-left: 6px; }
input, select, textarea {
  width: 100%; min-height: 48px; margin: 0;
  background: var(--leaf-2); color: var(--text);
  border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: var(--r-1);
  font: 400 17px/1.3 var(--sans); padding: 11px 12px;
  font-variant-numeric: tabular-nums;
}
textarea { min-height: 110px; resize: vertical; font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-bottom-color: var(--gilt); box-shadow: 0 1px 0 var(--gilt); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'><path d='M6 9l5 5 5-5' fill='none' stroke='%23A8894A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: grid; gap: 14px; margin-top: 6px; }
.form-foot .btn { width: 100%; }
@media (min-width: 720px) { .form-foot { grid-template-columns: auto 1fr; align-items: center; gap: 20px; } .form-foot .btn { width: auto; } }
.form-foot .hint { margin: 0; }
.form-msg { border-left: 2px solid var(--ember); padding: 10px 14px; color: var(--ember); background: var(--leaf); border-radius: 0 var(--r-1) var(--r-1) 0; }
.form-done .voice { margin-bottom: 10px; }
.beta-leaf { padding: 24px 20px; }
@media (min-width: 720px) { .beta-leaf { padding: 32px 32px 28px; } }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: 14.5px; color: var(--text-2); margin-top: 20px; }
.foot { display: grid; gap: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0; list-style: none; }
.foot-links a { font: 700 12px/1 var(--sc); letter-spacing: .14em; text-decoration: none; padding: 8px 0; display: inline-block; }
@media (min-width: 720px) { .foot { grid-template-columns: 1fr auto; align-items: start; } }

/* Long-form pages */
.page { padding: 20px 0 60px; }
.prose { max-width: 44em; }
.prose h1 { font-size: clamp(36px, 6vw, 52px); }
.prose h2 { font-size: 27px; margin-top: 1.9em; padding-top: 1em; border-top: 1px solid var(--line); }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose p, .prose li { color: var(--text); }
.prose .meta { color: var(--text-2); font-size: 15px; margin-bottom: 20px; }
.prose table { min-width: 0; font-size: 15px; }
.draft { border-left: 3px solid var(--ember); background: var(--leaf); padding: 14px 18px; border-radius: 0 var(--r-2) var(--r-2) 0; margin: 20px 0 28px; }
.draft .kicker { color: var(--ember); margin-bottom: 6px; }
.draft p { margin: 0; color: var(--text-2); }
.toc { list-style: none; padding: 0; margin: 0 0 8px; columns: 1; }
.toc li { margin: .25em 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (min-width: 720px) { .toc { columns: 2; column-gap: 32px; } }
.contact-leaf { margin: 20px 0; }
.contact-leaf b { font-family: var(--serif); font-size: 22px; }

/* 404 */
.lost { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 40px 0; }
.lost .roman { font-size: 30px; }
.lost h1 { font-size: clamp(36px, 7vw, 56px); }

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  body::before, .top, footer, .draft, .skip { display: none; }
  a { color: #000; }
}
