:root {
  color-scheme: dark;
  --void: #050505;
  --deep: #09090a;
  --panel: #0d0d0f;
  --panel-2: #121214;
  --panel-3: #17171a;
  --paper: #f5f0e6;
  --soft: #d9d3c8;
  --muted: #a19b92;
  --faint: #77736d;
  --line: rgba(245, 240, 230, .14);
  --line-strong: rgba(245, 240, 230, .38);
  --violet: #a89fff;
  --violet-bright: #c1bcff;
  --violet-soft: rgba(168, 159, 255, .1);
  --violet-line: rgba(168, 159, 255, .48);
  --cyan: #96d8cf;
  --cyan-bright: #b8ebe4;
  --cyan-soft: rgba(150, 216, 207, .09);
  --cyan-line: rgba(150, 216, 207, .45);
  --amber: #dbb878;
  --amber-soft: rgba(219, 184, 120, .1);
  --amber-line: rgba(219, 184, 120, .46);
  --red: #dc9180;
  --red-soft: rgba(220, 145, 128, .1);
  --red-line: rgba(220, 145, 128, .5);
  --green: #b8d5bd;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --body: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --ui: Inter, "Helvetica Neue", Helvetica, Arial, "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --shell: 82rem;
  --prose: 46rem;
  --wide: 65rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-gap: clamp(5.5rem, 11vw, 9rem);
  --fast: 180ms;
  --normal: 320ms;
  --ease: cubic-bezier(.2, .72, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  background: var(--void);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  color: var(--paper);
  background:
    radial-gradient(ellipse 65% 26% at 84% 2%, rgba(168, 159, 255, .1), transparent 70%),
    radial-gradient(ellipse 48% 22% at 4% 33%, rgba(150, 216, 207, .045), transparent 72%),
    linear-gradient(rgba(245, 240, 230, .017) 1px, transparent 1px) 0 0 / 100% 11rem,
    var(--void);
  font-family: var(--body);
  font-size: clamp(1.04rem, 1.16vw, 1.13rem);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .16;
  background-image:
    radial-gradient(circle at 17% 29%, rgba(255, 255, 255, .11) 0 .5px, transparent .8px),
    radial-gradient(circle at 79% 67%, rgba(255, 255, 255, .07) 0 .5px, transparent .75px);
  background-size: 97px 89px, 149px 137px;
}

::selection {
  color: var(--void);
  background: var(--violet);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration-color: var(--violet-line);
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
}

a:hover {
  text-decoration-color: currentColor;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 4px;
}

strong,
b {
  font-weight: 600;
}

code,
.mono {
  font-family: var(--mono);
}

code {
  overflow-wrap: anywhere;
}

sup {
  line-height: 0;
}

sup a {
  color: var(--cyan);
  font-family: var(--ui);
  font-size: .68rem;
  text-decoration: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: var(--void);
  background: var(--paper);
  font-family: var(--ui);
  font-size: .76rem;
  letter-spacing: .08em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform var(--fast) ease;
}

.skip-link:focus {
  transform: none;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--amber));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.site-header,
.hero,
.thesis,
.mobile-toc,
.page-grid,
.course-close,
.site-footer {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  min-height: 5.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
}

.brand {
  flex: none;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .36em;
  text-decoration: none;
}

.course-crumb {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.crumb-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.lesson-code {
  color: var(--violet-bright);
}

.hero {
  min-height: min(50rem, calc(100svh - 5.1rem));
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(20rem, .8fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
}

.eyebrow,
.nav-kicker,
.section-heading > p,
.lab-kicker,
.mini-kicker {
  margin: 0;
  color: var(--violet-bright);
  font-family: var(--ui);
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .15em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 15ch;
  margin: 1.25rem 0 1.6rem;
  font-family: var(--display);
  font-size: clamp(2.9rem, 6.7vw, 6.7rem);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1.03;
  text-wrap: balance;
}

.hero h1 span {
  color: var(--violet-bright);
  font-family: var(--ui);
  font-weight: 350;
  letter-spacing: -.07em;
}

.hero-lead {
  max-width: 42rem;
  margin: 0;
  color: var(--soft);
  font-size: clamp(1.08rem, 1.65vw, 1.32rem);
  line-height: 1.95;
}

.hero-lead strong:first-of-type {
  color: var(--violet-bright);
}

.hero-lead strong:nth-of-type(2) {
  color: var(--cyan-bright);
}

.hero-meta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  font-family: var(--ui);
}

.hero-meta span {
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .018);
  font-size: .67rem;
  letter-spacing: .07em;
}

.diagram {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .022), transparent 45%),
    var(--panel);
}

.diagram figcaption {
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
}

.diagram figcaption span {
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .15em;
}

.diagram figcaption strong {
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .04em;
}

.hero-diagram {
  position: relative;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(168, 159, 255, .11), transparent 45%),
    linear-gradient(rgba(245, 240, 230, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 240, 230, .025) 1px, transparent 1px),
    var(--panel);
  background-size: auto, 42px 42px, 42px 42px, auto;
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, .3);
}

.hero-diagram::after {
  position: absolute;
  inset: 15% -20% auto;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--violet-line), transparent);
  transform: rotate(-13deg);
}

.hero-layers {
  padding: clamp(1.25rem, 3vw, 2.2rem);
  display: grid;
  gap: .72rem;
}

.hero-layer {
  position: relative;
  padding: 1rem;
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: .9rem;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, .72);
}

.hero-layer.active {
  border-color: var(--violet-line);
  background: rgba(168, 159, 255, .075);
  transform: translateX(-.6rem);
}

.layer-index {
  color: var(--faint);
  font-family: var(--mono);
  font-size: .66rem;
}

.hero-layer b {
  display: block;
  font-size: .98rem;
  line-height: 1.4;
}

.hero-layer small {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.45;
}

