/* Shared by every page under /learn/. Tokens follow the app's flat restyle: warm grey page,
   white cards, pink as the one accent fill, Bricolage Grotesque, Geist and Geist Mono. */
:root {
  --paper: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #ece9e3;
  --ink: #161513;
  --ink-2: #3d3b37;
  --ink-3: #67645e;
  --rule: #16151324;
  --rule-soft: #16151314;

  --cast-a: #b0368f;
  --cast-a-fill: #ffd5f6;
  --cast-b: #2563eb;
  --cast-b-fill: #dbeafe;
  --cast-c: #9a6a00;
  --cast-c-fill: #fff0b8;
  --alarm: #b42318;
  --alarm-fill: #fbd5d0;
  --chain: #4b4842;
  --pink: #ff90e8;
  --dark-ink: #161513;

  --display: "Bricolage Grotesque", Geist, system-ui, sans-serif;
  --body: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 36rem;
  --wide: 60rem;
  color-scheme: light;
}

/* Dark values twice on purpose: once for a reader who never chose, once for an explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111110;
    --surface: #1c1b19;
    --surface-2: #2a2926;
    --ink: #f3f1ec;
    --ink-2: #cfccc5;
    --ink-3: #a3a09a;
    --rule: #ffffff24;
    --rule-soft: #ffffff14;
    --cast-a: #ff90e8;
    --cast-a-fill: #4a1f40;
    --cast-b: #7db8f0;
    --cast-b-fill: #16304a;
    --cast-c: #ffc900;
    --cast-c-fill: #3d3210;
    --alarm: #f97066;
    --alarm-fill: #4a231c;
    --chain: #a3a09a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111110;
  --surface: #1c1b19;
  --surface-2: #2a2926;
  --ink: #f3f1ec;
  --ink-2: #cfccc5;
  --ink-3: #a3a09a;
  --rule: #ffffff24;
  --rule-soft: #ffffff14;
  --cast-a: #ff90e8;
  --cast-a-fill: #4a1f40;
  --cast-b: #7db8f0;
  --cast-b-fill: #16304a;
  --cast-c: #ffc900;
  --cast-c-fill: #3d3210;
  --alarm: #f97066;
  --alarm-fill: #4a231c;
  --chain: #a3a09a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
::selection { background: var(--cast-a-fill); color: var(--ink); }
a { color: inherit; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--cast-a); outline-offset: 3px; }

.skip { position: absolute; top: -100px; left: 16px; background: var(--pink); color: var(--dark-ink); padding: 10px 14px; border-radius: 10px; z-index: 30; }
.skip:focus { top: 12px; }

/* ---------- site bar ---------- */
.site-bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.4rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-bar .brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.03em; }
.site-bar .brand img { width: 30px; height: 30px; }
.site-bar nav { display: flex; gap: 1.4rem; font-size: .88rem; font-weight: 500; }
.site-bar nav a { text-decoration: none; color: var(--ink-2); }
.site-bar nav a:hover, .site-bar nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem 6rem; }
.col { max-width: var(--measure); }

/* ---------- rail ---------- */
.rail { position: fixed; left: max(1rem, calc(50vw - 33.5rem)); top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: .55rem; z-index: 20; }
@media (min-width: 78rem) { .rail { display: flex; } }
.rail a { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink-3); font-family: var(--mono); font-size: .625rem; letter-spacing: .09em; text-transform: uppercase; padding: .1rem 0; }
.rail .tick { width: 1.1rem; height: 2px; border-radius: 2px; background: var(--rule); flex: none; transition: width .25s ease, background .25s ease; }
.rail .lbl { opacity: 0; transform: translateX(-.25rem); transition: opacity .25s ease, transform .25s ease; white-space: nowrap; }
.rail a:hover .lbl, .rail a:focus-visible .lbl { opacity: 1; transform: none; }
.rail a.here .tick { width: 2rem; background: var(--cast-a); }
.rail a.here { color: var(--ink); }

