/* Layout: a monthly atlas of plates. Text sits in a narrow measure, figures take the full width,
   and every figure carries a drawing-style title block (figure no., unit, vintage, source).
   One plate is dark (the globe). Everything else is ink on eye-ease ledger paper. */

:root {
  color-scheme: light;

  /* paper + ink (neutrals lean toward ledger green) */
  --paper: #ECEFE7;
  --paper-2: #F5F7F1;
  --paper-3: #DFE4D8;
  --ink: #121610;
  --ink-2: #3F4638;
  --ink-3: #5F6759;
  --rule: #BDC4B4;
  --rule-2: #D3D9CB;

  /* data roles: blue = demand (reactors), amber = supply (mines), green = market/price */
  --demand: #1F55E0;
  --demand-2: #86A4EE;
  --supply: #D48A00;
  --supply-2: #A86F00;
  --supply-3: #7D5200;
  --market: #0F8A6A;
  --neutral-mark: #8C9485;
  --crit: #C8372D;
  --good: #1B7F3B;
  --on-data: #FFFFFF;

  /* the dark plate keeps its own palette in both themes */
  --plate: #0B0E0A;
  --plate-2: #141912;
  --plate-ink: #E8ECE2;
  --plate-ink-2: #A9B1A1;
  --plate-ink-3: #7C8476;
  --plate-rule: #2A3026;
  --plate-land: #56614E;
  --glow-demand: #5F9DFF;
  --glow-supply: #FFC21A;

  --tip-bg: #121610;
  --tip-ink: #F5F7F1;
  --tip-ink-2: #B9C0B1;

  /* type */
  --f-display: "Doto", ui-monospace, "SF Mono", Menlo, monospace;
  --f-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --f-serif: "STIX Two Text", "Iowan Old Style", Georgia, serif;

  --t-micro: 0.6875rem;   /* 11px mono labels */
  --t-small: 0.8125rem;   /* 13px */
  --t-body: 1rem;
  --t-lede: clamp(1.125rem, 0.55vw + 1rem, 1.375rem);
  --t-h3: 1.25rem;
  --t-h2: clamp(1.9rem, 2.6vw + 1rem, 3.5rem);
  --t-h1: clamp(2.2rem, 3.6vw + 1rem, 4.6rem);

  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --page: 1360px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0F120E; --paper-2: #171B15; --paper-3: #090B08;
    --ink: #E8ECE2; --ink-2: #BCC3B4; --ink-3: #939B8B;
    --rule: #333A2E; --rule-2: #23281F;
    --demand: #4A86F0; --demand-2: #2C4F8F;
    --supply: #C98500; --supply-2: #9E6C00; --supply-3: #765204;
    --market: #1FA886; --neutral-mark: #6E7668;
    --crit: #E66767; --good: #3FB565; --on-data: #0B0E0A;
    --plate: #070906; --plate-2: #10140E;
    --tip-bg: #E8ECE2; --tip-ink: #121610; --tip-ink-2: #4B5245;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0F120E; --paper-2: #171B15; --paper-3: #090B08;
  --ink: #E8ECE2; --ink-2: #BCC3B4; --ink-3: #939B8B;
  --rule: #333A2E; --rule-2: #23281F;
  --demand: #4A86F0; --demand-2: #2C4F8F;
  --supply: #C98500; --supply-2: #9E6C00; --supply-3: #765204;
  --market: #1FA886; --neutral-mark: #6E7668;
  --crit: #E66767; --good: #3FB565; --on-data: #0B0E0A;
  --plate: #070906; --plate-2: #10140E;
  --tip-bg: #E8ECE2; --tip-ink: #121610; --tip-ink-2: #4B5245;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--paper);
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--demand); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--supply); color: #121610; }

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
@media (min-width: 720px) { :root { --gutter-l: max(28px, env(safe-area-inset-left, 0px)); --gutter-r: max(28px, env(safe-area-inset-right, 0px)); } }
@media (min-width: 1200px) { :root { --gutter-l: max(40px, env(safe-area-inset-left, 0px)); --gutter-r: max(40px, env(safe-area-inset-right, 0px)); } }

