/* ==========================================================
   Quantum-Safe, Explained — styles
   Paper + ink. Hard edges, mono labels, one loud yellow.
   ========================================================== */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --card: #fffdf8;
  --ink: #141414;
  --ink-2: #3d3a35;
  --ink-3: #6f6a61;
  --line: #141414;

  --yellow: #ffd84d;
  --yellow-soft: #fff0b3;
  --orange: #ff6b35;
  --orange-soft: #ffd9c7;
  --blue: #7aa7ff;
  --blue-soft: #dbe7ff;
  --mint: #7fdcac;
  --mint-soft: #d6f5e4;
  --red: #ef4444;
  --red-soft: #fde0de;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);

  --f-display: "Archivo", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --read: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(20,20,20,.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,239,230,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 900; letter-spacing: -.01em;
  text-decoration: none; font-size: 17px; text-transform: uppercase;
}
.brand-mark {
  width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--yellow); box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--f-mono); font-size: 12.5px; text-decoration: none;
  padding: 6px 10px; border-radius: 8px; border: 2px solid transparent; white-space: nowrap;
  color: var(--ink-2);
}
.nav a:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--paper); }
.progress { position: absolute; left: 0; bottom: -2px; height: 3px; width: 0; background: var(--orange); }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.read { max-width: var(--read); }
section.part { padding: 96px 0 40px; }

/* ---------- labels / chips ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: var(--mint); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow-sm); text-decoration: none; white-space: nowrap;
}
.chip.y { background: var(--yellow); }
.chip.o { background: var(--orange-soft); }
.chip.b { background: var(--blue-soft); }
.chip.m { background: var(--mint-soft); }
.chip.r { background: var(--red-soft); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 24px; }
.hero h1 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(32px, 8.4vw, 104px); line-height: .9; letter-spacing: -.035em;
  margin: 22px 0 18px;
}
.hl {
  display: inline-block; background: var(--yellow); border: 3px solid var(--ink);
  padding: 0 .12em; box-shadow: var(--shadow); transform: rotate(-1.2deg);
  margin-top: .08em;
}
.hero .lede { font-size: clamp(18px, 2vw, 21px); max-width: 640px; color: var(--ink-2); margin: 0 0 28px; }
.hero .lede strong { color: var(--ink); }
.hero .lede p { margin: 0 0 14px; }
.hero .lede p:first-child { font-size: 1.12em; color: var(--ink); }

/* ---------- byline ---------- */
.byline {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  padding: 3px 14px 3px 3px; box-shadow: 2px 2px 0 var(--ink); font-size: 14px;
  transition: transform .12s, box-shadow .12s;
}
.byline:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.byline img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; background: var(--yellow); }

/* ---------- newsletter CTA ---------- */
.nl {
  position: relative; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px;
  margin: 34px 0 8px; background: var(--orange); border: 3px solid var(--ink); border-radius: var(--r);
  box-shadow: 8px 8px 0 var(--ink); padding: 28px 30px;
}
.nl h3 { font-family: var(--f-display); font-weight: 900; font-size: clamp(24px, 3vw, 34px); margin: 0 0 10px; line-height: 1.05; color: var(--ink); }
.nl p { margin: 0; color: var(--ink); font-size: 16px; }
.nl .callout-label { background: var(--yellow); }
.nl-form { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 14px; }
.nl-form.has-embed .nl-fallback, .nl-form.is-subbed .nl-fallback { display: none; }
.nl-subbed { display: none; font-weight: 800; font-size: 17px; background: var(--mint-soft); border: 2px solid var(--ink); border-radius: 10px; padding: 14px 16px; text-align: center; }
.nl-form.is-subbed .nl-subbed { display: block; }
.nl-form.is-subbed .nl-embed { display: none; }
.btn.nl-fallback { width: 100%; justify-content: center; font-size: 17px; padding: 14px 18px; }
.nl-fine { font-family: var(--f-mono); font-size: 11.5px; margin-top: 8px; color: var(--ink-2); }
.nl-fine a { color: var(--ink); }
.nl-sticker {
  position: absolute; top: -16px; right: 22px; transform: rotate(6deg);
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 15px; padding: 3px 10px;
}
@media (max-width: 760px) { .nl { grid-template-columns: 1fr; padding: 24px 18px; box-shadow: 5px 5px 0 var(--ink); } }

