@charset "UTF-8";

:root {
  --paper: #f2eddf;
  --paper-2: #fbf8ef;
  --ink: #17211d;
  --muted: #667069;
  --line: #c8c1b3;
  --red: #ff5a44;
  --red-deep: #b5392a;
  --blue: #276b83;
  --gold: #e2b84f;
  --green: #34735a;
  --night: #14211e;
  --night-2: #1c2c28;
  --white: #fffdf8;
  --shadow: 0 28px 70px rgba(23, 33, 29, .12);
  --serif: Georgia, "Times New Roman", "Noto Serif KR", serif;
  --sans: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: var(--red); color: var(--white); }

/* Keep Korean words intact while letting prose and headings wrap deliberately. */
p, li, dd, figcaption, legend, .answer-option span { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6, .button, .nav-title, .rail-heading strong,
.visual-caption p, .coverage-heading, .prob-card, .verdict-item,
.utility-results, .exam-score-stamp { text-wrap: balance; }
[lang="en"] { word-break: normal; hyphens: manual; }
code, pre, kbd, samp, .equation-card, .source-badge, .source-link,
.coalition-pill, .coverage-table a { overflow-wrap: anywhere; }

/* Grid and flex children must be allowed to shrink before text overflows. */
:where(
  .topbar, .hero-grid, .hero-stats, .section-heading, .course-shell,
  .lesson-masthead, .lesson-lead, .lesson-block, .lesson-footer-nav,
  .lab-tabs, .lab-workbench, .probability-cards, .matrix-verdict,
  .utility-results, .atlas-grid, .coverage-heading, .exam-section,
  .source-notes, .source-note-grid article, footer
) > * { min-width: 0; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(23,33,29,.032) 1px, transparent 1px), linear-gradient(90deg, rgba(23,33,29,.032) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 75%);
}

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 1000; background: var(--white); padding: 12px 18px; border: 2px solid var(--ink); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #0a66d8; outline-offset: 3px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 3vw;
  color: var(--white);
  background: rgba(20, 33, 30, .96);
  border-bottom: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid currentColor; font: 700 13px/1 var(--mono); transform: rotate(-3deg); }