.mono { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; }
.label {
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5;
  font-size: var(--t-micro); line-height: 1.3; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.num { font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- masthead ---------- */
.mast {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.mast__row { display: flex; align-items: center; gap: var(--s5); min-height: 56px; }
.brand { display: flex; align-items: baseline; gap: var(--s3); text-decoration: none; flex: none; }
.brand__mark {
  font-family: var(--f-display); font-weight: 900; font-size: 1.5rem; letter-spacing: 0.02em; line-height: 1;
  text-transform: uppercase;
}
.brand__issue { display: none; }
.nav { display: none; gap: var(--s5); margin-left: auto; }
.nav a {
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro);
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--ink-2);
  padding-block: 6px; border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); } }
.mast__tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
@media (min-width: 1080px) {
  .nav { display: flex; }
  .mast__tools { margin-left: var(--s5); flex: none; }
  .mast__tools .seg { flex-wrap: nowrap; } /* the unit switch stays on one line beside the full nav */
}
@media (min-width: 1260px) { .brand__issue { display: inline; } } /* the issue label needs the extra room */

/* segmented control + buttons */
.seg {
  display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper-2); padding: 2px; gap: 2px; max-width: 100%;
}
.seg button {
  border: 0; background: transparent; border-radius: 2px;
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro);
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2);
  padding: 7px 10px; min-height: 30px; white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .seg button:not([aria-pressed="true"]):hover { background: var(--paper-3); color: var(--ink); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--rule); background: var(--paper-2); border-radius: 3px;
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro);
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2);
  padding: 7px 10px; min-height: 34px; min-width: 34px;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .btn:not([aria-pressed="true"]):hover { background: var(--paper-3); color: var(--ink); } }
.btn svg { width: 14px; height: 14px; }

/* ---------- sections ---------- */
.sec { padding-block: var(--s8) var(--s7); border-top: 1px solid var(--rule); }
.sec:first-of-type { border-top: 0; }
@media (min-width: 900px) { .sec { padding-block: var(--s9) var(--s8); } }

