/* ============================================================================
   AZIMUTH · FIELD LOG  — devlog design system
   A deliberate single-theme "darkroom instrument" identity. The whole story
   lives among dark period screenshots, so the chrome commits to the dark room:
   near-black grounds with a cool bias, an amber signal, the app's own blue for
   anything interactive, and a film-red reserved for the darkroom chapter.
   ============================================================================ */

:root {
  /* grounds — aligned to azimuthphoto.com (#0a0c0e) so the log reads as one site */
  --ground:    #0a0c0e;
  --ground-2:  #0e1114;
  --panel:     #12161a;
  --panel-2:   #171c22;
  --panel-3:   #1d232b;
  --line:      rgba(238,241,244,0.09);
  --line-2:    rgba(238,241,244,0.16);

  /* ink — the site's exact ink ramp */
  --ink:   #eef1f4;
  --ink-2: #98a1aa;
  --ink-3: #6b7480;
  --ink-4: #4a525b;

  /* signals — the site's orange-red is the accent; amber stays for data/bearing */
  --accent:    #fc4d21;   /* Azimuth orange-red — interactive, links, focus */
  --accent-dk: #c53a17;
  --amber:     #f2b03d;   /* the ranking dot / signal / bearing warmth */
  --amber-dk:  #b57f1f;
  --film:      #fc4d21;   /* darkroom / halation shares the brand accent */
  --green:     #46c464;
  --violet:    #9b7bff;

  /* type — matches the site: Inter + IBM Plex Mono (loaded in <head>) */
  --sans: "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", "SF Mono", "Consolas", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;

  /* scale */
  --measure: 66ch;
  --radius: 10px;
  --radius-lg: 16px;
  --pad: clamp(20px, 5vw, 64px);

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --shadow-2: 0 8px 40px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
  --glow-accent: 0 0 0 1px rgba(252,77,33,.35), 0 8px 30px rgba(252,77,33,.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(252,77,33,.10), transparent 60%),
    radial-gradient(1000px 600px at 6% 4%, rgba(242,176,61,.05), transparent 55%),
    var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(252,77,33,.30); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: 46px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 3vw, 26px);
  background: color-mix(in srgb, var(--ground) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.topbar .wm { display: flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: .16em; color: var(--ink); font-weight: 600; }
.topbar .wm .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.topbar .wm b { color: var(--ink-3); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar a { color: inherit; }
.topbar a:hover { text-decoration: none; }
.topbar .wm:hover { color: var(--accent); }
.topbar .backlink { font-size: 11.5px; color: var(--ink-3); letter-spacing: .08em; margin-right: 4px; transition: color .15s; }
.topbar .backlink:hover { color: var(--accent); }
.topbar .bearing { font-size: 11.5px; color: var(--ink-3); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .topbar .backlink { display: none; } }
.topbar .bearing b { color: var(--amber); font-weight: 600; }
.scrollrail { position: fixed; top: 46px; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; }
.scrollrail > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber), var(--accent)); box-shadow: 0 0 10px rgba(252,77,33,.6); }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); }
.shell { display: grid; grid-template-columns: 232px minmax(0,1fr); gap: 0; max-width: 1360px; margin: 0 auto; }
@media (max-width: 1080px) { .shell { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- left rail */
.rail {
  position: sticky; top: 46px; align-self: start; height: calc(100vh - 46px);
  padding: 26px 18px 26px 24px; overflow-y: auto;
  border-right: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
@media (max-width: 1080px) { .rail { display: none; } }
.rail h4 { color: var(--ink-4); letter-spacing: .18em; font-size: 10px; margin: 0 0 14px; font-weight: 600; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail a { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); border-left: 2px solid transparent; }
.rail a:hover { background: var(--panel); text-decoration: none; color: var(--ink); }
.rail a .n { color: var(--ink-4); font-variant-numeric: tabular-nums; }
.rail a.active { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); border-left-color: var(--accent); }
.rail a.active .n { color: var(--accent); }
.rail .spark { margin-top: 22px; }

/* --------------------------------------------------------------- content */
.content { min-width: 0; padding-bottom: 120px; }

/* eyebrow / labels */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.eyebrow .sep { color: var(--ink-4); }
.eyebrow .muted { color: var(--ink-3); }

h1, h2, h3 { font-family: var(--sans); text-wrap: balance; letter-spacing: -.02em; line-height: 1.08; font-weight: 700; }

/* --------------------------------------------------------------- the hero */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 96px var(--pad) 60px; overflow: hidden; }
.hero .grid-bg { position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 62px 62px; opacity: .16; mask-image: radial-gradient(120% 90% at 70% 0%, #000 20%, transparent 72%); }
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font-family: var(--mono); font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 22px; }
.hero .kicker b { color: var(--amber); }
.hero h1 { font-size: clamp(38px, 7.2vw, 92px); margin: 0 0 24px; max-width: 15ch; }
.hero h1 .film { color: var(--film); }
.hero h1 .accent { color: var(--accent); }
.hero .lede { font-size: clamp(18px, 2.3vw, 23px); color: var(--ink-2); max-width: 40ch; margin: 0 0 40px; line-height: 1.5; }
.hero .lede b { color: var(--ink); font-weight: 600; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 860px; }
.statgrid .cell { background: var(--ground-2); padding: 18px 20px; }
.statgrid .v { font-family: var(--mono); font-size: clamp(22px, 3vw, 30px); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.statgrid .v small { font-size: .5em; color: var(--ink-3); font-weight: 400; }
.statgrid .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

.hero .scrolldown { margin-top: 54px; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--ink-3); display: inline-flex; gap: 10px; align-items: center; }
.hero .scrolldown .arrow { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(5px)} }
@media (prefers-reduced-motion: reduce) { .hero .scrolldown .arrow { animation: none; } }

/* --------------------------------------------------------- section/chapter */
.chapter { padding: clamp(64px, 9vw, 130px) 0 0; scroll-margin-top: 60px; }
.chapter .head { max-width: var(--measure); }
.chapter h2 { font-size: clamp(28px, 4.4vw, 50px); margin: 16px 0 0; }
.chapter .dek { font-size: clamp(18px, 2.1vw, 22px); color: var(--ink-2); margin: 18px 0 0; max-width: 42ch; line-height: 1.5; }
.chapter .dek b { color: var(--ink); }

.prose { max-width: var(--measure); margin: 30px 0 0; }
.prose p { margin: 0 0 20px; color: var(--ink-2); }
.prose p:first-child { margin-top: 0; }
.prose strong, .prose b { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); font-style: italic; }
.prose .lead { font-size: 1.06em; color: var(--ink); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: #d8e3f2; }
.prose h3 { font-size: clamp(20px, 2.6vw, 27px); margin: 40px 0 0; color: var(--ink); }

/* full-bleed break for plates/demos on wide screens */
.bleed { margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); }

