/*
  The Long Thaw: data journalism scrollytelling story (Screenery template)
  A calm white newspaper page: Merriweather for the reading voice, Merriweather Sans for charts, labels and data.
  Colour means one thing only: a winter's ice days against the 1925 to 1954 baseline (cold blue to warm red).

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Masthead, headline, ribbon, byline
   4. Scrolly: sticky chart and steps
   5. Chart marks and labels (SVG)
   6. Interlude and quote
   7. Your year explorer
   8. Data table
   9. Small multiples
  10. Method, correction, footer
  11. Motion preferences
  12. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Paper and ink */
  --paper: #ffffff;
  --paper-2: #f6f7f8;          /* quiet wells: table head, empty state */
  --ink: #161b20;              /* 17.6:1 on paper */
  --ink-2: #3d454d;            /* body secondary, 10:1 */
  --ink-3: #5c656d;            /* labels and captions, 5.9:1 */
  --line: #e1e4e7;
  --line-2: #c5cbd0;
  --mute-mark: #d3d7dc;        /* de-emphasised chart marks */

  /* Diverging scale: ice days against the 1925 to 1954 average. Blue/red pair, safe for the common colour blindnesses. */
  --c3p: #2d6aa8;              /* +20 or more */
  --c2p: #6fa8d6;              /* +10 to +19 */
  --c1p: #c6dcee;              /* 0 to +9 */
  --c1m: #f7c8a8;              /* -1 to -14 */
  --c2m: #ec8a5c;              /* -15 to -29 */
  --c3m: #cf5434;              /* -30 to -44 */
  --c4m: #9e1b14;              /* -45 or fewer */
  --warm-text: #9e1b14;        /* "less ice" in text, 7.5:1 */
  --cold-text: #245a93;        /* "more ice" in text, 6.9:1 */

  /* Type */
  --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --sans: 'Merriweather Sans', 'Segoe UI', system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.8rem, 1.3rem + 2vw, 2.5rem);
  --step-4: clamp(3rem, 1.6rem + 6vw, 5.75rem);

  /* Space and shape */
  --s-1: 0.375rem;
  --s0: 0.75rem;
  --s1: 1rem;
  --s2: 1.5rem;
  --s3: 2.25rem;
  --s4: 3.5rem;
  --s5: 5.5rem;
  --s6: 8rem;
  --radius: 3px;
  --measure: 40rem;            /* about 68 characters of Merriweather at body size */
  --wide: 76rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgb(22 27 32 / 0.06), 0 8px 24px -8px rgb(22 27 32 / 0.14);
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s2); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.75 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--ink);
  accent-color: var(--ink);
  scrollbar-color: var(--line-2) var(--paper);
}
::selection { background: var(--c1p); color: var(--ink); }
img, svg { display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
strong { font-weight: 700; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico--lg { width: 2rem; height: 2rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s1); top: -4rem; z-index: 50; background: var(--ink); color: var(--paper); padding: var(--s0) var(--s1); font: 600 var(--step--1) var(--sans); border-radius: var(--radius); }
.skip:focus { top: var(--s1); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15em; }
.prose h3 { font: 700 var(--step-1)/1.35 var(--serif); margin-top: 1.9em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0 1.25rem;
  border-radius: var(--radius); border: 1.5px solid var(--ink);
  font: 600 0.95rem/1 var(--sans); cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #2c343c; }
.btn--line { background: var(--paper); color: var(--ink); }
.btn--line:hover { background: var(--paper-2); }

/* ---------- 3. Masthead, headline, ribbon, byline ---------- */
.masthead { border-bottom: 1px solid var(--line); }
.masthead__in {
  max-width: var(--wide); margin: 0 auto; padding: var(--s1) var(--s2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
}
.paper { font: 900 1.3rem/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; display: inline-block; padding-block: 0.4rem; } /* padding keeps the masthead link a 24px+ tap target on phones */
.nav { display: flex; gap: var(--s2); font: 500 var(--step--1) var(--sans); }
.nav a { text-decoration: none; color: var(--ink-2); padding: 0.6rem 0; }
.nav a:hover { color: var(--ink); text-decoration: underline; }

.lede { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s2) var(--s4); }
.lede__title {
  font: 900 var(--step-4)/1 var(--serif);
  letter-spacing: -0.03em;
  max-width: 12ch;
}
.lede__stand {
  margin-top: var(--s2);
  max-width: 34rem;
  font: 300 var(--step-1)/1.6 var(--serif);
  color: var(--ink-2);
}
.ribbon { margin: var(--s4) 0 0; }
.ribbon__svg { width: 100%; height: clamp(44px, 7vw, 76px); }
.ribbon__cap {
  display: flex; justify-content: space-between; gap: var(--s1);
  margin-top: var(--s0);
  font: 400 0.8125rem/1.4 var(--sans); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.ribbon__cap span:nth-child(2) { text-align: center; }
.byline {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s0) var(--s2);
  margin-top: var(--s3); padding: var(--s1) 0;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
  font: 400 0.9375rem/1.5 var(--sans); color: var(--ink-2);
}
.byline strong { color: var(--ink); font-weight: 600; }
.fiction {
  display: flex; gap: var(--s0); align-items: flex-start;
  margin-top: var(--s2); max-width: var(--measure);
  font: 400 0.875rem/1.55 var(--sans); color: var(--ink-3);
}
.fiction .ico { margin-top: 0.15em; }
.lede .prose { margin-top: var(--s4); }
.lede .prose p:first-child::first-letter {
  float: left; font: 900 3.6em/0.8 var(--serif); margin: 0.08em 0.1em 0 0; color: var(--ink);
}

/* ---------- 4. Scrolly: sticky chart and steps ---------- */
.scrolly {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--s2);
  display: grid;
  grid-template-columns: minmax(17rem, 25rem) minmax(0, 1fr);
  gap: var(--s4);
}
.scrolly__chart { grid-column: 2; grid-row: 1; }
.scrolly__steps { grid-column: 1; grid-row: 1; padding: 30vh 0 45vh; }

.chart {
  position: sticky; top: 4vh;
  height: 92vh; margin: 0;
  display: flex; flex-direction: column; gap: var(--s0);
}
.chart__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); min-height: 48px; }
.chart__title { font: 700 1.05rem/1.3 var(--sans); }
.stepper { display: flex; align-items: center; gap: 0.25rem; font: 500 0.85rem/1 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stepper__count { min-width: 6.2em; text-align: center; }
.stepper__btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--paper); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.stepper__btn:hover:not(:disabled) { border-color: var(--ink); background: var(--paper-2); }
.stepper__btn:disabled { color: var(--line-2); cursor: default; }
.chart__stage { position: relative; flex: 1; min-height: 240px; }
.chart__svg, .chart__static { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__svg:focus-visible { outline-offset: 6px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s1); font: 400 0.75rem/1.3 var(--sans); color: var(--ink-3); }
.legend.is-off { visibility: hidden; }
.legend__label { color: var(--ink-2); }
.legend__scale { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; font-variant-numeric: tabular-nums; }
.legend__scale span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend__scale span::before { content: ''; width: 0.8rem; height: 0.8rem; background: var(--c); border-radius: 1px; box-shadow: inset 0 0 0 1px rgb(22 27 32 / 0.18); }
.chart__desc { font: 400 0.875rem/1.55 var(--sans); color: var(--ink-2); max-width: 60rem; border-top: 1px solid var(--line); padding-top: var(--s0); }
.chart__desc-lab { display: block; font-weight: 700; color: var(--ink); }
.chart__kbd { font: 400 0.8rem/1.45 var(--sans); color: var(--ink-3); }
html:not(.js) .stepper, html:not(.js) .chart__kbd { display: none; }

.tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  display: grid; gap: 0.1rem; padding: 0.55rem 0.7rem; min-width: 10.5rem;
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  font: 400 0.8rem/1.4 var(--sans); font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow);
}
.tip strong { font-size: 0.875rem; }

.step { min-height: 92vh; display: flex; align-items: center; }
.step + .step { margin-top: 0; }
.step__card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s2);
  box-shadow: var(--shadow);
  transition: border-color 0.4s var(--ease-out);
}
.step.is-active .step__card { border-color: var(--ink); }
.step__title { font: 700 var(--step-1)/1.3 var(--serif); margin-bottom: var(--s0); }
.step__card p + p { margin-top: 0.85em; }
.step__card p { font-size: 1rem; line-height: 1.7; }

/* ---------- 5. Chart marks and labels (SVG) ---------- */
.chart__svg { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.mark { stroke: rgb(22 27 32 / 0.3); stroke-width: 0.6; }
.chart__svg[data-step="2"] .mark { stroke: none; }
.grid { stroke: var(--line); stroke-width: 1; }
.tick { font-size: 12px; fill: var(--ink-3); }
.lab { font-size: 13px; fill: var(--ink-2); }
.lab--soft { fill: var(--ink-3); }
.lab--strong, .strong { fill: var(--ink); font-weight: 700; }
.base { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.55; }
.ma { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ma--faint { opacity: 0.3; }
.band { fill: #e3e6e9; }
.fit { stroke: var(--ink); stroke-width: 1.5; fill: none; opacity: 0.6; }
.proj { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.divider { stroke: var(--line-2); stroke-dasharray: 2 4; }
.leader { stroke: var(--ink); stroke-width: 1; }
.cur-box, .cur-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.cur-line { stroke: var(--ink); stroke-width: 1; opacity: 0.25; }

/* Overlays fade in after the marks start moving; the average line draws itself */
.ov { opacity: 0; transition: opacity 0.6s var(--ease-out) 0.3s; }
.ov.on { opacity: 1; }
.ov--front .ma { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out) 0.35s; }
.ov--front.on .ma { stroke-dashoffset: 0; }
.ov.instant, .ov.instant .ma { transition: none; }

/* ---------- 6. Interlude and quote ---------- */
.interlude { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s2) var(--s4); }
.interlude h2, .rivers h2, .data h2, .year h2, .method h2 { font: 900 var(--step-3)/1.15 var(--serif); letter-spacing: -0.015em; margin-bottom: var(--s2); max-width: 22ch; }
.quote { margin: var(--s3) 0; padding: var(--s1) 0 var(--s1) 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.quote p { font: 300 italic var(--step-2)/1.45 var(--serif); }
.quote footer { margin-top: var(--s0); font: 500 0.875rem/1.4 var(--sans); color: var(--ink-3); }

/* ---------- 7. Your year explorer ---------- */
.year { border-top: 1px solid var(--line); }
.year__in { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s2); display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: var(--s2) var(--s4); }
.year__in > h2, .year__lead { grid-column: 1; }
.year__lead { color: var(--ink-2); }
.yform { grid-column: 1; }
.yresult { grid-column: 2; grid-row: 1 / span 3; }
.field label { display: block; font: 700 0.9375rem/1.4 var(--sans); margin-bottom: var(--s-1); }
.field__row { display: flex; gap: var(--s0); flex-wrap: wrap; }
.field input {
  width: 8.5ch; min-height: 52px; padding: 0 0.75rem;
  border: 1.5px solid var(--ink-3); border-radius: var(--radius); background: var(--paper);
  font: 600 1.4rem/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.field input::placeholder { color: var(--ink-3); }
.field input:hover { border-color: var(--ink); }
.field input:focus-visible { outline-offset: 2px; border-color: var(--ink); }
.field .btn { min-height: 52px; }
.field__hint { margin-top: var(--s-1); font: 400 0.8125rem/1.5 var(--sans); color: var(--ink-3); }
.field__err { display: flex; gap: 0.45rem; align-items: flex-start; margin-top: var(--s-1); font: 600 0.875rem/1.45 var(--sans); color: var(--warm-text); }
.field__err .ico { margin-top: 0.1em; }
.field.is-error input { border-color: var(--warm-text); border-width: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s2); }
.chip {
  min-height: 44px; min-width: 64px; padding: 0 0.9rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper);
  font: 500 0.875rem/1 var(--sans); font-variant-numeric: tabular-nums; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.yresult { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); min-height: 22rem; }
.yresult__empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: var(--s1); text-align: center; color: var(--ink-3); font: 400 0.9375rem/1.6 var(--sans); max-width: 26rem; margin: 0 auto; }
.yresult__head { font: 400 var(--step-1)/1.5 var(--serif); max-width: 36rem; }
.yresult__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); margin: var(--s2) 0; border-top: 1px solid var(--ink); }
.yresult__nums p { padding-top: var(--s0); display: grid; gap: 0.2rem; }
.num { font: 900 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--serif); font-variant-numeric: tabular-nums lining-nums; }
.num__lab { font: 400 0.8125rem/1.35 var(--sans); color: var(--ink-3); }
[data-sign="less"] .num { color: var(--warm-text); }
[data-sign="more"] .num { color: var(--cold-text); }
.ybars { width: 100%; height: auto; font-family: var(--sans); font-variant-numeric: tabular-nums; overflow: visible; }
.ybar { stroke: rgb(22 27 32 / 0.3); stroke-width: 0.6; }
.yresult__note { margin-top: var(--s1); font: 400 0.875rem/1.6 var(--sans); color: var(--ink-2); max-width: 40rem; }