.hero-layer i {
  min-width: 3.35rem;
  padding: .27rem .4rem;
  border: 1px solid var(--line);
  font-family: var(--ui);
  font-size: .58rem;
  font-style: normal;
  letter-spacing: .05em;
  text-align: center;
}

.layer-lock { color: var(--cyan); }
.layer-vote { color: var(--violet-bright); }
.layer-final { color: var(--amber); }

.hero-thresholds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.hero-thresholds div {
  padding: 1rem .65rem;
  text-align: center;
}

.hero-thresholds div + div {
  border-left: 1px solid var(--line);
}

.hero-thresholds b {
  display: block;
  color: var(--paper);
  font-family: var(--ui);
  font-size: 1.25rem;
}

.hero-thresholds div:first-child b { color: var(--amber); }
.hero-thresholds div:nth-child(2) b { color: var(--violet-bright); }
.hero-thresholds div:last-child b { color: var(--cyan); }

.hero-thresholds span {
  color: var(--muted);
  font-size: .66rem;
}

.diagram-note {
  margin: 0;
  padding: .8rem 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.6;
}

.thesis {
  padding-block: 0 clamp(5rem, 9vw, 8rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.thesis article {
  min-height: 15rem;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.thesis article + article {
  border-left: 1px solid var(--line);
}

.thesis-number {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .65rem;
}

.thesis h2 {
  margin: 3rem 0 .75rem;
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
}

.thesis p {
  margin: 0;
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.75;
}

.mobile-toc {
  display: none;
}

.page-grid {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 7rem);
}

.lesson-nav {
  position: sticky;
  top: 2.4rem;
  align-self: start;
  padding-block: 1rem;
}

.lesson-nav ol {
  padding: 0;
  margin: 1.25rem 0 2rem;
  list-style: none;
}

.lesson-nav li {
  border-top: 1px solid var(--line);
}

.lesson-nav li:last-child {
  border-bottom: 1px solid var(--line);
}

.lesson-nav a {
  padding: .66rem 0;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: .35rem;
  color: var(--faint);
  font-family: var(--ui);
  font-size: .68rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color var(--fast) ease, transform var(--fast) ease;
}

.lesson-nav a span {
  font-family: var(--mono);
  font-size: .59rem;
}

.lesson-nav a:hover,
.lesson-nav a[aria-current="true"] {
  color: var(--paper);
  transform: translateX(.2rem);
}

.lesson-nav a[aria-current="true"] span {
  color: var(--violet-bright);
}

.nav-status {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--ui);
  font-size: .64rem;
  letter-spacing: .05em;
}

.nav-status strong {
  color: var(--cyan);
  font-family: var(--mono);
}

.lesson-content {
  min-width: 0;
}

.chapter {
  max-width: var(--prose);
  margin-bottom: var(--section-gap);
}

.wide-chapter {
  max-width: var(--wide);
}

.section-heading {
  max-width: var(--prose);
  margin-bottom: clamp(2.2rem, 5vw, 3.8rem);
}

.section-heading > p:first-child {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.section-heading > p:first-child::after {
  width: 3.5rem;
  height: 1px;
  content: "";
  background: var(--violet-line);
}

.section-heading > p span {
  font-family: var(--mono);
}

.section-heading h2 {
  margin: 1.2rem 0 1rem;
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: 1.16;
  text-wrap: balance;
}

.section-intro {
  margin: 0;
  color: var(--soft);
  font-size: clamp(1.08rem, 1.55vw, 1.24rem);
  line-height: 1.95;
}

.concept-grid {
  margin: 2rem 0 2.2rem;
  display: grid;
  gap: 1rem;
}

.concept-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.concept-card {
  padding: 1.45rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.card-tag {
  font-family: var(--ui);
  font-size: .6rem;
  letter-spacing: .13em;
}

.card-tag.cyan { color: var(--cyan); }
.card-tag.violet { color: var(--violet-bright); }
.card-tag.amber { color: var(--amber); }

.concept-card h3 {
  min-height: 3.1em;
  margin: 2rem 0 .7rem;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.55;
}

.concept-card p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.75;
}

.concept-card .card-verdict {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
}

.two-locks,
.consensus-pipeline,
.checkpoint-diagram,
.fork-choice-diagram,
.penalty-ladder,
.inactivity-story,
.recovery-layers,
.diversity-diagram {
  margin: 2.5rem 0;
}

.lock-flow {
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: grid;
  grid-template-columns: 1fr auto 1.25fr auto 1.25fr auto 1fr;
  align-items: center;
  gap: .8rem;
}

.lock-input,
.lock-output,
.lock-gate {
  min-height: 8.7rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, .68);
}

.lock-input span,
.lock-output span,
.gate-number {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .6rem;
  letter-spacing: .1em;
}

.lock-input b,
.lock-output b,
.lock-gate b {
  margin-top: .45rem;
  font-size: 1rem;
  line-height: 1.45;
}

.lock-gate small {
  margin-top: .3rem;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.5;
}

.lock-gate i {
  margin-top: 1.1rem;
  font-family: var(--ui);
  font-size: .59rem;
  font-style: normal;
}

.cyan-gate {
  border-color: var(--cyan-line);
  box-shadow: inset 0 0 2.5rem rgba(150, 216, 207, .04);
}

.cyan-gate i { color: var(--cyan); }

.violet-gate {
  border-color: var(--violet-line);
  box-shadow: inset 0 0 2.5rem rgba(168, 159, 255, .05);
}

.violet-gate i { color: var(--violet-bright); }

.flow-arrow {
  color: var(--faint);
  font-family: var(--ui);
  font-size: 1.1rem;
}

.definition,
.callout,
.operator-note,
.source-policy {
  margin: 2rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: var(--panel);
}

.definition {
  border-left: 3px solid var(--violet);
}

.definition-label {
  margin: 0 0 .75rem;
  color: var(--violet-bright);
  font-family: var(--ui);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.definition p:last-child {
  max-width: 50rem;
  margin: 0;
  color: var(--soft);
  font-size: 1.03rem;
}

.callout {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
}

.callout.warning {
  border-color: rgba(220, 145, 128, .3);
  background: var(--red-soft);
}

.callout.nuance {
  border-color: rgba(219, 184, 120, .3);
  background: var(--amber-soft);
}

.callout-mark {
  color: var(--red);
  font-family: var(--ui);
  font-size: 1.4rem;
  line-height: 1.3;
}

.callout.nuance .callout-mark {
  color: var(--amber);
}

.callout h3,
.operator-note h3 {
  margin: 0 0 .45rem;
  font-size: 1rem;
  font-weight: 600;
}

.callout p,
.operator-note p {
  margin: 0;
  color: var(--soft);
  font-size: .9rem;
  line-height: 1.8;
}

.pipeline {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
}

.pipeline li {
  position: relative;
  min-height: 11rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, .64);
}

.pipeline li + li {
  border-left: 0;
}

.pipeline li:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -.42rem;
  z-index: 2;
  width: .75rem;
  height: .75rem;
  content: "";
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: var(--panel);
  transform: rotate(45deg);
}