/* ---------- bitcoin pros/cons ---------- */
.pc { margin: 12px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.pc li { margin-bottom: 6px; }
.hero-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--f-body); font-weight: 700; font-size: 15px; color: var(--ink);
  padding: 11px 18px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow); text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.y { background: var(--yellow); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; box-shadow: var(--shadow-sm); }

.author {
  display: flex; align-items: center; gap: 12px; margin-top: 34px;
  font-size: 14.5px; color: var(--ink-2);
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink);
  background: var(--blue); display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 900; font-size: 16px; color: var(--ink);
}
.author b { color: var(--ink); }

/* TL;DR card */
.tldr {
  margin-top: 48px; background: var(--card); border: 2px solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden;
}
.tldr-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 2px solid var(--ink); background: var(--yellow);
  font-family: var(--f-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
}
.tldr-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.tldr-item { padding: 20px 18px 22px; border-right: 2px solid var(--ink); }
.tldr-item:last-child { border-right: 0; }
.tldr-item .n { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.tldr-item h3 { font-family: var(--f-display); font-weight: 800; font-size: 19px; line-height: 1.15; margin: 8px 0 8px; letter-spacing: -.01em; }
.tldr-item p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* ---------- section headers ---------- */
.part-head { margin-bottom: 36px; }
.part-num {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
}
.part-num span {
  background: var(--ink); color: var(--paper); padding: 3px 8px; border-radius: 6px;
}
.part-head h2 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(34px, 5.4vw, 64px); line-height: .95; letter-spacing: -.03em;
  margin: 16px 0 14px;
}
.part-head .sub { font-size: 19px; color: var(--ink-2); max-width: 640px; margin: 0; }

h3.t {
  font-family: var(--f-display); font-weight: 800; font-size: 27px; line-height: 1.15;
  letter-spacing: -.015em; margin: 56px 0 12px;
}
h4.t { font-family: var(--f-display); font-weight: 800; font-size: 19px; margin: 28px 0 6px; }
p { margin: 0 0 18px; }
.read p, .read li { color: #24221f; }
.read ul, .read ol { padding-left: 22px; margin: 0 0 18px; }
.read li { margin-bottom: 8px; }
mark { background: var(--yellow-soft); padding: 0 3px; border-radius: 3px; color: inherit; }
code, .mono { font-family: var(--f-mono); font-size: .88em; }
code { background: var(--paper-2); border: 1px solid rgba(20,20,20,.18); padding: 1px 5px; border-radius: 5px; }

/* ---------- callouts ---------- */
.analogy, .note, .warn {
  position: relative; border: 2px solid var(--ink); border-radius: var(--r);
  padding: 18px 20px 18px 20px; margin: 26px 0; box-shadow: var(--shadow);
}
.analogy { background: var(--blue-soft); }
.note { background: var(--mint-soft); }
.warn { background: var(--orange-soft); }
.callout-label {
  display: inline-block; font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .08em; background: var(--card); border: 2px solid var(--ink); border-radius: 6px;
  padding: 1px 8px; margin-bottom: 10px;
}
.analogy p:last-child, .note p:last-child, .warn p:last-child { margin-bottom: 0; }

/* Go deeper (details) */
details.deeper {
  border: 2px solid var(--ink); border-radius: var(--r); background: var(--card);
  margin: 26px 0; box-shadow: var(--shadow-sm); overflow: hidden;
}
details.deeper summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 16px;
}
details.deeper summary::-webkit-details-marker { display: none; }
details.deeper summary .tag {
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--ink); color: var(--paper); padding: 3px 7px; border-radius: 5px; flex: none;
}
details.deeper summary .pm {
  margin-left: auto; width: 26px; height: 26px; flex: none; border: 2px solid var(--ink); border-radius: 7px;
  display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; background: var(--yellow);
  transition: transform .15s ease;
}
details.deeper[open] summary .pm { transform: rotate(45deg); }
details.deeper[open] summary { border-bottom: 2px dashed var(--ink); }
details.deeper .body { padding: 18px 20px 6px; font-size: 16px; }

/* ---------- figures ---------- */
figure.fig {
  margin: 34px 0; background: var(--card); border: 2px solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden;
}
.fig-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; border-bottom: 2px solid var(--ink); background: var(--paper);
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.fig-bar .lights { display: flex; gap: 6px; }
.fig-bar .lights i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); display: block; }
.fig-bar .lights i:nth-child(1) { background: var(--orange); }
.fig-bar .lights i:nth-child(2) { background: var(--yellow); }
.fig-bar .lights i:nth-child(3) { background: var(--mint); }
.fig-body { padding: 22px; }
.fig-body svg { width: 100%; height: auto; margin: 0 auto; }
figcaption {
  padding: 12px 18px; border-top: 2px solid var(--ink); font-size: 14.5px; color: var(--ink-2);
  background: var(--paper);
}
figcaption b { color: var(--ink); }
.wide { max-width: 980px; }