/* ---------- opening ---------- */
.hero { padding: clamp(3.5rem, 12vh, 7.5rem) 0 clamp(3rem, 8vh, 5rem); }
.hero.short { padding-bottom: 1rem; }
.kicker { font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1.4rem; display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.level { display: inline-block; padding: .2rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); letter-spacing: .1em; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 7.5vw, 4.8rem); line-height: 1; letter-spacing: -.035em; margin: 0 0 1.4rem; text-wrap: balance; }
h1 em { font-style: normal; color: var(--cast-a); }
.standfirst { font-size: 1.28rem; line-height: 1.5; color: var(--ink-2); max-width: 34rem; margin: 0 0 2.2rem; }

/* ---------- beats ---------- */
.beat { padding: clamp(3.5rem, 9vh, 6rem) 0; border-top: 1px solid var(--rule-soft); scroll-margin-top: 2rem; }
.eyebrow { font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; display: flex; align-items: baseline; gap: .8rem; }
.eyebrow .n { color: var(--cast-a); font-weight: 600; }
.beat h2 { font-family: var(--display); font-weight: 650; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 1.4rem; max-width: 24ch; text-wrap: balance; }
.beat p { margin: 0 0 1.15rem; max-width: var(--measure); }
.beat p:last-child { margin-bottom: 0; }
.lead { font-size: 1.2rem; color: var(--ink); }
strong { font-weight: 600; }
.who-a { color: var(--cast-a); font-weight: 600; }
.who-b { color: var(--cast-b); font-weight: 600; }
.who-c { color: var(--cast-c); font-weight: 600; }
.who-x { color: var(--alarm); font-weight: 600; }
code { font-family: var(--mono); font-size: .84em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }

/* In the app: what the reader sees on the phone, and what it stands for. */
.in-app { max-width: var(--measure); margin: 2rem 0; padding: 1.2rem 1.3rem; background: var(--surface); border-radius: 18px; }
.in-app .tag { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .6rem; }
.in-app .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.in-app p { margin: 0 0 .6rem; font-size: 1rem; }
.in-app p:last-child { margin-bottom: 0; }
.in-app .ui { font-family: var(--display); font-weight: 650; font-size: 1.05rem; }

.flat { margin: 2rem 0; padding: 1.3rem 1.4rem; background: var(--surface); border-radius: 18px; border-left: 4px solid var(--alarm); max-width: var(--measure); }
.flat p { margin: 0; font-size: 1.04rem; }
.flat .tag { display: block; font-family: var(--mono); font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--alarm); margin-bottom: .6rem; }
.flat.calm { border-left-color: var(--cast-a); }
.flat.calm .tag { color: var(--cast-a); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 6px; max-width: var(--wide); margin: 2.2rem 0; }
.stat { background: var(--surface); padding: 1.05rem 1.15rem; border-radius: 16px; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.85rem; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: .55rem; line-height: 1.5; }

/* ---------- figures ---------- */
figure { margin: 2.5rem 0; max-width: var(--wide); }
.fig-frame { background: var(--surface); border-radius: 20px; padding: 1.5rem 1.25rem 1.1rem; overflow-x: auto; }
figure svg { display: block; width: 100%; min-width: 30rem; height: auto; color: var(--ink-2); }
figcaption { font-family: var(--mono); font-size: .72rem; line-height: 1.6; color: var(--ink-3); margin-top: .85rem; max-width: 46rem; }

