/* World Models — shared design system. White paper, one colour per component. */

:root {
  --paper: #fdfcf9;
  --paper-2: #f6f4ee;
  --paper-3: #eeebe2;
  --ink: #1c1d21;
  --ink-2: #4a4c55;
  --ink-3: #8a8c94;
  --rule: #e4e0d5;

  /* Component colours: fixed across every chapter, figure and equation */
  --c-real: #1c1d21;     /* the real environment */
  --c-dream: #7046e0;    /* anything imagined */
  --c-enc: #0f9488;      /* encoder */
  --c-h: #2563eb;        /* deterministic state h */
  --c-z: #9b5de5;        /* stochastic state z */
  --c-dec: #d97706;      /* decoder */
  --c-rew: #15a34a;      /* reward */
  --c-actor: #e8590c;    /* actor */
  --c-critic: #db2b5c;   /* critic */

  --good: #15a34a;
  --bad: #d63a3a;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --col: 690px;
  --wide: 1040px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--c-dream) 22%, transparent); }

a { color: var(--c-h); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- layout ---------- */
.article { padding: 0 16px 120px; }
.article > *, .section > * { max-width: var(--col); margin-left: auto; margin-right: auto; }
.article .l-wide, .section .l-wide { max-width: var(--wide); }
.article .l-full, .section .l-full { max-width: none; }

h1, h2, h3, h4 { font-family: var(--sans); letter-spacing: -0.02em; color: var(--ink); }
h2 {
  font-size: 30px; line-height: 1.2; font-weight: 700;
  margin-top: 96px; margin-bottom: 8px;
}
h2 .act {
  display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c-dream); margin-bottom: 10px;
}
h3 { font-size: 21px; margin-top: 48px; margin-bottom: 4px; font-weight: 650; }
p { margin: 0 0 1.05em; }
strong { font-weight: 650; }
em.key { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--c-dream) 18%, transparent) 62%); }
.lede { font-size: 22px; line-height: 1.55; color: var(--ink-2); }
hr.sep { border: 0; height: 1px; background: var(--rule); margin: 72px auto; }

/* coloured inline terms */
.t-real { color: var(--c-real); font-weight: 600; }
.t-dream { color: var(--c-dream); font-weight: 600; }
.t-enc { color: var(--c-enc); font-weight: 600; }
.t-h { color: var(--c-h); font-weight: 600; }
.t-z { color: var(--c-z); font-weight: 600; }
.t-dec { color: var(--c-dec); font-weight: 600; }
.t-rew { color: var(--c-rew); font-weight: 600; }
.t-actor { color: var(--c-actor); font-weight: 600; }
.t-critic { color: var(--c-critic); font-weight: 600; }

/* ---------- hero ---------- */
.hero { max-width: var(--wide) !important; padding: 72px 0 24px; }
.hero .kicker {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px); line-height: 1.02; font-weight: 800;
  letter-spacing: -0.035em; margin: 14px 0 18px; max-width: 14ch;
}
.hero h1 .dream {
  background: linear-gradient(100deg, var(--c-h), var(--c-dream) 55%, var(--c-critic));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: 23px; color: var(--ink-2); max-width: 36ch; line-height: 1.45; }
.meta {
  display: flex; flex-wrap: wrap; gap: 28px; margin-top: 30px; padding-top: 18px;
  border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 13px; color: var(--ink-3);
}
.meta b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }

/* ---------- side contents ---------- */
.toc { position: fixed; top: 92px; left: 28px; width: 232px; z-index: 5; display: none; font-family: var(--sans); }
.toc-card {
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px); border: 1px solid var(--rule);
  border-radius: 16px; padding: 18px 16px 14px; box-shadow: 0 18px 50px -36px rgba(60,40,140,.35);
}
.toc-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--c-dream); }
.toc-name { margin: 4px 0 14px; font-size: 15px; font-weight: 750; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.toc-list { list-style: none; margin: 0; padding: 0; position: relative; }
.toc-list::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--paper-3); }
.toc-list li { position: relative; }
.toc-list a {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: baseline; padding: 6px 6px 6px 0;
  color: var(--ink-3); text-decoration: none; font-size: 13px; line-height: 1.35; border-radius: 8px; transition: color .2s;
}
.toc-list a:hover { color: var(--ink); }
.toc-n {
  position: relative; z-index: 1; justify-self: center; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: var(--ink-3);
  background: var(--paper); border: 2px solid var(--paper-3); transition: all .25s; transform: translateY(5px);
}
.toc-list li.done .toc-n { border-color: color-mix(in srgb, var(--c-dream) 45%, var(--paper-3)); color: var(--c-dream); }
.toc-list li.done a { color: var(--ink-2); }
.toc-list li.active .toc-n { background: var(--c-dream); border-color: var(--c-dream); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-dream) 16%, transparent); }
.toc-list li.active a { color: var(--ink); font-weight: 650; }
.toc-jump {
  display: block; margin-top: 14px; padding: 10px 12px; border-radius: 10px; text-decoration: none; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--c-dream);
  background: color-mix(in srgb, var(--c-dream) 8%, #fff); border: 1px solid color-mix(in srgb, var(--c-dream) 25%, transparent);
  transition: background .2s;
}
.toc-jump:hover { background: color-mix(in srgb, var(--c-dream) 14%, #fff); }
@media (min-width: 1560px) { .toc { display: block; } }

/* ---------- figures ---------- */
figure { margin: 44px auto; }
.fig {
  background: #fff; border: 1px solid var(--rule); border-radius: 14px;
  padding: 22px; box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 12px 40px -24px rgba(40,30,80,.18);
}
.fig-cap {
  font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink-2);
  margin-top: 14px; max-width: var(--col);
}
.fig-cap b { color: var(--ink); }
.fig-cap .n { font-weight: 700; color: var(--ink); margin-right: 4px; }
canvas, svg { display: block; max-width: 100%; }
video.anim { width: 100%; border-radius: 10px; display: block; background: #fff; }

/* ---------- controls ---------- */
.ctrl {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  font-family: var(--sans); font-size: 14px; color: var(--ink-2); margin-top: 14px;
}
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 999px; padding: 8px 18px; transition: transform .12s, opacity .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.dream { background: var(--c-dream); border-color: var(--c-dream); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
input[type=range] { accent-color: var(--c-dream); width: 180px; }
.pill {
  display: inline-block; font-family: var(--sans); font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2);
}
.readout { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; background: var(--paper-2); }
.seg button {
  font-family: var(--sans); font-size: 13px; font-weight: 600; border: 0; background: transparent;
  color: var(--ink-2); padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- pause & think (Socratic) ---------- */
.think:not(.p-type) {
  position: relative; margin: 40px auto; padding: 22px 26px 18px 26px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c-dream) 6%, #fff), #fff 70%);
  border: 1px solid color-mix(in srgb, var(--c-dream) 22%, var(--rule)); border-radius: var(--radius);
}
.think:not(.p-type)::before {
  content: "Pause & think"; display: block; font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-dream); margin-bottom: 8px;
}
.think:not(.p-type) > p:last-of-type { margin-bottom: 8px; }
.think details summary { color: var(--c-dream); }

/* ---------- problems ---------- */
.problem {
  margin: 36px auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff;
  overflow: hidden;
}
.problem .p-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--paper-2);
  border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 13px;
}
.problem .p-num { font-weight: 800; color: var(--ink); }
.problem .p-type {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: var(--ink-2); padding: 2px 8px; border-radius: 4px;
}
.p-type.numerical { background: var(--c-h); }
.p-type.mcq { background: var(--c-enc); }
.p-type.design { background: var(--c-actor); }
.p-type.fermi { background: var(--c-dec); }
.p-type.think { background: var(--c-dream); }
.p-type.derive { background: var(--c-critic); }
.problem .p-diff { margin-left: auto; letter-spacing: 2px; color: var(--ink-3); }
.problem .p-diff i { font-style: normal; color: var(--c-dream); }
.problem .p-body { padding: 18px 20px 6px; }
.problem .p-body > :last-child { margin-bottom: 12px; }

details { margin: 6px 0 14px; }
details summary {
  cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-2);
  list-style: none; display: inline-flex; align-items: center; gap: 8px; user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s; margin-right: 2px;
}
details[open] summary::before { transform: rotate(45deg); }
details .sol {
  margin-top: 12px; padding: 14px 18px; background: var(--paper); border-left: 3px solid var(--c-dream);
  border-radius: 0 8px 8px 0; font-size: 17.5px;
}
details .sol > :last-child { margin-bottom: 0; }

