/* THE DOSSIER LAYER
   Investigator's case file drawn with a draftsman's hand.
   Classical structure on the existing modern palette and type.
   No sepia, no parchment, no costume. */

:root {
  --line-draw: rgba(36, 56, 232, .17);
  --line-faint: rgba(16, 16, 19, .07);
  --thread: #e8451f;
}

body.dossier::before {
  content: "";
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.plate { position: relative; }
.plate.ink { background-color: var(--ink); color: var(--bg); }

.plate-head {
  position: relative;
  border-top: 1.5px solid var(--ink);
  padding-top: 14px;
  margin-bottom: clamp(28px, 4vw, 52px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: start;
}
.plate.ink .plate-head { border-top-color: rgba(255,255,255,.5); }
.plate-head .pl { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); }
.plate.ink .plate-head .pl { color: var(--lab-accent); }
.plate-head .pt {
  font-family: var(--disp); font-weight: 800; letter-spacing: -.025em;
  font-size: clamp(30px, 4.6vw, 54px); line-height: 1; margin-top: 6px;
}
.plate-head .pm { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); text-align: right; max-width: 22ch; line-height: 1.6; }
.plate.ink .plate-head .pm { color: var(--lab-soft); }
/* phones: the side note moves under the title, which keeps the full width */
@media (max-width: 640px) {
  .plate-head { grid-template-columns: 1fr; }
  .plate-head .pm { text-align: left; max-width: none; }
}

.ghost-num {
  position: absolute; left: -.06em; top: -.28em; z-index: 0;
  font-family: var(--disp); font-weight: 800; font-size: clamp(150px, 26vw, 340px);
  line-height: .8; letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-draw);
  pointer-events: none; user-select: none;
}
.plate.ink .ghost-num { -webkit-text-stroke-color: rgba(143,165,255,.16); }
.plate > .inner { position: relative; z-index: 1; }

.rule-eng {
  height: 9px; border: 0; margin: clamp(30px, 4.4vw, 54px) 0;
  background-image: repeating-linear-gradient(70deg, var(--line-draw) 0 1px, transparent 1px 7px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.plate.ink .rule-eng { border-color: rgba(255,255,255,.22); background-image: repeating-linear-gradient(70deg, rgba(143,165,255,.3) 0 1px, transparent 1px 7px); }

.dimline { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; }
.dimline::before, .dimline::after { content: ""; height: 1px; background: var(--line-draw); flex: 1; }
.dimline span { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); white-space: nowrap; }

.fig { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); display: block; margin-top: 9px; }
.fig b { color: var(--accent-ink); font-weight: 600; }
.plate.ink .fig { color: var(--lab-soft); }
.plate.ink .fig b { color: var(--lab-accent); }

.margin-thread {
  position: relative;
  font-size: 13px; line-height: 1.6; color: var(--soft);
  padding-left: 18px;
}
.margin-thread::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px;
  background: repeating-linear-gradient(to bottom, var(--thread) 0 4px, transparent 4px 8px);
}
.margin-thread .k { display: block; margin-bottom: 6px; color: var(--thread); letter-spacing: .14em; }

.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; margin-top: 22px; }
.ecard {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 16px 16px 14px; position: relative;
  box-shadow: 0 2px 0 rgba(16,16,19,.05), 0 10px 26px rgba(16,16,19,.05);
}
.ecard::after {   
  content: ""; position: absolute; right: 0; top: 0; width: 16px; height: 16px;
  background: linear-gradient(225deg, var(--bg-alt) 50%, transparent 50%);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ecard .eref { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--thread); }
.ecard h4 { font-family: var(--disp); font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; margin-top: 6px; line-height: 1.2; }
.ecard p { font-size: 13px; line-height: 1.55; color: var(--soft); margin-top: 7px; }
.ecard .ask { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 12px; display: block; }
.stagepick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.stagepick button {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 3px; padding: 6px 9px; cursor: pointer;
}
.stagepick button:hover { border-color: var(--accent); color: var(--accent-ink); }
.stagepick button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ecard .everdict { display: none; font-size: 12.5px; line-height: 1.55; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--ink); }
.ecard.answered .everdict { display: block; }
.ecard.answered .stagepick button:not(.on) { opacity: .35; }

