:root {
  color-scheme: dark;
  --ink: #f3eee5;
  --ink-soft: #d4cec3;
  --muted: #979088;
  --dim: #706b65;
  --void: #050505;
  --ground: #09090a;
  --panel: #0e0e10;
  --panel-2: #141416;
  --line: rgba(243, 238, 229, 0.13);
  --line-strong: rgba(243, 238, 229, 0.3);
  --violet: #a89cff;
  --violet-dim: rgba(168, 156, 255, 0.11);
  --cyan: #86d8cf;
  --cyan-dim: rgba(134, 216, 207, 0.1);
  --amber: #ddb778;
  --amber-dim: rgba(221, 183, 120, 0.1);
  --danger: #e58f7d;
  --danger-dim: rgba(229, 143, 125, 0.1);
  --success: #acd4b3;
  --success-dim: rgba(172, 212, 179, 0.1);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --shell: 84rem;
  --reading: 48rem;
  --gutter: clamp(1.15rem, 4vw, 4rem);
  --radius: 0.15rem;
}

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

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

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(70rem 48rem at 78% -7%, rgba(168, 156, 255, 0.1), transparent 66%),
    radial-gradient(54rem 40rem at -8% 30%, rgba(134, 216, 207, 0.045), transparent 70%),
    linear-gradient(rgba(243, 238, 229, 0.018) 1px, transparent 1px) 0 0 / 100% 11rem,
    var(--void);
  font-family: var(--serif);
  font-synthesis: none;
  line-height: 1.82;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.2;
  background-image:
    repeating-radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 8px),
    repeating-radial-gradient(circle at 79% 65%, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 10px);
  background-size: 139px 127px, 187px 163px;
  mix-blend-mode: soft-light;
}

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

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