.brand-copy { display: grid; gap: 5px; letter-spacing: .08em; }
.brand-copy strong { font: 800 13px/1 var(--sans); }
.brand-copy small { color: #aeb9b4; font: 10px/1 var(--mono); }
.topnav { display: flex; align-items: center; gap: 30px; }
.topnav a { position: relative; color: #d7dfda; font: 700 11px/1 var(--mono); letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
.topnav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px; background: var(--red); transition: right .25s ease; }
.topnav a:hover::after { right: 0; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.language-switch { display: flex; border: 1px solid #586460; border-radius: 4px; overflow: hidden; }
.language-switch button { min-width: 38px; height: 34px; padding: 0 9px; border: 0; color: #b8c1bd; background: transparent; font: 700 11px var(--mono); cursor: pointer; }
.language-switch button + button { border-left: 1px solid #586460; }
.language-switch button.active { color: var(--night); background: var(--white); }
.icon-button { width: 36px; height: 36px; border: 1px solid #586460; border-radius: 50%; color: var(--white); background: transparent; cursor: pointer; }

html[data-language="ko"] .lang-en { display: none !important; }
html[data-language="en"] .lang-ko { display: none !important; }
html[data-language="both"] .lang-ko + .lang-en { margin-top: -.35rem; padding-top: .4rem; color: var(--muted); font-size: .92em; border-top: 1px dotted var(--line); }
.hero html[data-language="both"] .lang-ko + .lang-en { border-color: rgba(255,255,255,.2); }
html[data-language="ko"] .lesson-lead > .lang-ko,
html[data-language="en"] .lesson-lead > .lang-en { grid-column: 1 / -1; border-left: 0; }

.hero { color: var(--white); background: var(--night); overflow: hidden; }
.hero-grid { min-height: calc(100vh - 76px - 126px); display: grid; grid-template-columns: 1.02fr .98fr; gap: 6vw; align-items: center; max-width: 1560px; margin: 0 auto; padding: clamp(70px, 8vw, 128px) 5vw clamp(52px, 7vw, 92px); }
.hero-copy { position: relative; z-index: 1; }
.kicker { display: flex; justify-content: space-between; gap: 24px; margin: 0 0 28px; color: #9baca4; font: 700 10px/1 var(--mono); letter-spacing: .15em; }
.kicker span:first-child { color: var(--red); }
.hero h1 { margin: 0; max-width: 760px; font: 400 clamp(3.5rem, 6.2vw, 7.5rem)/.85 var(--serif); letter-spacing: -.06em; }
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em { position: relative; margin-left: 10%; color: var(--red); font-weight: 400; }
.hero h1 em::after { content: ""; position: absolute; left: 2%; bottom: 5%; width: 67%; height: 4px; background: var(--red); transform: rotate(-2deg); }
.hero-ko, .hero-en { max-width: 650px; margin: 30px 0 0; color: #d9e0dc; font-size: clamp(1.05rem, 1.35vw, 1.28rem); line-height: 1.65; }
.hero strong { color: var(--white); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; padding: 10px 20px; border: 1px solid currentColor; border-radius: 3px; font: 800 12px/1.35 var(--sans); text-align: center; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 rgba(0,0,0,.13); }
.button-primary { border-color: var(--red); color: var(--night); background: var(--red); }
.button-quiet { color: inherit; background: transparent; }
.full-button { width: 100%; }
.hero-note { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 25px; color: #91a098; font: 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.hero-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,115,90,.24); }
.hero-note .lang-en { padding-left: 9px; border-left: 1px solid #485650; }
.hero-visual { position: relative; width: min(100%, 660px); justify-self: center; }
.hero-visual svg { display: block; color: #afbeb7; }
.hero-svg-bg { fill: #192824; stroke: #52615b; }
.hero-svg-grid { color: #cbd6d0; }
.orbit { stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.orbit-1 { stroke: #51635c; stroke-dasharray: 3 7; }
.orbit-2 { stroke: var(--red); }
.orbit-3 { stroke: var(--gold); stroke-opacity: .75; }
.strategy-path { stroke: #7e9ba7; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1 10; }
.hero-node circle { fill: var(--blue); stroke: var(--white); stroke-width: 1.5; }
.hero-node.node-alt circle { fill: #9b6d20; }
.hero-node text, .equilibrium-node text { fill: var(--white); font: 700 16px var(--mono); text-anchor: middle; }
.equilibrium-node circle:first-child { fill: var(--red); }
.equilibrium-node circle:nth-child(2) { stroke: var(--red); stroke-width: 2; stroke-dasharray: 2 5; }
.axis-label { fill: #7d8e86; font: 10px var(--mono); letter-spacing: .13em; }
.hero-axis { fill: none; stroke: #596a62; stroke-width: 1; }
.visual-caption { position: absolute; right: -18px; bottom: 42px; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; padding: 14px 16px; color: var(--ink); background: var(--paper-2); border-left: 5px solid var(--red); box-shadow: 10px 12px 0 rgba(0,0,0,.18); transform: rotate(1.5deg); }
.visual-caption span { color: var(--red-deep); font: 800 9px var(--mono); }
.visual-caption p { margin: 0; font-size: 11px; line-height: 1.45; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1560px; margin: 0 auto; border-top: 1px solid #40504a; border-left: 1px solid #40504a; }
.hero-stats > div { min-height: 126px; display: flex; align-items: center; gap: 20px; padding: 24px 3.3vw; border-right: 1px solid #40504a; }
.hero-stats strong { color: var(--red); font: 400 2.7rem/1 var(--serif); }
.hero-stats span { color: #d8dfdc; font: 700 10px/1.6 var(--mono); letter-spacing: .07em; }
.hero-stats i { color: #7e8d86; font-style: normal; }

.section { max-width: 1560px; margin: 0 auto; padding: clamp(76px, 9vw, 140px) 5vw; }
.section-heading { display: grid; grid-template-columns: minmax(400px, 1fr) minmax(320px, .7fr); gap: 9vw; align-items: end; margin-bottom: 70px; }
.section-heading > div { position: relative; }
.section-heading h2, .source-notes h2 { margin: 16px 0 0; font: 400 clamp(2.7rem, 4.2vw, 5.3rem)/.98 var(--serif); letter-spacing: -.045em; }
.section-heading h2 em, .source-notes h2 em { color: var(--red-deep); font-weight: 400; }
.section-heading > p { max-width: 500px; margin: 0; color: var(--muted); }
.section-heading > p.lang-en { grid-column: 2; margin-top: -7vw; }
.section-index, .eyebrow { color: var(--red-deep); font: 800 10px/1 var(--mono); letter-spacing: .15em; }

.course-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.course-rail { position: sticky; top: 104px; min-width: 0; border: 1px solid var(--line); background: rgba(251,248,239,.72); }
.rail-heading { display: grid; gap: 10px; padding: 22px; border-bottom: 1px solid var(--line); }
.rail-heading span { color: var(--red-deep); font: 800 9px var(--mono); letter-spacing: .14em; }
.rail-heading strong { font: 400 1.45rem/1.25 var(--serif); }
.progress-card { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.progress-ring { --progress: 0deg; flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--red-deep) var(--progress), #d9d3c6 0); }
.progress-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--paper-2); }
.progress-ring span { position: relative; z-index: 1; font: 800 10px var(--mono); }
.progress-card p { display: grid; gap: 3px; margin: 0; color: var(--muted); font-size: 11px; }
.progress-card b { color: var(--ink); font: 800 13px var(--mono); }
.lesson-nav { max-height: min(48vh, 500px); overflow: auto; }
.lesson-nav button { width: 100%; display: grid; grid-template-columns: 30px 1fr 16px; gap: 8px; align-items: start; padding: 14px 18px; border: 0; border-bottom: 1px solid #ded8cc; color: var(--muted); text-align: left; background: transparent; cursor: pointer; }
.lesson-nav button:hover { background: var(--paper-2); }
.lesson-nav button.active { color: var(--ink); background: #fff; box-shadow: inset 4px 0 0 var(--red); }
.lesson-nav .nav-num { font: 700 10px var(--mono); }
.lesson-nav .nav-title { min-width: 0; display: grid; gap: 3px; font-weight: 800; line-height: 1.35; }
.lesson-nav .nav-title small { color: var(--muted); font: 9px/1.2 var(--mono); }
.lesson-nav .nav-check { width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 50%; }
.lesson-nav button.complete .nav-check { display: grid; place-items: center; border-color: var(--green); color: white; background: var(--green); }
.lesson-nav button.complete .nav-check::after { content: "✓"; font: 8px var(--sans); }
.source-link { display: grid; gap: 5px; padding: 19px 22px; color: var(--paper-2); background: var(--night); text-decoration: none; }
.source-link span { font: 700 9px var(--mono); letter-spacing: .1em; }
.source-link b { color: var(--red); font: 700 12px var(--mono); }

.course-main { min-width: 0; }
.course-main .section-heading { grid-template-columns: minmax(380px, 1fr) minmax(280px, .7fr); gap: 5vw; margin-bottom: 48px; }
.course-main .section-heading > p.lang-en { margin-top: -5vw; }
.lesson-reader { border-top: 7px solid var(--ink); background: var(--paper-2); box-shadow: var(--shadow); }
.lesson-masthead { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: clamp(28px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.lesson-masthead .lesson-tag { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; color: var(--red-deep); font: 800 10px var(--mono); letter-spacing: .12em; }
.lesson-masthead h3 { margin: 0; font: 400 clamp(2.3rem, 4vw, 4.7rem)/.95 var(--serif); letter-spacing: -.045em; }
.lesson-masthead h3 span { display: block; margin-top: 10px; color: var(--muted); font-size: .38em; font-style: italic; letter-spacing: 0; }
.source-badge { align-self: start; display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); color: var(--muted); font: 700 9px/1.4 var(--mono); text-decoration: none; transform: rotate(1deg); }
.source-badge strong { color: var(--ink); font-size: 11px; }
.lesson-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 1px solid var(--line); }
.lesson-lead > div { padding: 30px clamp(26px, 4vw, 50px); }
.lesson-lead > div + div { border-left: 1px solid var(--line); }
.lesson-lead span { display: block; margin-bottom: 12px; color: var(--red-deep); font: 800 9px var(--mono); letter-spacing: .12em; }
.lesson-lead p { margin: 0; font: 400 1.25rem/1.65 var(--serif); }
.lesson-body { padding: clamp(32px, 5vw, 68px); }
.lesson-block { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); padding: 34px 0; border-top: 1px solid var(--line); }
.lesson-block:first-child { padding-top: 0; border-top: 0; }
.lesson-block-label { padding-top: 6px; color: var(--red-deep); font: 800 9px/1.5 var(--mono); letter-spacing: .11em; overflow-wrap: normal; }
.lesson-block-content { max-width: 820px; }
.lesson-block-content h4 { margin: 0 0 12px; font: 400 1.75rem/1.2 var(--serif); }
.lesson-block-content p { margin: 0 0 12px; color: #3f4944; }
.lesson-block-content ul { margin: 16px 0; padding-left: 20px; }
.lesson-block-content li { margin: 8px 0; }
.equation-card { overflow-x: auto; margin: 20px 0; padding: 24px; border-left: 5px solid var(--red); color: var(--night); background: #e8e2d5; font: 400 clamp(1.2rem, 2.1vw, 2rem)/1.5 var(--serif); text-align: center; }
.equation-card small { display: block; margin-top: 10px; color: var(--muted); font: 10px/1.5 var(--mono); }
.concept-warning { margin: 18px 0; padding: 16px 18px; border: 1px solid #c8b37b; background: #f7edcf; }
.concept-warning b { display: block; margin-bottom: 4px; color: #805b16; font: 800 10px var(--mono); letter-spacing: .08em; }
.lesson-figure { margin: 24px 0 8px; border: 1px solid var(--line); background: #efeadf; }
.lesson-figure svg { display: block; width: 100%; }
.lesson-figure figcaption { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.lesson-figure figcaption b { color: var(--red-deep); font: 800 9px var(--mono); }
.lesson-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 16px 18px; color: var(--white); background: var(--night); }
.lesson-check span { color: var(--red); font: 800 10px var(--mono); }
.lesson-check p { margin: 0; color: #d9e0dc; font-size: 13px; }
.lesson-footer-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 24px; }
.lesson-footer-nav #next-lesson { justify-self: end; }

.lab-section { max-width: none; color: var(--white); background: var(--night); }
.lab-section > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
.light-heading .section-index { color: var(--red); }
.light-heading h2 em { color: var(--red); }
.light-heading > p { color: #aab7b1; }
.light-heading > p.lang-en { border-color: #43514c; }
.lab-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; border-top: 1px solid #51605a; border-left: 1px solid #51605a; }
.lab-tabs button { min-width: 0; min-height: 88px; display: grid; grid-template-columns: 35px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 8px; padding: 14px 18px; border: 0; border-right: 1px solid #51605a; border-bottom: 1px solid #51605a; color: #a9b5b0; text-align: left; background: transparent; font: 800 12px var(--mono); cursor: pointer; }
.lab-tabs button > span { grid-row: 1 / span 2; color: #72817a; font-weight: 400; }
.lab-tabs button small { color: #73827b; font: 11px var(--sans); }
.lab-tabs button[aria-selected="true"] { color: var(--night); background: var(--red); }
.lab-tabs button[aria-selected="true"] span, .lab-tabs button[aria-selected="true"] small { color: #61251d; }
.lab-panel { border: 1px solid #596861; background: var(--night-2); }
.lab-workbench { min-height: 580px; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.lab-controls { padding: clamp(25px, 3vw, 42px); border-right: 1px solid #596861; }
.eyebrow { margin: 0 0 20px; color: var(--red); }
.lab-controls h3 { margin: 0 0 18px; font: 400 2.15rem/1.05 var(--serif); }
.lab-controls h3 span { color: #81918a; font-size: .52em; font-style: italic; }
.lab-controls p:not(.eyebrow):not(.modern-note) { color: #aebbb5; font-size: 13px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 24px 0 8px; color: #adbbb4; font: 700 9px/1.45 var(--mono); letter-spacing: .08em; }
.field-label output { flex: 0 0 auto; white-space: nowrap; }
.lab-controls select, .lab-controls input[type="number"] { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #65736d; border-radius: 2px; color: var(--white); background: #13201d; }
.lab-controls input[type="range"] { width: 100%; accent-color: var(--red); }
.mini-theorem { margin: 28px 0; padding: 16px; border: 1px solid #66746e; color: var(--white); background: rgba(0,0,0,.12); }
.mini-theorem > span { display: block; margin-bottom: 12px; color: var(--red); font: 700 9px var(--mono); letter-spacing: .08em; }
.mini-theorem > div { font: 400 1.3rem var(--serif); text-align: center; }
.matrix-stage { position: relative; display: grid; place-items: center; align-content: center; padding: clamp(32px, 5vw, 72px); background-image: radial-gradient(circle at 65% 30%, rgba(39,107,131,.14), transparent 36%); }
.payoff-table { width: min(650px, 100%); table-layout: fixed; border-collapse: collapse; text-align: center; box-shadow: 12px 12px 0 rgba(0,0,0,.13); }
.payoff-table th, .payoff-table td { height: 82px; border: 1px solid #708078; }
.payoff-table th { padding: 8px 4px; color: #86968e; font: 700 9px var(--mono); letter-spacing: .06em; white-space: nowrap; background: #15231f; }
.payoff-table td { background: #233530; }
.payoff-table .result-cell, .payoff-table .result-row td { color: var(--gold); font: 400 1.45rem var(--serif); background: #172520; }
.payoff-input { width: 100%; height: 100%; border: 0; color: var(--white); text-align: center; background: transparent; font: 400 2.2rem var(--serif); }
.payoff-table td.saddle-cell { outline: 4px solid var(--red); outline-offset: -5px; background: #4f2a23; }
.player-axis { position: absolute; color: #809088; font: 800 9px var(--mono); letter-spacing: .09em; }
.player-axis span { color: var(--red); margin-right: 8px; }
.player-axis-top { top: 38px; left: 50%; transform: translateX(-50%); }
.player-axis-side { left: 21px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.matrix-verdict { width: min(650px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; border-top: 1px solid #596861; border-bottom: 1px solid #596861; }
.verdict-item { display: grid; gap: 6px; padding: 14px; text-align: center; }
.verdict-item + .verdict-item { border-left: 1px solid #596861; }
.verdict-item span { color: #82918a; font: 700 8px var(--mono); letter-spacing: .08em; }
.verdict-item strong { color: var(--white); font: 400 1.3rem var(--serif); }
.verdict-item strong.positive { color: var(--red); }
.simulation-stage, .utility-stage, .coalition-stage { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 70px); }
.probability-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.prob-card { display: grid; gap: 7px; padding: 18px; border: 1px solid #586861; background: #182722; }
.prob-card span { color: #819089; font: 700 8px/1.4 var(--mono); letter-spacing: .08em; }
.prob-card strong { font: 400 1.9rem var(--serif); }
.prob-card small { color: #819089; font-size: 10px; }
#simulation-chart, #utility-chart { width: 100%; overflow: visible; border: 1px solid #53635c; background: #172520; }
.chart-grid { stroke: #41514a; stroke-width: 1; }
.chart-label { fill: #819089; font: 10px var(--mono); }
.chart-value { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 8 5; }
.chart-empirical { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: rgba(255,90,68,.09); }
.chart-legend { display: flex; gap: 22px; margin-top: 14px; color: #91a199; font-size: 10px; }
.chart-legend i { display: inline-block; width: 18px; height: 2px; margin-right: 7px; vertical-align: middle; }
.legend-empirical { background: var(--red); }
.legend-value { background: var(--gold); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.two-fields label span { display: block; margin-bottom: 7px; color: #adbbb4; font: 700 8px var(--mono); }
.utility-curve { fill: none; stroke: var(--red); stroke-width: 3; }
.utility-chord { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 5; }
.utility-guide { fill: none; stroke: #779087; stroke-width: 1; stroke-dasharray: 3 5; }
.utility-point { fill: var(--red); stroke: var(--white); stroke-width: 1.5; }
.certainty-point { fill: var(--gold); stroke: var(--night); stroke-width: 2; }
.utility-results { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #53635c; border-top: 0; }
.utility-results > div { display: grid; gap: 4px; padding: 16px; }
.utility-results > div + div { border-left: 1px solid #53635c; }
.utility-results span { color: #819089; font: 700 8px var(--mono); }
.utility-results strong { font: 400 1.35rem var(--serif); }
.weight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.weight-grid label { display: grid; grid-template-rows: 28px 45px; border: 1px solid #65736d; text-align: center; }
.weight-grid label span { padding: 5px; color: var(--gold); font: 700 10px var(--mono); background: #253630; }
.weight-grid label input { min-width: 0; height: 45px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; text-align: center; }
.modern-note { margin-top: 20px; color: #9d8e68; font-size: 10px; }
.power-chart { display: grid; gap: 16px; margin-bottom: 30px; }
.power-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 96px; gap: 12px; align-items: center; }
.power-row > span { display: grid; place-items: center; width: 28px; height: 28px; color: var(--night); background: var(--gold); font: 800 10px var(--mono); }
.power-track { height: 30px; position: relative; background: #111c19; border: 1px solid #53635c; }
.power-fill { height: 100%; background: var(--blue); transition: width .3s ease; }
.power-row strong { color: #c7d2cd; font: 700 10px var(--mono); }
.coalition-results { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #53635c; }
.coalition-results > div { padding: 24px 0; }
.coalition-results > div + div { padding-left: 24px; border-left: 1px solid #53635c; }
.coalition-results span { display: block; margin-bottom: 15px; color: #87968f; font: 700 9px var(--mono); }
.coalition-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.coalition-pill { padding: 5px 8px; border: 1px solid #66766e; color: #d9e1dd; font: 700 10px var(--mono); }
.coalition-pill.minimal { border-color: var(--red); color: var(--red); }

.atlas-toolbar { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; padding: 15px 18px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.atlas-toolbar label { color: var(--muted); font: 800 10px var(--mono); letter-spacing: .08em; }
.atlas-toolbar input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 400 1.2rem var(--serif); }
.atlas-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.term-card { min-height: 238px; padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(251,248,239,.55); transition: background .2s ease, transform .2s ease; }
.term-card:hover { position: relative; z-index: 1; background: var(--paper-2); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(23,33,29,.09); }
.term-card .term-index { color: var(--red-deep); font: 800 9px var(--mono); }
.term-card h3 { margin: 22px 0 3px; font: 400 1.65rem/1 var(--serif); }
.term-card h4 { margin: 0 0 18px; color: var(--muted); font-size: .82rem; }
.term-card p { margin: 0; color: #4a544f; font-size: 13px; }
.term-card .misconception { margin-top: 16px; padding-top: 12px; border-top: 1px dotted var(--line); color: #7c4b3d; font-size: 11px; }
.coverage-panel { margin-top: 70px; border-top: 7px solid var(--ink); background: var(--paper-2); box-shadow: var(--shadow); }
.coverage-heading { display: grid; grid-template-columns: 160px minmax(260px, .7fr) 1fr; gap: 28px; align-items: start; padding: 28px; border-bottom: 1px solid var(--line); }
.coverage-heading > span { padding-top: 7px; color: var(--red-deep); font: 800 9px var(--mono); letter-spacing: .11em; }
.coverage-heading h3 { margin: 0; font: 400 1.75rem var(--serif); }
.coverage-heading p { max-width: 530px; margin: 0; color: var(--muted); font-size: 12px; }
.coverage-table-wrap { overflow-x: auto; }
.coverage-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.coverage-table th, .coverage-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; }
.coverage-table th { color: var(--muted); background: #e8e2d5; font: 800 9px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.coverage-table td { font-size: 12px; }
.coverage-table td:first-child, .coverage-table td:nth-child(3), .coverage-table td:nth-child(4), .coverage-table td:last-child { font-family: var(--mono); font-size: 10px; }
.coverage-table td:first-child { color: var(--red-deep); font-weight: 800; }
.coverage-table a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.coverage-table tr:hover td { background: #f5f0e5; }

.exam-section { max-width: none; display: grid; grid-template-columns: minmax(300px, .55fr) minmax(500px, 1fr); column-gap: 8vw; color: var(--white); background: var(--red-deep); }
.exam-intro { position: sticky; top: 110px; align-self: start; max-width: 510px; padding-left: 4vw; }
.exam-intro .section-index { color: #ffcfc7; }
.exam-intro h2 { margin: 22px 0 26px; font: 400 clamp(2.8rem, 4.7vw, 5.5rem)/.95 var(--serif); letter-spacing: -.05em; }
.exam-intro h2 em { color: #241b18; font-weight: 400; }
.exam-intro p { color: #f5d1ca; }
.exam-score-stamp { width: 150px; height: 150px; display: grid; place-items: center; align-content: center; margin-top: 40px; border: 3px double #f5c7bf; border-radius: 50%; transform: rotate(-7deg); }
.exam-score-stamp span { font: 700 9px var(--mono); letter-spacing: .1em; }
.exam-score-stamp strong { margin: 6px 0 -5px; font: 400 3.8rem/1 var(--serif); }
.exam-score-stamp small { font: 11px var(--mono); }
.exam-form { display: grid; gap: 18px; padding-right: 4vw; }
.question-card { padding: 26px; color: var(--ink); background: var(--paper-2); border: 2px solid transparent; }
.question-card.correct { border-color: #235a43; }
.question-card.incorrect { border-color: #782017; }
.question-card legend { width: 100%; margin-bottom: 18px; font: 700 1rem/1.6 var(--sans); }
.question-card legend span { margin-right: 8px; color: var(--red-deep); font: 800 10px var(--mono); }
.question-card legend small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.answers { display: grid; gap: 7px; }
.answer-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #d2ccbf; cursor: pointer; }
.answer-option:hover { border-color: var(--ink); }
.answer-option input { margin-top: 5px; accent-color: var(--red-deep); }
.answer-option span { font-size: 13px; }
.answer-feedback { display: none; margin: 15px 0 0; padding: 12px; color: #42504a; background: #e9e3d6; font-size: 12px; }
.question-card.graded .answer-feedback { display: block; }
.exam-actions { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 24px 4vw 0 0; }
.exam-actions .button-primary { color: var(--red-deep); background: var(--white); border-color: var(--white); }
.exam-actions p { flex-basis: 100%; min-height: 24px; margin: 10px 0 0; color: #ffd8d2; }

.source-notes { display: grid; grid-template-columns: .6fr 1fr; gap: 7vw; }
.source-note-grid { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.source-note-grid article { display: grid; grid-template-columns: 115px 180px 1fr; gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.source-note-grid article > span { padding-top: 5px; color: var(--red-deep); font: 800 9px var(--mono); }
.source-note-grid h3 { margin: 0; font: 400 1.3rem var(--serif); }
.source-note-grid p { margin: 0; color: var(--muted); font-size: 12px; }

footer { min-height: 240px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 40px; padding: 50px 5vw; color: #a9b6b0; background: #0d1714; border-top: 1px solid #3f4f48; }
footer > div { display: flex; align-items: center; gap: 16px; }
footer p { font-size: 11px; line-height: 1.7; }
footer div p { color: var(--white); font: 700 12px/1.5 var(--mono); }
footer small { color: #718079; font-weight: 400; }
footer a { color: var(--red); font: 800 10px var(--mono); text-decoration: none; }

.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 48px)); padding: 14px 18px; color: var(--white); background: var(--night); border-left: 4px solid var(--red); box-shadow: var(--shadow); font-size: 12px; animation: toastIn .24s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

html.high-contrast { --paper: #fff; --paper-2: #fff; --ink: #000; --muted: #333; --line: #555; --red: #d2230a; --red-deep: #9d1500; --night: #000; --night-2: #111; }
html.high-contrast body::before { display: none; }

@media (max-width: 1120px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .course-shell { grid-template-columns: 230px minmax(0, 1fr); gap: 36px; }
  .section-heading, .course-main .section-heading { gap: 4vw; }
  .atlas-grid { grid-template-columns: repeat(2, 1fr); }
  .coverage-heading { grid-template-columns: 120px 1fr; }
  .coverage-heading p { grid-column: 2; }
  .source-notes { grid-template-columns: 1fr; }
  .lab-workbench { grid-template-columns: 300px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .topbar { height: 68px; padding: 0 18px; }
  .brand-copy { display: none; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; padding: 75px 7vw 55px; }
  .hero-copy { max-width: 680px; }
  .hero-visual { width: min(100%, 560px); }
  .visual-caption { right: 0; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div { min-height: 95px; }
  .section-heading, .course-main .section-heading { grid-template-columns: 1fr; gap: 22px; }
  .section-heading > p.lang-en, .course-main .section-heading > p.lang-en { grid-column: auto; margin-top: -14px; }
  .course-shell { grid-template-columns: 1fr; }
  .course-rail { position: relative; top: 0; }
  .lesson-nav { display: flex; max-height: none; overflow-x: auto; }
  .lesson-nav button { flex: 0 0 220px; border-right: 1px solid var(--line); }
  .source-link { display: none; }
  .lab-tabs { grid-template-columns: repeat(2, 1fr); }
  .lab-workbench { grid-template-columns: 1fr; }
  .lab-controls { border-right: 0; border-bottom: 1px solid #596861; }
  .exam-section { grid-template-columns: 1fr; }
  .exam-intro { position: relative; top: 0; padding: 0; }
  .exam-form { padding: 60px 0 0; }
  .exam-actions { grid-column: 1; padding-right: 0; }
  .source-note-grid article { grid-template-columns: 100px 150px 1fr; }
  footer { grid-template-columns: 1fr 1fr; }
  footer > a { grid-column: 2; }
}

@media (max-width: 580px) {
  html { scroll-padding-top: 66px; }
  .top-actions { gap: 6px; }
  .language-switch button { min-width: 34px; padding: 0 6px; }
  .icon-button { display: none; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.7rem); line-height: .9; letter-spacing: -.055em; }
  .kicker span:last-child { display: none; }
  .hero-actions { display: grid; }
  .hero-visual { margin-top: -20px; }
  .hero-stats > div { padding: 18px 6vw; }
  .hero-stats strong { font-size: 2rem; }
  .section { padding-left: 6vw; padding-right: 6vw; }
  .section-heading { margin-bottom: 45px; }
  .section-heading h2, .source-notes h2 { font-size: clamp(2.15rem, 10vw, 2.9rem); line-height: 1.02; }
  .course-shell { padding-left: 0; padding-right: 0; }
  .course-rail { margin: 0 6vw; }
  .course-main > .section-heading, .lesson-footer-nav { margin-left: 6vw; margin-right: 6vw; }
  .lesson-reader { box-shadow: none; }
  .lesson-masthead { grid-template-columns: 1fr; }
  .lesson-masthead h3 { font-size: clamp(2rem, 10.5vw, 2.7rem); line-height: 1.02; }
  .source-badge { justify-self: start; }
  .lesson-lead { grid-template-columns: 1fr; }
  .lesson-lead > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .lesson-lead p { font-size: 1.1rem; }
  .lesson-body { padding: 28px 6vw; }
  .lesson-block { grid-template-columns: 1fr; gap: 11px; }
  .lesson-block-content h4 { font-size: 1.5rem; }
  .lesson-footer-nav { grid-template-columns: 1fr 1fr; }
  .lesson-footer-nav #complete-lesson { grid-row: 1; grid-column: 1 / -1; }
  .lab-tabs button { min-height: 76px; grid-template-columns: 25px minmax(0, 1fr); padding: 12px 10px; font-size: 10px; }
  .lab-controls h3 { font-size: clamp(1.8rem, 8.5vw, 2.15rem); }
  .matrix-stage, .simulation-stage, .utility-stage, .coalition-stage { padding: 30px 14px; }
  .player-axis { display: none; }
  .payoff-table th, .payoff-table td { height: 68px; }
  .payoff-input { font-size: 1.7rem; }
  .matrix-verdict, .probability-cards, .utility-results { grid-template-columns: 1fr; }
  .verdict-item + .verdict-item, .utility-results > div + div { border-left: 0; border-top: 1px solid #596861; }
  .coalition-results { grid-template-columns: 1fr; }
  .coalition-results > div + div { padding-left: 0; border-left: 0; border-top: 1px solid #53635c; }
  .atlas-grid { grid-template-columns: 1fr; }
  .coverage-heading { grid-template-columns: 1fr; gap: 8px; }
  .coverage-heading p { grid-column: 1; }
  .atlas-toolbar { align-items: stretch; flex-direction: column; gap: 2px; }
  .exam-intro h2 { font-size: clamp(2.3rem, 11vw, 3.25rem); }
  .source-note-grid article { grid-template-columns: 1fr; gap: 9px; }
  footer { grid-template-columns: 1fr; align-items: start; }
  footer > a { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .hero-visual, .lab-section, .lesson-footer-nav, .exam-actions, footer { display: none !important; }
  body { background: #fff; }
  .hero { color: #000; background: #fff; }
  .hero h1 { font-size: 52pt; }
  .hero-stats { border-color: #000; }
  .course-shell { display: block; }
  .course-rail { display: none; }
  .lesson-reader { box-shadow: none; }
}