.tally { margin-top: 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); padding: 18px 18px 14px; }
.tallyrow { display: grid; grid-template-columns: 120px 1fr 34px; gap: 12px; align-items: center; margin-bottom: 8px; }
.tallyrow .tl { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.tallybar { height: 16px; background: var(--bg-alt); border-radius: 2px; overflow: hidden; }
.tallybar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .45s cubic-bezier(.2,.8,.3,1); }
.tallyrow.hot .tallybar i { background: var(--thread); }
.tallyrow.hot .tl { color: var(--thread); }
.tallyrow .tn { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--soft); }
.tally-note { display: none; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; }
.tally.done .tally-note { display: block; animation: resIn .35s ease both; }

.build { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 18px; margin-top: 22px; align-items: start; }
@media (max-width: 900px) { .build { grid-template-columns: 1fr; } }

/* act two waits for act one: it says so, dims its controls, never looks broken,
   and the note goes away the moment the act unlocks */
.act-lock-note { display: none; }
.act-locked .act-lock-note {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px;
  margin-bottom: 26px; padding: 12px 14px 12px 16px;
  border: 1px dashed color-mix(in srgb, var(--thread) 45%, white); border-left: 3px solid var(--thread);
  border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--thread) 4%, white);
  font-size: 14px; line-height: 1.5;
}
.lockbtn {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 15px; cursor: pointer; white-space: nowrap; transition: border-color .14s ease, color .14s ease;
}
.lockbtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.build { transition: opacity .3s ease; }
.act-locked .build { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .build { transition: none; } }

.budget { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.budget b { font-family: var(--disp); font-size: 24px; letter-spacing: -.02em; color: var(--ink); }
.budget.over b { color: var(--thread); }

.parts { display: grid; gap: 8px; }
.part {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 11px; align-items: start;
  border: 1px solid var(--line); border-radius: 4px; background: var(--card);
  padding: 12px 14px; cursor: pointer; text-align: left; color: var(--ink);
  transition: border-color .14s ease, background .14s ease;
}
.part:hover { border-color: var(--accent); }
.part .box { width: 16px; height: 16px; border: 1.5px solid var(--soft); border-radius: 3px; margin-top: 2px; position: relative; }
.part.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, white); }
.part.on .box { background: var(--accent); border-color: var(--accent); }
.part.on .box::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 11px; line-height: 15px; text-align: center; }
.part .pn { display: block; font-family: var(--disp); font-weight: 700; font-size: 14.5px; letter-spacing: -.005em; }
.part .pd { display: block; font-size: 12.5px; color: var(--soft); line-height: 1.5; margin-top: 3px; }
.part .pc { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.part.on .pc { color: var(--accent-ink); }

.readout { border: 1px solid var(--line); border-radius: 4px; background: var(--card); padding: 16px 16px 14px; position: sticky; top: 74px; }
.readout h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); font-weight: 500; }
.props { display: grid; gap: 7px; margin-top: 12px; }
.prop { display: grid; grid-template-columns: 14px 1fr; gap: 9px; align-items: start; font-size: 12.5px; line-height: 1.45; }
.prop .dotm { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; border: 1.5px solid var(--faint); }
.prop.met .dotm { background: var(--green); border-color: var(--green); }
.prop.broken .dotm { background: var(--thread); border-color: var(--thread); }
.prop .pl2 { color: var(--soft); }
.prop.met .pl2 { color: var(--ink); }
.prop.broken .pl2 { color: var(--thread); }
.readout .warn { display: none; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 12.5px; line-height: 1.55; color: var(--thread); }
.readout .warn.show { display: block; }

