/* Aura Distill site. Identity "Marginalia", palette "Verdigris".
   Layout: a folio. Each section pairs a short argument with one seeded plate; the intro plate is full bleed. */

@font-face { font-family: "IM Fell English"; src: url("fonts/imfell.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/imfell-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("fonts/alegreya.woff2") format("woff2"); font-style: normal; font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("fonts/alegreya-italic.woff2") format("woff2"); font-style: italic; font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Compagnon"; src: url("fonts/compagnon.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Compagnon"; src: url("fonts/compagnon-medium.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }

:root {
  --bg: #E7E5E0; --surface: #F1F0EC; --ink: #2A2019; --muted: #655A50; --rule: #C8C3B9;
  --accent: #2C6A5E; --gall: #8E6B36;
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --text: "Alegreya", "Iowan Old Style", Georgia, serif;
  --mono: "Compagnon", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181513; --surface: #221E1B; --ink: #E6DFD3; --muted: #A29785; --rule: #3A342E;
    --accent: #79B6A6; --gall: #C9A46A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181513; --surface: #221E1B; --ink: #E6DFD3; --muted: #A29785; --rule: #3A342E;
  --accent: #79B6A6; --gall: #C9A46A; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 19px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: .86em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wordmark { font-family: var(--display); font-style: italic; font-size: 26px; text-decoration: none; letter-spacing: -0.005em; white-space: nowrap; }
.wordmark .drop { color: var(--accent); }
.wordmark.small { font-size: 22px; }

.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 12px; background: linear-gradient(var(--bg) 55%, transparent); }
.top nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .top nav a:not(:last-child):not([href="#install"]) { display: none; } }

.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gall); margin: 0 0 14px; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0 0 18px; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 6vw, 84px); line-height: 1.0; }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; }
p { margin: 0 0 16px; max-width: 62ch; }
.note { color: var(--muted); font-size: 16px; font-style: italic; }

/* Intro */
.intro { position: relative; height: clamp(600px, 92vh, 960px); overflow: hidden; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-copy { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%); width: min(560px, 42vw); }
.lede { font-size: 20px; color: var(--ink); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn { font-family: var(--mono); font-size: 14px; text-decoration: none; padding: 11px 18px; border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.plate-no { position: absolute; right: var(--gutter); bottom: 18px; margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.plate-no b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.plate-no button { font: inherit; color: var(--muted); background: none; border: 1px solid var(--rule); padding: 4px 9px; cursor: pointer; }
.plate-no button:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 820px) {
  .intro { height: auto; min-height: 640px; display: flex; flex-direction: column; }
  .intro-copy { position: relative; transform: none; top: auto; left: auto; width: auto; padding: 96px var(--gutter) 0; }
  .intro canvas { position: relative; inset: auto; height: 380px; flex: none; }
  .plate-no { position: relative; right: auto; bottom: auto; padding: 0 var(--gutter) 16px; justify-content: flex-end; }
}

/* Bands */
.band { padding-block: clamp(64px, 10vw, 140px); padding-inline: var(--gutter); border-top: 1px solid var(--rule); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.split.rev > .copy { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } .split.rev > .copy { order: 0; } }
.copy { min-width: 0; }
.copy.narrow { max-width: 760px; margin-bottom: 32px; }
.plate { margin: 0; position: relative; aspect-ratio: 4 / 5; max-width: 100%; }
.plate.tall { aspect-ratio: 4 / 5; }
.plate.square { aspect-ratio: 1; }
.plate.wide { aspect-ratio: 21 / 8; }
@media (max-width: 700px) { .plate.wide { aspect-ratio: 4 / 3; } }
#why .plate { aspect-ratio: 4 / 5; }
.plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Ledger */
.table-wrap { overflow-x: auto; margin: 8px 0 18px; }
.ledger { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.ledger caption { text-align: left; color: var(--muted); font-style: italic; font-size: 15px; padding-bottom: 10px; caption-side: top; }
.ledger th, .ledger td { padding: 9px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.ledger thead th { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); font-weight: 400; }
.ledger tbody th { font-weight: 400; }
.ledger td { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.ledger td.win { color: var(--accent); font-weight: 500; }

/* Expansion */
.expand { position: relative; min-height: 760px; display: flex; align-items: center; }
.expand canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.expand-copy { position: relative; width: min(620px, 100%); }
.console { background: var(--surface); border: 1px solid var(--rule); padding: 20px 22px; margin: 8px 0 18px; font-family: var(--mono); font-size: 14px; line-height: 1.6; min-height: 330px; }
.prompt { margin: 0 0 12px; font-size: 16px; }
.prompt .who { color: var(--gall); }
.caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -0.15em; background: var(--accent); margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.expanded { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.expanded li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; animation: rise .5s ease both; }
.expanded .tag { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; }
.expanded .tag.directive, .expanded .tag.updated { color: var(--gall); }
.expanded .tag.principle { color: var(--accent); }
.expanded li.out { color: var(--muted); }
.expanded li.out .txt { text-decoration: line-through; text-decoration-color: var(--muted); }
.expanded s { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .expanded li { animation: none; } }
@media (max-width: 820px) { .expand { min-height: 0; display: block; } .expand canvas { opacity: .45; } }

/* Rules */
.rules { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: r; border-top: 1px solid var(--rule); }
.rules li { counter-increment: r; border-bottom: 1px solid var(--rule); }
.rules button { all: unset; box-sizing: border-box; display: block; position: relative; width: 100%; padding: 10px 6px 10px 2.6em; cursor: pointer; font-size: 17px; line-height: 1.45; color: var(--muted); }
.rules button::before { content: counter(r, upper-roman) "."; position: absolute; left: 6px; top: 10px; font-family: var(--display); color: var(--gall); }
.rules button b { color: var(--ink); font-weight: 600; }
.rules button:hover, .rules button[aria-pressed="true"] { color: var(--ink); background: var(--surface); }
.rules button[aria-pressed="true"]::before { color: var(--accent); }
.rules button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Installer */
.installer { margin: 10px 0 20px; }
.tabs { display: flex; gap: 0; }
.tabs button { font-family: var(--mono); font-size: 12px; letter-spacing: .03em; background: none; border: 1px solid var(--rule); border-bottom: none; color: var(--muted); padding: 7px 12px; cursor: pointer; }
.tabs button + button { border-left: none; }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface); }
.cmd { display: flex; align-items: stretch; border: 1px solid var(--rule); background: var(--surface); }
.cmd code { flex: 1; min-width: 0; padding: 14px 16px; font-size: 14px; overflow-x: auto; white-space: nowrap; }
.copy-btn { font-family: var(--mono); font-size: 13px; border: none; border-left: 1px solid var(--rule); background: var(--ink); color: var(--bg); padding: 0 18px; cursor: pointer; }
.copy-btn:hover { background: var(--accent); }
.copy-btn.done { background: var(--accent); }

/* Floating install dock */
.dock { position: fixed; z-index: 30; right: var(--gutter); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); width: min(470px, calc(100vw - 2 * var(--gutter)));
  background: var(--bg); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); transition: opacity .35s ease, transform .35s ease; }