.pipeline-step {
  color: var(--faint);
  font-family: var(--mono);
  font-size: .6rem;
}

.pipeline b,
.pipeline small {
  display: block;
}

.pipeline b {
  margin: 2.7rem 0 .45rem;
  font-size: .96rem;
}

.pipeline small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
}

.pipeline .accent-violet {
  border-color: var(--violet-line);
  background: var(--violet-soft);
}

.pipeline .accent-violet .pipeline-step,
.pipeline .accent-violet b {
  color: var(--violet-bright);
}

.pipeline .accent-amber {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.pipeline .accent-amber .pipeline-step,
.pipeline .accent-amber b {
  color: var(--amber);
}

.split-explainer {
  margin: 2.5rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.split-explainer > div {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--panel);
}

.mini-kicker.amber { color: var(--amber); }
.mini-kicker.cyan { color: var(--cyan); }
.mini-kicker.red { color: var(--red); }

.split-explainer h3,
.deep-dive h3,
.security-checklist h3 {
  margin: .85rem 0 .75rem;
  font-size: 1.35rem;
  font-weight: 500;
}

.split-explainer > div > p:not(.mini-kicker),
.deep-dive > p:not(.mini-kicker, .fine-print) {
  color: var(--soft);
  font-size: .92rem;
}

.plain-list {
  padding: 1rem 0 0;
  margin: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.plain-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: .83rem;
}

.plain-list li::before {
  position: absolute;
  left: 0;
  content: "·";
  color: var(--violet);
}

.checkpoint-chain {
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1fr .7fr 1fr .7fr 1fr;
  align-items: center;
  gap: .7rem;
}

.checkpoint {
  min-height: 9.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  text-align: center;
}

.checkpoint span,
.checkpoint i,
.super-link small {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .61rem;
  font-style: normal;
  letter-spacing: .06em;
}

.checkpoint b {
  margin: .5rem 0;
  font-size: 1rem;
}

.checkpoint.finalized {
  border-color: var(--cyan-line);
  background: var(--cyan-soft);
}

.checkpoint.finalized b { color: var(--cyan-bright); }

.checkpoint.justified {
  border-color: var(--violet-line);
  background: var(--violet-soft);
}

.checkpoint.justified b { color: var(--violet-bright); }

.checkpoint.candidate {
  border-style: dashed;
}

.super-link {
  position: relative;
  text-align: center;
}

.super-link::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.super-link span {
  position: relative;
  z-index: 1;
  padding: .2rem .45rem;
  color: var(--amber);
  background: var(--panel);
  font-family: var(--ui);
  font-size: .72rem;
}

.super-link small {
  position: relative;
  z-index: 1;
  margin-top: .65rem;
  display: block;
}

.lab {
  margin: 2.6rem 0;
  padding: clamp(1.3rem, 4vw, 2.4rem);
  border: 1px solid var(--violet-line);
  background:
    radial-gradient(circle at 90% 0, rgba(168, 159, 255, .1), transparent 34%),
    var(--panel);
}

.lab-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.lab-heading h3 {
  margin: .6rem 0 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
}

.lab-heading output {
  color: var(--violet-bright);
  font-family: var(--ui);
  font-size: clamp(1.65rem, 3.5vw, 2.8rem);
  font-weight: 300;
  line-height: 1;
}

.lab-intro {
  max-width: 48rem;
  margin: 1rem 0 1.7rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.75;
}

.threshold-control label,
.leak-control label {
  display: block;
  margin-bottom: .85rem;
  color: var(--soft);
  font-family: var(--ui);
  font-size: .72rem;
  letter-spacing: .04em;
}

input[type="range"] {
  width: 100%;
  height: 1.8rem;
  margin: 0;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

input[type="range"]::-webkit-slider-thumb {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -.5rem;
  appearance: none;
  border: 2px solid var(--void);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--violet);
}

input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--void);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--violet);
}

.range-scale {
  position: relative;
  height: 1.4rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .57rem;
}

.range-scale span {
  position: absolute;
  left: var(--x);
  transform: translateX(-50%);
}

.range-scale span:first-child {
  transform: none;
}

.range-scale span:last-child {
  transform: translateX(-100%);
}

.preset-row {
  margin: 1.2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.preset-row button,
.scenario-tabs button {
  padding: .48rem .76rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--deep);
  font-family: var(--ui);
  font-size: .68rem;
  transition: border-color var(--fast) ease, color var(--fast) ease, background var(--fast) ease;
}