.report { margin-top: 22px; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.report-head { background: var(--ink); color: var(--bg); padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-head span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
/* Light cards sitting inside a dark (.plate.ink) section must restate their
   own ink colour. Inheriting the section's near-white text renders them
   invisible on their own white background. */
.attack { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: var(--card); align-items: start; color: var(--ink); }
.plate.ink .attack, .plate.ink .attack .an { color: var(--ink); }
.plate.ink .attack .ad, .plate.ink .attack .ao { color: var(--soft); }
.plate.ink .mine { color: var(--ink); }
.plate.ink .mine p { color: var(--ink); }
.plate.ink .mine h4 { color: var(--accent-ink); }
.attack:last-child { border-bottom: 0; }
.attack .an { font-family: var(--disp); font-weight: 700; font-size: 14.5px; }
.attack .ad { font-size: 12.5px; color: var(--soft); line-height: 1.5; margin-top: 3px; }
.attack .ao { font-size: 12.5px; line-height: 1.5; margin-top: 7px; grid-column: 1 / -1; padding-top: 8px; border-top: 1px dashed var(--line); }
.verdict-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 999px; padding: 5px 11px; white-space: nowrap; border: 1px solid;
}
.v-prevented { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, white); background: color-mix(in srgb, var(--green) 8%, white); }
.v-attributed { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 32%, white); background: color-mix(in srgb, var(--accent) 6%, white); }
.v-missed { color: var(--thread); border-color: color-mix(in srgb, var(--thread) 40%, white); background: color-mix(in srgb, var(--thread) 7%, white); }

.mine { margin-top: 20px; border: 1px dashed var(--line); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--accent) 3%, white); padding: 16px 18px; }
.mine h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.mine p { font-size: 14px; line-height: 1.62; margin-top: 9px; }
.mine .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.mine .chips span { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid color-mix(in srgb, var(--accent) 28%, white); background: #fff; color: var(--accent-ink); border-radius: 3px; padding: 5px 9px; }
.mine .chips span.cut { border-color: color-mix(in srgb, var(--thread) 34%, white); color: var(--thread); border-style: dashed; }


/* ================================================================
   SIGNATURE LAYER
   The moves that make the site read as one authored object:
   marker sweep, drawn link underlines, ink-flood doors,
   staggered grids, drifting numerals.
   ================================================================ */

/* 1. Marker sweep: a highlighter stroke that draws itself on arrival. */
.sweep {
  background-image: linear-gradient(to top, color-mix(in srgb, var(--accent) 26%, transparent) 0 38%, transparent 38%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size .9s cubic-bezier(.25,.8,.25,1) .25s;
}
.in-view .sweep, .swept .sweep { background-size: 100% 100%; }

/* 2. Content links: underline that draws left to right. */
main p a:not(.btn), main li a:not(.btn), .margin-note a, .margin-thread a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size .3s ease, color .15s ease;
}
main p a:not(.btn):hover, main li a:not(.btn):hover { background-size: 0% 1px; color: var(--accent); }

/* 3. Doors: ink flood on hover. The homepage's one unforgettable move. */
.door { position: relative; overflow: hidden; isolation: isolate; }
.door::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .38s cubic-bezier(.3,.8,.3,1);
}
.door:hover::before { transform: scaleX(1); }
.door:hover, .door:hover .dt, .door:hover p { color: #fff; }
.door:hover .k, .door:hover .go { color: rgba(255,255,255,.85); }
.door:hover .go { transform: translateX(6px); }
.door .go { transition: transform .3s ease, color .2s ease; }
.door:hover { border-color: var(--accent); box-shadow: 0 18px 44px rgba(36,56,232,.28); }

/* 4. Staggered grids: children rise in sequence, motion stays additive. */
.stagger > * { transform: translateY(12px); transition: transform .55s cubic-bezier(.2,.7,.3,1); }
.stagger.in-view > * { transform: none; }
.stagger.in-view > *:nth-child(1) { transition-delay: .04s; }
.stagger.in-view > *:nth-child(2) { transition-delay: .1s; }
.stagger.in-view > *:nth-child(3) { transition-delay: .16s; }
.stagger.in-view > *:nth-child(4) { transition-delay: .22s; }
.stagger.in-view > *:nth-child(5) { transition-delay: .28s; }
.stagger.in-view > *:nth-child(6) { transition-delay: .34s; }

/* 5. Nav: the same drawn underline, so the system repeats. */
#nav .links a {
  border-bottom: 0;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px;
  transition: background-size .25s ease, color .15s ease;
}
#nav .links a:hover, #nav .links a.active { background-size: 100% 2px; }