/* ---------- 8. Data table ---------- */
.data { max-width: var(--wide); margin: 0 auto; padding: var(--s4) var(--s2) var(--s5); border-top: 1px solid var(--line); }
.data__head p { color: var(--ink-2); max-width: var(--measure); }
.data__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s0) var(--s1); margin-top: var(--s2); }
.data__status { font: 400 0.875rem/1.4 var(--sans); color: var(--ink-2); }
.table-wrap { margin-top: var(--s2); max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font: 400 0.875rem/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 0.55rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table thead th { position: sticky; top: 0; background: var(--paper-2); font-weight: 700; color: var(--ink); z-index: 1; box-shadow: 0 1px 0 var(--line-2); }
.table tbody th { font-weight: 600; }
.table .r { text-align: right; }
.table tbody tr:hover { background: var(--paper-2); }
.sw { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.45rem; vertical-align: -0.05em; border-radius: 1px; box-shadow: inset 0 0 0 1px rgb(22 27 32 / 0.18); }
.na { color: var(--ink-3); }

/* ---------- 9. Small multiples ---------- */
.rivers { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s2); border-top: 1px solid var(--line); }
.rivers__head p { color: var(--ink-2); max-width: var(--measure); }
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s2); margin-top: var(--s3); }
.mult { margin: 0; }
.mult figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s0); border-top: 1px solid var(--ink); padding-top: var(--s-1); margin-bottom: var(--s-1); }
.mult__name { font: 700 1.05rem/1.3 var(--serif); }
.mult__name span { font: 400 0.875rem var(--sans); color: var(--ink-3); }
.mult__fig { font: 400 0.8125rem/1.3 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mult svg { width: 100%; height: auto; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.mult__note { font: 400 0.8125rem/1.4 var(--sans); color: var(--ink-3); margin-top: 0.2rem; }
.mg { stroke: var(--line); }
.mt { font-size: 10.5px; fill: var(--ink-3); }
.mv { fill: none; stroke: #8b949c; stroke-width: 1.4; stroke-dasharray: 4 3; }
.ma { fill: none; }
.mult .ma { stroke: var(--ink); stroke-width: 2; }
.md circle { stroke: rgb(22 27 32 / 0.25); stroke-width: 0.4; }

/* ---------- 10. Method, correction, footer ---------- */
.method { border-top: 1px solid var(--line); background: var(--paper-2); }
.method__in { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s2); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2) var(--s4); }
.method h2 { grid-column: 1 / -1; }
.terms { margin: 0; display: grid; gap: var(--s1); align-content: start; }
.terms div { border-top: 1px solid var(--line-2); padding-top: var(--s0); }
.terms dt { font: 700 0.9375rem/1.4 var(--sans); }
.terms dd { margin: 0.2rem 0 0; font-size: 0.9375rem; line-height: 1.65; color: var(--ink-2); }
.method .prose { font-size: 0.9375rem; color: var(--ink-2); }
.method .prose h3 { color: var(--ink); font-size: 1.1rem; }
.method .prose h3:first-child { margin-top: 0; }

.corrections { max-width: var(--wide); margin: 0 auto; padding: var(--s4) var(--s2); }
.corrections h2 { font: 700 var(--step-1)/1.3 var(--serif); margin-bottom: var(--s0); }
.corrections p { max-width: var(--measure); font-size: 0.9375rem; color: var(--ink-2); padding: var(--s1) var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); }
.corrections time { font-weight: 700; color: var(--ink); }