.dock .installer { margin: 0; }
.dock .cmd code { font-size: 12px; padding: 10px 12px; }
.dock .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 0 10px; display: flex; align-items: center; }
.dock.away { opacity: 0; transform: translateY(12px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; } }

.foot { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; justify-content: space-between; padding: 32px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 110px); border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.foot .fonts { flex-basis: 100%; }

/* Phone: copy first, plate after; the graph gets its own strip; the dock stays out of the way. */
@media (max-width: 820px) {
  .intro-copy { order: 1; }
  .intro canvas { order: 2; }
  .plate-no { order: 3; }
  .expand { display: flex; flex-direction: column; }
  .expand-copy { order: 1; }
  .expand canvas { position: relative; inset: auto; order: 2; height: 360px; opacity: 1; }
}
@media (max-width: 600px) { .dock { display: none; } }

.perf-hud { position: fixed; z-index: 40; left: var(--gutter); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); font-family: var(--mono); font-size: 12px;
  padding: 6px 10px; background: var(--ink); color: var(--bg); font-variant-numeric: tabular-nums; }

/* HDR glint over the drop: a PQ-tagged PNG, brighter than paper white on HDR displays, plain white elsewhere */
.glint { position: absolute; left: 0; top: 0; width: 96px; height: 96px; pointer-events: none; opacity: 0; mix-blend-mode: plus-lighter; dynamic-range-limit: no-limit; will-change: transform, opacity; }

/* Signature: the makers, after the glasscam.app signature, in Marginalia. Ink assets drawn with Codex, painted with the page tokens through CSS masks. */
.signature {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px 48px;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(48px, 7vw, 88px); border-top: 1px solid var(--rule);
}
.signature .sig-ivan { display: flex; align-items: center; gap: 26px; text-decoration: none; color: var(--ink); }
.signature .sig-words { display: grid; gap: 4px; justify-items: start; }
.signature .sig-line { font-family: var(--display); font-style: italic; font-size: clamp(26px, 3vw, 38px); line-height: 1.1;
  letter-spacing: -0.005em; color: var(--ink); transform: rotate(-2deg); transform-origin: left center; }
.signature .sig-flourish { display: block; width: min(210px, 56vw); aspect-ratio: 520 / 60; margin: 4px 0 14px 18%; background: var(--gall);
  -webkit-mask: url("sig/flourish.png") center / contain no-repeat; mask: url("sig/flourish.png") center / contain no-repeat;
  transform: rotate(-2deg); transition: clip-path .9s ease .2s; clip-path: inset(0 0 0 0); }
.signature .sig-name { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.signature .sig-name u { text-decoration-color: var(--accent); text-underline-offset: 3px; color: var(--ink); }
.signature .sig-ivan:hover u, .signature .sig-ivan:focus-visible u { color: var(--accent); }
.signature .sig-ivan:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }

.signature .sig-claude { display: grid; gap: 6px; justify-items: start; margin: 0; max-width: none; }
.signature .sig-claude-row { position: relative; display: flex; align-items: center; gap: 12px; }
.signature .sig-mark { position: relative; width: 42px; height: 50px; flex: none; background: var(--ink);
  -webkit-mask: url("sig/braces.png") center / contain no-repeat; mask: url("sig/braces.png") center / contain no-repeat; }
.signature .sig-mark + .sig-hand { margin-left: -2px; }
.signature .sig-claude-row::before { content: ""; position: absolute; left: 17px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--accent); }
.signature .sig-hand { font-family: var(--display); font-style: italic; font-size: clamp(30px, 3vw, 38px); line-height: 1; color: var(--ink); }
.signature .sig-note { font-family: var(--text); font-style: italic; font-size: 16px; color: var(--muted); }

/* Motion: armed by signature.js only, so without script or with reduced motion the ink is simply there. */
.signature.is-armed .sig-flourish { clip-path: inset(0 100% 0 0); }
.signature.is-armed.is-inked .sig-flourish { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .signature .sig-flourish { transition: none; } .signature.is-armed .sig-flourish { clip-path: none; } }

@media (max-width: 560px) {
  .signature { flex-direction: column; align-items: flex-start; }
  .signature .sig-flourish { width: min(190px, 46vw); margin-left: 6%; }
}