/* dark-plate contrast: margin notes must restate their accent on ink */
.plate.ink .margin-note { color: var(--lab-soft); border-left-color: var(--lab-accent); }
.plate.ink .margin-note .k { color: var(--lab-accent); }
.plate.ink .margin-thread { color: var(--lab-soft); }

@media (prefers-reduced-motion: reduce) {
  .sweep { background-size: 100% 100%; transition: none; }
  .stagger > * { transform: none; transition: none; }
  .door::before { transition: none; }
}


/* ================================================================
   VISIBILITY PASS
   Buttons must survive dark plates; motion must be perceptible
   on every page, not implied.
   ================================================================ */

/* Buttons on ink plates: restate the contrast. */
.plate.ink .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.plate.ink .btn:hover { background: var(--lab-accent); border-color: var(--lab-accent); color: var(--ink); }
.plate.ink .btn--ghost { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.55); }
.plate.ink .btn--ghost:hover { background: transparent; color: var(--lab-accent); border-color: var(--lab-accent); }

/* Every plate announces itself: the title rule draws in from the left. */
.plate-head { border-top-color: var(--line); }
.plate-head::after {
  content: ""; position: absolute; left: 0; top: -1.5px; height: 2px; width: 100%;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .8s cubic-bezier(.25,.8,.25,1) .1s;
}
.plate-head.in-view::after { transform: scaleX(1); }
.plate.ink .plate-head { border-top-color: rgba(255,255,255,.18); }
.plate.ink .plate-head::after { background: var(--lab-accent); }

/* Stagger, now perceptible. */
.stagger > * { transform: translateY(26px); transition: transform .65s cubic-bezier(.2,.7,.25,1); }
.stagger.in-view > * { transform: none; }
.stagger.in-view > *:nth-child(1) { transition-delay: .05s; }
.stagger.in-view > *:nth-child(2) { transition-delay: .13s; }
.stagger.in-view > *:nth-child(3) { transition-delay: .21s; }
.stagger.in-view > *:nth-child(4) { transition-delay: .29s; }
.stagger.in-view > *:nth-child(5) { transition-delay: .37s; }
.stagger.in-view > *:nth-child(6) { transition-delay: .45s; }
.stagger.in-view > *:nth-child(7) { transition-delay: .53s; }
.stagger.in-view > *:nth-child(8) { transition-delay: .61s; }

@media (prefers-reduced-motion: reduce) {
  .plate-head::after { transform: scaleX(1); transition: none; }
  .stagger > * { transform: none; transition: none; }
}


/* ================================================================
   THEME ZONES
   One ambient move per page, drawn from the page's own content.
   Never under body text.
   ================================================================ */

/* bid leveling: the number the whole case turns on, embossed in the dark band */
.money-line { position: relative; }
.money-ghost {
  position: absolute; right: -0.05em; bottom: -0.22em; z-index: 0;
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(150px, 26vw, 340px); line-height: 1; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 143, 107, .14);
  pointer-events: none; user-select: none;
}
.money-line > p { position: relative; z-index: 1; }

/* mohar: the seal, embossed behind the case brief */
#brief.sealbrief { overflow: hidden; }
.sealmark {
  position: absolute; top: -40px; right: -60px; z-index: 0;
  width: clamp(260px, 34vw, 430px); height: auto;
  color: rgba(232, 69, 31, .10);
  transform: rotate(-12deg);
  pointer-events: none; user-select: none;
}
@media (max-width: 720px) { .sealmark { width: 230px; right: -70px; top: -30px; opacity: .8; } }

/* guard1: the page performs its own argument when Night is selected */
#nightzone { transition: background-color .7s ease, color .7s ease; }
#nightzone .plate-head, #nightzone .prose, #nightzone .margin-note, #nightzone .k { transition: color .7s ease; }
#nightzone.ink .modebtn { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.35); }
#nightzone.ink .modebtn:hover { border-color: var(--lab-accent); }
#nightzone.ink .modebtn.is-on { background: var(--signal); border-color: var(--signal); color: #fff; }
#nightzone.ink .device { box-shadow: 0 0 90px rgba(255, 60, 60, .22), 0 18px 44px rgba(0,0,0,.5); }
.plate.ink .k { color: var(--lab-soft); }
.plate.ink .lede, .plate.ink p { color: inherit; }