a:hover {
  color: var(--cyan);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

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

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

code {
  color: var(--cyan);
  font-size: 0.86em;
}

sup {
  font-family: var(--sans);
  font-size: 0.65em;
}

sup a {
  color: var(--violet);
  text-decoration: none;
}

h1,
h2,
h3,
p,
li,
dd {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  font-weight: 400;
}

.skip-link {
  position: fixed;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 100;
  padding: 0.65rem 0.85rem;
  color: var(--void);
  background: var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  background: rgba(243, 238, 229, 0.04);
  pointer-events: none;
}

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

.site-header,
.page,
.site-footer {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.masthead {
  min-height: 5.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-decoration: none;
}

.course-mark {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.67rem;
  letter-spacing: 0.16em;
  line-height: 1.6;
  text-align: right;
  text-transform: uppercase;
}

.course-mark strong {
  color: var(--ink);
  font-weight: 500;
}

.hero {
  position: relative;
  min-height: min(56rem, calc(100dvh - 5rem));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(19rem, 0.72fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  padding: clamp(5rem, 11vw, 9rem) 0 clamp(4rem, 8vw, 6.5rem);
  border-bottom: 1px solid var(--line-strong);
  isolation: isolate;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: -0.04em;
  bottom: -0.28em;
  z-index: -1;
  color: rgba(243, 238, 229, 0.027);
  content: "20.03";
  font-family: var(--mono);
  font-size: clamp(9rem, 23vw, 22rem);
  letter-spacing: -0.09em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.chapter-number,
.lab-kicker,
.threat-index,
.toc-title {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.55;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.8rem;
}

.eyebrow::before {
  width: 2.75rem;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.hero h1 {
  max-width: 10.7ch;
  margin: 0;
  font-size: clamp(3.15rem, 7.5vw, 7.15rem);
  letter-spacing: 0.015em;
  line-height: 1.02;
}

.hero h1 em {
  display: block;
  color: var(--violet);
  font-style: normal;
}

.hero-deck {
  max-width: 42rem;
  margin: 2.5rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  line-height: 1.9;
}

.hero-deck strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 2.4rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  list-style: none;
  text-transform: uppercase;
}

.hero-meta li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-meta li:not(:last-child)::after {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.hero-visual {
  align-self: center;
}

.control-stack {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--line-strong);
  background: rgba(9, 9, 10, 0.74);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
}

.stack-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0.2rem 0.85rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.live-mark {
  color: var(--cyan);
}

.stack-layer {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.85rem;
  align-items: center;
  min-height: 5.25rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.stack-layer::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: currentColor;
  content: "";
}

.stack-layer > span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.stack-layer b {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.stack-layer small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.stack-layer.order,
.order-card {
  color: var(--amber);
}

.stack-layer.permission,
.permission-card {
  color: var(--violet);
}

.stack-layer.interface,
.interface-card {
  color: var(--cyan);
}

.stack-layer.key,
.key-card {
  color: var(--danger);
}

.stack-foot {
  margin: 0.9rem 0.2rem 0.1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.thesis-item {
  padding: clamp(1.5rem, 3vw, 2.6rem);
  border-right: 1px solid var(--line);
}

.thesis-item:last-child {
  border-right: 0;
}

.thesis-item > span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
}

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

.thesis-item strong {
  color: var(--ink);
}

.lesson-safety {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.15rem clamp(1.25rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line-strong);
  color: var(--cyan);
  background: linear-gradient(90deg, var(--cyan-dim), transparent 48%);
}

.lesson-safety strong {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lesson-safety p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100dvh - 3rem);
  padding: 5rem 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.toc {
  border-left: 1px solid var(--line);
}

.toc-title {
  margin: 0 0 1rem;
  padding-left: 1rem;
}

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

.toc a {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.55rem;
  padding: 0.55rem 0.5rem 0.55rem 1rem;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-decoration: none;
  transform: translateX(-1px);
}

.toc a::before {
  color: var(--dim);
  content: attr(data-number);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.toc a:hover,
.toc a[aria-current="true"],
.toc a.is-active {
  border-left-color: var(--violet);
  color: var(--ink);
}

.lesson {
  min-width: 0;
}

.chapter {
  width: min(100%, var(--reading));
  margin-inline: auto;
  padding: clamp(5.5rem, 10vw, 9rem) 0;
  border-bottom: 1px solid var(--line-strong);
}

.wide-chapter {
  width: 100%;
}

.chapter > p,
.chapter > h3,
.chapter > .lead,
.chapter > .definition-stack,
.chapter > .protocol-note,
.chapter > .precision-note,
.chapter > .warning-note,
.chapter > .success-note,
.chapter > .formula {
  width: min(100%, var(--reading));
  margin-inline: auto;
}

.chapter-header {
  width: min(100%, var(--reading));
  margin: 0 auto clamp(2.8rem, 6vw, 4.5rem);
}

.chapter-number {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.chapter-number::after {
  width: 3rem;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.chapter h2 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  letter-spacing: 0.015em;
  line-height: 1.15;
}

.section-deck {
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

.chapter > h3 {
  margin-top: 3.5rem;
  margin-bottom: 1.15rem;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.35;
}

.chapter > p {
  color: var(--ink-soft);
  font-size: 1rem;
}

.chapter > p + p {
  margin-top: 1.35rem;
}

.chapter .lead {
  margin-top: 0;
  margin-bottom: 3rem;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.9;
}

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

.threat-card {
  position: relative;
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, currentColor 0 2px, transparent 2px), rgba(14, 14, 16, 0.6);
}

.threat-card:last-child {
  border-right: 0;
}

.threat-index {
  color: currentColor;
  font-family: var(--mono);
}

.threat-card h3 {
  margin: 2.25rem 0 0.8rem;
  color: var(--ink);
  font-size: 1.35rem;
}

.threat-card p {
  min-height: 8.5rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.75;
}

.threat-card small {
  display: block;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.6;
}

.protocol-note,
.precision-note,
.warning-note,
.success-note {
  position: relative;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding: 1.35rem 1.5rem 1.35rem 3.3rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.protocol-note::before,
.precision-note::before,
.warning-note::before,
.success-note::before {
  position: absolute;
  top: 1.55rem;
  left: 1.25rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.protocol-note,
.precision-note {
  color: var(--violet);
  background: linear-gradient(90deg, var(--violet-dim), transparent 45%), var(--panel);
}

.warning-note {
  color: var(--danger);
  background: linear-gradient(90deg, var(--danger-dim), transparent 45%), var(--panel);
}

.success-note {
  color: var(--success);
  background: linear-gradient(90deg, var(--success-dim), transparent 45%), var(--panel);
}

.protocol-note > strong,
.precision-note > strong,
.warning-note > strong,
.success-note > strong {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.protocol-note p,
.precision-note p,
.warning-note p,
.success-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.lab {
  margin: clamp(3.5rem, 7vw, 6rem) 0;
  border: 1px solid var(--line-strong);
  background: var(--ground);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.25);
}

.lab-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--violet-dim), transparent 48%);
}

.lab-kicker {
  margin: 0 0 0.6rem;
  color: var(--violet);
}

.lab-head h3,
.quiz-head h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.3;
}

.lab-head > p {
  max-width: 22rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.lab-body {
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.choice-button,
.quiz-option {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.74rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice-button {
  padding: 0.65rem 1rem;
}

.choice-button:hover,
.quiz-option:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(243, 238, 229, 0.035);
}

.choice-button:active,
.quiz-option:active {
  transform: translateY(1px);
}

.choice-button[aria-pressed="true"],
.choice-button.is-active,
.quiz-option[aria-pressed="true"],
.quiz-option.is-selected {
  border-color: var(--violet);
  color: var(--ink);
  background: var(--violet-dim);
}

.quiz-option.is-correct,
.quiz-option[data-state="correct"],
.quiz-option[data-result="correct"] {
  border-color: var(--success);
  background: var(--success-dim);
}

.quiz-option.is-incorrect,
.quiz-option.is-wrong,
.quiz-option[data-state="wrong"],
.quiz-option[data-result="incorrect"] {
  border-color: var(--danger);
  background: var(--danger-dim);
}

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

.control-result > div,
.metric-grid > div {
  min-width: 0;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.control-result > div:last-child,
.metric-grid > div:last-child {
  border-right: 0;
}

.result-label,
.metric-grid span {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.control-result strong,
.metric-grid strong {
  display: block;
  font-weight: 400;
  line-height: 1.45;
}

.lab-verdict {
  margin: 1.2rem 0 0;
  padding: 1rem 1.15rem;
  border-left: 2px solid var(--violet);
  color: var(--ink-soft);
  background: var(--violet-dim);
  font-size: 0.9rem;
}

.lab-verdict[data-status="pass"] {
  border-color: var(--success);
  background: var(--success-dim);
}

.lab-verdict[data-status="fail"],
.lab-verdict[data-status="blocked"] {
  border-color: var(--danger);
  background: var(--danger-dim);
}

.static-note,
.diagram-caption {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.static-note {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.key-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr auto 1.15fr;
  gap: 1rem;
  align-items: center;
  margin: 3rem 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: var(--ground);
}

.flow-node {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.flow-node > span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.flow-node b {
  display: block;
  margin-top: 0.35rem;
  font-weight: 500;
}

.flow-node small {
  color: var(--muted);
  font-size: 0.72rem;
}

.seed-node {
  border-color: rgba(229, 143, 125, 0.48);
}

.key-node {
  border-color: rgba(168, 156, 255, 0.38);
}

.address-node {
  border-color: rgba(134, 216, 207, 0.35);
}

.flow-branch {
  display: grid;
  gap: 0.6rem;
}

.flow-arrow {
  color: var(--dim);
  font-family: var(--mono);
}

.definition-stack {
  margin-top: 1.5rem;
}

.definition-stack > div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 2rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.definition-stack > div:last-child {
  border-bottom: 1px solid var(--line);
}

.definition-stack dt {
  color: var(--ink);
  font-weight: 600;
}

.definition-stack dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.surface-table,
.permission-table,
.response-table {
  margin: 2.5rem 0 0;
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) var(--ground);
}

table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  background: rgba(9, 9, 10, 0.6);
}

th,
td {
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

th:last-child,
td:last-child {
  border-right: 0;
}

thead th {
  color: var(--muted);
  background: var(--panel);
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody th {
  color: var(--ink);
  background: rgba(243, 238, 229, 0.018);
  font-size: 0.88rem;
  font-weight: 600;
}

tbody td {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.7;
}

tbody tr:hover {
  background: rgba(168, 156, 255, 0.035);
}

.diagram-caption {
  margin-top: 0.8rem;
}

.check-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 2.5rem 0;
  border: 1px solid var(--line);
}

.check-strip span {
  padding: 1rem 0.7rem;
  border-right: 1px solid var(--line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.check-strip span:last-child {
  border-right: 0;
}

.attack-chain,
.response-sequence {
  display: flex;
  align-items: stretch;
  margin: 3rem 0;
}

.chain-step {
  flex: 1;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.chain-step span {
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.63rem;
}

.chain-step b,
.chain-step small {
  display: block;
}

.chain-step b {
  margin: 1.5rem 0 0.45rem;
  font-size: 1rem;
}

.chain-step small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.attack-chain > i,
.response-sequence > i {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  color: var(--dim);
  font-style: normal;
}

.myth-grid,
.concept-grid,
.mev-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.myth-grid article,
.concept-grid article,
.mev-types article {
  min-width: 0;
  padding: clamp(1.2rem, 2.7vw, 2rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(14, 14, 16, 0.5);
}

.myth-grid article > span,
.concept-grid article > span,
.mev-types article > span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.myth-grid article > span {
  color: var(--danger);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
}

.myth-grid p,
.concept-grid p,
.mev-types p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.concept-grid h3,
.mev-types h3 {
  margin: 1.35rem 0 0;
  font-size: 1.45rem;
}

.harmful-card {
  background: linear-gradient(145deg, var(--danger-dim), transparent 72%), var(--panel) !important;
}

.harmful-card > span {
  color: var(--danger) !important;
}

.scenario-console {
  border: 1px solid var(--line);
  background: #080809;
}

.console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.console-top strong {
  color: var(--danger);
  font-weight: 500;
}

.console-top strong[data-tone="safe"],
.console-top strong[data-tone="low"] {
  color: var(--success);
}

.scenario-console > p {
  margin: 0;
  padding: 1.35rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.scenario-console dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
}

.scenario-console dl > div {
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.scenario-console dl > div:last-child {
  border-right: 0;
}

.scenario-console dt {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scenario-console dd {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.permission-diagram {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1fr 0.95fr 1fr;
  gap: 0.65rem;
  align-items: center;
  margin: 3rem 0;
}

.permission-party {
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.permission-party span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
}

.permission-party b {
  margin: 0.7rem 0 0.4rem;
  font-size: 0.95rem;
}

.permission-party small,
.permission-edge small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.owner-party {
  border-top-color: var(--cyan);
}

.spender-party {
  border-top-color: var(--violet);
}

.recipient-party {
  border-top-color: var(--amber);
}

.permission-edge {
  position: relative;
  padding: 0.75rem;
  border-block: 1px solid var(--line);
  color: var(--violet);
  text-align: center;
}

.permission-edge::after {
  position: absolute;
  top: 50%;
  right: -0.65rem;
  width: 0.65rem;
  height: 0.65rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.permission-edge b {
  display: block;
  font-family: var(--mono);
  font-size: 0.67rem;
}

.danger-edge {
  color: var(--danger);
}

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

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

.field-grid label {
  display: block;
}

.field-grid label > span,
.mode-fieldset legend {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
}

.field-grid input {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.field-grid input:hover,
.field-grid input:focus {
  border-color: var(--violet);
}

.mode-fieldset,
.quiz-item fieldset {
  min-width: 0;
  margin: 1.35rem 0;
  padding: 0;
  border: 0;
}

.mode-fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.mode-fieldset legend {
  width: 100%;
}

.mode-fieldset label {
  color: var(--ink-soft);
  font-size: 0.84rem;
  cursor: pointer;
}

.mode-fieldset input {
  width: 1rem;
  height: 1rem;
  margin: 0 0.45rem 0 0;
  accent-color: var(--violet);
  vertical-align: -0.16rem;
}

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

.radius-track {
  height: 0.35rem;
  margin-top: 1rem;
  background: var(--panel-2);
  overflow: hidden;
}

.radius-track span {
  display: block;
  width: var(--radius, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--danger));
  transition: width 240ms ease;
}

.static-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.35rem;
  border: 1px solid var(--line);
}

.static-compare > div {
  padding: 1rem;
}

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

.static-compare b,
.static-compare span {
  display: block;
}

.static-compare b {
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.static-compare span {
  color: var(--muted);
  font-size: 0.76rem;
}

.mempool-diagram {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  margin: 3rem 0;
}

.mempool-stage {
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.mempool-stage > span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.mempool-stage b {
  margin: 1rem 0 0.4rem;
  font-size: 0.9rem;
}

.mempool-stage small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
}

.search-stage > span {
  color: var(--violet);
}

.build-stage > span {
  color: var(--amber);
}

.settle-stage > span {
  color: var(--success);
}

.mempool-lane {
  display: flex;
  gap: 0.2rem;
  width: clamp(1.2rem, 3vw, 2.5rem);
  justify-content: center;
}

.mempool-lane i {
  width: 2px;
  height: 0.35rem;
  background: var(--line-strong);
  animation: pulse-lane 1.5s ease-in-out infinite;
}

.mempool-lane i:nth-child(2) {
  animation-delay: 120ms;
}

.mempool-lane i:nth-child(3) {
  animation-delay: 240ms;
}

.formula {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: var(--cyan-dim);
  font-size: clamp(0.73rem, 1.5vw, 0.9rem);
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.formula b {
  color: var(--ink);
}

.trade-tape {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
}

.tape-row {
  display: grid;
  grid-template-columns: 1fr minmax(10rem, auto) 1.2fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.tape-row:last-child {
  border-bottom: 0;
}

.tape-row > span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tape-row strong {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: right;
}

.tape-row small {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

.baseline-row strong {
  color: var(--ink);
}

.protection-row strong {
  color: var(--violet);
}

.attacked-row strong {
  color: var(--danger);
}

.attacker-row strong {
  color: var(--amber);
}

.response-sequence {
  margin-top: 3rem;
}

.response-sequence > span {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--panel);
  font-size: 0.76rem;
}

.response-sequence b {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.wallet-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 3rem 0;
  border: 1px solid var(--line);
}

.wallet-tier {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.wallet-tier:last-child {
  border-right: 0;
}

.wallet-tier::after {
  position: absolute;
  inset: auto -1rem -2.2rem auto;
  color: rgba(243, 238, 229, 0.025);
  content: attr(class);
  font-family: var(--mono);
  font-size: 5rem;
  pointer-events: none;
}

.tier-number {
  margin-bottom: 4rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.wallet-tier > span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.vault-tier > span {
  color: var(--amber);
}

.active-tier > span {
  color: var(--cyan);
}

.burner-tier > span {
  color: var(--danger);
}

.wallet-tier h3 {
  margin: 0.7rem 0 1.3rem;
  font-size: 1.45rem;
}

.wallet-tier ul {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  list-style: none;
}

.wallet-tier li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1rem;
  border-top: 1px solid var(--line);
}

.wallet-tier li::before {
  position: absolute;
  top: 1.25rem;
  left: 0;
  width: 0.25rem;
  height: 0.25rem;
  background: currentColor;
  content: "";
}

.recap-list {
  width: min(100%, var(--reading));
  margin: 0 auto 4rem;
  padding: 0;
  list-style: none;
}

.recap-list li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.25rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

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

.recap-list span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.recap-list p {
  margin: 0;
  color: var(--ink-soft);
}

.quiz {
  border: 1px solid var(--line-strong);
  background: var(--ground);
}

.quiz-head {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--violet-dim), transparent 52%);
}

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

.quiz-item {
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}

.quiz-item:last-child {
  border-bottom: 0;
}

.quiz-item fieldset {
  margin: 0;
}

.quiz-item legend {
  width: 100%;
  margin-bottom: 1.25rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.quiz-item legend span {
  margin-right: 0.7rem;
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.66rem;
}

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

.quiz-option {
  padding: 0.75rem 0.9rem;
  text-align: left;
}

.quiz-feedback {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.quiz-feedback[data-state="correct"],
.quiz-feedback[data-result="correct"] {
  color: var(--success);
}

.quiz-feedback[data-state="wrong"],
.quiz-feedback[data-result="incorrect"] {
  color: var(--danger);
}

.quiz-item details {
  margin-top: 0.8rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.quiz-item summary {
  width: fit-content;
  padding-top: 0.8rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  cursor: pointer;
}

.quiz-item details p {
  margin: 0.7rem 0 0;
}

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

.glossary > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.glossary dt {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.glossary dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.sources {
  width: min(100%, var(--reading));
  margin-inline: auto;
}

.sources h3 {
  margin: 0;
  font-size: 1.55rem;
}

.sources > p {
  color: var(--muted);
  font-size: 0.86rem;
}

.sources ol {
  margin: 2rem 0 0;
  padding: 0;
  counter-reset: source;
  list-style: none;
}

.sources li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0 0.9rem 2.5rem;
  border-top: 1px solid var(--line);
  counter-increment: source;
}

.sources li::before {
  position: absolute;
  top: 1rem;
  left: 0;
  color: var(--dim);
  content: counter(source, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.sources li a {
  color: var(--ink-soft);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.sources li span {
  color: var(--muted);
  font-size: 0.76rem;
}

.control-chain,
.signature-stack,
.phishing-chain,
.approval-ledger,
.operator-scope,
.mev-pipeline,
.sandwich-diagram,
.response-matrix,
.wallet-architecture,
.recap-equation {
  isolation: isolate;
}

.source-item {
  scroll-margin-top: 2rem;
}

.site-footer {
  min-height: 15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 4rem;
  color: var(--muted);
  border-top: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

.site-footer p {
  margin: 0.75rem 0 0;
}

.site-footer > p {
  text-align: right;
}

.js-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 500ms ease, transform 500ms ease;
}

.js-enabled [data-reveal].is-visible,
.js-enabled [data-reveal][data-visible="true"] {
  opacity: 1;
  transform: none;
}

@keyframes pulse-lane {
  0%,
  100% {
    opacity: 0.25;
    transform: scaleY(0.6);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 65.625rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.65fr);
    gap: 3rem;
  }

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

  .threat-map {
    grid-template-columns: repeat(2, 1fr);
  }

  .threat-card:nth-child(2) {
    border-right: 0;
  }

  .threat-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .permission-diagram {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .permission-party {
    min-height: 6.5rem;
  }

  .permission-edge {
    border: 0;
    border-left: 1px solid var(--line);
  }

  .permission-edge::after {
    top: auto;
    right: auto;
    bottom: -0.35rem;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .mempool-diagram {
    grid-template-columns: 1fr;
  }

  .mempool-stage {
    min-height: 7rem;
  }

  .mempool-lane {
    width: 100%;
    height: 1.5rem;
    align-items: center;
  }

  .mempool-lane i {
    width: 0.35rem;
    height: 2px;
  }

  .response-sequence {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .response-sequence > i {
    display: none;
  }
}

@media (max-width: 50rem) {
  :root {
    --gutter: clamp(1rem, 5vw, 2rem);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 5rem;
  }

  .hero-visual {
    width: min(100%, 33rem);
  }

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

  .thesis-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .thesis-item:last-child {
    border-bottom: 0;
  }

  .content-grid {
    display: block;
  }

  .sidebar {
    position: relative;
    top: auto;
    max-height: none;
    padding: 2rem 0 0;
    overflow: visible;
  }

  .toc {
    border: 1px solid var(--line);
  }

  .toc-title {
    padding: 0 1rem 0.8rem;
  }

  .toc ol {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .toc a {
    min-height: 100%;
    border-top: 1px solid var(--line);
    border-left: 0;
    transform: none;
  }

  .toc li:nth-child(odd) a {
    border-right: 1px solid var(--line);
  }

  .toc a:hover,
  .toc a[aria-current="true"],
  .toc a.is-active {
    border-left: 0;
    background: var(--violet-dim);
  }

  .chapter {
    padding-block: 5.5rem;
  }

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

  .attack-chain > i {
    min-height: 1.8rem;
    transform: rotate(90deg);
  }

  .myth-grid,
  .concept-grid,
  .mev-types {
    grid-template-columns: repeat(2, 1fr);
  }

  .mev-types article:last-child,
  .concept-grid article:last-child {
    grid-column: 1 / -1;
  }

  .wallet-tiers {
    grid-template-columns: 1fr;
  }

  .wallet-tier {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .wallet-tier:last-child {
    border-bottom: 0;
  }

  .tier-number {
    margin-bottom: 2rem;
  }

  .response-sequence {
    grid-template-columns: 1fr;
  }

  .response-sequence > span {
    min-height: 3.5rem;
  }

  .three-fields {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 43.75rem) {
  .masthead {
    min-height: 4.5rem;
  }

  .course-mark {
    font-size: 0.58rem;
  }

  .hero {
    padding-top: 4rem;
  }

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

  .hero-meta li::after {
    display: none;
  }

  .lesson-safety {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .stack-layer {
    min-height: 4.6rem;
  }

  .threat-map {
    grid-template-columns: 1fr;
  }

  .threat-card,
  .threat-card:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .threat-card:last-child {
    border-bottom: 0;
  }

  .threat-card p {
    min-height: 0;
    margin-bottom: 1rem;
  }

  .lab-head {
    display: block;
  }

  .lab-head > p {
    margin-top: 1rem;
    text-align: left;
  }

  .control-result,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .control-result > div,
  .metric-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-result > div:last-child,
  .metric-grid > div:last-child {
    border-bottom: 0;
  }

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

  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .definition-stack > div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .check-strip {
    grid-template-columns: 1fr;
  }

  .check-strip span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .check-strip span:last-child {
    border-bottom: 0;
  }

  .myth-grid,
  .concept-grid,
  .mev-types {
    grid-template-columns: 1fr;
  }

  .scenario-console dl {
    grid-template-columns: 1fr;
  }

  .scenario-console dl > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scenario-console dl > div:last-child {
    border-bottom: 0;
  }

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

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

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

  .tape-row {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.8rem;
  }

  .tape-row small {
    grid-column: 1 / -1;
    text-align: left;
  }

  .recap-list li {
    grid-template-columns: 2.25rem 1fr;
  }

  .glossary > div {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .sources li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 31.25rem) {
  .brand {
    letter-spacing: 0.25em;
  }

  .course-mark {
    max-width: 10rem;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }

  .toc li:nth-child(odd) a {
    border-right: 0;
  }

  .choice-button {
    flex: 1 1 calc(50% - 0.55rem);
  }

  .protocol-note,
  .precision-note,
  .warning-note,
  .success-note {
    padding-left: 1.25rem;
  }

  .protocol-note::before,
  .precision-note::before,
  .warning-note::before,
  .success-note::before {
    display: none;
  }

  .site-footer {
    display: block;
  }

  .site-footer > p {
    margin-top: 2rem;
    text-align: left;
  }
}

@media print {
  :root {
    color-scheme: light;
    --ink: #111;
    --ink-soft: #222;
    --muted: #555;
    --dim: #777;
    --void: #fff;
    --ground: #fff;
    --panel: #f7f7f7;
    --panel-2: #eee;
    --line: rgba(0, 0, 0, 0.18);
    --line-strong: rgba(0, 0, 0, 0.45);
    --violet: #4d3eb8;
    --violet-dim: transparent;
    --cyan: #096c66;
    --cyan-dim: transparent;
    --amber: #815d14;
    --amber-dim: transparent;
    --danger: #9a2d22;
    --danger-dim: transparent;
    --success: #236530;
    --success-dim: transparent;
  }

  html,
  body {
    background: #fff;
  }

  body::before,
  .reading-progress,
  .skip-link,
  .sidebar,
  .button-row {
    display: none !important;
  }

  .site-header,
  .page,
  .site-footer {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding: 3rem 0;
  }

  .hero::after {
    color: rgba(0, 0, 0, 0.035);
  }

  .control-stack,
  .lab,
  .quiz {
    box-shadow: none;
  }

  .content-grid {
    display: block;
  }

  .chapter {
    break-before: page;
    padding: 2.5rem 0;
  }

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

  .threat-card,
  .wallet-tier,
  .quiz-item,
  .lab,
  .protocol-note,
  .precision-note,
  .warning-note,
  .success-note {
    break-inside: avoid;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  a {
    text-decoration: none;
  }

  .sources a[href^="http"]::after {
    color: var(--muted);
    content: " (" attr(href) ")";
    font-family: var(--sans);
    font-size: 0.72em;
    overflow-wrap: anywhere;
  }
}

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

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

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

@media (forced-colors: active) {
  * {
    forced-color-adjust: auto;
  }

  body {
    background: Canvas;
  }

  .reading-progress span,
  .radius-track span,
  .stack-layer::after {
    background: Highlight;
  }

  .choice-button[aria-pressed="true"],
  .choice-button.is-active,
  .quiz-option[aria-pressed="true"],
  .quiz-option.is-selected {
    border: 2px solid Highlight;
  }

  .protocol-note,
  .precision-note,
  .warning-note,
  .success-note,
  .lab-verdict {
    border: 1px solid CanvasText;
  }
}