.sec-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4) var(--s6); margin-bottom: var(--s6); }
.sec-head h2 {
  font-size: var(--t-h2); line-height: 1.02; font-weight: 640; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 108; text-wrap: balance; max-width: 16ch;
}
.lede { font-family: var(--f-serif); font-size: var(--t-lede); line-height: 1.42; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: end; margin-bottom: var(--s7); }
}
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s5); margin: var(--s8) 0 var(--s5); }
.sub-head h3 { font-size: var(--t-h3); font-weight: 620; letter-spacing: -0.01em; font-variation-settings: "wdth" 105; }
.sub-head p { color: var(--ink-3); font-size: var(--t-small); max-width: 60ch; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin-bottom: var(--s5); }
.control { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.control > .label { margin-right: 2px; }

/* figure + title block */
.fig { position: relative; min-width: 0; }
.fig__body { position: relative; min-width: 0; }
.fig svg { overflow: visible; }
.titleblock {
  display: grid; grid-template-columns: auto 1fr; margin-top: var(--s5);
  border: 1px solid var(--rule); font-family: var(--f-mono); font-variation-settings: "wdth" 87.5;
  font-size: var(--t-micro); line-height: 1.35; color: var(--ink-2);
}
.titleblock > div { padding: 8px 10px; border-top: 1px solid var(--rule); min-width: 0; overflow-wrap: anywhere; }
.titleblock > div:nth-child(-n+2) { border-top: 0; }
.titleblock > div:nth-child(odd) { border-right: 1px solid var(--rule); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.titleblock b { font-weight: 600; color: var(--ink); }
.titleblock a { color: inherit; }
@media (min-width: 900px) {
  .titleblock { grid-template-columns: auto minmax(0, 1.2fr) auto minmax(0, 0.8fr) auto minmax(0, 0.8fr) auto minmax(0, 2fr); }
  .titleblock > div { border-top: 0; border-right: 1px solid var(--rule); }
  .titleblock > div:last-child { border-right: 0; }
}

/* legends */
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: var(--t-small); color: var(--ink-2); margin-bottom: var(--s4); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 2px; background: var(--c, var(--ink)); flex: none; }
.sw--line { height: 2px; width: 18px; border-radius: 1px; }
.sw--dash { height: 0; width: 18px; border-top: 2px dashed var(--c, var(--ink)); background: none; border-radius: 0; }
.sw--ring { background: transparent; border: 1.5px solid var(--c, var(--ink)); }
.sw--band { height: 10px; width: 18px; background: color-mix(in srgb, var(--c, var(--ink)) 22%, transparent); }

/* chart text */
.ax text, .ax-label { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.ax line, .ax path { stroke: var(--rule); fill: none; }
.gridline { stroke: var(--rule-2); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.direct { font-family: var(--f-sans); font-size: 12px; fill: var(--ink); font-weight: 560; }
.direct--muted { fill: var(--ink-3); font-weight: 450; }
.crosshair { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }

/* stats row */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin-bottom: var(--s6); }
.stat { padding: var(--s4) var(--s4) var(--s4) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.stat__v { font-size: clamp(1.6rem, 2.2vw + 0.8rem, 2.6rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; font-variation-settings: "wdth" 104; }
.stat__v small { font-size: 0.42em; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; }
.stat__l { margin-top: 6px; font-size: var(--t-small); color: var(--ink-2); max-width: 26ch; }
.stat__d { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--ink-3); margin-top: 4px; }
.stat__d[data-dir="up"] { color: var(--good); }
.stat__d[data-dir="down"] { color: var(--crit); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat { padding-right: var(--s5); } }

/* tooltip */
.tip {
  position: fixed; z-index: 80; left: 0; top: 0; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-ink); border-radius: 3px; padding: 9px 11px;
  font-size: 12.5px; line-height: 1.4; max-width: min(300px, calc(100vw - 24px));
  opacity: 0; transform: translate3d(0, 0, 0) scale(0.97); transform-origin: 0 0;
  transition: opacity 120ms ease;
}
.tip[data-on="1"] { opacity: 1; }
.tip__t { font-weight: 620; font-size: 13px; }
.tip__s { color: var(--tip-ink-2); font-size: 11.5px; margin-top: 1px; }
.tip__rows { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin-top: 7px; align-items: baseline; }
.tip__rows dt { color: var(--tip-ink-2); display: flex; align-items: center; gap: 6px; }
.tip__rows dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tip__key { width: 10px; height: 2px; background: var(--c); flex: none; border-radius: 1px; }

/* data table twin */
.tableview { margin-top: var(--s4); border: 1px solid var(--rule); max-height: 420px; overflow: auto; background: var(--paper-2); }
table.data { border-collapse: collapse; width: 100%; font-size: var(--t-small); font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td.l, table.data th.l { text-align: left; }
table.data thead th {
  position: sticky; top: 0; background: var(--paper-2); z-index: 1;
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule);
}
.fig__tools { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s3); }

/* ---------- plate: the globe ---------- */
.plate {
  background: var(--plate); color: var(--plate-ink);
  position: relative; overflow: hidden; isolation: isolate;
}
.plate .label { color: var(--plate-ink-3); }
.plate__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-block: var(--s6) var(--s5); position: relative; }
.plate__grid > * { min-width: 0; }
.plate h1 {
  font-size: var(--t-h1); line-height: 0.98; font-weight: 640; letter-spacing: -0.025em;
  font-variation-settings: "wdth" 110; text-wrap: balance; max-width: 13ch;
}
.plate .lede { color: var(--plate-ink-2); max-width: 40ch; margin-top: var(--s4); }
.plate .lede i { font-style: normal; white-space: nowrap; }
.key { display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%; margin-right: 0.3em; vertical-align: 0.02em; background: var(--c); }
.globe { position: relative; min-width: 0; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.globe[data-drag="1"] { cursor: grabbing; }
.globe canvas { position: absolute; left: -16%; top: -10%; width: 132%; height: 120%; }
.globe::before { content: ""; display: block; padding-top: 100%; }
.globe__hint { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); pointer-events: none; white-space: nowrap; transition: opacity 400ms ease; }
.globe[data-touched="1"] .globe__hint { opacity: 0; }