/* ================================================================
   THE DRAFTING LAYER
   The blueprint ground earns its ruling: fine vellum grid with a
   major line every fourth cell, sheet-corner marks on every plate,
   and dimension-line figures drawn in the draftsman's notation.
   ================================================================ */

/* ruled vellum under everything; solid surfaces (ink plates, lab,
   cards, bands) cover it and read as sheets laid on the table */
body.dossier {
  background-image:
    linear-gradient(rgba(36, 56, 232, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 56, 232, .06) 1px, transparent 1px),
    linear-gradient(rgba(36, 56, 232, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 56, 232, .035) 1px, transparent 1px);
  background-size: 112px 112px, 112px 112px, 28px 28px, 28px 28px;
}

/* sheet corners: two drawn Ls per plate, light variant on ink */
.plate::before, .plate::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  pointer-events: none; z-index: 1;
}
.plate::before {
  top: 16px; left: 16px;
  border-top: 1.5px solid rgba(36, 56, 232, .30);
  border-left: 1.5px solid rgba(36, 56, 232, .30);
}
.plate::after {
  bottom: 16px; right: 16px;
  border-bottom: 1.5px solid rgba(36, 56, 232, .30);
  border-right: 1.5px solid rgba(36, 56, 232, .30);
}
.plate.ink::before, .plate.ink::after { border-color: rgba(143, 165, 255, .42); }

/* dimension figures: inline SVG drawings; wide ones scroll in place */
.dimfig { margin-top: clamp(26px, 4vw, 40px); overflow-x: auto; }
.dimfig svg { display: block; width: 100%; min-width: 680px; height: auto; }
/* a figure whose story is at its right edge opens scrolled to that end */
.dimfig.from-end { direction: rtl; }
.dimfig.from-end > svg { direction: ltr; }
.dimfig .draw {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.1s cubic-bezier(.4, 0, .2, 1) .2s;
}
.dimfig.in-view .draw { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .dimfig .draw { transition: none; stroke-dashoffset: 0; }
}