/* svg text */
.svg-mono { font-family: var(--f-mono); }
.svg-disp { font-family: var(--f-display); font-weight: 800; }
.svg-body { font-family: var(--f-body); }

/* ---------- two/three col cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.card h4 { font-family: var(--f-display); font-weight: 800; font-size: 20px; margin: 10px 0 6px; line-height: 1.15; }
.card p { font-size: 15px; line-height: 1.55; margin: 0 0 10px; color: var(--ink-2); }
.card .meta { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.card.y { background: var(--yellow-soft); }
.card.b { background: var(--blue-soft); }
.card.m { background: var(--mint-soft); }
.card.o { background: var(--orange-soft); }

/* algorithm cards */
.algo { display: flex; flex-direction: column; }
.algo .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.algo .name { font-family: var(--f-display); font-weight: 900; font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.algo .aka { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.algo .job { margin: 14px 0 10px; font-size: 15px; }
.algo dl { margin: auto 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; border-top: 2px dashed var(--ink); padding-top: 12px; }
.algo dt { font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
.algo dd { margin: 0; }

/* ---------- comparison table ---------- */
.tbl-wrap { overflow-x: auto; margin: 26px 0; border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); background: var(--card); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--ink); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--paper); }
.tbl td:first-child { font-weight: 700; }