.readout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-content: start; min-width: 0; }
.year {
  font-family: var(--f-display); font-weight: 800; line-height: 0.82; letter-spacing: 0.01em;
  font-size: clamp(4rem, 9vw, 8.2rem); font-variant-numeric: tabular-nums;
}
.year__tag { display: block; margin-top: 10px; }
.ro { border-top: 1px solid var(--plate-rule); padding-top: var(--s3); display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s4); align-items: baseline; }
.ro__k { display: flex; align-items: center; gap: 8px; font-size: var(--t-small); color: var(--plate-ink-2); }
.ro__v { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; font-variation-settings: "wdth" 104; text-align: right; font-variant-numeric: tabular-nums; }
.ro__v small { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); font-weight: 400; color: var(--plate-ink-3); margin-left: 5px; letter-spacing: 0.03em; }
.ro__n { grid-column: 1 / -1; font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--plate-ink-3); letter-spacing: 0.03em; }
.cover { border-top: 1px solid var(--plate-rule); padding-top: var(--s3); }
.cover__bar { position: relative; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--glow-demand) 34%, transparent); margin-top: 10px; overflow: hidden; }
.cover__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--glow-supply); border-radius: 4px; transition: width 300ms var(--ease-out); }
.cover__txt { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: var(--t-small); color: var(--plate-ink-2); }
.cover__txt b { font-size: 1.5rem; font-weight: 600; color: var(--plate-ink); font-variation-settings: "wdth" 104; font-variant-numeric: tabular-nums; }

.scrub { display: grid; grid-template-columns: auto 1fr; gap: var(--s3) var(--s4); align-items: center; }
.scrub__play {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--plate-rule); background: var(--plate-2); color: var(--plate-ink);
  display: grid; place-items: center; transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.scrub__play:active { transform: scale(0.95); }
.scrub__play svg { width: 16px; height: 16px; fill: currentColor; }
.scrub__track { position: relative; min-width: 0; padding-top: 2px; }
.scrub input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; display: block; }
.scrub input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--plate-rule); }
.scrub input[type="range"]::-moz-range-track { height: 2px; background: var(--plate-rule); }
.scrub input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 22px; margin-top: -10px; border-radius: 2px; background: var(--plate-ink); border: 0; cursor: ew-resize; }
.scrub input[type="range"]::-moz-range-thumb { width: 14px; height: 22px; border-radius: 2px; background: var(--plate-ink); border: 0; cursor: ew-resize; }
.scrub__ticks { display: flex; justify-content: space-between; margin-top: 2px; padding-inline: 7px; }
.scrub__ticks span { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: 10px; color: var(--plate-ink-3); width: 0; display: flex; justify-content: center; white-space: nowrap; }
.scrub__ticks span[data-now="1"] { color: var(--plate-ink); }
.spark { grid-column: 1 / -1; height: 54px; position: relative; }
.spark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.plate__foot { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; justify-content: space-between; }
.plate .legend { color: var(--plate-ink-2); margin: 0; }
.plate .seg { background: var(--plate-2); border-color: var(--plate-rule); }
.plate .seg button { color: var(--plate-ink-2); }
.plate .seg button[aria-pressed="true"] { background: var(--plate-ink); color: var(--plate); }
@media (hover: hover) and (pointer: fine) { .plate .seg button:not([aria-pressed="true"]):hover { background: var(--plate-rule); color: var(--plate-ink); } }
.plate .titleblock { border-color: var(--plate-rule); color: var(--plate-ink-2); margin-top: 0; }
.plate .titleblock > div { border-color: var(--plate-rule); }
.plate .titleblock > div:nth-child(odd) { color: var(--plate-ink-3); }
.plate .titleblock b { color: var(--plate-ink); }
.plate :focus-visible { outline-color: var(--glow-supply); }
.pin {
  position: absolute; z-index: 3; left: var(--s4); bottom: var(--s4); max-width: min(320px, calc(100% - 32px));
  background: var(--plate-2); border: 1px solid var(--plate-rule); border-radius: 3px; padding: 12px 14px; font-size: var(--t-small);
}
.pin h4 { font-size: 0.95rem; font-weight: 620; padding-right: 28px; }
.pin__x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--plate-ink-2); border-radius: 3px; }
.pin dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin-top: 8px; color: var(--plate-ink-2); }
.pin dd { text-align: right; color: var(--plate-ink); font-variant-numeric: tabular-nums; }
.pin ul { margin-top: 8px; max-height: 132px; overflow: auto; color: var(--plate-ink-2); font-size: 12px; display: grid; gap: 2px; }
.pin li { display: flex; justify-content: space-between; gap: 12px; }