/* ================================================================
   SHEET 00 · the cover title block (r25)
   A drawing's title block: bordered grid of labeled cells. Every
   claim cites the plate that backs it, click-to-source style.
================================================================ */
.tblock {
  display: grid; grid-template-columns: 7fr 5fr;
  grid-template-areas: "who rec" "how rec" "how why" "how act" "foot foot";
  border: 1.5px solid var(--ink); background: var(--card);
}
.tcell { padding: 20px 22px 18px; border-top: 1px solid var(--line); min-width: 0; }
.tc-who { grid-area: who; border-top: none; border-right: 1px solid var(--line); }
.tc-how { grid-area: how; border-right: 1px solid var(--line); }
.tc-rec { grid-area: rec; border-top: none; display: flex; flex-direction: column; gap: 4px; }
.tc-why { grid-area: why; }
.tc-act { grid-area: act; }
.tc-foot {
  grid-area: foot; border-top: 1.5px solid var(--ink);
  padding: 11px 22px 10px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .05em; color: var(--faint);
}
.tk {
  font-family: var(--mono); font-weight: 600; font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-ink); display: block; margin-bottom: 10px;
}
.tc-who p, .tc-why p { font-size: 14px; line-height: 1.62; }
.rules { list-style: none; display: grid; gap: 15px; counter-reset: rule; }
.rules li {
  counter-increment: rule; display: grid;
  grid-template-columns: auto 1fr; gap: 12px;
  font-size: 14px; line-height: 1.6;
}
.rules li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: var(--mono); font-weight: 600; font-size: 11px;
  color: var(--accent); padding-top: 3px;
}
.cite {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .03em; color: var(--accent-ink);
  margin-top: 5px; margin-right: 16px; white-space: nowrap;
}
.cite::before { content: "→ "; }
.trec {
  display: grid; gap: 1px; padding: 9px 10px 8px; margin: 0 -10px;
  border-radius: 8px; text-decoration: none; color: var(--ink);
}
.trec:hover { background: color-mix(in srgb, var(--accent) 6%, white); color: var(--ink); }
.trec b { font-family: var(--mono); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.trec span { font-size: 12.5px; color: var(--soft); line-height: 1.45; }
.actrow { display: flex; flex-wrap: wrap; gap: 10px; }
.tc-act .longer { margin-top: 12px; font-size: 13px; }
@media (max-width: 860px) {
  .tblock { grid-template-columns: 1fr; grid-template-areas: "who" "how" "rec" "why" "act" "foot"; }
  .tc-who, .tc-how { border-right: none; }
  .tc-rec { border-top: 1px solid var(--line); }
}

/* deep-link arrival: land clear of the sticky nav, corners answer */
.plate, section[id], #main { scroll-margin-top: 72px; }
.plate::before, .plate::after {
  transition: width .5s ease .25s, height .5s ease .25s, border-color .5s ease .25s;
}
.plate:target::before, .plate:target::after {
  width: 30px; height: 30px; border-color: var(--accent);
}
.plate:target .plate-head .pl { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .plate::before, .plate::after { transition: none; }
}

/* ================================================================
   SHEET COVERS (r26)
   Every sheet in the set opens with its own index strip: the
   claims, each linking to the plate that backs it. Same
   click-to-source convention as Sheet 00 on the set's cover.
================================================================ */
.sheetdex {
  width: var(--w); margin: 22px auto 0;
  display: grid; grid-template-columns: 150px;
  grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1.5px solid var(--ink); background: var(--card);
}
.sdk {
  display: flex; align-items: center;
  padding: 13px 16px; border-right: 1px solid var(--line);
  font-family: var(--mono); font-weight: 600; font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink);
}
.sdx {
  display: block; min-width: 0; padding: 12px 16px 11px;
  border-right: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.sdx:last-child { border-right: none; }
.sdx:hover { background: color-mix(in srgb, var(--accent) 6%, white); }
.sdx b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.45; letter-spacing: -.005em; }
.sdx span {
  display: block; margin-top: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sdx span::before { content: "→ "; }
@media (max-width: 900px) {
  .sheetdex { grid-auto-flow: row; grid-template-columns: 1fr; grid-auto-columns: auto; }
  .sdk { padding: 11px 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .sdx { border-right: none; border-bottom: 1px solid var(--line); }
  .sdx:last-child { border-bottom: none; }
}

/* ================================================================
   SOURCED (r40)
   The site cites itself the way the product does: a marked claim
   opens the sentence that backs it, then links to its plate.
   Without script every mark is still a plain link.
================================================================ */
.nw { white-space: nowrap; }
.kn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 4px; vertical-align: .32em;
  font-family: var(--mono); font-weight: 600; font-size: 10.5px; line-height: 1; letter-spacing: 0;
  color: var(--accent-ink); background: var(--card);
  border: 1.5px solid var(--accent); border-radius: 50%;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.kn::after { content: ""; position: absolute; inset: -12px; }   /* a finger-sized target */
.kn:hover, .kn[aria-expanded="true"] { background: var(--accent); color: #fff; }
#cover h1 .kn {
  width: max(22px, .3em); height: max(22px, .3em); font-size: max(11px, .15em);
  vertical-align: top; margin: .2em 0 0 .07em;
}
/* the marks announce themselves once, after the headline settles */
@keyframes knPing { from { box-shadow: 0 0 0 0 rgba(36, 56, 232, .42); } to { box-shadow: 0 0 0 12px rgba(36, 56, 232, 0); } }
.swept .kn { animation: knPing 1.1s ease-out calc(1.3s + var(--i, 0) * .2s) 2; }
.kn-hint {
  margin-top: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--soft);
}
.cite[aria-expanded="true"], .trec[aria-expanded="true"] { color: var(--accent); }
.trec[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 6%, white); }