/* MCQ */
.mcq { display: grid; gap: 8px; margin: 10px 0 14px; }
.mcq button {
  text-align: left; font-family: var(--serif); font-size: 17px; line-height: 1.45; cursor: pointer;
  background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px 10px 44px;
  position: relative; color: var(--ink); transition: border-color .15s, background .15s;
}
.mcq button::before {
  content: attr(data-k); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--rule); font-family: var(--sans); font-size: 12px;
  font-weight: 700; display: grid; place-items: center; color: var(--ink-2);
}
.mcq button:hover:not(:disabled) { border-color: var(--ink-3); }
.mcq button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 7%, #fff); }
.mcq button.right::before { background: var(--good); color: #fff; border-color: var(--good); }
.mcq button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, #fff); }
.mcq button.wrong::before { background: var(--bad); color: #fff; border-color: var(--bad); }
.mcq button:disabled { cursor: default; }
.mcq-why { display: none; }
.mcq-why.show { display: block; }
.mcq-why .sol {
  margin-top: 4px; padding: 14px 18px; background: var(--paper); border-left: 3px solid var(--c-dream);
  border-radius: 0 8px 8px 0; font-size: 17.5px;
}
.mcq-why .sol > :last-child { margin-bottom: 0; }

/* numeric answer */
.num-answer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; font-family: var(--sans); font-size: 14px; }
.num-answer input {
  font-family: var(--mono); font-size: 15px; width: 140px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--paper);
}
.num-answer .fb { font-weight: 600; }
.num-answer .fb.ok { color: var(--good); }
.num-answer .fb.no { color: var(--bad); }

/* predict-then-reveal */
.locked [data-reveal] { display: none !important; }
.lockbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--sans); font-size: 14px;
  padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--c-dream) 7%, #fff);
  border: 1px dashed color-mix(in srgb, var(--c-dream) 40%, transparent); margin-top: 14px;
}
.lockbar .q { font-weight: 600; color: var(--ink); }

/* side notes */
.sn {
  display: block;
  font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
  border-left: 2px solid var(--rule); padding-left: 12px; margin: 0 auto 1.1em;
}
@media (min-width: 1240px) {
  .has-sn { position: relative; }
  .sn {
    position: absolute; left: calc(50% + var(--col)/2 + 36px); width: 230px; margin: 0;
    transform: translateY(4px);
  }
}

/* equation block */
.eq { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.katex { font-size: 1.06em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* end-of-chapter challenge card */
.challenge-card {
  display: block; text-decoration: none; color: inherit; margin: 64px auto; padding: 30px 32px;
  border-radius: 16px; background: radial-gradient(120% 140% at 0% 0%, #f3edff 0%, #fff 55%), #fff;
  border: 1px solid color-mix(in srgb, var(--c-dream) 30%, var(--rule));
  box-shadow: 0 20px 60px -30px rgba(90,60,200,.35); transition: transform .2s, box-shadow .2s;
}
.challenge-card:hover { transform: translateY(-2px); box-shadow: 0 26px 70px -30px rgba(90,60,200,.45); }
.challenge-card .k { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--c-dream); }
.challenge-card h3 { margin: 8px 0 6px; font-size: 28px; }
.challenge-card p { color: var(--ink-2); margin: 0; }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; font-family: var(--sans); }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--ink-3); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--c, #000); vertical-align: middle; margin-right: 6px; }

/* ---------- series bar ---------- */
.series-bar {
  position: sticky; top: 0; z-index: 30; height: 54px; display: flex; align-items: center; gap: 10px;
  padding: 0 22px; font-family: var(--sans); font-size: 14px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--rule);
}
.sb-home { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; }
.sb-mark { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(from 200deg, var(--c-h), var(--c-dream), var(--c-critic), var(--c-h)); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--rule); }
.sb-sep { color: var(--paper-3); font-size: 20px; font-weight: 300; }
.sb-chapter {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: min(560px, 50vw);
  font-family: var(--sans); font-size: 14px; color: var(--ink); background: transparent; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: 6px 10px 6px 6px; transition: background .15s, border-color .15s;
}
.sb-chapter:hover, .series-bar.open .sb-chapter { background: #fff; border-color: var(--rule); box-shadow: 0 2px 10px -6px rgba(0,0,0,.2); }
.sb-num {
  flex: none; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c-h), var(--c-dream) 60%, var(--c-critic));
}
.sb-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-caret { flex: none; color: var(--ink-3); transition: transform .2s; }
.series-bar.open .sb-caret { transform: rotate(180deg); }
.sb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sb-dots { display: flex; gap: 4px; }
.sb-dots i { width: 14px; height: 4px; border-radius: 4px; background: var(--paper-3); }
.sb-dots i.past { background: color-mix(in srgb, var(--c-dream) 45%, var(--paper-3)); }
.sb-dots i.now { width: 22px; background: linear-gradient(90deg, var(--c-h), var(--c-dream)); }
.sb-count { font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sb-count span { color: var(--ink-3); font-weight: 600; }
.sb-step {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--rule); background: #fff; text-decoration: none; transition: all .15s;
}
.sb-step:hover { color: var(--c-dream); border-color: color-mix(in srgb, var(--c-dream) 40%, var(--rule)); transform: translateY(-1px); }
.sb-step[aria-disabled] { opacity: .35; pointer-events: none; }
.sb-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.sb-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--c-h), var(--c-dream), var(--c-critic)); transform-origin: left; transform: scaleX(0); }