.preset-row button:hover,
.preset-row button[aria-pressed="true"],
.scenario-tabs button:hover,
.scenario-tabs button[aria-selected="true"] {
  border-color: var(--violet-line);
  color: var(--paper);
  background: var(--violet-soft);
}

.threshold-track {
  position: relative;
  height: 4.5rem;
  margin: 1.5rem 0;
  overflow: visible;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49.7%, var(--line) 50%, transparent 50.3%),
    var(--deep);
}

.stake-fill {
  width: var(--stake);
  height: 100%;
  background:
    linear-gradient(90deg, rgba(219, 184, 120, .32), rgba(168, 159, 255, .42) 70%, rgba(220, 145, 128, .5));
  transition: width var(--normal) var(--ease);
}

.threshold-marker {
  position: absolute;
  top: -.35rem;
  bottom: -.35rem;
  width: 1px;
  border-left: 1px dashed var(--line-strong);
}

.threshold-marker span {
  position: absolute;
  top: -.95rem;
  left: 50%;
  padding: 0 .25rem;
  color: var(--muted);
  background: var(--panel);
  font-family: var(--ui);
  font-size: .59rem;
  font-style: normal;
  transform: translateX(-50%);
}

.marker-33 { left: 47.14%; }
.marker-50 { left: 71.43%; }
.marker-66 { left: 95.24%; }

.lab-result {
  display: grid;
  grid-template-columns: .75fr 1.25fr 1.25fr 1.25fr;
  border: 1px solid var(--line);
}

.lab-result > div {
  min-width: 0;
  padding: 1rem;
}

.lab-result > div + div {
  border-left: 1px solid var(--line);
}

.result-label {
  display: block;
  margin-bottom: .55rem;
  color: var(--faint);
  font-family: var(--ui);
  font-size: .56rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lab-result strong {
  color: var(--violet-bright);
  font-size: 1.05rem;
}

.lab-result p,
.scenario-panel p {
  margin: 0;
  color: var(--soft);
  font-size: .76rem;
  line-height: 1.65;
}

.noscript-note {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--amber-line);
  color: var(--soft);
  background: var(--amber-soft);
  font-size: .8rem;
}

.threshold-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}

.threshold-cards article {
  min-height: 17rem;
  padding: 1.35rem;
  background: var(--panel);
}

.threshold-cards article + article {
  border-left: 1px solid var(--line);
}

.threshold-cards .featured {
  background: var(--violet-soft);
}

.threshold-value {
  color: var(--amber);
  font-family: var(--ui);
  font-size: 1.25rem;
  font-weight: 300;
}

.featured .threshold-value {
  color: var(--violet-bright);
}

.threshold-cards h3 {
  margin: 3rem 0 .7rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.threshold-cards p,
.threshold-cards small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.65;
}

.threshold-cards small {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
}

.fork-choice-diagram {
  overflow: hidden;
}

.fork-origin {
  width: 9rem;
  margin: 2rem auto 0;
  padding: .85rem;
  border: 1px solid var(--cyan-line);
  background: var(--cyan-soft);
  text-align: center;
}

.fork-origin span,
.fork-origin b {
  display: block;
}

.fork-origin span {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .59rem;
}

.fork-origin b {
  margin-top: .3rem;
}

.fork-lines {
  position: relative;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.fork-lines::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 66%;
  height: 2.2rem;
  content: "";
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  transform: translateX(-50%);
}

.fork {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--deep);
}

.fork::before {
  position: absolute;
  top: -3.05rem;
  left: 50%;
  width: 1px;
  height: 3rem;
  content: "";
  background: var(--line-strong);
}

.fork-name {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .61rem;
  letter-spacing: .06em;
}

.blocks {
  margin: 1rem 0;
  display: flex;
  gap: .35rem;
}

.blocks i {
  min-width: 2.45rem;
  min-height: 2.45rem;
  padding: .35rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .58rem;
  font-style: normal;
  text-align: center;
}

.branch-honest {
  border-color: var(--cyan-line);
}

.branch-honest .blocks i {
  border-color: var(--cyan-line);
  color: var(--cyan);
}

.branch-attacker {
  border-color: var(--red-line);
  box-shadow: inset 0 0 2rem rgba(220, 145, 128, .04);
}

.branch-attacker .blocks i {
  border-color: var(--red-line);
  color: var(--red);
}

.branch-invalid {
  border-style: dashed;
  opacity: .62;
}

.branch-invalid .blocks i:last-child {
  color: var(--red);
  text-decoration: line-through;
}

.fork strong {
  color: var(--soft);
  font-family: var(--ui);
  font-size: .68rem;
}

.branch-attacker strong {
  color: var(--red);
}

.ability-matrix {
  margin: 2rem 0;
  border: 1px solid var(--line);
}

.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: .9fr 1.25fr 1.25fr;
}