.srccard {
  position: absolute; z-index: 55; width: min(372px, calc(100vw - 24px));
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px;
  box-shadow: 0 18px 44px rgba(16, 16, 19, .16);
}
.srccard[hidden] { display: none; }
.srccard:focus { outline: none; }
@keyframes srcIn { from { transform: translateY(7px); } to { transform: none; } }
.srccard.is-in { animation: srcIn .2s cubic-bezier(.2, .8, .3, 1); }
.sc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 6px 7px 14px; border-bottom: 1px solid var(--line); background: var(--bg-alt);
}
.sc-at { font-family: var(--mono); font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.sc-x {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none;
  font-size: 19px; line-height: 1; color: var(--soft); cursor: pointer;
}
.sc-x:hover { color: var(--ink); background: var(--line-soft); }
.sc-quote { padding: 15px 16px 6px; font-family: var(--quote); font-size: 16.5px; line-height: 1.62; color: var(--ink); }
/* the sentence, highlighted the way the app highlights it in the PDF */
.sc-quote span {
  background: linear-gradient(transparent 56%, rgba(36, 56, 232, .15) 56%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sc-open {
  display: block; padding: 9px 16px 14px; font-family: var(--mono); font-weight: 600; font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); text-decoration: none;
}
.sc-open:hover { color: var(--accent); }
.srccard.is-sheet { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; }
@media (prefers-reduced-motion: reduce) {
  .swept .kn, .srccard.is-in { animation: none; }
}

/* ================================================================
   WAYFINDING (r40)
   A long sheet gets a plate index: a drafting scale at the right
   edge on wide screens, a pill that opens the same list on narrow
   ones. Every sheet ends with a strip to its neighbours.
================================================================ */
.rail, .railpill { display: none; }
.rail ol { list-style: none; }
.rail a { text-decoration: none; font-family: var(--mono); }
@media (min-width: 1360px) {
  .rail {
    display: block; position: fixed; z-index: 40; right: 44px; top: 50%; transform: translateY(-50%);
    padding: 8px 0 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  }
  .rail ol { display: grid; border-right: 1px solid var(--line); }
  .rail a {
    position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    padding: 5px 15px 5px 0; font-size: 10.5px; letter-spacing: .08em; color: var(--faint);
  }
  .rail a::after { content: ""; position: absolute; right: 0; top: 50%; width: 6px; height: 1px; background: var(--faint); }
  .rail a:hover { color: var(--ink); }
  .rail a[aria-current="true"] { color: var(--accent-ink); font-weight: 600; }
  .rail a[aria-current="true"]::after { width: 12px; height: 2px; margin-top: -1px; background: var(--accent); }
  .rail .rt { display: none; text-transform: uppercase; white-space: nowrap; }
  .rail:hover, .rail:focus-within { box-shadow: 0 14px 36px rgba(16, 16, 19, .12); border-color: var(--ink); }
  .rail:hover .rt, .rail:focus-within .rt { display: inline; }
}
@media (max-width: 1359.98px) {
  .railpill {
    display: block; position: fixed; z-index: 45; right: 14px; bottom: 14px;
    font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .08em;
    color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px;
    padding: 9px 14px; cursor: pointer; box-shadow: 0 8px 22px rgba(16, 16, 19, .16);
    transform: translateY(90px); transition: transform .25s ease;
  }
  .railpill.is-on { transform: none; }
  .rail.is-open {
    display: block; position: fixed; z-index: 46; left: 12px; right: 12px; bottom: 62px;
    max-height: 62vh; overflow-y: auto; background: var(--card);
    border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: 0 18px 44px rgba(16, 16, 19, .18);
  }
  .rail.is-open a {
    display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 14px;
    padding: 12px 14px; font-size: 11.5px; letter-spacing: .06em; color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
  }
  .rail.is-open li:last-child a { border-bottom: 0; }
  .rail.is-open .rc { color: var(--accent-ink); font-weight: 600; }
  .rail.is-open .rt { text-transform: uppercase; }
  .rail.is-open a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 6%, white); }
}
@media (prefers-reduced-motion: reduce) { .railpill { transition: none; } }