.foot { border-top: 3px solid var(--ink); }
.foot__in { max-width: var(--wide); margin: 0 auto; padding: var(--s3) var(--s2) var(--s4); display: grid; gap: var(--s1); }
.paper--foot { font-size: 1.6rem; }
.foot__note { max-width: var(--measure); font: 400 0.9375rem/1.6 var(--sans); color: var(--ink-2); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 0 var(--s2); font: 500 0.875rem var(--sans); }
.foot__nav a { padding: 0.7rem 0; display: inline-block; }
.foot__fine { font: 400 0.8125rem/1.5 var(--sans); color: var(--ink-3); }

/* ---------- 11. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; scroll-behavior: auto !important; }
  .ov--front .ma { stroke-dashoffset: 0; }
}

/* ---------- 12. Narrow screens ---------- */
@media (max-width: 1080px) {
  .scrolly { grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: var(--s3); }
  .multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year__in { grid-template-columns: minmax(0, 1fr); }
  .yresult { grid-column: 1; grid-row: auto; min-height: 13rem; }
}
@media (max-width: 760px) {
  :root { --s5: 3.5rem; --s4: 2.5rem; }
  .masthead__in { padding: var(--s0) var(--s1); flex-wrap: wrap; gap: 0 var(--s1); }
  .nav { gap: var(--s1); }
  .nav a[href="#method"] { display: none; }
  .lede, .interlude, .year__in, .data, .rivers, .method__in, .corrections, .foot__in { padding-left: var(--s1); padding-right: var(--s1); }
  .lede { padding-top: var(--s4); }
  .ribbon__cap span:nth-child(2) { display: none; }
  .byline { flex-direction: column; }

  /* The chart sticks to the top; the step cards scroll up underneath its lower edge */
  .scrolly { display: block; padding: 0; }
  .scrolly__chart {
    position: sticky; top: 0; z-index: 2; height: 62svh;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .chart { position: relative; top: auto; height: 100%; padding: var(--s0) var(--s1) var(--s-1); gap: var(--s-1); }
  .chart__title { font-size: 0.9rem; }
  .chart__desc, .chart__kbd { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .legend__label { display: none; }
  .legend__scale { gap: 0.15rem 0.55rem; font-size: 0.6875rem; }
  .scrolly__steps { padding: 4svh var(--s1) 30svh; position: relative; z-index: 1; }
  .step { min-height: 78svh; align-items: flex-end; padding-bottom: 6svh; }
  .step__card { padding: var(--s1) var(--s1) var(--s1); }
  .step__card p { font-size: 0.9375rem; }

  .yresult { padding: var(--s1); min-height: 0; }
  .yresult__nums { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s0); }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .method__in { grid-template-columns: minmax(0, 1fr); }
  .corrections p { padding: var(--s1); }
}