.sk { stroke: var(--ink-2); }
.skq { stroke: var(--rule); }
.fl { fill: var(--surface); }
.fl2 { fill: var(--surface-2); }
.tx { fill: var(--ink); font-family: var(--mono); font-size: 12px; }
.tx-s { fill: var(--ink-3); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; }
.tx-b { fill: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.a-s { stroke: var(--cast-a); } .a-f { fill: var(--cast-a); } .a-bg { fill: var(--cast-a-fill); }
.b-s { stroke: var(--cast-b); } .b-f { fill: var(--cast-b); } .b-bg { fill: var(--cast-b-fill); }
.c3-s { stroke: var(--cast-c); } .c3-f { fill: var(--cast-c); } .c3-bg { fill: var(--cast-c-fill); }
.x-s { stroke: var(--alarm); } .x-f { fill: var(--alarm); } .x-bg { fill: var(--alarm-fill); }
.c-s { stroke: var(--chain); } .c-f { fill: var(--chain); }
.rim { stroke: var(--surface); }

/* ---------- motion ---------- */
.js .beat figure .stage { opacity: 0; transition: opacity .55s ease; }
.js .beat.in figure .stage { opacity: 1; }
.js .beat figure .s2 { transition-delay: .18s; }
.js .beat figure .s3 { transition-delay: .36s; }
.js .beat figure .s4 { transition-delay: .54s; }
.js .beat figure .s5 { transition-delay: .72s; }
.js .beat figure .flow { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1) .25s; }
.js .beat.in figure .flow { stroke-dashoffset: 0; }
.js .beat figure .flow.d2 { transition-delay: .55s; }
.js .beat figure .flow.d3 { transition-delay: .85s; }
.js .beat figure .flow.d4 { transition-delay: 1.15s; }
.js .beat figure .grow { transform: scaleX(0); transform-box: fill-box; transform-origin: left center; transition: transform .9s cubic-bezier(.4,0,.2,1) .3s; }
.js .beat.in figure .grow { transform: scaleX(1); }
.js .beat figure .grow.g2 { transition-delay: .6s; }
.js .beat figure .grow.g3 { transition-delay: .9s; }
.js .beat figure .grow.grow-r { transform-origin: right center; }
.js .beat figure .pkt { opacity: 0; }
.js .beat.in figure .pkt { animation: ride var(--cycle, 5.4s) linear var(--rd, 0s) infinite both; }
@keyframes ride {
  0% { opacity: 0; transform: translate(0, 0); }
  3% { opacity: 1; transform: translate(calc(var(--ride, 120px) * .16), calc(var(--rise, 0px) * .16)); }
  19% { opacity: 1; transform: translate(var(--ride, 120px), var(--rise, 0px)); }
  25%, 100% { opacity: 0; transform: translate(var(--ride, 120px), var(--rise, 0px)); }
}
.js .beat figure .latch { opacity: 0; transform-box: fill-box; transform-origin: center; }
.js .beat.in figure .latch { animation: latch var(--cycle, 5.4s) linear var(--rd, 0s) infinite both; }
@keyframes latch {
  0%, 15% { opacity: 0; transform: scale(.4); }
  22%, 100% { opacity: 1; transform: scale(1); }
}
.js .beat figure .hop1 { --rd: 0s; }
.js .beat figure .hop2 { --rd: 1.05s; }
.js .beat figure .hop3 { --rd: 2.1s; }
.js .beat figure .hop4 { --rd: 3.15s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .beat figure .stage { opacity: 1 !important; }
  .js .beat figure .flow { stroke-dashoffset: 0 !important; }
  .js .beat figure .grow { transform: none !important; }
  .js .beat figure .pkt { opacity: 1 !important; animation: none !important; transform: translate(var(--ride, 0px), var(--rise, 0px)) !important; }
  .js .beat figure .latch { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ---------- look underneath ---------- */
details.under { max-width: var(--wide); margin: 2rem 0 0; border-radius: 16px; background: var(--surface); }
details.under > summary { list-style: none; cursor: pointer; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding: .9rem 1.1rem; display: flex; align-items: center; gap: .7rem; user-select: none; border-radius: 16px; }
details.under > summary::-webkit-details-marker { display: none; }
details.under > summary::before { content: "+"; font-size: .95rem; line-height: 1; color: var(--cast-a); font-weight: 700; width: .7rem; text-align: center; }
details.under[open] > summary::before { content: "\2212"; }
details.under > summary:hover { color: var(--ink); }
details.under > summary:focus-visible { outline-offset: -2px; }
.under-body { padding: 0 1.1rem 1.4rem; border-top: 1px solid var(--rule-soft); font-family: var(--mono); font-size: .84rem; line-height: 1.7; color: var(--ink-2); }
.under-body > *:first-child { margin-top: 1.1rem; }
.under-body p { margin: 0 0 .9rem; max-width: 52rem; }
.under-body p:last-child { margin-bottom: 0; }
.under-body strong { color: var(--ink); font-weight: 600; }
.under-body h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin: 1.6rem 0 .7rem; font-weight: 500; }
.under-body ul { margin: 0 0 .9rem; padding-left: 1.1rem; max-width: 52rem; }
.under-body li { margin-bottom: .45rem; }
pre.script { background: var(--surface-2); border-radius: 10px; padding: .9rem 1rem; overflow-x: auto; font-family: var(--mono); font-size: .78rem; line-height: 1.75; margin: 0 0 1rem; color: var(--ink); }
pre.script .cmt { color: var(--ink-3); }
pre.script .op { color: var(--cast-a); }

/* ---------- close ---------- */
.outro { border-top: 1px solid var(--rule-soft); padding: clamp(3.5rem, 9vh, 6rem) 0 0; }
.outro h2 { font-family: var(--display); font-weight: 650; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 1.2rem; max-width: 22ch; }
.ledger { max-width: var(--wide); border-radius: 18px; overflow: hidden; margin: 2rem 0 0; background: var(--surface); }
.ledger-row { display: grid; grid-template-columns: 11rem 1fr; gap: 1.2rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule-soft); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: .3rem; }
.ledger-row dd { margin: 0; font-size: 1rem; }
@media (max-width: 40rem) { .ledger-row { grid-template-columns: 1fr; gap: .4rem; } }