.sheetnav {
  width: var(--w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--ink); background: var(--card);
}
.sheetnav .sn { display: grid; gap: 5px; padding: 16px 20px 15px; text-decoration: none; color: var(--ink); }
.sheetnav .sn + .sn { border-left: 1px solid var(--line); text-align: right; }
.sheetnav .sn:hover { background: color-mix(in srgb, var(--accent) 6%, white); color: var(--ink); }
.sheetnav .k { color: var(--accent-ink); letter-spacing: .14em; }
.sheetnav b { font-family: var(--disp); font-weight: 800; font-size: clamp(19px, 2.2vw, 25px); letter-spacing: -.015em; line-height: 1.1; }
@media (max-width: 560px) {
  .sheetnav { grid-template-columns: 1fr; }
  .sheetnav .sn + .sn { border-left: 0; border-top: 1px solid var(--line); text-align: left; }
}

/* ---------------------------------------------------------------
   Ink plates: links and choice cards. The measure chapter was a .lab
   section before it became an ink plate, and lost these with the class:
   its one link read at 1.9:1 and its choice cards stayed white.
--------------------------------------------------------------- */
.plate.ink a:not(.btn) { color: var(--lab-accent); }
.plate.ink a:not(.btn):hover { color: #fff; }
.plate.ink .copt { background: var(--lab-card); border-color: var(--lab-line); color: var(--lab-ink); box-shadow: none; }
.plate.ink .copt .d { color: var(--lab-soft); }
.plate.ink .copt-static:hover { border-color: var(--lab-line); }
.plate.ink .copt-static.my, .plate.ink .copt-static.my:hover { border-color: var(--lab-accent); }
.plate.ink .mychip { background: var(--lab-accent); color: var(--lab-bg); }
.plate.ink .posr { color: var(--lab-ink); border-top-color: rgba(160, 180, 255, .2); }
.plate.ink .posr.dim { color: var(--lab-soft); }

/* ---------------------------------------------------------------
   Phones: data tables and wide figures.
   Number tables keep each cell on one line and scroll sideways instead
   of wrapping into stacks. An edge fade says more is there and lifts at
   the far end (classes set in main.js). The Guard1 trade-off table is
   prose, so it stacks into one block per decision instead.
--------------------------------------------------------------- */
.chartfig { overflow-x: auto; }
@media (max-width: 720px) {
  .lab-table { min-width: 600px; }
  .lab-table th, .lab-table td { white-space: nowrap; }
  .level-table { min-width: 520px; }
  .level-table th, .level-table td.num { white-space: nowrap; }
  .frag table { min-width: 600px; }
  .frag td:first-child { min-width: 190px; }
  .chartfig svg { min-width: 600px; }
}
.can-scroll {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent);
}
.dimfig.from-end.can-scroll {
  -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent);
          mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent);
}
.can-scroll.at-far { -webkit-mask-image: none; mask-image: none; }

@media (max-width: 640px) {
  .honesty.tradeoffs, .honesty.tradeoffs tbody, .honesty.tradeoffs tr, .honesty.tradeoffs td { display: block; }
  .honesty.tradeoffs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .honesty.tradeoffs tr { padding: 15px 16px 14px; border-bottom: 1px solid var(--line-soft); }
  .honesty.tradeoffs tbody tr:last-child { border-bottom: 0; }
  .honesty.tradeoffs td, .honesty.tradeoffs td.real { border: 0; padding: 0; }
  .honesty.tradeoffs td.real { font-size: 15px; font-weight: 600; line-height: 1.4; }
  .honesty.tradeoffs td + td { margin-top: 9px; }
  .honesty.tradeoffs td + td::before {
    display: block; margin-bottom: 2px;
    font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--soft);
  }
  .honesty.tradeoffs td:nth-child(2)::before { content: "Trade-off accepted"; }
  .honesty.tradeoffs td:nth-child(3)::before { content: "Why anyway"; }
}

/* ---------------------------------------------------------------
   App screenshots: the document frame at full width, each image a
   link to its full-size capture. One wide shot, then a pair.
--------------------------------------------------------------- */
.appshots { margin-top: 22px; }
.docshot.appshot { max-width: none; }
.appshot a { display: block; cursor: zoom-in; }
.appshot a:focus-visible { outline-offset: -3px; }
.appshot figcaption { font-size: 13px; }
.appshots-2 { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 760px) { .appshots-2 { grid-template-columns: 1fr; } }