.matrix-head {
  color: var(--muted);
  background: var(--panel-2);
  font-family: var(--ui);
  font-size: .61rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.matrix-head span,
.matrix-row > span {
  padding: 1rem;
}

.matrix-head span + span,
.matrix-row > span + span {
  border-left: 1px solid var(--line);
}

.matrix-row {
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.matrix-row > span {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.65;
}

.matrix-row b,
.matrix-row small {
  display: block;
}

.matrix-row b {
  color: var(--paper);
  font-size: .91rem;
}

.matrix-row small {
  margin-top: .2rem;
  color: var(--faint);
}

.matrix-row > span:last-child {
  color: var(--soft);
}

.myth-fact {
  margin: 2rem 0;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  border: 1px solid var(--line);
}

.myth-fact > div {
  padding: 1.4rem;
}

.myth-fact > div + div {
  border-left: 1px solid var(--line);
}

.myth {
  background: var(--red-soft);
}

.fact {
  background: var(--cyan-soft);
}

.myth-fact span {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .6rem;
  letter-spacing: .12em;
}

.myth span { color: var(--red); }
.fact span { color: var(--cyan); }

.myth-fact p {
  margin: .75rem 0 0;
  color: var(--soft);
  font-size: .88rem;
}

.subheading {
  margin: 3rem 0 1.4rem;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 500;
}

.ladder {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 1rem;
}

.ladder article {
  min-height: 15rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--deep);
}

.ladder article:nth-child(2) {
  min-height: 17rem;
  border-color: var(--amber-line);
}

.ladder article.danger {
  min-height: 19rem;
  border-color: var(--red-line);
  background: var(--red-soft);
}

.ladder-step {
  color: var(--faint);
  font-family: var(--ui);
  font-size: .58rem;
  letter-spacing: .12em;
}

.ladder h3 {
  margin: 2.7rem 0 .5rem;
  font-size: 1.12rem;
  font-weight: 500;
}

.ladder p,
.ladder small {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.6;
}

.ladder strong,
.ladder small {
  display: block;
}

.ladder strong {
  margin: 1.5rem 0 .4rem;
  color: var(--paper);
  font-size: .86rem;
}

.ladder article:nth-child(2) strong { color: var(--amber); }
.ladder article.danger strong { color: var(--red); }

.slashing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.slash-card {
  margin: 0;
  padding: 1.25rem;
}

.slash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.slash-head span {
  color: var(--red);
  font-family: var(--ui);
  font-size: .58rem;
  letter-spacing: .12em;
}

.slash-head b {
  font-size: 1rem;
}

.signature-pair {
  margin: 2rem 0 1.2rem;
  display: grid;
  gap: .55rem;
}

.signature-pair code,
.surround-votes span {
  padding: .55rem;
  border: 1px solid var(--red-line);
  color: var(--red);
  background: var(--red-soft);
  font-size: .63rem;
}

.slash-card p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
}

.surround-votes {
  position: relative;
  min-height: 5rem;
  margin: 2rem 0 1.2rem;
}

.surround-votes span {
  position: absolute;
  left: 50%;
  font-family: var(--mono);
  transform: translateX(-50%);
  white-space: nowrap;
}

.outer-vote {
  top: 0;
  width: 100%;
  text-align: center;
}

.inner-vote {
  bottom: 0;
  width: 65%;
  text-align: center;
}

.deep-dive {
  margin: 2.5rem 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--red-line);
  background: var(--red-soft);
}

.correlation-visual {
  margin-top: 1.5rem;
  display: grid;
  gap: .75rem;
}

.correlation-visual > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr 9rem;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-family: var(--ui);
  font-size: .65rem;
}

.correlation-visual i {
  position: relative;
  height: .55rem;
  background: rgba(245, 240, 230, .06);
}

.correlation-visual i::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level);
  content: "";
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.correlation-visual b {
  color: var(--soft);
  font-weight: 500;
}

.fine-print {
  margin: 1.3rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(220, 145, 128, .22);
  color: var(--muted);
  font-family: var(--ui);
  font-size: .67rem;
  line-height: 1.65;
}

.operator-note {
  border-left: 3px solid var(--amber);
}

.fraction-story {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.fraction-stage {
  min-height: 13rem;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--deep);
  text-align: center;
}

.fraction-stage > span {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .61rem;
  letter-spacing: .08em;
}

.fraction {
  margin: 1.1rem auto;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .3rem;
  font-family: var(--ui);
}

.fraction b {
  color: var(--cyan);
  font-size: 2.2rem;
  font-weight: 300;
}

.fraction i {
  color: var(--faint);
  font-size: 1.2rem;
  font-style: normal;
}

.fraction strong {
  color: var(--paper);
  font-size: 1.3rem;
  font-weight: 300;
}

.fraction-stage p {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.6;
}

.leak-stage {
  border-color: var(--amber-line);
}

.recovered {
  border-color: var(--cyan-line);
  background: var(--cyan-soft);
}

.leak-drops {
  height: 3.8rem;
  margin: 1.25rem 0 .7rem;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: .4rem;
}

.leak-drops i {
  width: .55rem;
  border-radius: 50% 50% 55% 45%;
  background: var(--amber);
  transform: rotate(45deg);
}

.leak-drops i:nth-child(1) { height: .55rem; opacity: .35; }
.leak-drops i:nth-child(2) { height: .75rem; opacity: .5; }
.leak-drops i:nth-child(3) { height: .95rem; opacity: .7; }
.leak-drops i:nth-child(4) { height: 1.15rem; }

.leak-layout {
  display: grid;
  grid-template-columns: 1.35fr .75fr;
  gap: 2rem;
  align-items: center;
}

.leak-numbers {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}

.leak-numbers div {
  padding: .8rem;
}

.leak-numbers div + div {
  border-left: 1px solid var(--line);
}

.leak-numbers span,
.leak-numbers b {
  display: block;
}

.leak-numbers span {
  color: var(--faint);
  font-family: var(--ui);
  font-size: .56rem;
}

.leak-numbers b {
  margin-top: .45rem;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 400;
}

.leak-numbers div:last-child b {
  color: var(--cyan);
}

.leak-meter {
  text-align: center;
}

.meter-ring {
  width: 11rem;
  height: 11rem;
  margin: auto;
  padding: .7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--honest), rgba(245, 240, 230, .08) 0);
  transition: background var(--normal) ease;
}

.meter-ring > div {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--panel);
}

.meter-ring b,
.meter-ring span {
  display: block;
}

.meter-ring b {
  color: var(--cyan-bright);
  font-family: var(--ui);
  font-size: 1.55rem;
  font-weight: 300;
}

.meter-ring span {
  color: var(--muted);
  font-size: .64rem;
}

.leak-meter > p {
  margin: 1rem auto 0;
  color: var(--soft);
  font-size: .72rem;
  line-height: 1.55;
}