@media (min-width: 980px) {
  .plate__grid {
    grid-template-columns: minmax(0, 3.6fr) minmax(0, 5.6fr) minmax(0, 2.9fr);
    grid-template-areas: "intro globe readout" "scrub scrub scrub" "foot foot foot" "tb tb tb";
    gap: var(--s5) var(--s6); padding-block: var(--s7) var(--s6);
  }
  .plate__intro { grid-area: intro; align-self: start; }
  .globe { grid-area: globe; margin-block: -24px -8px; }
  .readout { grid-area: readout; }
  .scrub { grid-area: scrub; }
  .plate__foot { grid-area: foot; }
  .plate .titleblock { grid-area: tb; }
}
@media (max-width: 979px) {
  .globe { max-width: 560px; width: 100%; margin-inline: auto; }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
  .readout .year, .readout .cover { grid-column: 1 / -1; }
  .ro { grid-template-columns: 1fr; }
  .ro__v { text-align: left; }
}

/* ---------- reactors: lattice ---------- */
.lattice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px var(--s5); }
.lat-row { display: grid; grid-template-columns: minmax(0, 112px) minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.lat-row__c { font-size: var(--t-small); font-weight: 560; line-height: 1.25; padding-top: 1px; overflow-wrap: anywhere; }
.lat-row__n { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--ink-3); padding-top: 3px; white-space: nowrap; text-align: right; }
.cells { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.cell { width: 11px; height: 11px; border-radius: 1.5px; background: var(--demand); border: 0; padding: 0; flex: none; position: relative; }
.cell[data-s="construction"] { background: repeating-linear-gradient(135deg, var(--demand) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1.5px var(--demand); }
.cell[data-s="planned"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--demand); }
.cell[data-s="idle"] { background: var(--neutral-mark); }
.cell[data-s="shutdown"] { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.cell::after { content: ""; position: absolute; inset: -4px; }
@media (hover: hover) and (pointer: fine) { .cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; } }
@media (min-width: 900px) { .lattice { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lat-row { grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto; } .cell { width: 12px; height: 12px; } }

/* ---------- wire ---------- */
.wire { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
.wire > * { min-width: 0; }
@media (min-width: 1000px) { .wire { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s7); align-items: start; } }
.wire h3 { font-size: var(--t-h3); font-weight: 620; font-variation-settings: "wdth" 105; margin-bottom: var(--s4); }
.news { border-top: 1px solid var(--ink); }
.news__item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.news__date { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--ink-3); letter-spacing: 0.04em; padding-top: 4px; text-transform: uppercase; }
.news__title { font-weight: 580; line-height: 1.3; text-decoration: none; display: inline; }
@media (hover: hover) and (pointer: fine) { .news__title:hover { text-decoration: underline; } }
.news__sum { font-family: var(--f-serif); color: var(--ink-2); margin-top: 4px; line-height: 1.4; max-width: 62ch; }
.news__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; align-items: center; font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--ink-3); letter-spacing: 0.03em; }
.tag { display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ink-3)); display: inline-block; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: uppercase; color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .linkbtn:hover { color: var(--ink); } }
.more { margin-top: var(--s4); }
.filings { border-top: 1px solid var(--ink); }
.filing { display: grid; grid-template-columns: 52px 62px minmax(0, 1fr); gap: 2px var(--s3); padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-small); align-items: baseline; }
.filing__form { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); border: 1px solid var(--rule); border-radius: 2px; padding: 1px 5px; justify-self: start; white-space: nowrap; color: var(--ink-2); }
.filing a { text-decoration: none; font-weight: 560; }
@media (hover: hover) and (pointer: fine) { .filing a:hover { text-decoration: underline; } }
.filing__d { grid-column: 3; color: var(--ink-3); line-height: 1.35; }
.select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--rule); background: var(--paper-2); border-radius: 3px;
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 8px 28px 8px 10px; min-height: 34px; color: var(--ink-2); max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat;
}