.next-up { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: var(--wide); margin: 3rem 0 0; }
.next-up a { display: block; background: var(--surface); border-radius: 18px; padding: 1.1rem 1.2rem; text-decoration: none; }
.next-up a:hover { background: var(--surface-2); }
.next-up small { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem; }
.next-up strong { font-family: var(--display); font-size: 1.2rem; font-weight: 650; letter-spacing: -.02em; }
.next-up .to-next { text-align: right; }
@media (max-width: 40rem) { .next-up { grid-template-columns: 1fr; } .next-up .to-next { text-align: left; } }

.colophon { margin-top: 3.5rem; font-family: var(--mono); font-size: .72rem; line-height: 1.75; color: var(--ink-3); max-width: 38rem; border-top: 1px solid var(--rule-soft); padding-top: 1.4rem; }
.colophon a { color: var(--cast-a); }

.site-foot { max-width: var(--wide); margin: 0 auto; padding: 1.6rem 1.5rem 2.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); border-top: 1px solid var(--rule-soft); }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* ---------- index ---------- */
.levels { display: grid; gap: 3rem; margin-top: 1rem; }
.level-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.level-head h2 { font-family: var(--display); font-weight: 650; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; margin: 0; }
.level-head p { margin: 0; color: var(--ink-3); font-size: .95rem; max-width: 30rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 8px; }
.card { display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border-radius: 20px; padding: 1.25rem 1.3rem 1.3rem; text-decoration: none; transition: transform .15s; }
.card:hover { transform: scale(.985); }
.card .num { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: .5rem; }
.card .num::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--pink)); }
.card h3 { font-family: var(--display); font-weight: 650; font-size: 1.45rem; letter-spacing: -.025em; line-height: 1.1; margin: .2rem 0 0; }
.card p { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.card .hides { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--rule-soft); font-family: var(--mono); font-size: .7rem; color: var(--ink-3); line-height: 1.6; }
.route { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); margin: 0 0 2.5rem; line-height: 1.8; }
.route a { color: var(--ink); }
.lvl-0 { --dot: var(--ink); }
.lvl-1 { --dot: #ff90e8; }
.lvl-2 { --dot: #4cc77a; }
.lvl-3 { --dot: #ffc900; }
.lvl-4 { --dot: #7db8f0; }
.level-head .tag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); margin-right: .6rem; vertical-align: 2px; }

/* ---------- scroll sequences ----------
   A picture that stays pinned while short text steps scroll past it. learn.js puts
   at1..atN on the .scrolly as each step crosses the reading line, cumulative, so
   .st3 appears from step 3 on, .out3 leaves at step 3, .dim3 fades back at step 3, and .mv3 moves to its
   --mv transform at step 3. Without JS every class applies: the final state. */
.scrolly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 2rem; max-width: var(--wide); margin: 2.5rem 0; }
.scrolly-steps { padding: 18vh 0 28vh; }
.scrolly-step { min-height: 62vh; display: flex; align-items: flex-start; }
.scrolly-step:last-child { min-height: 0; }
.scrolly-step > div { background: var(--surface); border-radius: 18px; padding: 1.1rem 1.25rem; font-size: 1rem; transition: opacity .35s ease; }
.scrolly-step p { margin: 0 0 .6rem; }
.scrolly-step p:last-child { margin-bottom: 0; }
.scrolly-step .n { display: block; font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cast-a); margin-bottom: .45rem; font-weight: 600; }
.js .scrolly-step > div { opacity: .35; }
.js .scrolly-step.on > div { opacity: 1; }
.scrolly-pin { position: sticky; top: 12vh; align-self: start; }
.scrolly-pin .fig-frame { padding: 1rem; overflow: hidden; }
.scrolly svg { display: block; width: 100%; min-width: 0; height: auto; }
.scrolly figure, figure.scrolly-pin { margin: 0; }
.scrolly svg .tx { font-size: 14px; }
.scrolly svg .tx-b { font-size: 14px; }
.scrolly svg .tx-s { font-size: 12.5px; }
.scrolly figcaption { margin-top: .7rem; }

