:root {
  --paper: #f6f3ed;
  --surface: #fffdf9;
  --ink: #172139;
  --muted: #687188;
  --line: #d9d4ca;
  --blue: #3155d9;
  --blue-dark: #203c99;
  --coral: #e86d55;
  --mint: #9fd7c0;
  --mint-dark: #2f8062;
  --yellow: #f1cb62;
  --night: #111b31;
  --night-2: #1d2a47;
  --shadow: 0 18px 50px rgba(24, 34, 57, .09);
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.75 var(--sans); }
a { color: inherit; }
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible, .term:focus-visible { outline: 3px solid rgba(49,85,217,.35); outline-offset: 3px; }
code { font-family: var(--mono); }
.shell { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.topbar { position: sticky; z-index: 20; top: 0; height: 68px; padding: 0 max(28px, calc((100vw - 1180px)/2)); display: flex; align-items: center; gap: 30px; color: var(--ink); background: rgba(246,243,237,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand > span { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 50%; font: 700 16px/1 var(--serif); }
.brand b { font-size: 14px; }
.topbar nav { display: flex; gap: 24px; margin-left: auto; }
.topbar nav a { color: var(--muted); font-size: 12px; text-decoration: none; }
.topbar nav a:hover { color: var(--blue); }
.runtime-badge { padding: 7px 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; white-space: nowrap; }
.runtime-badge::before { content: ""; width: 7px; height: 7px; margin-right: 7px; display: inline-block; background: var(--yellow); border-radius: 50%; }
.runtime-badge.live::before { background: #48b589; }

.hero { min-height: 670px; padding: 92px 0 78px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); align-items: center; gap: 72px; }
.eyebrow, .section-tag { margin: 0 0 12px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 500 clamp(56px, 6.6vw, 88px)/.95 var(--serif); letter-spacing: -.055em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.lead { max-width: 710px; margin: 32px 0; color: var(--muted); font-size: 19px; line-height: 1.95; }
.lead b { color: var(--ink); }
.hero-context { max-width: 700px; margin: 22px 0 14px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-context b, .same-principle b { color: var(--ink); }
.scale-comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.scale-comparison > div { min-width: 0; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.scale-comparison span, .scale-comparison small { display: block; color: var(--muted); font-size: 8px; }
.scale-comparison strong { margin: 3px 0 4px; display: block; color: var(--blue-dark); font: 700 17px/1.15 var(--mono); }
.scale-comparison > div:last-child strong { color: #8c6a1c; }
.same-principle { margin: 13px 0 7px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.hero-sources { margin: 0 0 12px; color: #8c93a3; font-size: 8px; }
.hero-sources a { color: var(--blue); }
.hero-link { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.hero-decoder { padding: 16px; color: white; background: var(--night); border-radius: 24px; box-shadow: var(--shadow); }
.decoder-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.decoder-map-heading span { color: var(--mint); font-size: 12px; font-weight: 800; }
.decoder-map-heading b { padding: 5px 8px; color: var(--yellow); background: var(--night-2); border-radius: 999px; font: 800 9px/1 var(--mono); }
.flow-direction { margin: 3px 0 6px; display: flex; justify-content: space-between; color: #8896ae; font-size: 8px; }
.flow-direction span { color: #c2cbdb; }
.flow-direction span i { width: 8px; height: 8px; margin-right: 5px; display: inline-block; background: var(--mint); border-radius: 2px; }
.decoder-terminal, .decoder-simple-node, .decoder-input-node { min-height: 28px; padding: 4px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--night-2); border: 1px solid #3a4a68; border-radius: 6px; }
.diagram-link, .layer-jump { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, filter .16s ease; }
.diagram-link:hover { border-color: #7e91b5; box-shadow: 0 0 0 2px rgba(126,145,181,.17); transform: translateY(-1px); }
.diagram-link.attention-node:hover { border-color: white; box-shadow: 0 0 0 2px rgba(159,215,192,.3); }
.decoder-terminal.diagram-link:hover, .decoder-input-node.diagram-link:hover { filter: brightness(1.035); }
.diagram-link:focus-visible, .layer-jump:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.decoder-terminal { min-height: 40px; color: var(--night); background: var(--yellow); border-color: var(--yellow); }
.decoder-input-node { color: var(--night); background: #dce3f1; border-color: #dce3f1; }
.decoder-terminal strong, .decoder-simple-node strong, .decoder-input-node strong { font-size: 10px; }
.decoder-terminal small, .decoder-simple-node small, .decoder-input-node small { color: inherit; opacity: .72; font-size: 8px; }
.decoder-terminal > strong { flex: 0 0 auto; }
.decoder-softmax-probs { min-width: 0; flex: 1 1 auto; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; }
.decoder-probability { min-width: 0; padding: 2px 1px; display: grid; grid-template-columns: auto auto; gap: 2px; place-items: center; justify-content: center; color: #5d4b19; background: rgba(255,255,255,.27); border-radius: 3px; font: 700 6px/1 var(--mono); }
.decoder-probability b { max-width: 100%; overflow: hidden; font: inherit; text-overflow: ellipsis; }
.decoder-probability small { color: inherit; font: 6px/1 var(--mono); opacity: .8; }
.decoder-probability.max { color: white; background: var(--blue-dark); }
.decoder-probability.loading { grid-column: 1 / -1; color: #67541e; background: transparent; font-size: 7px; }
#decoder-input-tokens { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); letter-spacing: .14em; opacity: 1; }
.map-arrow { height: 9px; display: grid; place-items: center; color: var(--coral); font: 800 9px/1 var(--mono); }
.decoder-layer-map { padding: 6px; background: rgba(255,255,255,.035); border: 1px solid #40506d; border-radius: 8px; }
.decoder-layer-map header { margin-bottom: 4px; }
.layer-jump { padding: 1px 2px; display: flex; align-items: center; justify-content: space-between; border-radius: 3px; }
.layer-jump:hover { background: rgba(255,255,255,.06); }
.decoder-layer-map header b { color: #e9edf6; font-size: 10px; }
.decoder-layer-map header span { color: #8390a7; font: 8px/1 var(--mono); }
.decoder-sublayer-row { display: grid; grid-template-columns: minmax(74px,.82fr) 10px minmax(128px,1.35fr) 10px minmax(88px,1fr); gap: 4px; align-items: stretch; }
.decoder-sublayer-row > i { display: grid; place-items: center; color: var(--coral); font: normal 800 10px/1 var(--mono); }
.map-node { min-height: 33px; padding: 4px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #d6ddea; background: var(--night-2); border: 1px solid #384865; border-radius: 5px; text-align: center; }
.map-node b { font-size: 8px; line-height: 1.3; }
.map-node small { margin-top: 2px; color: #8491a8; font-size: 7px; line-height: 1.25; }
.attention-node { color: var(--night); background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 2px rgba(159,215,192,.14); }
.attention-node b { font-size: 8px; }
.attention-node small { color: #2f604f; font-family: var(--mono); }
.attention-node > span { margin-top: 2px; display: flex; gap: 3px; }
.attention-node em { padding: 2px 4px; color: white; background: var(--mint-dark); border-radius: 3px; font: normal 700 6px/1 var(--mono); }
.layer-turn { height: 8px; display: grid; place-items: center; color: var(--coral); font: 800 8px/1 var(--mono); }

.experiment-band { padding: 70px 0; color: white; background: var(--night); }
.experiment-grid { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); gap: 55px; }
.experiment-copy h2 { margin: 0; font: 500 38px/1.2 var(--serif); }
.experiment-copy > p:not(.section-tag) { color: #b9c3d7; }
.experiment-copy label { display: block; margin-top: 28px; color: var(--mint); font-size: 11px; font-weight: 800; }
#token-input { width: 100%; margin-top: 8px; padding: 13px 16px; color: white; background: var(--night-2); border: 1px solid #50617f; border-radius: 10px; font: 700 30px/1.2 var(--mono); }
.input-status { margin: 8px 0 0; color: #aeb9ce; font-size: 11px; }
.input-status.error { color: #ff9e8c; }
.trainer { align-self: start; }
.trainer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trainer-stats span { padding: 16px; color: #b9c3d7; background: var(--night-2); border-radius: 10px; font-size: 11px; }
.trainer-stats b { margin-top: 4px; display: block; color: white; font: 700 20px/1.2 var(--mono); }
.train-actions { margin-top: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.train-actions button, .head-switch button, .code-tabs button { padding: 10px 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 800; }
.train-actions button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.train-actions button:disabled { opacity: .45; cursor: wait; }
.train-status { min-height: 24px; margin: 12px 0; color: #b9c3d7; font-size: 11px; }
.prediction-now { padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; background: rgba(159,215,192,.12); border-left: 3px solid var(--mint); }
.prediction-now span { color: var(--mint); font-size: 11px; }
.prediction-now b { grid-row: 1 / 3; grid-column: 2; color: var(--yellow); font: 700 42px/1 var(--serif); }
.prediction-now small { color: #d3dbea; }
.minor-heading { margin: 38px 0 13px; color: #d7deeb; font-size: 13px; }
.prefix-history { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.prefix-card { padding: 13px; background: var(--night-2); border-radius: 8px; }
.prefix-card > code { display: block; color: var(--yellow); }
.prefix-card div { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.prefix-card span { padding: 4px 6px; color: #c9d1df; background: rgba(255,255,255,.06); border-radius: 5px; font: 10px/1.2 var(--mono); }
.probability-details { margin-top: 14px; border-top: 1px solid #33415d; }
.probability-details summary, details > summary { padding: 14px 0; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 800; }
.probability-details summary { color: var(--mint); }
.probability-bars { padding: 10px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.probability-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 58px; gap: 8px; align-items: center; font: 10px/1.2 var(--mono); }
.probability-row div { height: 7px; overflow: hidden; background: #32405c; border-radius: 999px; }
.probability-row i { height: 100%; display: block; background: var(--mint); }

.invention-story { padding: 100px 0 112px; background: var(--surface); scroll-margin-top: 76px; }
.invention-heading { max-width: 980px; margin-bottom: 52px; }
.invention-heading > span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.invention-heading h2 { margin: 10px 0 18px; font: 500 clamp(43px,5.5vw,70px)/1.08 var(--serif); letter-spacing: -.035em; }
.invention-heading p { max-width: 900px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.invention-step { padding: 34px 0; display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 24px; border-top: 1px solid var(--line); }
.invention-step > div:last-child { min-width: 0; }
.invention-step-number { width: 48px; height: 48px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 50%; font: 800 12px/1 var(--mono); }
.invention-step > div:last-child > span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.invention-step h3 { max-width: 980px; margin: 6px 0 12px; font: 500 30px/1.35 var(--serif); }
.invention-step > div:last-child > p { max-width: 1000px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.invention-step > div:last-child > p code { overflow-wrap: anywhere; white-space: normal; }
.invention-core-step { margin: 18px 0; padding: 36px 24px; background: rgba(159,215,192,.15); border-top: 5px solid var(--mint-dark); }
.invention-core-step .invention-step-number { background: var(--mint-dark); }
.invention-a-shape, .invention-full-formula { margin: 16px 0; padding: 20px; display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; color: #dfe6f4; background: var(--night); }
.invention-a-shape code, .invention-full-formula code { padding: 10px 12px; overflow-x: auto; color: #e7ecf6; background: var(--night-2); border: 1px solid #3b4c6b; border-radius: 6px; font-size: 10px; white-space: nowrap; }
.invention-a-shape i, .invention-full-formula i { color: var(--yellow); font: normal 800 11px/1 var(--mono); }
.invention-mini-conclusion, .invention-names { margin-top: 16px; padding: 17px; color: #285c49; background: rgba(159,215,192,.25); border-left: 4px solid var(--mint-dark); font-size: 12px; }
.invention-live-note { grid-column: 1 / -1; margin: 0 !important; padding: 14px 16px; color: #765d1c !important; background: rgba(241,203,98,.2); border-left: 4px solid #cda52f; font-size: 11px !important; }
.invention-pair-score { margin: 18px 0; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; }
.invention-pair-score code { padding: 15px; overflow-x: auto; color: #e5ebf6; background: var(--night-2); border-top: 4px solid var(--blue); font-size: 9px; text-align: center; white-space: nowrap; }
.invention-pair-score i { color: var(--coral); font: normal 800 10px/1.4 var(--mono); text-align: center; }
.invention-names { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.invention-names b { color: var(--blue-dark); }
.invention-two-jobs { margin: 18px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.invention-two-jobs article { padding: 20px; background: #efebe4; border-top: 4px solid var(--blue); }
.invention-two-jobs article:last-child { border-top-color: var(--mint-dark); }
.invention-two-jobs b { display: block; color: var(--blue-dark); }
.invention-two-jobs code { margin: 9px 0; padding: 9px; display: block; overflow-x: auto; color: #e5ebf6; background: var(--night-2); font-size: 9px; white-space: nowrap; }
.invention-two-jobs p { margin: 0; color: var(--muted); font-size: 10px; }
.invention-finish-step { margin-top: 18px; padding: 38px 26px; color: white; background: var(--night); border-top: 0; }
.invention-finish-step .invention-step-number { color: var(--night); background: var(--yellow); }
.invention-finish-step > div:last-child > span { color: var(--mint); }
.invention-finish-step h3 { color: var(--yellow); }
.invention-finish-step > div:last-child > p { color: #bcc6d8; }
.invention-finish-step .matrix-panel h4 { color: white; }
.invention-answer-chain { margin: 18px 0; display: flex; align-items: center; gap: 7px; overflow-x: auto; padding-bottom: 5px; }
.invention-answer-chain code, .invention-answer-chain strong { flex: 0 0 auto; padding: 9px 10px; color: #e5ebf6; background: var(--night-2); border: 1px solid #40516f; font: 9px/1.2 var(--mono); white-space: nowrap; }
.invention-answer-chain strong { color: var(--yellow); }
.invention-answer-chain i { flex: 0 0 auto; color: var(--coral); font: normal 800 8px/1.3 var(--mono); }
.invention-training-loop { margin-top: 20px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 13px; color: var(--ink); background: var(--mint); }
.invention-training-loop b { color: var(--blue-dark); }
.invention-training-loop span { font-size: 11px; }
.two-moments { margin-top: 46px; padding-top: 46px; border-top: 8px solid var(--blue); scroll-margin-top: 76px; }
.two-moments > header { max-width: 1000px; }
.two-moments > header > span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.two-moments > header h3 { margin: 7px 0 12px; font: 500 36px/1.3 var(--serif); }
.two-moments > header p { margin: 0; color: var(--muted); font-size: 13px; }
.two-moment-premise { margin: 24px 0; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 14px; align-items: stretch; }
.two-moment-premise article { padding: 20px; background: #efebe4; border-top: 4px solid var(--blue); }
.two-moment-premise article:last-child { border-top-color: var(--mint-dark); }
.two-moment-premise article > span { color: var(--blue); font-size: 9px; font-weight: 800; }
.two-moment-premise b { margin: 6px 0; display: block; font-size: 14px; }
.two-moment-premise p { margin: 0; color: var(--muted); font-size: 10px; }
.two-moment-premise > i { align-self: center; color: var(--coral); font: normal 800 9px/1.4 var(--mono); text-align: center; }
.two-moment-live-state { margin-bottom: 14px; padding: 14px 17px; display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; color: #dfe6f4; background: var(--night); }
.two-moment-live-state b { color: var(--mint); }
.two-moment-live-state span { color: var(--yellow); font: 800 10px/1 var(--mono); }
.two-moment-live-state p { margin: 0; color: #b9c3d6; font-size: 9px; text-align: right; }
.attention-moment-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; align-items: start; }
.attention-moment-card { min-width: 0; padding: 20px; background: #eae6de; border-top: 5px solid var(--blue); }
.attention-moment-card:last-child { border-top-color: var(--mint-dark); }
.moment-heading > span { color: var(--blue); font-size: 9px; font-weight: 800; }
.moment-heading h4 { margin: 6px 0 11px; font: 500 22px/1.35 var(--serif); }
.moment-heading > div { display: flex; gap: 5px; flex-wrap: wrap; }
.moment-heading em { padding: 6px 8px; color: #5d6678; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font: normal 800 9px/1 var(--mono); }
.moment-heading em.max { color: white; background: var(--blue); border-color: var(--blue); }
.moment-layer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.moment-layer h5 { margin: 0 0 11px; color: var(--blue-dark); font-size: 10px; }
.attention-moment-card .matrix-grid.two { grid-template-columns: 1fr; }
.moment-output-proof { margin-top: 20px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.two-moment-insight { margin-top: 20px; padding: 22px; background: #efebe4; border-top: 5px solid var(--yellow); }
.two-moment-insight > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.two-moment-insight > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.two-moment-insight > div { margin-top: 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.two-moment-insight article { padding: 16px; background: var(--surface); border-top: 3px solid var(--blue); }
.two-moment-insight article:nth-child(2) { border-top-color: var(--mint-dark); }
.two-moment-insight article:nth-child(3) { border-top-color: #cda52f; }
.two-moment-insight b { color: var(--blue-dark); font-size: 11px; }
.two-moment-insight article p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.two-moment-depth { margin-top: 20px; padding: 20px; color: #285c49; background: rgba(159,215,192,.26); border-left: 4px solid var(--mint-dark); }
.two-moment-depth b { color: var(--blue-dark); }
.two-moment-depth p { margin: 5px 0 0; font-size: 11px; }
.two-moment-boundary { margin-top: 12px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 14px; color: white; background: var(--blue); }
.two-moment-boundary b { color: var(--yellow); }
.two-moment-boundary span { font-size: 11px; }
.learning-direction { margin-top: 54px; padding-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.learning-direction > header { max-width: 960px; }
.learning-direction > header > span { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.learning-direction > header h3 { margin: 7px 0 13px; font: 500 36px/1.25 var(--serif); }
.learning-direction > header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.learning-chain { margin-top: 28px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; align-items: stretch; }
.learning-chain > article { min-width: 0; padding: 19px; background: #efebe4; border-top: 4px solid var(--blue); }
.learning-chain > article:nth-of-type(2) { border-top-color: var(--mint-dark); }
.learning-chain > article:nth-of-type(3) { border-top-color: #cda52f; }
.learning-chain > article.learning-chain-result { color: white; background: var(--night); border-top-color: var(--coral); }
.learning-chain > article > span { color: var(--blue); font-size: 8px; font-weight: 800; }
.learning-chain > article.learning-chain-result > span { color: var(--mint); }
.learning-chain b, .learning-chain code, .learning-chain p { display: block; }
.learning-chain b { margin: 7px 0 10px; color: var(--blue-dark); font-size: 11px; }
.learning-chain-result b { color: var(--yellow); }
.learning-chain code { padding: 8px; overflow-x: auto; color: #e4ebf7; background: var(--night-2); font-size: 8px; white-space: nowrap; }
.learning-chain p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.learning-chain-result p { color: #bdc8da; }
.learning-chain > i { display: none; }
.learning-equation-proof { margin-top: 14px; padding: 19px; display: grid; grid-template-columns: auto 1fr; gap: 16px; color: #285c49; background: rgba(159,215,192,.26); border-left: 4px solid var(--mint-dark); }
.learning-equation-proof b { color: var(--blue-dark); }
.learning-equation-proof p { margin: 0; font-size: 10px; line-height: 1.75; }
.learning-equation-proof code { color: var(--blue-dark); font-size: 9px; }
.route-gradient-proof { margin-top: 24px; }
.route-gradient-state { padding: 14px 17px; display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; color: #dfe6f4; background: var(--night); }
.route-gradient-state b { color: var(--mint); }
.route-gradient-state span { color: var(--yellow); font: 800 10px/1 var(--mono); }
.route-gradient-state p { margin: 0; color: #b9c3d6; font-size: 9px; text-align: right; }
.route-gradient-moments { margin-top: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.route-gradient-moment { min-width: 0; padding: 18px; background: #eae6de; border-top: 5px solid var(--blue); }
.route-gradient-moment:last-child { border-top-color: var(--mint-dark); }
.route-gradient-moment > header > span { color: var(--blue); font-size: 8px; font-weight: 800; }
.route-gradient-moment > header h4 { margin: 6px 0; font: 500 20px/1.35 var(--serif); }
.route-gradient-moment > header p { margin: 0; color: var(--muted); font-size: 9px; }
.route-gradient-heads { margin-top: 14px; display: grid; gap: 12px; }
.route-gradient-head { min-width: 0; }
.route-gradient-head h5 { margin: 0 0 5px; color: var(--blue-dark); font-size: 9px; }
.route-gradient-head table { width: 100%; border-collapse: collapse; background: var(--surface); font: 8px/1.35 var(--mono); }
.route-gradient-head th, .route-gradient-head td { padding: 6px; border: 1px solid var(--line); text-align: right; white-space: nowrap; }
.route-gradient-head thead th { color: #667085; background: #e4dfd6; }
.route-gradient-head tbody th { color: var(--blue-dark); text-align: center; }
.route-gradient-head td:last-child { font-weight: 800; }
.route-gradient-head td.raise { color: #287058; }
.route-gradient-head td.lower { color: #a7493a; }
.route-gradient-head td.quiet { color: var(--muted); }
.gradient-force { width: 54px; height: 6px; display: inline-block; overflow: hidden; background: #dfd9ce; border-radius: 5px; }
.gradient-force i { height: 100%; display: block; background: var(--coral); border-radius: inherit; }
.qk-gradient-return { margin-top: 14px; padding: 19px; color: #dfe6f4; background: var(--night); }
.qk-gradient-return > b { color: var(--yellow); }
.qk-gradient-return > div { margin-top: 10px; display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.qk-gradient-return code { flex: 0 0 auto; padding: 8px 10px; color: #e5ebf6; background: var(--night-2); border: 1px solid #40516f; font-size: 8px; white-space: nowrap; }
.qk-gradient-return i { color: var(--coral); font: normal 800 8px/1 var(--mono); }
.qk-gradient-return p { margin: 12px 0 0; color: #b9c3d6; font-size: 9px; }
.shared-gradient-story { margin-top: 34px; }
.shared-gradient-story > header span { color: var(--blue); font-size: 9px; font-weight: 800; }
.shared-gradient-story > header h4 { max-width: 940px; margin: 6px 0 15px; font: 500 25px/1.35 var(--serif); }
.shared-gradient-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.shared-gradient-grid article { padding: 18px; background: #efebe4; border-top: 4px solid var(--blue); }
.shared-gradient-grid article:nth-child(2) { border-top-color: var(--coral); }
.shared-gradient-grid article:nth-child(3) { border-top-color: var(--mint-dark); }
.shared-gradient-grid article:nth-child(4) { border-top-color: #cda52f; }
.shared-gradient-grid span, .shared-gradient-grid b { display: block; }
.shared-gradient-grid span { color: var(--blue); font-size: 8px; font-weight: 800; }
.shared-gradient-grid b { margin: 6px 0; color: var(--blue-dark); font-size: 10px; }
.shared-gradient-grid p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.times-table-teacher { margin-top: 42px; padding-top: 34px; border-top: 1px solid var(--line); }
.times-table-teacher > header span { color: var(--coral); font-size: 9px; font-weight: 800; }
.times-table-teacher > header h4 { margin: 6px 0 8px; font: 500 25px/1.35 var(--serif); }
.times-table-teacher > header p { margin: 0; color: var(--muted); font-size: 10px; }
.supervision-lane { margin-top: 18px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; }
.supervision-lane article { min-width: 0; padding: 13px 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 7px; background: #efebe4; border-top: 4px solid #a8afbb; }
.supervision-lane article.needs-context { background: rgba(159,215,192,.25); border-top-color: var(--mint-dark); }
.supervision-lane b, .supervision-lane strong, .supervision-lane span, .supervision-lane small { min-width: 0; }
.supervision-lane b { overflow-wrap: anywhere; color: var(--blue-dark); font: 800 8px/1.35 var(--mono); }
.supervision-lane i { color: var(--coral); font: normal 800 8px/1 var(--mono); }
.supervision-lane strong { grid-column: 1 / -1; color: var(--blue); font-size: 10px; }
.supervision-lane span { color: var(--ink); font: 800 8px/1 var(--mono); }
.supervision-lane small { color: var(--muted); font-size: 7px; text-align: right; }
.communication-proof { margin-top: 13px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.communication-proof > article { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--blue); }
.communication-proof > article:nth-child(2) { border-top-color: var(--coral); }
.communication-proof > article:last-child { border-top-color: var(--mint-dark); }
.communication-proof > article > span { color: var(--blue); font-size: 8px; font-weight: 800; }
.communication-proof h5 { margin: 6px 0 10px; color: var(--blue-dark); font-size: 12px; }
.communication-proof > article > code { margin-top: 5px; padding: 9px; display: block; overflow-x: auto; color: #e5ebf6; background: var(--night-2); font-size: 8px; white-space: nowrap; }
.communication-proof p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.learning-boundary { margin-top: 14px; padding: 21px; color: white; background: var(--blue); }
.learning-boundary b { color: var(--yellow); }
.learning-boundary p { margin: 7px 0 0; font-size: 10px; line-height: 1.75; }

.aha-story { padding: 92px 0 104px; color: white; background: #0c1629; scroll-margin-top: 76px; }
.aha-heading { max-width: 920px; }
.aha-heading > span, .appendix-intro > span { color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.aha-heading h2 { margin: 10px 0 16px; font: 500 clamp(42px,5vw,66px)/1.1 var(--serif); }
.aha-heading h2 code { color: var(--yellow); font: inherit; }
.aha-heading > p { margin: 0; color: #bcc7da; font-size: 16px; line-height: 1.9; }
.aha-fixed-object { margin-top: 24px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.aha-fixed-object span { padding: 12px 14px; color: white; background: var(--night-2); border-top: 3px solid #506789; font-size: 11px; }
.aha-fixed-object b { display: block; margin-bottom: 3px; color: var(--mint); font-size: 9px; }
.aha-training-bar { margin: 30px 0 20px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(159,215,192,.12); border-left: 4px solid var(--mint); }
.aha-training-bar span, .aha-training-bar small { display: block; }
.aha-training-bar span { color: white; font-weight: 800; }
.aha-training-bar small { color: #9eabc1; font-size: 9px; }
.aha-training-bar button { padding: 10px 16px; color: white; background: var(--blue); border: 1px solid #5373e4; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.aha-training-bar button:disabled { color: #aeb9cb; background: #34415b; border-color: #465470; cursor: wait; }
.aha-stepper { display: grid; grid-template-columns: minmax(110px,1fr) 16px minmax(110px,1fr) 16px minmax(110px,1fr) 16px minmax(110px,1fr) 16px minmax(110px,1fr) 16px minmax(110px,1fr); gap: 4px; align-items: stretch; }
.aha-stepper > i { display: grid; place-items: center; color: var(--coral); font: normal 800 11px/1 var(--mono); }
.aha-stepper button { min-width: 0; padding: 12px 10px; color: #c8d1e0; background: var(--night-2); border: 1px solid #3c4d6b; border-radius: 8px; cursor: pointer; text-align: left; }
.aha-stepper button span, .aha-stepper button b, .aha-stepper button small { display: block; }
.aha-stepper button span { color: var(--yellow); font: 800 9px/1 var(--mono); }
.aha-stepper button b { margin: 6px 0 3px; color: white; font-size: 11px; }
.aha-stepper button small { color: #8f9db4; font-size: 8px; line-height: 1.4; }
.aha-stepper button[aria-pressed="true"] { color: var(--night); background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 3px rgba(159,215,192,.14); }
.aha-stepper button[aria-pressed="true"] span, .aha-stepper button[aria-pressed="true"] b, .aha-stepper button[aria-pressed="true"] small { color: var(--night); }
.aha-detail { min-height: 420px; margin-top: 16px; padding: 30px; color: var(--ink); background: var(--paper); border-top: 5px solid var(--mint); }
.aha-detail-heading { max-width: 920px; margin-bottom: 22px; }
.aha-detail-heading > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.aha-detail-heading h3 { margin: 6px 0 9px; font: 500 31px/1.3 var(--serif); }
.aha-detail-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.aha-vector-compare { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.aha-deduction { margin-top: 18px; padding: 18px 20px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; color: #244f40; background: rgba(159,215,192,.28); border-left: 4px solid var(--mint-dark); }
.aha-deduction b { color: var(--blue-dark); }
.aha-deduction code { padding: 7px 9px; color: white; background: var(--night-2); font-size: 10px; }
.aha-deduction i { color: var(--coral); font: normal 800 11px/1 var(--mono); }
.aha-deduction strong { font-size: 13px; }
.aha-detail details { margin-top: 16px; border-top: 1px solid var(--line); }
.aha-route-chain { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.aha-route-chain article { min-width: 190px; padding: 13px; background: white; border-top: 4px solid #586d94; }
.aha-route-chain article:nth-of-type(3) { min-width: 155px; border-top-color: var(--coral); }
.aha-route-chain article.aha-weight { min-width: 165px; border-top-color: #cda52f; }
.aha-route-chain article:last-of-type { min-width: 275px; border-top-color: var(--mint-dark); }
.aha-route-chain article span { display: block; min-height: 29px; color: var(--muted); font-size: 8px; }
.aha-route-chain article b { display: block; margin: 5px 0 8px; color: var(--blue-dark); font-size: 10px; }
.aha-route-chain code { display: block; overflow-x: auto; color: #dde5f2; background: var(--night-2); padding: 7px; font-size: 8px; white-space: nowrap; }
.aha-route-chain strong { color: #8b6b18; font: 800 23px/1 var(--mono); }
.aha-route-chain > i { align-self: center; color: var(--coral); font: normal 800 9px/1.35 var(--mono); text-align: center; }
.aha-mini-evidence { max-width: 620px; margin-top: 16px; }
.aha-probability-line { margin-top: 14px; padding: 15px 18px; display: flex; gap: 13px; align-items: center; flex-wrap: wrap; background: rgba(241,203,98,.22); border-left: 4px solid #cda52f; }
.aha-probability-line span { color: var(--muted); }
.aha-probability-line code { padding: 7px 9px; color: var(--yellow); background: var(--night); }
.aha-probability-line b { margin-left: auto; color: #745b1b; }
.aha-training-sequence { padding: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--night); }
.aha-training-sequence code { padding: 8px 10px; color: white; background: var(--night-2); }
.aha-training-sequence i { color: var(--yellow); font: normal 800 9px/1 var(--mono); }
.aha-gradient-cards { margin-top: 13px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.aha-gradient-cards article { padding: 16px; background: white; border-top: 4px solid var(--blue); }
.aha-gradient-cards article:nth-child(2) { border-top-color: var(--coral); }
.aha-gradient-cards article:nth-child(3) { border-top-color: var(--mint-dark); }
.aha-gradient-cards span, .aha-gradient-cards b, .aha-gradient-cards code, .aha-gradient-cards small { display: block; }
.aha-gradient-cards span { color: var(--blue-dark); font-weight: 800; }
.aha-gradient-cards b { margin: 6px 0; font: 800 11px/1 var(--mono); }
.aha-gradient-cards code { padding: 7px; color: #dfe6f3; background: var(--night-2); font-size: 9px; }
.aha-gradient-cards small { margin-top: 8px; color: var(--muted); font-size: 9px; }
.aha-boundary { padding: 13px 15px; color: #785e1f; background: rgba(241,203,98,.2); border-left: 3px solid #cda52f; font-size: 10px; }
.aha-before-after { display: grid; gap: 14px; }
.aha-before-after > section { padding: 16px; background: #ece8e0; border-left: 4px solid #8090ad; }
.aha-before-after > section:last-child { border-left-color: var(--mint-dark); }
.aha-before-after h4 { margin: 0 0 10px; font-size: 12px; }
.aha-change-strip { margin-top: 13px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.aha-change-strip span { padding: 13px; color: var(--muted); background: white; font-size: 9px; }
.aha-change-strip b { display: block; margin-top: 5px; color: var(--blue-dark); font: 800 13px/1 var(--mono); }
.aha-moving-zero { margin-top: 17px; padding: 22px; display: flex; align-items: center; justify-content: center; gap: 28px; background: var(--night); }
.aha-moving-zero > div { min-width: 190px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: end; }
.aha-moving-zero span { color: white; font: 800 26px/1 var(--mono); }
.aha-moving-zero span b { color: var(--yellow); }
.aha-moving-zero i { grid-row: 2; color: #9aa8be; font: normal 9px/1 var(--mono); }
.aha-moving-zero strong { grid-row: 1 / 3; grid-column: 2; color: var(--mint); font: 800 24px/1 var(--mono); }
.aha-moving-zero em { color: var(--coral); font: normal 800 10px/1.4 var(--mono); text-align: center; }
.aha-output-flow { display: grid; gap: 7px; }
.aha-output-flow article { padding: 13px 16px; display: grid; grid-template-columns: minmax(180px,.6fr) minmax(0,1.4fr); gap: 16px; align-items: center; background: white; border-left: 4px solid #8190aa; }
.aha-output-flow article.tracked { background: rgba(159,215,192,.25); border-left-color: var(--mint-dark); }
.aha-output-flow span { color: var(--blue-dark); font-size: 10px; font-weight: 800; }
.aha-output-flow code { overflow-x: auto; color: #dfe6f3; background: var(--night-2); padding: 8px; font-size: 8px; white-space: nowrap; }
.aha-output-flow > i { color: var(--muted); font: normal 8px/1 var(--mono); text-align: center; }
.aha-lm-finish { margin-top: 14px; padding: 18px; background: rgba(241,203,98,.18); border-left: 4px solid #cda52f; }
.aha-lm-finish .matrix-equation { margin: 7px auto; }
.aha-final-sentence { margin-top: 16px; padding: 20px; color: white; background: var(--blue); font-size: 14px; }
.aha-final-sentence b { color: var(--yellow); }
.appendix-intro { padding: 80px 0 0; }
.appendix-intro > span { color: var(--blue); }
.appendix-intro h2 { margin: 7px 0 10px; font: 500 38px/1.2 var(--serif); }
.appendix-intro p { margin: 0; color: var(--muted); }
.decoder-appendix { padding-top: 56px; }
.decoder-appendix > .shell > .lesson-heading { margin-bottom: 24px; }
.appendix-index { position: sticky; z-index: 8; top: 78px; margin-bottom: 30px; padding: 10px; display: flex; gap: 7px; flex-wrap: wrap; background: rgba(246,243,237,.94); border: 1px solid var(--line); border-radius: 11px; backdrop-filter: blur(10px); }
.appendix-index a { padding: 7px 10px; color: var(--blue-dark); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; font-size: 10px; font-weight: 800; text-decoration: none; }
.appendix-entry, .appendix-layer { scroll-margin-top: 138px; }
.appendix-entry { margin-top: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #9aa8c3; border-radius: 12px; transition: border-color .25s ease, box-shadow .25s ease, background .25s ease; }
.appendix-entry:target { background: #fff8df; border-color: #c49c29; box-shadow: 0 0 0 4px rgba(241,203,98,.25), var(--shadow); }
.appendix-entry-heading, .appendix-layer > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.appendix-entry-heading > div, .appendix-layer > header > div { min-width: 0; flex: 1 1 auto; }
.appendix-entry-heading > div > span, .appendix-layer > header > div > span { display: block; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.appendix-entry-heading h3, .appendix-layer > header h3 { margin: 5px 0 0; font: 500 26px/1.3 var(--serif); }
.appendix-entry-heading > a, .appendix-layer > header > a { flex: 0 0 auto; color: var(--blue); font-size: 10px; font-weight: 800; text-decoration: none; }
.appendix-layer { margin-top: 34px; padding: 22px; background: #e9e5dd; border-top: 6px solid var(--blue); border-radius: 15px; }
.appendix-layer:target { box-shadow: 0 0 0 5px rgba(49,85,217,.16); }
.appendix-layer > header { padding: 4px 4px 16px; }
.appendix-layer > header h3 { font-size: 32px; }
.appendix-layer .appendix-entry { margin-top: 12px; }
.appendix-explanation { margin: 12px 0 18px; color: var(--muted); font-size: 12px; }
.appendix-shape-equation { margin: 16px 0 18px; padding: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: #dfe6f4; background: var(--night); border-radius: 9px; }
.appendix-shape-equation code { padding: 7px 9px; background: var(--night-2); border: 1px solid #3b4c6b; border-radius: 5px; font-size: 9px; }
.appendix-shape-equation i { color: var(--yellow); font: normal 800 9px/1.4 var(--mono); }
.appendix-equation-stack { margin: 0 0 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.appendix-equation-stack code { padding: 11px; overflow-x: auto; color: #e5ebf6; background: var(--night-2); border-left: 3px solid var(--mint); font-size: 9px; white-space: nowrap; }
.appendix-token-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.appendix-token-row span { min-width: 0; padding: 14px; display: grid; grid-template-columns: 1fr; gap: 6px; background: #efebe4; border-top: 3px solid var(--blue); }
.appendix-token-row b { color: var(--muted); font-size: 9px; }
.appendix-token-row code { overflow-x: auto; color: var(--blue-dark); font-size: 10px; white-space: nowrap; }
.appendix-token-row i { color: var(--coral); font: normal 800 9px/1 var(--mono); }
.appendix-vocab-ledger { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.appendix-vocab-ledger > div:first-child { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.appendix-vocab-ledger > div:first-child b { color: var(--blue-dark); font-size: 12px; }
.appendix-vocab-ledger > div:first-child span { color: var(--muted); font-size: 10px; text-align: right; }
.ffn-dimension-proof { margin: 18px 0; display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr) 24px minmax(0,1fr); gap: 8px; align-items: stretch; }
.ffn-dimension-proof article { min-width: 0; padding: 17px; background: #efebe4; border-top: 4px solid var(--blue); }
.ffn-dimension-proof article:nth-of-type(2) { border-top-color: #c99f2f; }
.ffn-dimension-proof article:nth-of-type(3) { border-top-color: var(--mint-dark); }
.ffn-dimension-proof > i { align-self: center; color: var(--coral); font: normal 800 14px/1 var(--mono); text-align: center; }
.ffn-dimension-proof article > span { display: block; color: var(--blue); font-size: 9px; font-weight: 800; }
.ffn-dimension-proof b { margin: 6px 0 9px; display: block; }
.ffn-dimension-proof code { display: block; padding: 8px; overflow-x: auto; color: #e5ebf6; background: var(--night-2); font-size: 9px; white-space: nowrap; }
.ffn-dimension-proof p { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.ffn-insight { margin: 18px 0; padding: 18px; color: #285c49; background: rgba(159,215,192,.25); border-left: 4px solid var(--mint-dark); font-size: 12px; }
.ffn-one-feature { margin: 20px 0; padding: 20px; background: #eeeae3; border-left: 4px solid var(--blue); }
.ffn-one-feature-heading > span, .ffn-writeback > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.ffn-one-feature-heading h4 { margin: 6px 0 16px; font: 500 19px/1.45 var(--serif); }
.ffn-one-feature-heading h4 code { color: var(--blue-dark); }
.ffn-dot-ledger { margin: 15px 0 0; padding: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #dfe6f4; background: var(--night); }
.ffn-dot-ledger code { min-width: 0; flex: 1 1 650px; overflow-x: auto; color: #dfe6f4; font-size: 9px; white-space: nowrap; }
.ffn-dot-ledger i { color: var(--coral); font: normal 800 9px/1.3 var(--mono); }
.ffn-dot-ledger strong { padding: 7px 9px; color: var(--yellow); background: var(--night-2); font: 800 11px/1 var(--mono); }
.ffn-one-feature > p, .ffn-writeback > p { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.ffn-writeback { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.ffn-writeback > code { margin: 7px 0 12px; padding: 10px; display: block; overflow-x: auto; color: #e5ebf6; background: var(--night-2); font-size: 9px; white-space: nowrap; }
.ffn-attention-contrast { margin: 18px 0; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 14px; color: white; background: var(--blue); }
.ffn-attention-contrast b { color: var(--yellow); }
.ffn-attention-contrast span { font-size: 11px; }
.layernorm-ledger { margin-top: 18px; padding: 18px; color: #dfe6f4; background: var(--night); border-left: 4px solid var(--yellow); }
.layernorm-ledger > b { display: block; margin-bottom: 10px; color: var(--mint); }
.layernorm-ledger code { display: block; margin-top: 7px; padding: 8px 10px; overflow-x: auto; color: var(--yellow); background: var(--night-2); font-size: 9px; white-space: nowrap; }
.layernorm-ledger p { margin: 10px 0 0; color: #b8c2d5; font-size: 10px; }
.decoder-appendix details { margin-top: 18px; border-top: 1px solid var(--line); }

.lesson { padding: 110px 0; }
.lesson-heading { max-width: 900px; margin-bottom: 45px; }
.lesson-heading > span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.lesson-heading h2 { margin: 10px 0 16px; font: 500 clamp(38px, 5vw, 62px)/1.12 var(--serif); letter-spacing: -.025em; }
#forward .lesson-heading h2 { font-size: clamp(38px, 4.5vw, 56px); }
.lesson-heading p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.lesson-heading.light h2 { color: white; }
.lesson-heading.light p { color: #bcc6d8; }
.dark-lesson { color: white; background: var(--night); }
.training-lesson { background: #ebe7df; }
.architecture-lesson { background: var(--surface); }
.language-lesson { color: white; background: var(--night); }
#experiment, #problem, #qkv-design, #forward, #answer-step, #training, #architecture, #language { scroll-margin-top: 76px; }

.matrix-equation { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr) auto minmax(120px, 1fr); gap: 9px; align-items: center; }
.matrix-equation.wide { max-width: 900px; margin: 20px auto; }
.matrix-equation code { padding: 13px 10px; color: #e7ecf6; background: var(--night-2); border: 1px solid #3b4c6b; border-radius: 8px; text-align: center; font-size: 11px; white-space: nowrap; }
.matrix-equation i { color: var(--coral); font: normal 800 14px/1 var(--mono); text-align: center; white-space: nowrap; }
.equation-stack { display: grid; gap: 8px; }
.equation-stack.compact { margin-top: 18px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.equation-stack.compact .matrix-equation { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }

.matrix-grid { display: grid; gap: 14px; align-items: start; }
.matrix-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.matrix-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.matrix-panel { min-width: 0; }
.matrix-panel h4 { margin: 0 0 8px; color: var(--ink); font-size: 12px; }
.dark-lesson .matrix-panel h4, .language-lesson .matrix-panel h4 { color: white; }
.matrix-panel p { min-height: 38px; margin: -2px 0 8px; color: var(--muted); font-size: 10px; }
.matrix-scroll { max-width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.matrix { width: max-content; min-width: 100%; border-collapse: collapse; }
.matrix th, .matrix td { min-width: 57px; padding: 9px 7px; border-right: 1px solid #e5e0d7; border-bottom: 1px solid #e5e0d7; text-align: center; white-space: nowrap; font: 10px/1.2 var(--mono); }
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix thead th { color: #687188; background: #eeeae3; }
.matrix tbody th { color: var(--blue-dark); background: #f4f1eb; }
.matrix td { color: #556078; background: #fff; }
.matrix tr.focus th { color: #815200; background: rgba(241,203,98,.35); }
.matrix tr.focus td { box-shadow: inset 0 2px rgba(220,174,51,.65), inset 0 -2px rgba(220,174,51,.65); }
.matrix td.heat { color: var(--blue-dark); background: rgba(49,85,217,calc(.05 + var(--heat) * .45)); font-weight: 800; }

.proof-block { margin-top: 55px; padding: 30px; background: var(--surface); border-left: 5px solid var(--mint-dark); box-shadow: var(--shadow); }
.proof-block > span { color: var(--mint-dark); font-size: 11px; font-weight: 800; }
.proof-block h3 { margin: 8px 0; font: 500 28px/1.35 var(--serif); }
.proof-block > p { color: var(--muted); }
.proof-block > p.contrast-answer-note { padding: 13px 15px; color: #2c604e; background: rgba(159,215,192,.22); border-left: 3px solid var(--mint-dark); font-size: 12px; }
.hero-thesis { margin: 22px 0 18px; padding: 18px 20px; color: var(--ink); background: rgba(159,215,192,.28); border-left: 5px solid var(--mint-dark); font-size: 14px; line-height: 1.75; }
.early-proof { margin-top: 28px; }
.early-proof-next { margin: 16px 0 0 !important; padding: 14px 16px; color: #765d1c !important; background: rgba(241,203,98,.22); border-left: 3px solid #cda52f; }
.data-details { margin-top: 28px; border-top: 1px solid var(--line); }
.data-details > p { color: var(--muted); font-size: 12px; }
.token-table-wrap { max-width: 100%; overflow-x: auto; }
.token-table { min-width: 1040px; width: 100%; border-collapse: collapse; }
.token-table th, .token-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; }
.token-table code { white-space: nowrap; }
.token-table .used { background: rgba(159,215,192,.18); }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.role-grid article { padding: 28px; background: var(--night-2); border-top: 4px solid var(--blue); }
.role-grid article:nth-child(2) { border-color: var(--coral); }
.role-grid article:nth-child(3) { border-color: var(--mint); }
.role-grid b { color: var(--yellow); font-size: 11px; }
.role-grid h3 { margin: 10px 0; font: 500 26px/1.3 var(--serif); }
.role-grid p { margin: 0; color: #bdc7d9; font-size: 13px; }
.wiring-proof { margin-bottom: 24px; padding: 24px; background: var(--night-2); border-left: 5px solid var(--yellow); }
.wiring-equation { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; }
.wiring-equation code { padding: 11px; color: white; background: #14203a; border: 1px solid #3b4c6b; text-align: center; }
.wiring-equation i { color: var(--coral); font: normal 800 12px/1 var(--mono); }
.wiring-labels { margin: 8px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiring-labels span { padding: 11px 13px; color: #c6d0e0; border-top: 1px solid #455574; font-size: 11px; }
.wiring-labels.single { grid-template-columns: 1fr; margin-bottom: 0; }
.derived-roles article { border-top-width: 5px; }
.design-conclusion { margin-top: 20px; padding: 18px 20px; color: var(--ink); background: var(--mint); font-size: 13px; }

.head-switch { margin: -20px 0 25px; display: flex; gap: 7px; justify-content: flex-end; }
.head-switch button[aria-pressed="true"] { color: white; background: var(--blue); border-color: var(--blue); }
.route-explorer-shell { margin: 0 0 34px; padding: 24px; color: white; background: var(--night); border-top: 5px solid var(--yellow); }
.route-explorer-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.route-explorer-heading span { color: var(--mint); font-size: 11px; font-weight: 800; }
.route-explorer-heading h3 { margin: 6px 0 0; color: white; font: 500 25px/1.35 var(--serif); }
.route-explorer-heading small { color: #aeb9cc; font-size: 10px; white-space: nowrap; }
.route-source-buttons { margin: 20px 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.route-source-buttons button { min-width: 0; padding: 11px; color: #d8e0ee; background: var(--night-2); border-color: #40516f; display: grid; grid-template-columns: auto auto; gap: 4px 10px; align-items: baseline; text-align: left; }
.route-source-buttons button span { color: #96a4bb; font-size: 9px; }
.route-source-buttons button b { justify-self: end; color: white; font: 800 16px/1 var(--mono); }
.route-source-buttons button small { grid-column: 1 / -1; color: var(--mint); font: 9px/1.2 var(--mono); }
.route-source-buttons button[aria-pressed="true"] { color: var(--night); background: var(--yellow); border-color: var(--yellow); }
.route-source-buttons button[aria-pressed="true"] span, .route-source-buttons button[aria-pressed="true"] b, .route-source-buttons button[aria-pressed="true"] small { color: var(--night); }
.route-live-chain { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; padding-bottom: 8px; }
.route-live-chain article { min-width: 205px; padding: 14px; background: var(--night-2); border-top: 3px solid #526687; }
.route-live-chain article.route-score-card { min-width: 315px; border-top-color: var(--coral); }
.route-live-chain article.route-weight-card { min-width: 190px; border-top-color: var(--yellow); }
.route-live-chain article.route-contribution-card { min-width: 300px; border-top-color: var(--mint); }
.route-live-chain > i { align-self: center; color: var(--yellow); font: normal 800 12px/1 var(--mono); }
.route-live-chain span { display: block; min-height: 29px; color: #98a7be; font-size: 9px; }
.route-live-chain b { display: block; margin: 4px 0 8px; color: white; font-size: 11px; }
.route-live-chain code { display: block; overflow-x: auto; color: #dce4f2; font-size: 8px; white-space: nowrap; }
.route-weight-card strong { display: block; color: var(--yellow); font: 800 24px/1 var(--mono); }
.route-sum-line { margin-top: 6px; padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; align-items: center; background: rgba(159,215,192,.12); border-left: 3px solid var(--mint); }
.route-sum-line span { color: var(--mint); font-size: 10px; font-weight: 800; }
.route-sum-line code { overflow-x: auto; color: white; font-size: 9px; white-space: nowrap; }
.mechanism-thesis { margin: -12px 0 34px; padding: 24px; color: white; background: var(--night); border-left: 5px solid var(--mint); }
.mechanism-thesis > b { color: var(--yellow); font-size: 12px; }
.mechanism-thesis > div { margin: 14px 0; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 8px 12px; align-items: center; }
.mechanism-thesis code { padding: 7px 9px; color: var(--mint); background: var(--night-2); font-size: 10px; }
.mechanism-thesis span { color: #c6cfdf; font-size: 11px; }
.mechanism-thesis p { margin: 0; color: #d5dceb; font-size: 12px; }
.mechanism-thesis p code { padding: 2px 5px; color: var(--yellow); }
.forward-step { padding: 38px 0; display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 28px; border-top: 1px solid var(--line); }
.forward-step > div { min-width: 0; }
.step-number { width: 46px; height: 46px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 10px; font: 700 12px/1 var(--mono); }
.forward-step h3, .credit-step h3 { margin: 4px 0 20px; font: 500 30px/1.3 var(--serif); }
.forward-step details { margin-top: 16px; border-top: 1px solid var(--line); }
.reading-line, .plain-conclusion { margin: 18px 0 0; padding: 15px 18px; color: #2c604e; background: rgba(159,215,192,.24); border-left: 3px solid var(--mint-dark); font-size: 12px; }
.row-focus-block { margin-top: 22px; padding: 22px; background: #eeeae3; border-left: 4px solid var(--blue); }
.row-focus-block.content-focus { border-left-color: var(--mint-dark); }
.row-focus-block h4 { margin: 0 0 12px; font: 500 22px/1.35 var(--serif); }
.row-focus-block .matrix-equation { margin: 0 auto 18px; }
.row-focus-block > p { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.row-focus-block > p.dot-intro { margin: 0 0 14px; }
.dot-product-expansion { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.dot-product-expansion article { min-width: 0; padding: 16px; background: var(--surface); border-top: 4px solid var(--blue); }
.dot-product-expansion article header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dot-product-expansion article header b { color: var(--blue-dark); font: 800 12px/1 var(--mono); }
.dot-product-expansion article header small { color: var(--muted); font-size: 9px; }
.dot-vectors { margin-top: 10px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.dot-vectors code { min-width: 0; padding: 7px 8px; overflow-x: auto; color: #dde5f3; background: var(--night-2); font-size: 9px; white-space: nowrap; }
.dot-vectors i, .dot-terms i, .dot-accumulation > i { color: var(--coral); font: normal 800 10px/1 var(--mono); }
.dot-terms { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; color: #4f5b72; font: 9px/1.5 var(--mono); }
.dot-terms span { padding: 3px 5px; background: #f0ece4; }
.dot-accumulation { margin-top: 11px; padding-top: 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.dot-accumulation span { color: var(--muted); font-size: 10px; }
.dot-accumulation span b { color: var(--ink); font-family: var(--mono); }
.dot-accumulation strong { padding: 6px 8px; color: white; background: var(--blue); font: 800 12px/1 var(--mono); }
.dot-product-expansion article > p { margin: 8px 0 0; color: var(--muted); font-size: 9px; text-align: right; }
.attention-state-note { margin: 10px 0 0; padding: 15px 18px; color: #785e1f; background: rgba(241,203,98,.25); border-left: 3px solid #cda52f; font-size: 12px; }
.contribution-intro { margin-bottom: 14px !important; }
.value-contribution-ledger { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.value-contribution-ledger article { min-width: 0; padding: 15px; background: var(--surface); border-top: 3px solid var(--mint-dark); }
.value-contribution-ledger header { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.value-contribution-ledger header b { color: var(--blue-dark); font-size: 11px; }
.value-contribution-ledger header small { color: var(--muted); font: 10px/1.4 var(--mono); }
.contribution-equation { margin-top: 10px; display: grid; grid-template-columns: auto 18px minmax(250px,1fr) 18px minmax(250px,1fr); gap: 5px; align-items: center; overflow-x: auto; padding-bottom: 4px; }
.contribution-equation code { padding: 8px; color: #dfe6f4; background: var(--night-2); font-size: 9px; white-space: nowrap; }
.contribution-equation i { color: var(--coral); font: normal 800 10px/1 var(--mono); text-align: center; }
.contribution-sum { grid-column: 1 / -1; padding: 16px; color: white; background: var(--night); border-left: 4px solid var(--yellow); }
.contribution-sum span { display: block; margin-bottom: 8px; color: var(--mint); font-size: 11px; font-weight: 800; }
.contribution-sum code { display: block; overflow-x: auto; color: var(--yellow); font-size: 10px; white-space: nowrap; }
.closure-step { padding-bottom: 16px; }
.substitution-proof { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.substitution-proof > div { min-width: 0; padding: 16px; background: #eeeae3; border-top: 3px solid var(--blue); }
.substitution-proof span { display: block; margin-bottom: 9px; color: var(--blue); font-size: 11px; font-weight: 800; }
.substitution-proof code { display: block; margin-top: 6px; overflow-x: auto; color: var(--ink); font-size: 10px; white-space: nowrap; }
.attention-one-line { margin-top: 14px; padding: 20px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; color: white; background: var(--night); border-left: 5px solid var(--yellow); }
.attention-one-line > span { width: 100%; color: var(--mint); font-size: 11px; font-weight: 800; }
.attention-one-line code { padding: 10px; color: #e7ecf6; background: var(--night-2); border: 1px solid #3b4c6b; font-size: 10px; }
.attention-one-line code:first-of-type { flex: 1 1 610px; }
.attention-one-line code:last-of-type { flex: 1 1 300px; }
.attention-one-line i { color: var(--yellow); font: normal 800 12px/1 var(--mono); }
.effective-matrices { margin-top: 15px !important; }
.aha-split { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aha-split article { padding: 20px; background: rgba(159,215,192,.22); border-top: 4px solid var(--mint-dark); }
.aha-split b { color: var(--blue-dark); }
.aha-split p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.answer-chain, .decoder-flow, .scale-chain { padding: 22px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; color: white; background: var(--night); border-radius: 12px; }
.answer-chain code, .decoder-flow code, .scale-chain code { padding: 10px 12px; color: #e7ecf6; background: var(--night-2); border: 1px solid #3b4c6b; border-radius: 7px; font-size: 10px; }
.answer-chain i, .decoder-flow i, .scale-chain i { color: var(--yellow); font: normal 800 10px/1.3 var(--mono); }
.answer-chain + .matrix-grid { margin-top: 20px; }
.correct-logit-equation { margin: 18px 0 22px; padding: 20px; background: rgba(241,203,98,.2); border-left: 4px solid #cda52f; }
.correct-logit-equation > span { display: block; margin-bottom: 8px; color: #765d1c; font-size: 11px; font-weight: 800; }
.correct-logit-equation .matrix-equation { margin: 0 0 16px; }
.answer-verdict { margin-top: 18px; padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; color: white; background: var(--blue); }
.answer-verdict strong { color: var(--yellow); font: 500 46px/1 var(--serif); }
.answer-verdict p { margin: 0; }
.autoregressive-loop { margin-top: 12px; padding: 20px; background: #eeeae3; border-left: 4px solid var(--blue); }
.autoregressive-loop > span { display: block; margin-bottom: 10px; color: var(--blue); font-size: 11px; font-weight: 800; }
.autoregressive-loop > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.autoregressive-loop code, .autoregressive-loop b { padding: 8px 10px; color: #dfe6f4; background: var(--night-2); font: 10px/1.2 var(--mono); }
.autoregressive-loop b { color: var(--yellow); }
.autoregressive-loop i { color: var(--coral); font: normal 800 10px/1.2 var(--mono); }
.autoregressive-loop p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.shift-proof { margin-bottom: 28px; padding: 20px; display: grid; grid-template-columns: 105px repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.shift-proof span { min-height: 47px; display: grid; place-items: center; background: var(--surface); font: 12px/1 var(--mono); }
.shift-proof span.label { color: var(--blue-dark); font-family: var(--sans); font-weight: 800; }
.credit-step { margin-top: 20px; padding: 30px; background: var(--surface); }
.credit-step > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.credit-step > p { color: var(--muted); }
.gradient-bridge { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.gradient-bridge > span { color: var(--coral); font-size: 11px; font-weight: 800; }
.gradient-bridge h3 { max-width: 920px; margin: 8px 0 18px; }
.gradient-bridge > p { margin: 18px 0 0; padding: 16px 18px; color: #2c604e; background: rgba(159,215,192,.25); border-left: 3px solid var(--mint-dark); font-size: 12px; }
.conceptual-equations > div { padding: 18px; background: #f1ede6; }
.conceptual-equations p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.training-change { margin-top: 22px; }
.training-change.empty { padding: 20px; color: #785e1f; background: rgba(241,203,98,.27); border-left: 4px solid #cda52f; }
.training-change.ready { padding: 28px; background: rgba(159,215,192,.24); border-left: 4px solid var(--mint-dark); }
.training-change h3 { margin: 5px 0 14px; font: 500 27px/1.3 var(--serif); }
.probability-change { margin-top: 13px; display: flex; gap: 9px; align-items: center; justify-content: center; }
.probability-change b { color: var(--blue-dark); font: 800 18px/1 var(--mono); }
.gradient-matrices-details, .training-full-comparison { margin-top: 14px; border-top: 1px solid var(--line); }
.scalar-change-chain { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; padding: 4px 0 10px; }
.scalar-change-chain article { min-width: 210px; padding: 15px; background: var(--surface); border-top: 4px solid var(--blue); }
.scalar-change-chain article:nth-of-type(2) { border-top-color: #cda52f; }
.scalar-change-chain article:nth-of-type(3) { min-width: 315px; border-top-color: var(--coral); }
.scalar-change-chain article:nth-of-type(4) { min-width: 340px; border-top-color: var(--mint-dark); }
.scalar-change-chain article.scalar-probability { border-top-color: var(--blue); }
.scalar-change-chain > i { align-self: center; color: var(--coral); font: normal 800 9px/1.35 var(--mono); text-align: center; }
.scalar-change-chain span { display: block; min-height: 28px; color: var(--muted); font-size: 9px; }
.scalar-change-chain b { display: block; margin: 4px 0 8px; color: var(--blue-dark); font-size: 11px; }
.scalar-change-chain code { display: block; margin-top: 4px; overflow-x: auto; color: #dfe6f4; background: var(--night-2); padding: 7px; font-size: 8px; white-space: nowrap; }
.training-causality-note { margin: 12px 0 0; padding: 14px 16px; color: #2c604e; background: rgba(255,255,255,.58); border-left: 3px solid var(--mint-dark); font-size: 11px; }
.zero-swap-proof { margin-top: 24px; padding: 30px; background: var(--surface); border-top: 5px solid var(--blue); }
.zero-swap-proof > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.zero-swap-proof h3 { margin: 7px 0 10px; font: 500 28px/1.35 var(--serif); }
.zero-swap-proof > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.zero-swap-verdict { margin-top: 14px; padding: 18px; color: #2c604e; background: rgba(159,215,192,.25); border-left: 4px solid var(--mint-dark); }
.zero-swap-verdict b { display: block; margin-bottom: 6px; }
.zero-swap-verdict p { margin: 0; font-size: 12px; }
.training-thesis { margin-top: 24px; padding: 32px; color: white; background: var(--night); }
.training-thesis span { color: var(--mint); font-size: 11px; font-weight: 800; }
.training-thesis h3 { margin: 8px 0; color: var(--yellow); font: 500 30px/1.3 var(--serif); }
.training-thesis p { color: #c1cadb; }

.decoder-flow { justify-content: center; }
.decoder-flow strong { padding: 11px 14px; color: var(--night); background: var(--mint); border-radius: 7px; font-size: 11px; }
.architecture-notes { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.architecture-notes p { margin: 0; padding: 18px; color: var(--muted); background: var(--paper); font-size: 12px; }

.scale-chain { margin-bottom: 24px; }
.ability-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ability-grid article { padding: 26px; background: var(--night-2); border-top: 4px solid var(--blue); }
.ability-grid article:nth-child(2) { border-color: var(--coral); }
.ability-grid article:nth-child(3) { border-color: var(--mint); }
.ability-grid span { color: var(--yellow); font-size: 11px; font-weight: 800; }
.ability-grid h3 { margin: 8px 0; font: 500 24px/1.3 var(--serif); }
.ability-grid p { margin: 0; color: #bdc7d9; font-size: 12px; }
.emergence-box { margin-top: 20px; padding: 28px; color: var(--ink); background: var(--mint); }
.emergence-box h3 { margin: 0 0 8px; font: 500 28px/1.3 var(--serif); }
.emergence-box p { margin: 8px 0; }
.interpretation-boundary { margin-top: 20px; padding: 25px 28px; color: #dfe6f4; background: var(--night-2); border-left: 4px solid var(--coral); }
.interpretation-boundary h3 { margin: 0 0 8px; color: var(--yellow); font: 500 23px/1.35 var(--serif); }
.interpretation-boundary p { margin: 0; color: #c3cddd; font-size: 12px; }
.final-definition { margin-top: 22px; padding: 34px; border: 1px solid #40516f; }
.final-definition span { color: var(--yellow); font-size: 11px; font-weight: 800; }
.final-definition h3 { margin: 10px 0 0; font: 500 32px/1.45 var(--serif); }
.research-notes { margin-top: 20px; border-top: 1px solid #40516f; }
.research-notes ul { margin: 14px 0 0; padding-left: 20px; color: #bdc7d9; }
.research-notes li { margin: 8px 0; font-size: 11px; }
.research-notes a { color: var(--mint); }

.code-lesson { background: #e9e5dd; }
.code-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.code-tabs button.active { color: white; background: var(--blue); border-color: var(--blue); }
.code-lesson pre { height: 520px; margin: 14px 0 0; padding: 24px; overflow: auto; color: #dfe6f4; background: var(--night); border-radius: 12px; font: 11px/1.75 var(--mono); }

.term { border-bottom: 1px dotted currentColor; cursor: help; }
.tooltip { position: fixed; z-index: 100; width: min(390px, calc(100vw - 28px)); padding: 15px 17px; display: none; color: #dfe6f4; background: #081225; border: 1px solid #425578; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.25); font-size: 12px; line-height: 1.75; pointer-events: none; }
.tooltip.show { display: block; }
.tooltip b { display: block; margin-bottom: 5px; color: var(--yellow); }

footer { padding: 26px max(28px, calc((100vw - 1180px)/2)); display: flex; justify-content: space-between; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 980px) {
  .topbar nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 50px; }
  .hero-decoder { max-width: 620px; }
  .experiment-grid { grid-template-columns: 1fr; }
  .matrix-grid.three, .role-grid, .ability-grid { grid-template-columns: 1fr; }
  .wiring-labels { grid-template-columns: 1fr; }
  .matrix-grid.two { grid-template-columns: 1fr; }
  .dot-product-expansion, .value-contribution-ledger, .substitution-proof, .aha-split { grid-template-columns: 1fr; }
  .equation-stack.compact { grid-template-columns: 1fr; }
  .matrix-panel p { min-height: 0; }
  .aha-fixed-object { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .aha-stepper { grid-template-columns: repeat(11,auto); overflow-x: auto; padding-bottom: 8px; }
  .aha-stepper button { min-width: 140px; }
  .appendix-equation-stack { grid-template-columns: 1fr; }
  .invention-pair-score { grid-template-columns: 1fr; }
  .invention-pair-score i { transform: rotate(90deg); }
  .attention-moment-grid { grid-template-columns: 1fr; }
  .two-moment-insight > div { grid-template-columns: 1fr; }
  .learning-chain, .shared-gradient-grid, .supervision-lane { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .route-gradient-moments { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { height: 58px; padding: 0 14px; }
  .brand b { display: none; }
  .runtime-badge { margin-left: auto; }
  .hero { min-height: 0; padding: 90px 0 70px; }
  .hero h1 { font-size: 58px; }
  .lead { font-size: 16px; }
  .scale-comparison { grid-template-columns: 1fr; }
  .hero-decoder { padding: 18px 12px; }
  .decoder-sublayer-row { grid-template-columns: minmax(54px,.82fr) 6px minmax(96px,1.35fr) 6px minmax(64px,1fr); gap: 2px; }
  .decoder-layer-map header span { max-width: 150px; text-align: right; }
  .map-node b, .attention-node b { font-size: 7px; }
  .map-node small { font-size: 6px; }
  .decoder-terminal { align-items: flex-start; flex-direction: column; }
  .decoder-softmax-probs { width: 100%; }
  .decoder-map-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .mechanism-thesis > div { grid-template-columns: auto 1fr; }
  .experiment-band { padding: 60px 0; }
  .trainer-stats { grid-template-columns: 1fr 1fr; }
  .trainer-stats span:last-child { grid-column: 1 / -1; }
  .train-actions button { flex: 1 1 42%; }
  .prefix-history { grid-template-columns: 1fr 1fr; }
  .probability-bars { grid-template-columns: 1fr; }
  .invention-story { padding: 72px 0 82px; }
  .invention-heading h2 { font-size: 43px; }
  .invention-heading p { font-size: 15px; }
  .invention-step, .invention-core-step, .invention-finish-step { padding: 28px 0; grid-template-columns: 1fr; gap: 12px; }
  .invention-core-step, .invention-finish-step { margin-inline: -14px; padding-inline: 14px; }
  .invention-step h3 { font-size: 26px; }
  .invention-a-shape, .invention-full-formula { align-items: stretch; flex-direction: column; }
  .invention-a-shape code, .invention-full-formula code { width: 100%; min-width: 0; max-width: 100%; }
  .invention-a-shape i, .invention-full-formula i { text-align: center; transform: rotate(90deg); }
  .invention-names, .invention-two-jobs, .invention-training-loop { grid-template-columns: 1fr; }
  .invention-answer-chain { align-items: stretch; flex-direction: column; overflow-x: visible; }
  .invention-answer-chain i { text-align: center; transform: rotate(90deg); }
  .two-moments > header h3 { font-size: 29px; }
  .two-moment-premise { grid-template-columns: 1fr; }
  .two-moment-premise > i { transform: rotate(90deg); }
  .two-moment-live-state, .two-moment-boundary { grid-template-columns: 1fr; }
  .two-moment-live-state p { text-align: left; }
  .attention-moment-card { padding: 17px 12px; }
  .learning-direction > header h3 { font-size: 29px; }
  .learning-chain, .shared-gradient-grid, .learning-equation-proof, .route-gradient-state, .communication-proof { grid-template-columns: 1fr; }
  .supervision-lane { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .route-gradient-state p { text-align: left; }
  .route-gradient-moment { padding: 16px 10px; }
  .qk-gradient-return > div { align-items: stretch; flex-direction: column; overflow-x: visible; }
  .qk-gradient-return i { text-align: center; transform: rotate(90deg); }
  .lesson { padding: 78px 0; }
  .aha-story { padding: 72px 0 82px; }
  .aha-heading h2 { font-size: 43px; }
  .aha-fixed-object, .aha-vector-compare, .aha-gradient-cards, .aha-change-strip { grid-template-columns: 1fr; }
  .aha-training-bar { align-items: stretch; flex-direction: column; }
  .aha-stepper { grid-template-columns: 1fr; overflow-x: visible; }
  .aha-stepper button { min-width: 0; }
  .aha-stepper > i { height: 14px; transform: rotate(90deg); }
  .aha-detail { min-height: 0; padding: 22px 15px; }
  .aha-detail-heading h3 { font-size: 27px; }
  .aha-route-chain { align-items: stretch; flex-direction: column; overflow-x: visible; }
  .aha-route-chain article, .aha-route-chain article:nth-of-type(3), .aha-route-chain article.aha-weight, .aha-route-chain article:last-of-type { min-width: 0; }
  .aha-route-chain > i { transform: rotate(90deg); }
  .aha-probability-line b { margin-left: 0; }
  .aha-moving-zero { align-items: stretch; flex-direction: column; gap: 14px; }
  .aha-moving-zero > div { min-width: 0; }
  .aha-moving-zero em { transform: rotate(90deg); }
  .aha-output-flow article { grid-template-columns: 1fr; gap: 7px; }
  .appendix-intro { padding-top: 58px; }
  .decoder-appendix { padding-top: 36px; }
  .appendix-index { top: 66px; overflow-x: auto; flex-wrap: nowrap; }
  .appendix-index a { flex: 0 0 auto; }
  .appendix-entry, .appendix-layer { scroll-margin-top: 116px; }
  .appendix-entry, .appendix-layer { padding: 17px 13px; }
  .appendix-entry-heading, .appendix-layer > header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .appendix-entry-heading h3, .appendix-layer > header h3 { font-size: 24px; }
  .appendix-token-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .appendix-vocab-ledger > div:first-child { align-items: flex-start; flex-direction: column; gap: 4px; }
  .appendix-vocab-ledger > div:first-child span { text-align: left; }
  .ffn-dimension-proof { grid-template-columns: 1fr; }
  .ffn-dimension-proof > i { transform: rotate(90deg); }
  .ffn-one-feature { padding: 17px 12px; }
  .ffn-attention-contrast { grid-template-columns: 1fr; gap: 6px; }
  .appendix-shape-equation { align-items: stretch; flex-direction: column; }
  .appendix-shape-equation i { text-align: center; }
  .lesson-heading h2 { font-size: 39px; }
  .lesson-heading p { font-size: 15px; }
  .matrix-equation { grid-template-columns: minmax(125px, 1fr) 22px minmax(125px, 1fr) 22px minmax(125px, 1fr); overflow-x: auto; padding-bottom: 5px; }
  .matrix-equation { width: 100%; min-width: 0; max-width: 100%; }
  .wiring-equation { grid-template-columns: minmax(125px,1fr) 22px minmax(125px,1fr) 22px minmax(125px,1fr); overflow-x: auto; }
  .forward-step { grid-template-columns: 1fr; gap: 12px; }
  .head-switch { justify-content: flex-start; }
  .route-explorer-shell { padding: 18px 14px; }
  .route-explorer-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .route-source-buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .route-live-chain, .scalar-change-chain { align-items: stretch; flex-direction: column; overflow-x: visible; }
  .route-live-chain article, .route-live-chain article.route-score-card, .route-live-chain article.route-weight-card, .route-live-chain article.route-contribution-card, .scalar-change-chain article, .scalar-change-chain article:nth-of-type(3), .scalar-change-chain article:nth-of-type(4) { min-width: 0; }
  .route-live-chain > i, .scalar-change-chain > i { transform: rotate(90deg); }
  .route-sum-line { grid-template-columns: 1fr; }
  .proof-block, .credit-step { padding: 20px 15px; }
  .row-focus-block, .value-contribution-ledger, .value-contribution-ledger > *, .conceptual-equations > div { width: 100%; min-width: 0; max-width: 100%; }
  .contribution-equation { width: 100%; min-width: 0; max-width: 100%; grid-template-columns: auto 18px minmax(180px,1fr) 18px minmax(180px,1fr); }
  .shift-proof { grid-template-columns: 75px repeat(6, minmax(45px,1fr)); overflow-x: auto; }
  .answer-chain, .decoder-flow, .scale-chain { align-items: stretch; flex-direction: column; }
  .answer-chain i, .decoder-flow i, .scale-chain i { text-align: center; transform: rotate(90deg); }
  .answer-verdict { grid-template-columns: 1fr; }
  .architecture-notes { grid-template-columns: 1fr; }
  .final-definition { padding: 22px 18px; }
  .final-definition h3 { font-size: 25px; }
  .code-lesson pre { height: 430px; padding: 16px; }
  footer { gap: 8px; flex-direction: column; }
}

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