/* ---------- scale ladder ---------- */
.ladder { position: relative; }
.ladder__view { position: relative; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); }
/* The overview strip above the ladder stands in for the scrollbar, so the native one is hidden. */
.ladder__scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: var(--s3); padding-inline: var(--gutter-l) var(--gutter-r); cursor: grab; }
.ladder__scroll::-webkit-scrollbar { display: none; }
.ladder__scroll[data-drag="1"] { cursor: grabbing; }
/* more to see: the edges fade out and an arrow sits in the fade */
.ladder__fade { position: absolute; top: 0; bottom: 0; width: clamp(48px, 9vw, 116px); pointer-events: none; opacity: 0; transition: opacity 220ms ease; }
.ladder__fade--l { left: 0; background: linear-gradient(to right, var(--paper) 18%, transparent); }
.ladder__fade--r { right: 0; background: linear-gradient(to left, var(--paper) 18%, transparent); }
.ladder[data-l="1"] .ladder__fade--l, .ladder[data-r="1"] .ladder__fade--r { opacity: 1; }
.ladder__arrow {
  position: absolute; top: calc(50% - 22px); width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: var(--ink); color: var(--paper); box-shadow: 0 2px 12px rgb(0 0 0 / 0.22);
  opacity: 0; pointer-events: none; transition: opacity 220ms ease, transform 140ms var(--ease-out);
}
.ladder__arrow svg { width: 18px; height: 18px; }
.ladder__arrow--l { left: max(8px, calc(var(--gutter-l) - 22px)); }
.ladder__arrow--r { right: max(8px, calc(var(--gutter-r) - 22px)); }
.ladder[data-l="1"] .ladder__arrow--l, .ladder[data-r="1"] .ladder__arrow--r { opacity: 1; pointer-events: auto; }
.ladder__arrow:active { transform: scale(0.94); }
.ladder__arrow:focus-visible { border-radius: 50%; }
@media (hover: hover) and (pointer: fine) { .ladder__arrow:hover { transform: scale(1.07); } .ladder__arrow:hover:active { transform: scale(0.96); } }
/* overview: every source as a dot on the whole ruler, with a frame around what is on screen */
.ladder__map { position: relative; height: 46px; margin-bottom: var(--s5); cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ladder__map::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1px; background: var(--rule); }
.ladder__tick { position: absolute; top: 14px; width: 1px; height: 6px; background: var(--ink-3); }
.ladder__tl { position: absolute; top: 28px; transform: translateX(-50%); white-space: nowrap; }
.ladder__dot { position: absolute; top: 11px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--supply); box-shadow: 0 0 0 1.5px var(--paper); }
.ladder__win { position: absolute; top: 0; height: 29px; min-width: 16px; box-sizing: border-box; border: 1.5px solid var(--ink); border-radius: 4px; background: color-mix(in srgb, var(--ink) 9%, transparent); cursor: grab; }
.ladder__map[data-drag="1"], .ladder__map[data-drag="1"] .ladder__win { cursor: grabbing; }
.ladder__rail { position: relative; height: 430px; }
.rung { position: absolute; display: grid; gap: 5px; justify-items: center; text-align: center; align-content: end; background: var(--paper); padding-top: 4px; }
.rung__art { width: 100%; color: var(--ink); display: grid; place-items: end center; }
.rung__art svg { width: 100%; height: auto; max-height: 104px; }
.rung__p { font-size: 1.3rem; font-weight: 620; letter-spacing: -0.01em; font-variation-settings: "wdth" 104; line-height: 1; margin-top: 2px; }
.rung__n { font-size: var(--t-small); font-weight: 560; line-height: 1.25; }
.rung__b { font-size: 12px; color: var(--ink-3); line-height: 1.35; max-width: 24ch; }
.ruler { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; border-top: 1px solid var(--ink); }
.ruler__t { position: absolute; top: 0; width: 1px; height: 8px; background: var(--ink); }
.ruler__t--minor { height: 4px; background: var(--ink-3); }
.ruler__l { position: absolute; top: 14px; transform: translateX(-50%); white-space: nowrap; }
.ua-w1 { stroke-width: 1.6; } .ua-w2 { stroke-width: 1; } .ua-w3 { stroke-width: 0.6; }
.ua-hot { color: var(--supply); fill: var(--supply); stroke: var(--supply); }