.formula {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--deep);
}

.formula code {
  color: var(--violet-bright);
  font-size: .77rem;
}

.formula p {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.recovery-stack {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  display: grid;
  gap: .65rem;
}

.recovery-stack article {
  padding: .9rem 1rem;
  display: grid;
  grid-template-columns: 2.8rem 1fr auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  background: var(--deep);
}

.recovery-stack article > span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .66rem;
}

.recovery-stack b,
.recovery-stack small {
  display: block;
}

.recovery-stack b {
  font-size: .94rem;
}

.recovery-stack small {
  color: var(--muted);
  font-size: .7rem;
}

.recovery-stack i {
  color: var(--cyan);
  font-family: var(--ui);
  font-size: .61rem;
  font-style: normal;
}

.recovery-stack .social-layer {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.recovery-stack .social-layer > span,
.recovery-stack .social-layer i {
  color: var(--amber);
}

.lab-badge {
  padding: .4rem .65rem;
  border: 1px solid var(--violet-line);
  color: var(--violet-bright);
  font-family: var(--ui);
  font-size: .58rem;
  letter-spacing: .1em;
}

.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.scenario-panel {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: .7fr repeat(4, 1fr);
  border: 1px solid var(--line);
}

.scenario-panel > div {
  padding: 1rem;
}

.scenario-panel > div + div {
  border-left: 1px solid var(--line);
}

.scenario-classification {
  background: var(--violet-soft);
}

.scenario-classification span,
.scenario-classification strong {
  display: block;
}

.scenario-classification span {
  color: var(--faint);
  font-family: var(--ui);
  font-size: .56rem;
  letter-spacing: .1em;
}

.scenario-classification strong {
  margin-top: .65rem;
  color: var(--violet-bright);
  font-size: 1.05rem;
}

.recovery-timeline {
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}

.recovery-timeline article {
  min-height: 14rem;
  padding: 1.25rem;
  background: var(--panel);
}

.recovery-timeline article + article {
  border-left: 1px solid var(--line);
}

.recovery-timeline span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .61rem;
}

.recovery-timeline h3 {
  margin: 2.6rem 0 .55rem;
  font-size: 1rem;
  font-weight: 500;
}

.recovery-timeline p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.65;
}

.diversity-compare {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.diversity-compare article {
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--deep);
  text-align: center;
}

.diversity-compare .concentrated {
  border-color: var(--red-line);
}

.diversity-compare .distributed {
  border-color: var(--cyan-line);
}

.compare-label {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .6rem;
  letter-spacing: .1em;
}

.dot-field {
  min-height: 8rem;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  place-items: center;
  gap: .45rem;
}

.dot-field i {
  width: .7rem;
  height: .7rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--red);
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(220, 145, 128, .08);
}

.concentrated .dot-field {
  padding: 1rem 25%;
  background: radial-gradient(circle, rgba(220, 145, 128, .12), transparent 67%);
}

.distributed .dot-field i {
  color: var(--cyan);
  opacity: .85;
}

.distributed .dot-field i:nth-child(3n) { color: var(--violet); }
.distributed .dot-field i:nth-child(4n) { color: var(--amber); }

.diversity-compare b {
  display: block;
  font-size: .92rem;
}

.diversity-compare p {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.versus {
  color: var(--faint);
  font-family: var(--ui);
  font-size: .68rem;
}

.defense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}

.defense-grid article {
  min-height: 12rem;
  padding: 1.25rem;
  background: var(--panel);
}

.defense-grid article:nth-child(3n + 2),
.defense-grid article:nth-child(3n + 3) {
  border-left: 1px solid var(--line);
}

.defense-grid article:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}

.defense-grid span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .6rem;
}

.defense-grid h3 {
  margin: 2.2rem 0 .45rem;
  font-size: 1rem;
  font-weight: 500;
}

.defense-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.65;
}

.security-checklist {
  margin: 2.5rem 0;
  display: grid;
  grid-template-columns: .75fr 1.35fr;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--cyan-line);
  background: var(--cyan-soft);
}

.security-checklist ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.security-checklist li {
  padding: .55rem 0;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .5rem;
  border-top: 1px solid rgba(150, 216, 207, .18);
  color: var(--soft);
  font-size: .82rem;
}

.security-checklist li:last-child {
  border-bottom: 1px solid rgba(150, 216, 207, .18);
}

.security-checklist li span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: .61rem;
}

.five-step {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
}

.five-step article {
  min-height: 10rem;
  padding: 1.1rem;
  background: var(--panel);
}

.five-step article + article {
  border-left: 1px solid var(--line);
}

.five-step span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .59rem;
}

.five-step b {
  margin: 2.2rem 0 .35rem;
  display: block;
  font-size: .96rem;
}

.five-step p {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
}

.recap-lines {
  margin: 2rem 0;
  border-top: 1px solid var(--line);
}

.recap-lines p {
  margin: 0;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: 5rem 1fr;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
}

.recap-lines span {
  color: var(--violet-bright);
  font-family: var(--ui);
  font-size: 1.25rem;
}

.quiz {
  margin-top: 3rem;
}

.quiz-heading {
  max-width: var(--prose);
  margin-bottom: 1.5rem;
}

.quiz-heading h3 {
  margin: .8rem 0 .4rem;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
}

.quiz-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.quiz-item {
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  background: var(--panel);
}

.quiz-item + .quiz-item {
  border-top: 0;
}

.quiz-item > p:first-child {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .7rem;
  color: var(--soft);
}

.quiz-item > p:first-child span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: .61rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}

.quiz-options button {
  min-height: 4.2rem;
  padding: .75rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--deep);
  font-size: .76rem;
  line-height: 1.5;
  text-align: left;
}

.quiz-options button:hover {
  border-color: var(--violet-line);
  color: var(--paper);
}