/* chapter drawer */
.sb-drawer {
  position: absolute; top: calc(100% + 8px); left: 150px; width: min(470px, calc(100vw - 32px)); max-height: min(72vh, 680px);
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 16px;
  box-shadow: 0 30px 80px -30px rgba(40,25,110,.4), 0 2px 8px rgba(0,0,0,.04); overflow: hidden; animation: sd-in .16s ease-out;
}
.sb-drawer[hidden] { display: none; }
@keyframes sd-in { from { opacity: 0; transform: translateY(-6px); } }
.sd-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--rule); }
.sd-head b { display: block; font-size: 15px; font-weight: 800; }
.sd-head span { font-size: 12.5px; color: var(--ink-3); }
.sd-list { overflow-y: auto; padding: 6px 10px 10px; }
.sd-arc { margin: 12px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.sd-row { border-radius: 12px; padding: 4px; }
.sd-row.current { background: color-mix(in srgb, var(--c-dream) 6%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-dream) 22%, transparent); }
.sd-ch { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.sd-ch:hover { background: var(--paper-2); }
.sd-n { font-size: 15px; font-weight: 800; color: #b8b3a6; letter-spacing: -0.02em; text-align: center; }
.sd-row.current .sd-n, .sd-ch:hover .sd-n { color: var(--c-dream); }
.sd-t { font-size: 14px; font-weight: 650; line-height: 1.3; }
.sd-seen { font-size: 12px; color: var(--c-dream); font-weight: 800; }
.sd-cl { display: block; margin: 0 0 2px 52px; padding: 3px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink-3); text-decoration: none; }
.sd-cl:hover { color: var(--c-dream); background: var(--paper-2); }
.sd-ch.here .sd-t, .sd-cl.here { color: var(--c-dream); font-weight: 700; }
.sd-home { padding: 12px 20px; border-top: 1px solid var(--rule); font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.sd-home:hover { color: var(--c-dream); }
@media (max-width: 760px) {
  .series-bar { padding: 0 12px; gap: 6px; }
  .sb-home-t, .sb-sep, .sb-dots { display: none; }
  .sb-chapter { max-width: none; flex: 1; }
  .sb-count { display: none; }
  .sb-drawer { left: 8px; right: 8px; width: auto; }
}
@media (max-width: 1100px) { .sb-dots { display: none; } }

/* ---------- end-of-page pager ---------- */
.pager { display: flex; gap: 14px; max-width: var(--col); margin: 56px auto 0 !important; }
.pg-card {
  position: relative; flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden;
  padding: 16px 20px; border-radius: 14px; text-decoration: none; color: var(--ink); font-family: var(--sans);
  background: #fff; border: 1px solid var(--rule); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.pg-card:hover { border-color: color-mix(in srgb, var(--c-dream) 40%, var(--rule)); transform: translateY(-2px); box-shadow: 0 16px 40px -28px rgba(80,50,200,.45); }
.pg-card small { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.pg-card span { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.pg-r { text-align: right; }
.pg-next { flex: 1.6; padding: 20px 24px; background: radial-gradient(120% 160% at 100% 0%, #f1ebff 0%, #fff 55%); border-color: color-mix(in srgb, var(--c-dream) 30%, var(--rule)); }
.pg-next span { font-size: 19px; }
.pg-next em { font-style: normal; margin-top: 8px; font-size: 13.5px; font-weight: 750; color: var(--c-dream); }
.pg-big { position: absolute; right: 14px; bottom: -18px; font-size: 92px !important; font-weight: 800 !important; letter-spacing: -0.05em; color: color-mix(in srgb, var(--c-dream) 9%, transparent); pointer-events: none; }
@media (max-width: 640px) { .pager { flex-direction: column; } .pg-r { text-align: left; } }
.problem { scroll-margin-top: 70px; }
.article h2[id] { scroll-margin-top: 74px; }

footer.end { max-width: var(--col); margin: 80px auto 0; font-family: var(--sans); font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 18px; }

@media (max-width: 640px) {
  body { font-size: 17.5px; }
  h2 { font-size: 25px; margin-top: 72px; }
  .fig { padding: 14px; border-radius: 10px; }
  .hero { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