/* ---------------------------------------------------------- screenshot plate */
.plate { margin: 40px 0 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-2); }
.plate.wide { max-width: 1120px; }
.plate .bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--ground-2); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.plate .bar .lights { display: flex; gap: 6px; }
.plate .bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.plate .bar .t { color: var(--ink-2); letter-spacing: .04em; }
.plate .bar .hash { margin-left: auto; color: var(--amber-dk); }
.plate .img { position: relative; background: #000; }
.plate .img img { width: 100%; height: auto; display: block; }
.plate figcaption { padding: 12px 16px; font-size: 13.5px; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--ground-2); font-family: var(--sans); line-height: 1.5; }
.plate figcaption b { color: var(--ink-2); font-weight: 600; }

.plate-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
@media (max-width: 720px) { .plate-duo { grid-template-columns: 1fr; } .plate-duo .plate { margin-top: 0; } }
.plate-duo .plate { margin-top: 0; }

/* ------------------------------------------------------------- code plate */
.code { margin: 34px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0b0e13; box-shadow: var(--shadow-1); max-width: var(--measure); }
.code .h { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--ground-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; }
.code .h .path { color: var(--ink-2); }
.code .h .why { color: var(--ink-4); margin-left: auto; font-style: normal; }
.code .h .lang { color: var(--amber-dk); text-transform: uppercase; letter-spacing: .1em; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.62; color: #c9d4e3; tab-size: 4; }
.code pre::-webkit-scrollbar { height: 8px; }
.code pre::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
/* light manual highlight tokens */
.tok-kw { color: #7ea6ff; } .tok-fn { color: #5fd0c0; } .tok-str { color: #d3a04b; }
.tok-num { color: #d98c6a; } .tok-com { color: #5b6675; font-style: italic; } .tok-cls { color: #e0c069; }
.tok-op { color: #9aa6b6; }

/* -------------------------------------------------------------- benchmark chips */
.bench { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 0; }
.chip { display: flex; flex-direction: column; gap: 8px; min-width: 190px; flex: 1 1 190px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.chip .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.chip .ba { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.chip .before { color: var(--ink-4); text-decoration: line-through; font-size: 15px; }
.chip .arw { color: var(--ink-4); }
.chip .after { color: var(--green); font-size: 22px; font-weight: 600; }
.chip .cm { font-family: var(--mono); font-size: 10.5px; color: var(--amber-dk); }

/* ----------------------------------------------------------- pull / aside */
.pull { margin: 40px 0 0; max-width: var(--measure); padding: 4px 0 4px 24px; border-left: 3px solid var(--amber); }
.pull p { font-family: var(--serif); font-size: clamp(20px, 2.7vw, 27px); line-height: 1.42; color: var(--ink); margin: 0; font-style: italic; }
.pull .who { font-family: var(--mono); font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 12px; letter-spacing: .08em; }

.callout { margin: 34px 0 0; border: 1px solid var(--line); border-left: 3px solid var(--film); border-radius: var(--radius); background: color-mix(in srgb, var(--film) 6%, var(--panel)); padding: 18px 20px; max-width: var(--measure); }
.callout .t { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--film); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.callout p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.callout p + p { margin-top: 10px; }
.callout b { color: var(--ink); }

.note { max-width: var(--measure); margin: 26px 0 0; font-size: 14px; color: var(--ink-3); font-style: italic; padding-left: 16px; border-left: 2px solid var(--line-2); }

/* ------------------------------------------------------------- interludes */
.interlude { padding: clamp(60px,8vw,110px) 0 0; }
.interlude .lab { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.interlude h2 { font-size: clamp(26px, 4vw, 44px); margin: 12px 0 0; max-width: 20ch; }

/* ------------------------------------------------------------- demo shells */
.demo { margin: 40px 0 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow-2); }
.demo .dh { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--ground-2); }
.demo .dh .badge { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ground); background: var(--amber); padding: 3px 8px; border-radius: 5px; font-weight: 700; }
.demo .dh .title { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: .04em; }
.demo .dh .hint { margin-left: auto; font-size: 12px; color: var(--ink-4); font-family: var(--mono); }
.demo .db { padding: clamp(18px, 3vw, 30px); }

/* Elo demo */
.elo { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px,2.4vw,30px); align-items: center; }
@media (max-width: 640px) { .elo { grid-template-columns: 1fr; } .elo .vs { display: none; } }
.elo .card { cursor: pointer; border-radius: 12px; overflow: hidden; border: 2px solid var(--line-2); background: #000; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; position: relative; }
.elo .card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--glow-accent); }
.elo .card:focus-visible { border-color: var(--accent); }
.elo .card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.elo .card .meter { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: linear-gradient(0deg, rgba(0,0,0,.82), transparent); display: flex; justify-content: space-between; align-items: flex-end; }
.elo .card .rt { font-family: var(--mono); font-size: 20px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.elo .card .delta { font-family: var(--mono); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.elo .card .delta.win { color: var(--green); opacity: 1; }
.elo .card .delta.lose { color: var(--film); opacity: 1; }
.elo .vs { font-family: var(--mono); color: var(--ink-4); font-size: 13px; letter-spacing: .2em; text-align: center; }
.elo-foot { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 22px; align-items: center; justify-content: space-between; }
.elo-foot .stat { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.elo-foot .stat b { color: var(--amber); font-size: 16px; font-variant-numeric: tabular-nums; }
.btn { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; color: var(--ink); background: var(--panel-3); border: 1px solid var(--line-2); padding: 8px 16px; border-radius: 7px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--panel-2); border-color: var(--accent); }

/* halation demo */
.hala { display: grid; grid-template-columns: 1fr; gap: 18px; }
.hala canvas { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; background: #000; image-rendering: auto; }
.hala .ctrls { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.hala .ctrl { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.hala .ctrl label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; }
.hala .ctrl label b { color: var(--film); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--line-2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--film); cursor: pointer; box-shadow: 0 0 0 4px color-mix(in srgb, var(--film) 25%, transparent); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--film); cursor: pointer; }
.hala .toggle { display: flex; gap: 0; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.hala .toggle button { font-family: var(--mono); font-size: 12px; padding: 7px 13px; background: var(--panel); color: var(--ink-3); border: none; cursor: pointer; }
.hala .toggle button.on { background: var(--film); color: #fff; }

/* benchmark race — two clear lanes per metric, labels outside the bars */
.race { display: flex; flex-direction: column; gap: 22px; }
.race .row { display: grid; grid-template-columns: 176px 1fr; gap: 18px; align-items: center; }
@media (max-width: 620px){ .race .row { grid-template-columns: 1fr; gap: 8px; } }
.race .rl { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.race .rl .cm { color: var(--amber-dk); font-size: 10.5px; display: block; margin-top: 3px; }
.race .bars { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.race .lane { display: flex; align-items: center; gap: 11px; }
.race .bar { height: 15px; border-radius: 5px; width: 0; flex: 0 0 auto; min-width: 3px; transition: width 1.15s cubic-bezier(.2,.8,.2,1); }
.race .bar.before { background: linear-gradient(90deg, #3a2531, #6b3549); }
.race .bar.after  { background: linear-gradient(90deg, var(--accent-dk), var(--accent)); box-shadow: 0 0 16px rgba(252,77,33,.35); }
.race .tag { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.race .lane.a .tag { color: var(--accent); font-weight: 600; }

/* twin parity demo */
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px){ .twin { grid-template-columns: 1fr; } }
.twin .side { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ground-2); }
.twin .side .lab { font-family: var(--mono); font-size: 11px; padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--ink-3); display: flex; justify-content: space-between; }
.twin .side .lab b { color: var(--accent); }
.twin canvas { width: 100%; display: block; }
.twin-foot { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-top: 4px; }
.twin-foot .d { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.twin-foot .d b { color: var(--green); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- fleet grid */
.fleet { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 34px; }
.fleet .m { background: var(--ground-2); padding: 20px; }
.fleet .m .who { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fleet .m .who i { width: 9px; height: 9px; border-radius: 2px; }
.fleet .m .role { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin: 8px 0 0; letter-spacing: .04em; }
.fleet .m p { font-size: 14px; color: var(--ink-2); margin: 12px 0 0; line-height: 1.5; }

/* war stories ledger */
.ledger { margin-top: 30px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ledger .row { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ledger .row:last-child { border-bottom: none; }
.ledger .row .no { font-family: var(--mono); color: var(--film); font-size: 13px; font-weight: 600; }
.ledger .row .h { font-weight: 600; color: var(--ink); }
.ledger .row .h .hash { font-family: var(--mono); font-size: 11px; color: var(--amber-dk); font-weight: 400; margin-left: 8px; }
.ledger .row p { margin: 6px 0 0; font-size: 14.5px; color: var(--ink-2); }

/* closing product CTA */
.endcta { margin: 60px 0 0; padding: clamp(28px,4vw,48px); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--panel); max-width: var(--measure); }
.endcta .ec-k { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.endcta h3 { font-size: clamp(22px,3vw,32px); margin: 12px 0 0; color: var(--ink); max-width: 20ch; }
.endcta p { color: var(--ink-2); margin: 14px 0 0; max-width: 48ch; font-size: 15.5px; }
.endcta .ec-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.endcta .ec-btn { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; padding: 11px 20px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink); transition: background .15s, border-color .15s, transform .15s; }
.endcta .ec-btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.endcta .ec-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.endcta .ec-btn.primary:hover { background: var(--accent-dk); }

/* footer */
.foot { margin-top: 110px; padding: 40px 0 60px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; color: var(--ink-4); }
.foot b { color: var(--ink-3); }
.foot .big { font-family: var(--sans); font-size: clamp(22px,3.4vw,34px); color: var(--ink); font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px; max-width: 24ch; line-height: 1.2; }

/* reveal animation */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ============================================================================
   ACT II — the gutting. A visual language of subtraction: mass that shrinks,
   questions that stop being asked, a spec small enough to hold in your head.
   ============================================================================ */

/* act divider */
.actbreak { margin: clamp(80px,11vw,150px) 0 0; padding: clamp(30px,4vw,48px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.actbreak .n { font-family: var(--mono); font-size: 11px; letter-spacing: .32em; color: var(--ink-4); text-transform: uppercase; }
.actbreak h2 { font-size: clamp(26px,4.6vw,46px); margin: 14px auto 0; max-width: 20ch; }
.actbreak p { font-family: var(--serif); font-style: italic; font-size: clamp(17px,2.2vw,21px); color: var(--ink-2); max-width: 46ch; margin: 18px auto 0; line-height: 1.5; }

/* the 0.06% — what is actually irreplaceable */
.mass { margin: 38px 0 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); }
.mass .mh { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--ground-2); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }
.mass .mb { padding: clamp(18px,3vw,26px); }
.mass .stack { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-2); }
.mass .stack .derived { flex: 1; background: repeating-linear-gradient(45deg, var(--panel-3), var(--panel-3) 6px, var(--panel-2) 6px, var(--panel-2) 12px); display: flex; align-items: center; padding-left: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.mass .stack .kept { width: 3px; min-width: 3px; background: var(--amber); box-shadow: 0 0 16px var(--amber); }
.mass .legend { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; font-family: var(--mono); font-size: 12px; }
.mass .legend .l { display: flex; align-items: center; gap: 9px; color: var(--ink-3); }
.mass .legend .l i { width: 10px; height: 10px; border-radius: 2px; }
.mass .legend .l b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mass table { width: 100%; border-collapse: collapse; margin-top: 22px; font-family: var(--mono); font-size: 13px; }
.mass table td { padding: 5px 0; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.mass table td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.mass table tr:last-child td { border-bottom: none; color: var(--amber); font-weight: 600; padding-top: 10px; }

/* spec block — five tables / seven functions */
.spec { margin: 34px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .spec { grid-template-columns: 1fr; } }
.spec .s { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0b0e13; }
.spec .s .t { padding: 9px 14px; background: var(--ground-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.spec .s pre { margin: 0; padding: 15px; font-family: var(--mono); font-size: 12.2px; line-height: 1.66; color: #c9d4e3; overflow-x: auto; }

/* seven rules, ordered by how much they removed */
.rules { margin: 34px 0 0; counter-reset: r; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rules .r { background: var(--panel); padding: 18px 20px; display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.rules .r .n { counter-increment: r; font-family: var(--mono); font-size: 12px; color: var(--amber); font-weight: 600; }
.rules .r .n::before { content: counter(r); }
.rules .r h4 { margin: 0; font-size: 16.5px; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.rules .r p { margin: 7px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.58; }
.rules .r p b { color: var(--ink); }
.rules .r code { font-family: var(--mono); font-size: .87em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: #d8e3f2; }

/* act divider inside the chapter rail */
.rail .railact { margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.rail .railact a .n { color: var(--film); }
.rail .railact a span:last-child { color: var(--ink-2); letter-spacing: .06em; }

/* ============================================================================
   THE DOCTRINE — lessons as the spine. An index you can read in 60 seconds,
   and a recurring in-chapter device that names what each episode paid for.
   ============================================================================ */

.doctrine { margin: 44px 0 0; }
.doctrine .dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.doctrine .d { background: var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 9px; text-decoration: none; transition: background .15s; }
a.d:hover { background: var(--panel-2); text-decoration: none; }
.doctrine .d .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.doctrine .d h4 { margin: 0; font-size: 17px; line-height: 1.3; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.doctrine .d p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.doctrine .d .paid { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-4); border-top: 1px solid var(--line); }
.doctrine .d .paid b { color: var(--film); font-weight: 500; }

/* in-chapter lesson device */
.lesson { margin: 36px 0 0; max-width: var(--measure); border-left: 3px solid var(--amber); background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 7%, transparent), transparent 70%); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.lesson .t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin-bottom: 7px; }
.lesson p { margin: 0; font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.lesson p + p { margin-top: 9px; font-size: 14.5px; color: var(--ink-2); }

/* two-column verdict table (what it was good at / what it could not do) */
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0 0; }
@media (max-width: 740px) { .verdict { grid-template-columns: 1fr; } }
.verdict .v { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.verdict .v .h { padding: 11px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.verdict .v.good .h { color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--ground-2)); }
.verdict .v.bad .h { color: var(--film); background: color-mix(in srgb, var(--film) 8%, var(--ground-2)); }
.verdict .v ul { margin: 0; padding: 14px 18px 16px 32px; }
.verdict .v li { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 9px; }
.verdict .v li:last-child { margin-bottom: 0; }
.verdict .v li b { color: var(--ink); }

/* ============================================================================
   STEERING — the slop taxonomy and the ask/instead swaps.
   ============================================================================ */

/* failure-mode table */
.slop { margin: 34px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.slop .sr { display: grid; grid-template-columns: 1.1fr 1.2fr 1.3fr; gap: 0; border-bottom: 1px solid var(--line); }
.slop .sr:last-child { border-bottom: none; }
.slop .sr.hd { background: var(--ground-2); font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }
.slop .sr.hd > div { padding: 10px 16px; }
.slop .sr > div { padding: 16px; background: var(--panel); border-right: 1px solid var(--line); }
.slop .sr > div:last-child { border-right: none; }
.slop .sr .what { color: var(--film); font-weight: 600; font-size: 15px; }
.slop .sr .why { color: var(--ink-3); font-size: 14px; line-height: 1.5; }
.slop .sr .fix { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.slop .sr .fix b { color: var(--ink); }
@media (max-width: 780px) {
  .slop .sr { grid-template-columns: 1fr; }
  .slop .sr.hd { display: none; }
  .slop .sr > div { border-right: none; border-bottom: 1px solid var(--line); }
  .slop .sr > div:last-child { border-bottom: none; }
  .slop .sr .what::before { content: "PATTERN — "; font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
}

/* ask this / not that */
.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 0; }
@media (max-width: 740px) { .swap { grid-template-columns: 1fr; } }
.swap .s { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.swap .s .h { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.swap .s.no .h { color: var(--film); background: color-mix(in srgb, var(--film) 8%, var(--ground-2)); }
.swap .s.yes .h { color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--ground-2)); }
.swap .s p { margin: 0; padding: 15px; font-family: var(--mono); font-size: 13.2px; line-height: 1.6; color: var(--ink-2); }
.swap .s.yes p { color: var(--ink); }
.swap-note { grid-column: 1/-1; font-size: 14.5px; color: var(--ink-3); line-height: 1.6; margin: 2px 0 0; }
.swap-note b { color: var(--ink-2); }

/* evidence table — measured results with a control column */
.evid { margin: 30px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.evid table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; }
.evid th { text-align: left; padding: 11px 16px; background: var(--ground-2); border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); font-weight: 500; }
.evid td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); background: var(--panel); }
.evid tr:last-child td { border-bottom: none; }
.evid td.k { color: var(--ink); font-weight: 600; }
.evid td.win { color: var(--green); font-weight: 600; }
.evid td.lose { color: var(--ink-4); }
.evid .cap { padding: 11px 16px; background: var(--ground-2); border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 13px; color: var(--ink-3); line-height: 1.55; }
@media (max-width: 620px){ .evid table, .evid th, .evid td { font-size: 12px; } .evid td, .evid th { padding: 9px 10px; } }