.quiz-options button.is-correct {
  border-color: var(--cyan-line);
  color: var(--cyan-bright);
  background: var(--cyan-soft);
}

.quiz-options button.is-wrong {
  border-color: var(--red-line);
  color: var(--red);
  background: var(--red-soft);
}

.quiz-options button:disabled {
  cursor: default;
}

.quiz-feedback {
  min-height: 1.6rem;
  margin: .8rem 0 0;
  color: var(--soft);
  font-size: .75rem;
}

.quiz-explanation {
  margin-top: .7rem;
  color: var(--muted);
  font-size: .76rem;
}

.js .quiz-explanation {
  display: none;
}

.quiz-explanation summary {
  color: var(--violet-bright);
  cursor: pointer;
}

.quiz-explanation p {
  margin: .4rem 0 0;
}

.next-question {
  margin: 3rem 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--violet-line);
  background: var(--violet-soft);
}

.next-question blockquote {
  max-width: 47rem;
  margin: 1.2rem 0 0;
  color: var(--soft);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  line-height: 1.65;
}

.next-question strong {
  color: var(--paper);
}

.sources-list {
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  list-style: none;
}

.source-item {
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: .75rem;
  background: var(--panel);
}

.source-item + .source-item {
  border-top: 1px solid var(--line);
}

.source-item > span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: .62rem;
}

.source-item a {
  color: var(--soft);
  font-size: .87rem;
}

.source-item p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.55;
}

.source-policy {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  border-left: 3px solid var(--cyan);
}

.source-policy span {
  color: var(--cyan);
  font-family: var(--ui);
  font-size: .65rem;
  letter-spacing: .1em;
}

.source-policy p {
  margin: 0;
  color: var(--soft);
  font-size: .82rem;
  line-height: 1.75;
}

.course-close {
  margin-top: clamp(4rem, 9vw, 8rem);
  padding-block: clamp(4rem, 9vw, 8rem);
  border-top: 1px solid var(--line-strong);
  text-align: center;
}

.course-close > p {
  margin: 0;
  color: var(--violet);
  font-family: var(--ui);
  font-size: .64rem;
  letter-spacing: .16em;
}

.course-close h2 {
  max-width: 55rem;
  margin: 1.4rem auto 2rem;
  font-size: clamp(2rem, 4.8vw, 4.3rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.28;
}

.course-close a {
  color: var(--muted);
  font-family: var(--ui);
  font-size: .7rem;
  letter-spacing: .08em;
  text-decoration: none;
}

.course-close a span {
  margin-left: .35rem;
  color: var(--violet-bright);
}

.site-footer {
  min-height: 6rem;
  padding-block: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--ui);
  font-size: .62rem;
  letter-spacing: .05em;
}