.js .scrolly svg [class] { transition: opacity .5s ease, transform .8s cubic-bezier(.4,0,.2,1), stroke-dashoffset .9s cubic-bezier(.4,0,.2,1); transform-box: view-box; }
.js .scrolly .st2, .js .scrolly .st3, .js .scrolly .st4, .js .scrolly .st5, .js .scrolly .st6, .js .scrolly .st7 { opacity: 0; }
.js .scrolly.at2 .st2, .js .scrolly.at3 .st3, .js .scrolly.at4 .st4, .js .scrolly.at5 .st5, .js .scrolly.at6 .st6, .js .scrolly.at7 .st7 { opacity: 1; }
.js .scrolly.at2 .out2, .js .scrolly.at3 .out3, .js .scrolly.at4 .out4, .js .scrolly.at5 .out5, .js .scrolly.at6 .out6, .js .scrolly.at7 .out7 { opacity: 0; }
.js .scrolly.at2 .dim2, .js .scrolly.at3 .dim3, .js .scrolly.at4 .dim4, .js .scrolly.at5 .dim5, .js .scrolly.at6 .dim6, .js .scrolly.at7 .dim7 { opacity: .2; }
.js .scrolly.at2 .mv2, .js .scrolly.at3 .mv3, .js .scrolly.at4 .mv4, .js .scrolly.at5 .mv5, .js .scrolly.at6 .mv6, .js .scrolly.at7 .mv7 { transform: var(--mv); }
html:not(.js) .scrolly [class*="out"] { display: none; }
html:not(.js) .scrolly [class*="mv"] { transform: var(--mv); }
.js .scrolly .draw { stroke-dasharray: 100; stroke-dashoffset: 100; }
.js .scrolly.at2 .st2.draw, .js .scrolly.at3 .st3.draw, .js .scrolly.at4 .st4.draw, .js .scrolly.at5 .st5.draw, .js .scrolly.at6 .st6.draw, .js .scrolly.at7 .st7.draw { stroke-dashoffset: 0; }

@media (max-width: 52rem) {
  .scrolly { grid-template-columns: 1fr; gap: 0; }
  .scrolly figure.scrolly-pin { order: -1; top: 0; z-index: 5; background: var(--paper); margin: 0 -1.5rem; padding: .5rem .5rem .4rem; }
  .scrolly-pin .fig-frame { padding: .4rem; border-radius: 14px; }
  .scrolly-pin figcaption { display: none; }
  .scrolly-steps { padding: 4vh 0 10vh; }
  .scrolly-step { min-height: 55vh; }
  .scrolly-step > div { box-shadow: 0 0 0 1px var(--rule-soft); }
}
@media (prefers-reduced-motion: reduce) {
  .js .scrolly * { transition: none !important; }
}