/* ---------- fuel-cycle flow ---------- */
.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); counter-reset: step; }
.flow__s { padding: var(--s4); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: 6px; align-content: start; min-width: 0; position: relative; }
.flow__k { counter-increment: step; }
.flow__k::before { content: counter(step, decimal-leading-zero) "  "; color: var(--ink); }
.flow__art { height: 84px; color: var(--ink); display: grid; place-items: center; margin-block: 4px; }
.flow__art svg { height: 100%; width: auto; max-width: 100%; }
.flow__v { font-size: clamp(1.4rem, 1vw + 1.1rem, 2rem); font-weight: 620; letter-spacing: -0.02em; line-height: 1; font-variation-settings: "wdth" 104; }
.flow__u { font-size: var(--t-small); color: var(--ink-2); line-height: 1.3; }
.flow__n { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
@media (min-width: 640px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .flow { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.flow-split { margin-top: var(--s5); }
.flow-split__bar { display: flex; gap: 2px; height: 28px; }
.flow-split__bar > div { border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; min-width: 3px; }
.flow-split__cap { margin-top: 10px; font-size: var(--t-small); color: var(--ink-2); max-width: 70ch; }

/* ---------- featured facts ---------- */
.feat { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); margin-bottom: var(--s6); }
.feat__c { padding: var(--s5) var(--s4); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: 10px; align-content: start; min-width: 0; }
.feat__art { display: flex; align-items: flex-end; gap: 10px; height: 96px; color: var(--ink); }
.feat__art > div { flex: 1 1 0; min-width: 0; max-width: 190px; }
.feat__art svg { width: 100%; height: auto; max-height: 96px; }
.feat__eq { flex: none !important; font-family: var(--f-mono); font-size: 1.2rem; color: var(--ink-3); align-self: center; }
@media (min-width: 640px) { .feat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .feat { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- facts ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); }
.fact { padding: var(--s5) var(--s4) var(--s5); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; display: grid; gap: 8px; align-content: start; }
.fact__v { font-size: clamp(1.7rem, 1.4vw + 1.1rem, 2.4rem); font-weight: 620; letter-spacing: -0.02em; line-height: 1; font-variation-settings: "wdth" 104; overflow-wrap: anywhere; }
.fact__v small { display: block; font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); font-weight: 400; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 8px; line-height: 1.3; }
.fact__s { font-family: var(--f-serif); font-size: 1.05rem; line-height: 1.35; color: var(--ink); }
.fact__d { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.fact__src { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.fact--wide { grid-column: 1 / -1; }

/* ---------- sources ---------- */
.sources { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
.sources > * { min-width: 0; }
.method { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.method h3 { font-size: 1rem; font-weight: 620; margin-bottom: 6px; }
.method p { font-family: var(--f-serif); color: var(--ink-2); max-width: 64ch; line-height: 1.45; }
@media (min-width: 900px) { .method { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); } }
.src-table td.l { white-space: normal; min-width: 180px; }
.src-table a { font-weight: 560; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .src-table a:hover { text-decoration: underline; } }

.foot { border-top: 1px solid var(--ink); padding-block: var(--s6) var(--s7); display: grid; gap: var(--s4); color: var(--ink-2); font-size: var(--t-small); }
.foot p { max-width: 72ch; }
@media (min-width: 900px) { .foot { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.foot .brand__mark { font-size: 2rem; }

.note { font-size: 12px; color: var(--ink-3); max-width: 80ch; margin-top: var(--s3); line-height: 1.45; }
.empty { padding: var(--s6) 0; color: var(--ink-3); font-size: var(--t-small); }
/* ---------- topic pages (reactors/, mines/, balance/, price/, facts/): the same data as plain tables ---------- */
a.btn { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.subnav { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-top: var(--s4); margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; display: inline-flex; align-items: center; min-height: 34px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper-2);
  font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; color: var(--ink-2);
}
.subnav a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (min-width: 1080px) { .subnav { display: none; } }
.doc { padding-bottom: var(--s8); }
.doc__head { display: grid; gap: var(--s4); padding-block: var(--s7) var(--s6); }
.doc__head h1 { font-size: var(--t-h2); line-height: 1.02; font-weight: 640; letter-spacing: -0.02em; font-variation-settings: "wdth" 108; text-wrap: balance; max-width: 18ch; }
.doc__go { margin-top: var(--s2); }
.doc__sec { padding-top: var(--s7); }
.doc__sec h2 { font-size: clamp(1.3rem, 1vw + 1rem, 1.75rem); line-height: 1.1; font-weight: 620; letter-spacing: -0.01em; font-variation-settings: "wdth" 104; margin-bottom: var(--s4); }
.doc .note a, .doc__list a { color: inherit; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--paper-2); }
.tablewrap table.data caption { caption-side: top; text-align: left; padding: 10px 10px 9px; font-size: var(--t-small); font-weight: 560; color: var(--ink); border-bottom: 1px solid var(--rule); }
table.data tbody th { font-weight: 500; }
table.data tfoot th, table.data tfoot td { font-weight: 640; border-top: 1px solid var(--ink); border-bottom: 0; }
table.data .w { white-space: normal; min-width: 15ch; max-width: 34ch; }
table.data td small { color: var(--ink-3); margin-left: 4px; }
.more { border-top: 1px solid var(--rule); }
.more:last-of-type { border-bottom: 1px solid var(--rule); }
.more > summary { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) 0; cursor: pointer; font-weight: 560; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; width: 1em; font-family: var(--f-mono); color: var(--ink-3); }
.more[open] > summary::before { content: "\2212"; }
.more > .tablewrap { margin-bottom: var(--s5); }
.doc__list { margin: 0; padding-left: 1.15em; display: grid; gap: var(--s3); max-width: 78ch; color: var(--ink-2); line-height: 1.5; }
.doc__facts { list-style: none; padding-left: 0; gap: 0; max-width: 88ch; }
.doc__facts li { padding: var(--s4) 0; border-top: 1px solid var(--rule-2); color: var(--ink); }
.doc__facts b { color: var(--ink); font-weight: 640; margin-right: 6px; }
.doc__detail { color: var(--ink-3); }
.doc__facts a { font-family: var(--f-mono); font-variation-settings: "wdth" 87.5; font-size: var(--t-micro); color: var(--ink-3); white-space: nowrap; }
.foot__pages { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.foot__pages a { color: var(--ink); }

/* shown only without JavaScript: the month's numbers in words */
.digest { padding-block: var(--s7); max-width: 78ch; }
.digest h2 { margin-bottom: var(--s4); }
.digest ul { margin: var(--s4) 0; padding-left: 1.2em; display: grid; gap: var(--s2); }
.digest a { text-decoration: underline; }

/* entrance: one orchestrated moment on the plate; everything is visible without it */
@media (prefers-reduced-motion: no-preference) {
  html[data-anim="1"] .plate [data-in] { animation: rise 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
  @keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