.site-footer .brand {
  color: var(--paper);
  font-size: .72rem;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1050px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 52rem;
  }

  .hero-diagram {
    max-width: 46rem;
  }

  .page-grid {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 3rem;
  }

  .lock-flow {
    grid-template-columns: 1fr;
  }

  .lock-flow .flow-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .lock-input,
  .lock-output,
  .lock-gate {
    min-height: auto;
  }

  .pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline li {
    min-height: auto;
    display: grid;
    grid-template-columns: 2rem 1fr;
    align-items: start;
    gap: .7rem;
  }

  .pipeline li + li {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .pipeline li:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -.42rem;
    transform: rotate(135deg);
  }

  .pipeline b {
    margin: 0 0 .35rem;
  }

  .pipeline small {
    grid-column: 2;
  }

  .lab-result,
  .scenario-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .lab-result > div + div,
  .scenario-panel > div + div {
    border-left: 0;
  }

  .lab-result > div:nth-child(even),
  .scenario-panel > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .lab-result > div:nth-child(n + 3),
  .scenario-panel > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .scenario-panel > div:last-child {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .threshold-cards,
  .recovery-timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .threshold-cards article:nth-child(odd),
  .recovery-timeline article:nth-child(odd) {
    border-left: 0;
  }

  .threshold-cards article:nth-child(n + 3),
  .recovery-timeline article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .security-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .site-header {
    min-height: 4.5rem;
  }

  .course-crumb > span:first-child,
  .crumb-dot {
    display: none;
  }

  .hero {
    padding-block: 4.5rem 5rem;
  }

  .hero h1 br {
    display: none;
  }

  .thesis {
    grid-template-columns: 1fr;
  }

  .thesis article {
    min-height: auto;
  }

  .thesis article + article {
    border-top: 0;
    border-left: 0;
  }

  .thesis h2 {
    margin-top: 1.6rem;
  }

  .mobile-toc {
    margin-bottom: 4rem;
    display: block;
    border: 1px solid var(--line);
    background: var(--panel);
    font-family: var(--ui);
  }

  .mobile-toc summary {
    padding: .9rem 1rem;
    color: var(--soft);
    cursor: pointer;
    font-size: .72rem;
    letter-spacing: .06em;
  }

  .mobile-toc ol {
    padding: 0 1rem 1rem 2.6rem;
    margin: 0;
  }

  .mobile-toc li {
    padding: .2rem 0;
    color: var(--muted);
    font-size: .69rem;
  }

  .lesson-nav {
    display: none;
  }

  .page-grid {
    display: block;
  }

  .concept-grid.three,
  .slashing-grid,
  .defense-grid {
    grid-template-columns: 1fr;
  }

  .concept-card h3 {
    min-height: auto;
    margin-top: 1.4rem;
  }

  .split-explainer {
    grid-template-columns: 1fr;
  }

  .checkpoint-chain {
    grid-template-columns: 1fr;
  }

  .super-link {
    min-height: 3.5rem;
    display: grid;
    place-content: center;
  }

  .super-link::before {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: auto;
  }

  .super-link small {
    padding: .2rem;
    background: var(--panel);
  }

  .fork-lines {
    grid-template-columns: 1fr;
  }

  .fork-lines::before {
    left: 2rem;
    width: 1px;
    height: calc(100% - 4rem);
    border: 0;
    background: var(--line-strong);
    transform: none;
  }

  .fork::before {
    top: 50%;
    left: -1.55rem;
    width: 1.5rem;
    height: 1px;
  }

  .matrix-head {
    display: none;
  }

  .matrix-row {
    grid-template-columns: 1fr;
  }

  .matrix-row > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .myth-fact {
    grid-template-columns: 1fr;
  }

  .myth-fact > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .ladder {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ladder article,
  .ladder article:nth-child(2),
  .ladder article.danger {
    min-height: auto;
  }

  .ladder h3 {
    margin-top: 1.5rem;
  }

  .slash-card + .slash-card,
  .defense-grid article {
    border-top: 1px solid var(--line);
  }

  .defense-grid article:nth-child(n) {
    border-left: 0;
  }

  .fraction-story {
    grid-template-columns: 1fr;
  }

  .fraction-story .flow-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .fraction-stage {
    min-height: auto;
  }

  .leak-layout {
    grid-template-columns: 1fr;
  }

  .diversity-compare {
    grid-template-columns: 1fr;
  }

  .five-step {
    grid-template-columns: 1fr;
  }

  .five-step article {
    min-height: auto;
    display: grid;
    grid-template-columns: 2rem 4rem 1fr;
    align-items: baseline;
    gap: .4rem;
  }

  .five-step article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .five-step b {
    margin: 0;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 1rem;
  }

  body {
    font-size: 1rem;
    line-height: 1.82;
  }

  .brand {
    font-size: .78rem;
  }

  .hero {
    gap: 2.5rem;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 13vw, 4.4rem);
  }

  .hero-layer {
    grid-template-columns: 2rem 1fr;
  }

  .hero-layer i {
    grid-column: 2;
    justify-self: start;
  }

  .hero-layer.active {
    transform: none;
  }

  .hero-thresholds {
    grid-template-columns: 1fr;
  }

  .hero-thresholds div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-heading h2 {
    font-size: clamp(1.85rem, 9vw, 2.8rem);
  }

  .diagram figcaption {
    align-items: start;
    flex-direction: column;
  }

  .lab {
    padding: 1rem;
  }

  .lab-heading {
    align-items: start;
    flex-direction: column;
  }

  .preset-row button {
    flex: 1;
  }

  .lab-result,
  .scenario-panel {
    grid-template-columns: 1fr;
  }

  .lab-result > div:nth-child(n),
  .scenario-panel > div:nth-child(n) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lab-result > div:first-child,
  .scenario-panel > div:first-child {
    border-top: 0;
  }

  .threshold-cards,
  .recovery-timeline {
    grid-template-columns: 1fr;
  }

  .threshold-cards article:nth-child(n),
  .recovery-timeline article:nth-child(n) {
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .threshold-cards article:first-child,
  .recovery-timeline article:first-child {
    border-top: 0;
  }

  .threshold-cards h3,
  .recovery-timeline h3 {
    margin-top: 1.5rem;
  }

  .correlation-visual > div {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .leak-numbers {
    grid-template-columns: 1fr;
  }

  .leak-numbers div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .recovery-stack article {
    grid-template-columns: 2rem 1fr;
  }

  .recovery-stack i {
    grid-column: 2;
  }

  .scenario-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .recap-lines p {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .source-policy {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: start;
    flex-direction: column;
    gap: .4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media print {
  :root {
    color-scheme: light;
    --void: #fff;
    --deep: #fff;
    --panel: #fff;
    --panel-2: #f5f5f5;
    --panel-3: #eee;
    --paper: #111;
    --soft: #222;
    --muted: #555;
    --faint: #666;
    --line: rgba(0, 0, 0, .18);
    --line-strong: rgba(0, 0, 0, .45);
    --violet: #4c42a8;
    --violet-bright: #3e358d;
    --violet-soft: rgba(76, 66, 168, .06);
    --violet-line: rgba(76, 66, 168, .45);
    --cyan: #176a61;
    --cyan-bright: #145d55;
    --cyan-soft: rgba(23, 106, 97, .06);
    --cyan-line: rgba(23, 106, 97, .45);
    --amber: #805d1f;
    --amber-soft: rgba(128, 93, 31, .06);
    --amber-line: rgba(128, 93, 31, .45);
    --red: #913b2f;
    --red-soft: rgba(145, 59, 47, .06);
    --red-line: rgba(145, 59, 47, .45);
  }

  body {
    background: #fff;
    font-size: 10.5pt;
  }

  body::before,
  .reading-progress,
  .lesson-nav,
  .mobile-toc,
  .hero-meta,
  .preset-row,
  input[type="range"],
  .quiz-feedback {
    display: none !important;
  }

  .site-header,
  .hero,
  .thesis,
  .page-grid,
  .course-close,
  .site-footer {
    width: 100%;
  }

  .hero {
    min-height: 0;
    padding-block: 2rem;
    grid-template-columns: 1fr 1fr;
  }

  .page-grid {
    display: block;
  }

  .chapter {
    max-width: none;
    margin-bottom: 3rem;
    break-before: page;
  }

  .chapter:first-child {
    break-before: auto;
  }

  .diagram,
  .lab,
  .concept-card,
  .quiz-item,
  .deep-dive,
  .callout,
  .operator-note {
    break-inside: avoid;
    box-shadow: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .js .quiz-explanation {
    display: block;
  }

  .quiz-explanation {
    border-top: 1px solid var(--line);
    padding-top: .5rem;
  }

  .quiz-explanation summary {
    list-style: none;
  }

  a {
    text-decoration: none;
  }

  .course-close {
    break-before: page;
  }
}