/* ---------- size bars ---------- */
.bars { padding: 6px 4px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin: 12px 0; }
.bar-row .lbl { font-family: var(--f-mono); font-size: 13px; line-height: 1.25; }
.bar-row .lbl small { display: block; color: var(--ink-3); font-size: 11px; }
.bar-track { position: relative; display: flex; flex-direction: column; gap: 4px; }
.bar {
  height: 18px; border: 2px solid var(--ink); border-radius: 5px; min-width: 6px;
  display: flex; align-items: center; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.bar.pk { background: var(--blue); }
.bar.sg { background: var(--orange); }
.bar-val { font-family: var(--f-mono); font-size: 11.5px; white-space: nowrap; padding-left: calc(100% + 8px); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 12px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 3px; vertical-align: -2px; margin-right: 6px; }

/* ---------- interactive widgets ---------- */
.widget {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow-lg); margin: 34px 0; overflow: hidden;
}
.widget-head {
  padding: 12px 18px; border-bottom: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.widget-head .live { display: inline-flex; align-items: center; gap: 6px; color: var(--yellow); }
.widget-head .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.widget-body { padding: 20px; }
.widget-body p.hint { font-size: 14.5px; color: var(--ink-2); margin: 0 0 16px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.presets button { font-family: var(--f-mono); font-size: 12.5px; }
.presets button[aria-pressed="true"] { background: var(--yellow); }

.factor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pane { border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 14px 16px; background: var(--paper); }
.pane h5 { margin: 0 0 8px; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }
.pane .big { font-family: var(--f-mono); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; min-height: 28px; line-height: 1.45; }
.pane .stat { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.pane.easy h5 span { color: #138a4c; }
.pane.hard h5 span { color: #c2410c; }

.mosca-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.slider label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.slider .help { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; line-height: 1.4; min-height: 36px; }
.slider .val { font-family: var(--f-mono); font-size: 22px; font-weight: 700; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 6px;
  background: var(--paper-2); border: 2px solid var(--ink); outline: none; margin: 8px 0 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 6px;
  background: var(--yellow); border: 2px solid var(--ink); cursor: pointer; box-shadow: var(--shadow-sm);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 6px; background: var(--yellow); border: 2px solid var(--ink); cursor: pointer;
}
.mosca-viz { border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 16px; background: var(--paper); }
.mtrack { position: relative; height: 34px; margin: 8px 0; }
.mseg {
  position: absolute; top: 0; height: 100%; border: 2px solid var(--ink); border-radius: 6px;
  display: flex; align-items: center; padding: 0 8px; font-family: var(--f-mono); font-size: 12px; white-space: nowrap; overflow: hidden;
  transition: left .25s ease, width .25s ease;
}
.mseg.x { background: var(--blue); }
.mseg.y { background: var(--mint); }
.mseg.z { background: var(--orange); }
.mline { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 3px dashed var(--ink); transition: left .25s ease; }
.mscale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.verdict {
  margin-top: 16px; border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 12px 14px;
  font-weight: 600; box-shadow: var(--shadow-sm);
}
.verdict.bad { background: var(--red-soft); }
.verdict.ok { background: var(--mint-soft); }

/* LWE widget */
.lwe-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 14px; }
.lwe-table td { padding: 6px 8px; border-bottom: 1px dashed rgba(20,20,20,.25); white-space: nowrap; }
.lwe-table td.res { font-weight: 700; }
.lwe-table .noise { color: #c2410c; }
.toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.toggle button { border: 0; background: var(--card); padding: 7px 12px; font-family: var(--f-mono); font-size: 12.5px; cursor: pointer; }
.toggle button + button { border-left: 2px solid var(--ink); }
.toggle button[aria-pressed="true"] { background: var(--yellow); font-weight: 700; }
.lwe-out { margin-top: 14px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper); font-size: 15px; }

/* ---------- timeline ---------- */
.timeline { position: relative; margin: 30px 0 10px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; border-left: 3px solid var(--ink); }
.tl { position: relative; margin-bottom: 18px; }
.tl::before {
  content: ""; position: absolute; left: -32px; top: 18px; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--card);
}
.tl.hot::before { background: var(--orange); }
.tl.std::before { background: var(--mint); }
.tl.now::before { background: var(--yellow); box-shadow: 0 0 0 5px rgba(255,216,77,.5); }
.tl .card { padding: 14px 16px; }
.tl .when { font-family: var(--f-mono); font-size: 12.5px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl h4 { margin: 6px 0 4px; font-size: 19px; }
.tl p { margin: 0; }

/* ---------- checklist ---------- */
.steps { counter-reset: s; display: grid; gap: 14px; margin: 26px 0; }
.step {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow);
}
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 10px; background: var(--yellow);
  display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: 18px;
}
.step h4 { margin: 2px 0 4px; font-family: var(--f-display); font-weight: 800; font-size: 19px; }
.step p { margin: 0; font-size: 15.5px; color: var(--ink-2); }

/* ---------- glossary ---------- */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--ink);
  border-radius: 12px; padding: 4px 6px 4px 14px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.search input { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 10px 0; outline: none; font-family: var(--f-body); color: var(--ink); }
.search .count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); padding-right: 8px; }
.gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.term { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.term dt { font-family: var(--f-display); font-weight: 800; font-size: 17px; }
.term dd { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.term[hidden] { display: none; }

/* ---------- resources ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button { cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
a.res {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease;
}
a.res:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
a.res .rtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
a.res .arrow { font-family: var(--f-mono); font-weight: 700; }
a.res h4 { margin: 6px 0 0; font-family: var(--f-display); font-weight: 800; font-size: 17px; line-height: 1.2; }
a.res p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
a.res .lvl { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: auto; padding-top: 6px; }
a.res[hidden] { display: none; }

/* ---------- footer ---------- */
footer { margin-top: 90px; border-top: 2px solid var(--ink); background: var(--ink); color: var(--paper); }
.foot { max-width: var(--max); margin: 0 auto; padding: 48px 20px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }
.foot h3 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 34px; line-height: 1; margin: 0 0 12px; letter-spacing: -.02em; }
.foot p { color: #cfc8bb; font-size: 15px; }
.foot .btn { box-shadow: 4px 4px 0 var(--yellow); }
.foot small { font-family: var(--f-mono); font-size: 11.5px; color: #9d968a; }

/* reveal */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.rv.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tldr-grid { grid-template-columns: 1fr 1fr; }
  .tldr-item:nth-child(2) { border-right: 0; }
  .tldr-item:nth-child(-n+2) { border-bottom: 2px solid var(--ink); }
  .grid3, .res-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .tldr-grid, .grid2, .grid3, .res-grid, .gloss, .factor-grid, .mosca-grid, .foot { grid-template-columns: 1fr; }
  .tldr-item { border-right: 0; border-bottom: 2px solid var(--ink); }
  .tldr-item:last-child { border-bottom: 0; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .fig-body { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fig-body svg { min-width: 680px; }
  .fig-bar .lights { display: none; }
  .fig-bar::after { content: "swipe →"; font-size: 11px; color: var(--ink-3); }
  .fig-bar:has(+ .fig-body .bars)::after { content: none; }
  section.part { padding-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .bar { transition: none; }
}
