/* ============================================================================
   Kent Applied Design System: ka-scenes.css (v1, 2026-10-29)
   The scene kit for scroll stories: a data story at /research/<slug>/ (ops/build_research_piece.py, type
   data-story) and anything else built from the same markup. Motion: ka-scenes.js; the motif: ka-comet.js.
   Rules, when to use each scene and the authoring syntax: site/DESIGN.md "Scene kit" and
   design-notes/RESEARCH_STORYTELLING.md. Samples: /design/samples/scenes/.

   Markup, in page order (the builder writes it; every scene is its figure, then its steps):
     <section class="ds" data-ka-plugins="ScrollTrigger Flip">
       <div class="ds-scene" data-kind="beside|over|grid" data-side="left|right" [data-reveal] [data-zoom] [data-morph]>
         <div class="ds-fig"> a library figure (build_charts.figure_html) </div>
         <div class="ds-steps"> <div class="step ds-step [ds-hasnum] [ds-rv] [ds-fact]"><div class="txt">...</div></div> ... </div>
     A step whose text opens with a bold phrase carries it as its headline: <p class="ds-lead"><strong class="ds-num">
     19.1% to 34.3%</strong> of the stays ...</p>. The headline is part of the sentence, so the page reads the same
     without styles.

   Scenes (data-kind, plus modifiers):
     beside   the figure holds still on one side while the step cards scroll past on the other; data-side="left"
              puts the cards on the left. The default, and the one readers learn first.
     over     a takeover: the figure takes the top of the screen on a tinted band and the card being read waits in the
              dock under it, so no card ever crosses the chart (12 Nov 2026; until then the cards crossed it).
     grid     an interlude that does not hold still: the figure at full width in the flow, then the steps as a grid
              of cards (fact cards are small charts with a callout number), each rising into place; on a wider screen
              three to seven of them are an insight cloud.
   Every card has one entrance (the card being read rises into place) and the live border; no figure ever scrolls inside
   itself. Rules: site/DESIGN.md "Scene kit", "The rules of the scroll" (Tyler on D44, 12 Nov 2026, and Tyler's
   scrollytelling guide).
     reveal   (with over) the scene opens on its numbers: the leading steps that carry a headline number (.ds-rv) are
              big centered statements over an empty stage, and the figure takes the stage at the first step that
              does not.
     zoom     a pick moves the camera: the plot scales to the marks it picks out (a region of a tile map), and a step
              that picks nothing pulls back out.
     morph    (with over) the figure starts full width with the first step over it, then moves aside (GSAP Flip) and
              the scene continues as beside; scrolling back reverses it.

   Without .ds-live (no JavaScript, reduced motion, print) every scene reads straight down at the article column's
   width: its figure (the live chart, or its PNG and data table without JavaScript), then its text. Layout only;
   every color, radius, shadow and size is a ka.css token. GSAP moves transform and opacity only, and nothing here
   transitions those on an element GSAP moves.
   ========================================================================== */
.ds,.ds-scene,.ds-fig,.ds-steps{box-sizing:border-box}
.ds{margin:clamp(1.75rem,4vw,2.75rem) 0 clamp(1.25rem,3vw,2rem)}

/* ---------- the headline of a step: a number or a short phrase, then the rest of its sentence ---------- */
.ds .ds-lead{margin:0}
.ds .ds-num{display:block;font:600 clamp(2.125rem,3.4vw,2.875rem)/1.02 var(--disp);letter-spacing:-.03em;color:var(--ink);font-variant-numeric:tabular-nums;margin:0 0 .5rem;text-wrap:balance}
.ds .ds-num.is-word{font-size:clamp(1.5625rem,2.4vw,1.9375rem);line-height:1.15;letter-spacing:-.015em}
/* a keyword that is also the legend ([[words|d4]] in piece.md): ink text, a dot in the series color before it */
.ds .ds-key{white-space:nowrap;font-weight:600;color:var(--ink)}
.ds .ds-key::before{content:"";display:inline-block;width:.62em;height:.62em;margin:0 .32em .1em .05em;border-radius:50%;vertical-align:middle;background:var(--k,var(--d2));box-shadow:0 0 0 2px var(--surface)}
.ds .ds-key-d1{--k:var(--d1)}.ds .ds-key-d2{--k:var(--d2)}.ds .ds-key-d3{--k:var(--d3)}.ds .ds-key-d4{--k:var(--d4)}.ds .ds-key-dim{--k:var(--data-dim)}

/* ---------- read straight down ---------- */
.ds:not(.ds-live) .ds-scene{max-width:47.5rem;margin:0 auto;padding:0 var(--gutter)}
.ds:not(.ds-live) .ds-scene+.ds-scene{margin-top:clamp(2.5rem,6vw,4rem)}
.ds:not(.ds-live) .ds-fig{margin:0 0 1.625rem}
.ds:not(.ds-live) .ds-steps{padding:0}
.ds:not(.ds-live) .step{display:block;min-height:0;padding:0}
.ds:not(.ds-live) .step .txt{max-width:none;padding:0;border:0;border-radius:0;background:none;box-shadow:none;translate:none}
.ds:not(.ds-live) .step p,.ds:not(.ds-live) .step li{font-size:1.0625rem;line-height:1.65;color:var(--body)}
.ds:not(.ds-live) .step p{margin:0 0 1.125rem}
.ds:not(.ds-live) .step p+p{margin-top:0}
.ds:not(.ds-live) .ds-fact .datafig{margin:.375rem 0 1.625rem}
.ds:not(.ds-live) .ds-num{margin-top:.375rem}
/* the scene's heading reads as the article's h2 does (the first step carries it) */
.ds .step h2{font-size:var(--fs-2xl);line-height:1.2;max-width:30ch;margin:0 0 .875rem}
.ds .step ul,.ds .step ol{margin:0 0 .875rem 1.25rem;padding:0}
.ds .step li{margin-bottom:.375rem}
.ds .step a{overflow-wrap:anywhere}

/* ---------- the live story: one grid per scene ---------- */
.ds.ds-live{max-width:77.5rem;margin-inline:auto;padding:0 var(--gutter)}
.ds-live .ds-scene{position:relative;display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);column-gap:clamp(1.75rem,3vw,3rem);align-items:start}
.ds-live .ds-scene+.ds-scene{margin-top:clamp(1.5rem,6vh,4.5rem)}
/* a held chart keeps the height ka.css reserves for it until it draws (ka-scenes.js renders it when its scene is near) */
html.js [data-ds-held][style*="--kch"]:not(.kc-drawn){min-height:var(--kch)}
@media (min-width:606px){html.js [data-ds-held][style*="--kchw"]:not(.kc-drawn){min-height:var(--kchw)}}
/* the figure holds still while its scene's steps pass, then leaves with the scene */
.ds-live .ds-fig{grid-area:1/1;position:sticky;top:calc(var(--hdr-h) + 1rem);height:calc(100svh - var(--hdr-h) - 2rem);display:flex;align-items:center;justify-content:center;z-index:0;min-width:0}
/* a figure never scrolls inside itself (Tyler on D44, 12 Nov 2026: a chart with its own scrollbar took the wheel meant
   for the story, and one under the cards could never be used). ka-scenes.js fits each chart to its frame (scaled down a
   little, or behind a window that the step moves) and the frame clips the rest, so a wheel or a trackpad over a figure
   always moves the page. The table and the source line wait in the page (the straight-down reading, the chart's own page) */
.ds-live .ds-fig .datafig{width:100%;max-height:100%;overflow:hidden;overflow:clip;padding:clamp(1rem,1.8vw,1.5rem);margin:0}
.ds-live .ds-scene:not([data-kind=grid]) .ds-fig .datafig-table,.ds-live .ds-scene:not([data-kind=grid]) .ds-fig .kc-meta{display:none}
/* the share link sits at the right of the brand row, so a held chart gets that line back */
.ds-live:not(.ds-phone) .ds-scene:not([data-kind=grid]) .ds-fig .datafig-foot{position:relative;display:flex;justify-content:flex-end;margin-top:-2.5rem;pointer-events:none}
.ds-live:not(.ds-phone) .ds-scene:not([data-kind=grid]) .ds-fig .datafig-foot a{pointer-events:auto}
.ds-live .ds-fig .datafig-title{font-size:var(--fs-xl);line-height:1.25;max-width:none}
.ds-live .ds-fig .datafig-sub{font-size:var(--fs-sm);max-width:none}
.ds-live .ds-fig .datafig-body{margin-top:.75rem}
/* one card a screen: each step is 88vh tall with its card at its top, so the card comes to rest 26% down the screen
   (ka-scenes.js, "advancement") and the next one waits below the screen. The run-up lets the figure settle before the
   first card; the run-out lets the last card clear the reading line before the scene leaves (Tyler's scrollytelling
   guide, 3; 12 Nov 2026) */
.ds-live .ds-steps{grid-area:1/2;position:relative;z-index:2;padding:22vh 0 30vh;min-width:0}
.ds-live .step{min-height:88vh;display:flex;align-items:flex-start}
.ds-live .step .txt{max-width:40ch}
/* the cards' moves are GSAP's (ka-scenes.js). story.css's 10px translate on a card that is not active would be caught
   mid-transition when a card's entrance clears its props (GSAP folds the CSS translate into the card's transform), and
   the card stayed a few pixels off for the rest of the visit */
html.js .ds-live .step .txt{translate:none}
/* ---------- the cards: one entrance and one emphasis on every scene (Tyler on D44, 12 Nov 2026) ----------
   Tyler found the cards flying in from the left and the right "chaotic and cluttered", and asked for "electric blue and
   alive tiles of insight", in the motif of the homepage constellation, the News timeline and the comet. So: a card is
   never faded to grey (a faded card reads as disabled; Tyler's scrollytelling guide, 6). A card waiting below or already
   read sits .875rem low and a touch smaller; the card being read rises into place with a short overshoot and wears the
   live border, a comet of light that runs once round its edge as it arrives and then holds still. CSS owns these
   moves (translate and scale; GSAP never tweens a card), so a card caught mid-move by a jump simply finishes it */
@property --ds-a{syntax:"<angle>";inherits:false;initial-value:0deg}
html.js .ds-live:not(.ds-phone) .step:not(.ds-rv) .txt{background:var(--surface);box-shadow:var(--sh);transition:translate .45s cubic-bezier(.2,.9,.25,1.15),scale .45s cubic-bezier(.2,.9,.25,1.15),box-shadow var(--dur-ui) var(--ease-ui),border-color var(--dur-ui) var(--ease-ui),opacity .3s var(--ease-ui)}
html.js .ds-live:not(.ds-phone) .step.ds-fact .txt{background:none;box-shadow:none}
html.js .ds-live:not(.ds-phone) .ds-scene:not([data-kind=grid]) .step:not(.ds-rv):not(.is-active) .txt{translate:0 .875rem;scale:.985}
html.js .ds-live .step.is-active:not(.ds-rv):not(.ds-fact) .txt{border-color:var(--tint-line);box-shadow:inset .1875rem 0 0 var(--blue2),0 0 0 1px rgb(37 99 235/.08),0 1.125rem 2.75rem -.875rem rgb(29 78 216/.3),0 0 1.75rem -.375rem rgb(56 189 248/.24)}
html.js .ds-live .step.is-active.ds-fact .txt>.datafig{border-color:var(--tint-line);box-shadow:0 0 0 1px rgb(37 99 235/.08),0 1.125rem 2.75rem -.875rem rgb(29 78 216/.3),0 0 1.75rem -.375rem rgb(56 189 248/.24)}
/* the live border (also .ds-glow, for any card outside a story: the samples page, the insight cloud). A conic gradient
   masked to a 2px ring; its angle (--ds-a) turns, so the light travels round the edge with a fading tail, the comet's
   head and trail. Text stays ink on white, so contrast is unchanged. Without @property support the ring holds still */
.ds-live .step:not(.ds-rv) .txt,.ds-live .ds-fact .txt>.datafig,.ds-glow{position:relative}
.ds-live .step.ds-fact:not(.ds-rv) .txt::after{content:none}
.ds-live .step:not(.ds-rv) .txt::after,.ds-live .ds-fact .txt>.datafig::after,.ds-glow::after{content:"";position:absolute;inset:-1px;z-index:1;border-radius:inherit;padding:2px;background:conic-gradient(from var(--ds-a),rgb(56 189 248/0) 0deg 200deg,rgb(56 189 248/.45) 285deg,var(--blue2) 336deg,#7dd3fc 352deg,rgb(56 189 248/0) 360deg);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);opacity:0;transition:opacity .4s var(--ease-ui);pointer-events:none}
.ds-glow::after{opacity:1;--ds-a:150deg}
/* the light runs round once as the card arrives, then holds still: a ring that kept circling repainted the card on every
   frame, and in Chromium's phone emulation that stopped a flick's momentum at the end of a run (12 Nov 2026) */
html.js .ds-live .step.is-active:not(.ds-rv) .txt::after,html.js .ds-live .step.is-active.ds-fact .txt>.datafig::after{opacity:1;animation:ds-orbit-in 1.4s cubic-bezier(.3,.7,.2,1) both}
.ds-glow.is-live::after{opacity:1;animation:ds-orbit-in 1.4s cubic-bezier(.3,.7,.2,1) both,ds-orbit 10s linear 1.4s infinite}
/* a phone's card keeps the ring still: even the one turn on arrival held up WebKit's snapping after a swipe in testing
   (D40's mid-swipe height checks failed with it and passed without it, 12 Nov 2026) */
.ds.ds-phone .step .txt::after,.ds.ds-phone .ds-fact .txt>.datafig::after{animation:none;--ds-a:270deg}
@keyframes ds-orbit-in{from{--ds-a:-90deg}to{--ds-a:270deg}}
@keyframes ds-orbit{from{--ds-a:270deg}to{--ds-a:630deg}}
@media (prefers-reduced-motion:reduce){.ds-glow.is-live::after{animation:none}}
.ds-live .step h2{font-size:var(--fs-xl);line-height:1.25;margin:0 0 .625rem}
.ds-live .step .txt>*:last-child{margin-bottom:0}
.ds-live .step p{margin:0}
.ds-live .step p+p{margin-top:.5rem}
/* a fact card is a step of its own: the card is the step. Its statement repeats the scene's text, so the live story
   shows the number, its line, its picture and its source (the statement stays in the page for every other reader) */
.ds-live .ds-fact .txt{padding:0;border:0;background:none;box-shadow:none;max-width:25rem;width:100%}
html.js .ds-live .ds-fact.is-active .txt{box-shadow:none}
.ds-live .ds-fact .datafig{margin:0}
.ds-live .ds-fact .kf-stmt,.ds-live .ds-fact .kf-src,.ds-live .ds-fact .kc-brand{display:none}
.ds-live .ds-fact .kf-num{font-size:clamp(2.125rem,3vw,2.625rem)}
.ds-live .ds-fact .kf-card .kf-rule{margin:.75rem 0 .625rem}
.ds-live .ds-fact h2{margin:0 0 .75rem}

/* beside, cards on the left */
.ds-live .ds-scene[data-side=left]{grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr)}
.ds-live .ds-scene[data-side=left] .ds-fig{grid-area:1/2}
.ds-live .ds-scene[data-side=left] .ds-steps{grid-area:1/1}
.ds-live .ds-scene[data-side=left] .step{justify-content:flex-end}

/* over: the figure takes the top of the screen on a tinted band and the card being read sits in the dock under it, so a
   card never crosses the chart. The band runs to the window's edges with a spread shadow, which never widens the page */
.ds-live .ds-scene[data-kind=over]{grid-template-columns:minmax(0,1fr)}
.ds-live .ds-scene[data-kind=over]::before{content:"";position:absolute;top:0;bottom:0;left:calc(50% - 50vw);right:calc(50% - 50vw);z-index:-1;background:linear-gradient(180deg,var(--bg),var(--tint) 12vh,var(--tint) calc(100% - 12vh),var(--bg));pointer-events:none;transition:opacity var(--dur-sig) var(--ease-out)}
.ds-live .ds-scene[data-kind=over] .ds-fig{grid-area:1/1;align-items:flex-start}
/* the source line and the table wait in the page (straight-down reading, the chart's own page, Sources) */
.ds-live .ds-scene[data-kind=over]:not(.is-split) .ds-fig .datafig-table,.ds-live .ds-scene[data-kind=over]:not(.is-split) .ds-fig .kc-meta{display:none}
.ds-live .ds-scene[data-kind=over] .ds-fig .datafig{max-width:67.5rem;margin-inline:auto;background:color-mix(in srgb,var(--surface) 72%,transparent);border-color:var(--tint-line);box-shadow:none}
.ds-live .ds-scene[data-kind=over] .ds-steps{grid-area:1/1}
.ds-live .ds-scene[data-kind=over] .ds-fig [data-chart-src]{margin-inline:auto}
.ds-live .ds-scene[data-kind=over] .ds-fact .txt{background:none!important}
/* the dock (Tyler on D44, 12 Nov 2026: "im kinda questioning if we should ever have these things crossing in front of a
   chart, or landing in front of a chart"). The chart fits the screen above the dock (--ds-dock: the scene's tallest card,
   measured by ka-scenes.js). Each card's step is sticky at the dock, so the cards wait there one on top of the other and
   only the card being read shows: it rises into place as the one before fades. A spacer before each step (.ds-sp, put in
   by ka-scenes.js) gives every card its screen of scrolling, exactly as much as a beside step, so a morph's split moves
   nothing on the page. The figure and the last card leave together at the scene's end */
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-fig .datafig{max-height:calc(100% - var(--ds-dock,12rem) - .75rem)}
/* (and holds its place: ka-motion.js's figure entrance fades it in without its rise, which would carry it into the dock;
   a morph keeps the transform for its Flip) */
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not([data-morph]):not(.is-split) .ds-fig .datafig{transform:none!important}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-steps{padding:0}
.ds-sp{display:none}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-sp{display:block;height:calc(88vh - var(--ds-dock,12rem))}
/* the first card's run-up is the stage less the dock, so the figure has settled at the top of the screen before the first
   card can show (with a shorter one the card lit up in the dock while the chart was still rising behind it). A morph keeps
   the same run-up once split, so its split never moves the page */
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-sp.is-first{height:calc(100svh - var(--hdr-h) - 1.5rem - var(--ds-dock,12rem))}
.ds-live:not(.ds-phone) .ds-scene[data-morph].is-split .ds-steps{padding-top:calc(100svh - var(--hdr-h) - 1.5rem - var(--ds-dock,12rem))}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-sp.is-tail{height:calc(118vh - var(--ds-dock,12rem))}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv){position:sticky;top:calc(100svh - 1rem - var(--ds-dock,12rem));height:var(--ds-dock,12rem);min-height:0;display:flex;align-items:flex-start;justify-content:center;padding:.375rem 0 0}
/* a docked card is a wide caption under the chart: its headline floats at the left with the sentence beside it, so the
   dock stays short and the chart keeps most of the screen */
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv):not(.ds-fact) .txt{max-width:min(60rem,100%);width:auto}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv) .ds-lead{display:flow-root}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv) .ds-lead .ds-num{float:left;max-width:42%;margin:0 1.5rem .25rem 0}
/* a fact card in the dock is wide, with its scene's heading in a card beside it, so the dock stays short */
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-fact .txt{max-width:min(60rem,100%);width:100%;display:flex;align-items:flex-start;justify-content:center;gap:1rem}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-fact .txt>h2{flex:0 1 34%;margin:0}
.ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .ds-fact .txt>.datafig{flex:0 1 36rem;min-width:0}
html.js .ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv):not(.is-active) .txt{opacity:0;pointer-events:none}
html.js .ds-live:not(.ds-phone) .ds-scene[data-kind=over]:not(.is-split) .step:not(.ds-rv):not(.is-active) .txt *{pointer-events:none}
/* a fact card that carries its scene's heading: the heading gets a card of its own, so it never sits on the figure */
.ds-live .ds-scene[data-kind=over] .ds-fact h2{background:var(--surface);padding:.75rem 1rem;border-radius:var(--r-sm);box-shadow:var(--sh);margin:0 0 .5rem}

/* reveal: the opening numbers stand alone in the middle of the screen; the figure waits (ka-scenes.js holds it back
   while .is-revealing) */
.ds-live .ds-scene[data-reveal] .step.ds-rv{justify-content:center;align-items:center;padding:0;min-height:88vh}
html.js .ds-live .ds-scene[data-reveal] .step.ds-rv .txt{max-width:min(60rem,100%);text-align:center;background:none;border-color:transparent;box-shadow:none;translate:none;-webkit-backdrop-filter:none;backdrop-filter:none;transition:opacity .28s var(--ease-ui)}
/* an opening number gives way as the figure arrives, so the two never sit on top of each other */
html.js .ds-live .ds-scene[data-reveal] .step.ds-rv:not(.is-active) .txt{opacity:0}
.ds-live .ds-scene[data-reveal] .step.ds-rv h2{font-size:var(--fs-lg);font-family:var(--sans);font-weight:600;letter-spacing:.01em;color:var(--blue);max-width:none;margin:0 0 1.125rem}
.ds-live .ds-scene[data-reveal] .step.ds-rv .ds-num{font-size:clamp(3rem,6.2vw,5.75rem);line-height:.98;letter-spacing:-.045em;margin:0 0 1.125rem;background:var(--grad-text);-webkit-background-clip:text;background-clip:text;color:transparent}
.ds-live .ds-scene[data-reveal] .step.ds-rv .ds-lead{font-size:var(--fs-xl);line-height:1.5;color:var(--ink);text-wrap:balance;max-width:none}
.ds-live .ds-scene[data-reveal] .step.ds-rv{padding-bottom:34vh}
.ds-live .ds-scene[data-reveal] .step.ds-rv:first-child{min-height:calc(100svh - var(--hdr-h))}
.ds-live .ds-scene[data-reveal] .ds-steps{padding-top:0}

/* morph: full width first, then the figure moves aside and the cards take the right-hand column (.is-split) */
.ds-live .ds-scene[data-morph].is-split{grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr)}
.ds-live .ds-scene[data-morph].is-split::before{opacity:0}
.ds-live .ds-scene[data-morph].is-split .ds-fig{grid-area:1/1}
.ds-live .ds-scene[data-morph].is-split .ds-fig .datafig{max-width:none;background:var(--surface);border-color:var(--line);box-shadow:var(--sh)}
.ds-live .ds-scene[data-morph].is-split .ds-steps{grid-area:1/2}
.ds-live .ds-scene[data-morph].is-split .step,.ds-live .ds-scene[data-morph].is-split .step:nth-child(even){justify-content:flex-start;padding:0}
.ds-live .ds-scene[data-morph].is-flipping .ds-fig .datafig{overflow:hidden}
/* the cards wait while the figure moves aside, then fade in, so none is crossed by the moving chart */
html.js .ds-live .ds-scene[data-morph].is-flipping .step .txt{opacity:0}

/* zoom: the plot keeps its frame while the camera moves inside it */
.ds-live .ds-scene[data-zoom] .kc-plot{overflow:hidden;border-radius:var(--r-sm)}
.ds-live .ds-scene[data-zoom] .kc-plot.is-zoomed{pointer-events:none}

/* grid: an interlude in the flow. The heading's card spans the row, the figure follows at full width, then the
   cards in a grid, each arriving from its own side (ka-scenes.js) */
.ds-live .ds-scene[data-kind=grid]{grid-template-columns:repeat(auto-fit,minmax(min(100%,18.125rem),1fr));gap:1.125rem;padding:clamp(.75rem,3vh,2rem) 0}
.ds-live .ds-scene[data-kind=grid] .ds-steps{display:contents}
.ds-live .ds-scene[data-kind=grid] .ds-fig{grid-column:1/-1;grid-row:2;position:relative;top:auto;height:auto;display:block;max-width:61.25rem;width:100%;margin:0 auto .375rem}
.ds-live .ds-scene[data-kind=grid] .ds-fig .datafig{max-height:none;overflow:visible}
/* (an opened table grows with the page instead of scrolling inside itself) */
.ds-live .ds-scene[data-kind=grid] .ds-fig .table-wrap{max-height:none}
.ds-live .ds-scene[data-kind=grid] .step{min-height:0;display:block}
.ds-live .ds-scene[data-kind=grid] .step:first-child{grid-column:1/-1;grid-row:1;max-width:47.5rem;width:100%;justify-self:center}
.ds-live .ds-scene[data-kind=grid] .step .txt{max-width:none;height:100%}
html.js .ds-live .ds-scene[data-kind=grid] .step .txt{background:var(--surface);translate:none;border-color:var(--line);box-shadow:var(--sh)}
html.js .ds-live .ds-scene[data-kind=grid] .step:first-child .txt{background:none;border-color:transparent;box-shadow:none;padding:0;text-align:center}
.ds-live .ds-scene[data-kind=grid] .step:first-child h2{max-width:none;margin:0 auto .625rem}
.ds-live .ds-scene[data-kind=grid] .ds-fact .txt{max-width:none;padding:0}
html.js .ds-live .ds-scene[data-kind=grid] .ds-fact .txt{background:none;border:0;box-shadow:none}
/* the insight cloud (Tyler on D44, 12 Nov 2026: the cards under the figure as "a constellation of insights ... very
   gently floating around", the one under the cursor pulled into focus). On a wider screen with motion, ka-scenes.js
   makes a grid scene of three to seven cards a cloud (.is-cloud): the cards sit off a straight grid (--cx, --cy), each
   drifts a few pixels on its own slow loop (--dd, --dl and the --x/--y points), and faint dashed lines with twinkling
   stars join them (.ds-web), the homepage constellation at rest. A card under the pointer or holding keyboard focus stops
   drifting, rises and grows a little, wears the live border, and its lines light; the others step back a touch. Cards with
   nothing to focus inside get tabindex="0" while the cloud is on. Phones, reduced motion, print and no JavaScript keep the
   plain grid or stack */
.ds-live:not(.ds-phone) .ds-scene.is-cloud{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:clamp(1.25rem,3vh,2.25rem) clamp(1.5rem,3vw,2.75rem);padding-bottom:clamp(1.5rem,5vh,3.5rem)}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:first-child{order:1;flex:0 0 100%;max-width:47.5rem}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .ds-fig{order:2;flex:0 0 100%;margin:0 auto .375rem}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child){order:3;position:relative;z-index:1;flex:0 1 clamp(16.5rem,29%,22rem);margin-top:var(--cy,0);left:var(--cx,0)}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child) .txt{height:auto;animation:ds-drift var(--dd,16s) ease-in-out var(--dl,0s) infinite;transition:transform .5s cubic-bezier(.2,.9,.25,1.15),box-shadow var(--dur-ui) var(--ease-ui),opacity .35s var(--ease-ui)}
@keyframes ds-drift{0%,100%{translate:0 0}25%{translate:var(--x1,.25rem) var(--y1,-.375rem)}50%{translate:var(--x2,-.1875rem) var(--y2,.3125rem)}75%{translate:var(--x3,.3125rem) var(--y3,.125rem)}}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child):is(:hover,:focus-within){z-index:3}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child):is(:hover,:focus-within) .txt{animation-play-state:paused;transform:translateY(-.625rem) scale(1.045)}
html.js .ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child):not(.ds-fact):is(:hover,:focus-within) .txt,html.js .ds-live:not(.ds-phone) .ds-scene.is-cloud .ds-fact:is(:hover,:focus-within) .txt>.datafig{border-color:var(--tint-line);box-shadow:0 0 0 1px rgb(37 99 235/.08),0 1.5rem 3rem -1rem rgb(29 78 216/.34),0 0 2rem -.375rem rgb(56 189 248/.28)}
.ds-live:not(.ds-phone) .ds-scene.is-cloud .step:not(:first-child):is(:hover,:focus-within) .txt::after,.ds-live:not(.ds-phone) .ds-scene.is-cloud .ds-fact:is(:hover,:focus-within) .txt>.datafig::after{opacity:1;animation:ds-orbit-in 1.4s cubic-bezier(.3,.7,.2,1) both}
.ds-live:not(.ds-phone) .ds-scene.is-cloud:has(.step:not(:first-child):is(:hover,:focus-within)) .step:not(:first-child):not(:hover):not(:focus-within) .txt{transform:scale(.97);opacity:.82}
.ds-live .ds-scene.is-cloud .step[tabindex]{outline:none}
.ds-live .ds-scene.is-cloud .step[tabindex]:focus-visible .txt{outline:2px solid var(--blue2);outline-offset:.25rem}
.ds-web{position:absolute;inset:0;z-index:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.ds-web line{stroke:rgb(37 99 235/.2);stroke-width:1;stroke-dasharray:2 6;stroke-linecap:round;transition:stroke var(--dur-ui) var(--ease-ui)}
.ds-web line.is-lit{stroke:rgb(37 99 235/.55);stroke-dasharray:none}
.ds-web circle{fill:var(--blue2);opacity:.5;animation:ds-twinkle var(--tw,4s) ease-in-out var(--tl,0s) infinite}
@keyframes ds-twinkle{50%{opacity:.12}}

/* ---------- the line through the story (the News timeline's spine): progress, one node per scene ---------- */
.ds-spine{position:fixed;z-index:30;pointer-events:none;opacity:0;transition:opacity var(--dur-ui) var(--ease-ui)}
.ds-spine.is-on{opacity:1}
.ds-spine i{position:absolute;display:block}
.ds-spine .sp-rail{background:var(--line-2);border-radius:2px}
.ds-spine .sp-fill{background:linear-gradient(var(--sp-dir,180deg),rgb(56 189 248/0),var(--blue2));border-radius:2px;transform-origin:0 0}
.ds-spine .sp-head{width:.4375rem;height:.4375rem;border-radius:50%;background:var(--blue2);box-shadow:0 0 0 .25rem rgb(37 99 235/.14),0 0 .875rem rgb(56 189 248/.7)}
.ds-spine .sp-node{width:.5625rem;height:.5625rem;border-radius:50%;background:var(--surface);border:1.5px solid var(--line-2);transition:border-color var(--dur-ui) var(--ease-ui),background-color var(--dur-ui) var(--ease-ui),box-shadow var(--dur-ui) var(--ease-ui)}
.ds-spine .sp-node.is-lit{border-color:var(--blue2);background:var(--blue2);box-shadow:0 0 0 .25rem rgb(37 99 235/.12)}
/* wide screens: a vertical line in the left margin */
.ds-spine.is-v{left:max(.625rem,calc((100vw - 77.5rem) / 2 - 1.875rem));top:calc(var(--hdr-h) + 1.75rem);bottom:1.75rem;width:.5625rem}
.ds-spine.is-v .sp-rail{left:.21875rem;top:0;bottom:0;width:2px}
.ds-spine.is-v .sp-fill{left:.21875rem;top:0;width:2px;height:100%;transform:scaleY(var(--sp,0))}
.ds-spine.is-v .sp-head{left:1px;top:calc(var(--sp,0) * 100% - .21875rem)}
.ds-spine.is-v .sp-node{left:0;margin-top:-.28125rem}
/* narrower screens: a hairline under the header */
.ds-spine.is-h{--sp-dir:90deg;left:0;right:0;top:var(--hdr-h);height:.5625rem}
.ds-spine.is-h .sp-rail{left:0;right:0;top:0;height:.1875rem;border-radius:0;background:rgb(207 220 243/.55)}
.ds-spine.is-h .sp-fill{left:0;top:0;height:.1875rem;width:100%;border-radius:0;transform:scaleX(var(--sp,0))}
.ds-spine.is-h .sp-head{top:-2px;left:calc(var(--sp,0) * 100% - .21875rem)}
.ds-spine.is-h .sp-node{top:-.1875rem;width:.5625rem;height:.5625rem;margin-left:-.28125rem}

/* ---------- phones and narrow windows (860px and less): the phone version ----------
   Tyler, 7 Nov 2026, on D44 from an iPhone 13: cards slid under a docked chart and the reader floated past steps. The
   phone version is its own layout (ka-scenes.js adds .ds-phone at 860px and less): one step at a time, each a screen of
   its own with the scene's chart in a top band and the step's card in the band under it, and the page snaps to the next
   step while a run of steps is on screen (html.ds-snap). The chart band holds still while the scene lasts; the next card
   rises from the bottom of the screen and stops where the card before it sits, covering it, so a card only ever moves
   inside its own band and never passes under or over the chart. A scene ends by moving its whole screen up, chart and
   card together, as the next one comes up from below. Every height is the small viewport (svh: the screen with Safari's
   toolbars showing; 100vh where svh is not supported), so the toolbar collapsing never moves a card; ka-scenes.js
   measures it and writes the bands in px (--ds-s, --ds-band, --ds-cards). The site header slides away while the story is
   on screen (html.ds-in), so the story has the whole screen. Grid scenes stay an interlude that scrolls freely. */
.ds-live{--ds-vh:100vh}
@supports (height:100svh){.ds-live{--ds-vh:100svh}}
.ds-probe{position:absolute;top:0;left:0;width:1px;height:var(--ds-vh);visibility:hidden;pointer-events:none}
@media (max-width:860px){
  /* a grid card flies in from the side: clipped at the screen's edge, so it never makes the page wider for a moment (a
     sideways wobble under a thumb); clip, unlike hidden, leaves the sticky stages alone */
  .ds.ds-live{padding:0 1rem;overflow-x:clip}
  html.js .ds-live .step .txt{background:var(--surface)}
  .ds-live .step .txt{max-width:none;width:100%;padding:.875rem 1rem}
  .ds-live .step h2{font-size:var(--fs-lg)}
  .ds-live .ds-fact .txt{padding:0;max-width:none}
  .ds-live .ds-num{font-size:1.875rem}
  .ds-live .ds-num.is-word{font-size:1.4375rem}
  /* a fact card with its scene's heading: the heading gets a card of its own */
  .ds-live .ds-fact h2{background:var(--surface);padding:.75rem 1rem;border-radius:var(--r-sm);box-shadow:var(--sh);margin:0 0 .5rem}
  .ds-live .ds-fact .kf-num{font-size:1.875rem}
  .ds-live .ds-fact .kf-card .kf-rule{margin:.5rem 0 .5rem}
  /* reveal: the numbers in the middle of the screen */
  .ds-live .ds-scene[data-reveal] .step.ds-rv .ds-num{font-size:clamp(2.75rem,12.5vw,3.625rem)}
  .ds-live .ds-scene[data-reveal] .step.ds-rv .txt{padding:0 .25rem}
  html.js .ds-live .ds-scene[data-reveal] .step.ds-rv .txt{background:none;box-shadow:none}
  /* grid: one column, in the flow */
  .ds-live .ds-scene[data-kind=grid]{display:flex;flex-direction:column;gap:.875rem}
  .ds-live .ds-scene[data-kind=grid] .ds-fig{order:2;position:relative;top:auto;height:auto;padding:0}
  .ds-live .ds-scene[data-kind=grid] .ds-fig .datafig{padding:.75rem .75rem .5rem}
  .ds-live .ds-scene[data-kind=grid] .step{padding:0}
  .ds-live .ds-scene[data-kind=grid] .step:first-child{order:1}
  .ds-live .ds-scene[data-kind=grid] .step:not(:first-child){order:3}
}

/* the phone stage: every scene but a grid is a column of screens */
.ds.ds-live.ds-phone{position:relative;padding:0;max-width:none;--ds-gap:.75rem}
.ds.ds-phone .ds-scene+.ds-scene{margin-top:0}
.ds.ds-phone .ds-scene[data-kind=grid]{padding:clamp(1.75rem,6svh,3rem) 1rem}
.ds.ds-phone .ds-scene:not([data-kind=grid]){display:flex;flex-direction:column;align-items:stretch;padding:0;--ds-stage:var(--bg)}
.ds.ds-phone .ds-scene[data-kind=over]:not([data-kind=grid]){--ds-stage:var(--tint)}
.ds.ds-phone .ds-scene[data-kind=over]::before{display:none}
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-steps{display:contents}
/* the chart band: the figure holds still at the top of the screen while its scene's cards pass. Its box is a whole
   screen tall, so the scene pushes it and its cards off together at the end; what shows is its top band */
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fig{order:0;flex:none;position:sticky;top:0;z-index:1;display:block;height:var(--ds-s,var(--ds-vh));margin:0;padding:var(--ds-gap) 1rem 0;background:var(--ds-stage);box-sizing:border-box}
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fig .datafig{max-height:calc(var(--ds-band,52svh) - var(--ds-gap));overflow:hidden;margin:0 auto;max-width:40rem;padding:.625rem .75rem .5rem;background:var(--surface);border-color:var(--line);box-shadow:var(--sh)}
/* the chart holds its place in the band: ka-motion.js's figure entrance fades it in and builds it, without its rise */
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fig .datafig{transform:none!important}
.ds.ds-phone .ds-fig .datafig-label,.ds.ds-phone .ds-fig .datafig-sub,.ds.ds-phone .ds-fig .datafig-table,.ds.ds-phone .ds-fig .datafig-foot,.ds.ds-phone .ds-fig .kc-meta{display:none}
.ds.ds-phone .ds-fig .datafig-title{font-size:var(--fs-base);line-height:1.3;margin:0;max-width:none}
.ds.ds-phone .ds-fig .datafig-body{margin-top:.375rem}
.ds.ds-phone .ds-fig .kc-brand{margin-top:.25rem;padding-top:.25rem}
.ds.ds-phone .ds-fig [data-chart-src]{margin-inline:auto}
/* a chart taller than its band shows through a window (.is-window, --ds-win): the camera (ka-scenes.js) brings the rows
   the step names into view, and the window's edges fade so the reader can tell the chart goes on */
.ds-live .ds-fig.is-window .kc-plot{height:var(--ds-win);overflow:hidden;-webkit-mask-image:linear-gradient(180deg,transparent,#000 .75rem,#000 calc(100% - .75rem),transparent);mask-image:linear-gradient(180deg,transparent,#000 .75rem,#000 calc(100% - .75rem),transparent)}
/* a moved camera puts the marks where the tooltips' hit regions are not, so the plot takes no taps until it is back */
.ds-live .ds-fig .kc-plot.is-zoomed{pointer-events:none}
/* a card's screen: the band under the chart. It sticks where the card before it sits, and its solid band covers that
   card, so the cards stack in place instead of sliding under the chart */
.ds.ds-phone .ds-scene:not([data-kind=grid]) .step{order:1;flex:none;position:sticky;top:var(--ds-band,52svh);z-index:2;display:block;height:var(--ds-cards,48svh);min-height:0;margin:0;padding:var(--ds-gap) 1rem 0;background:var(--ds-stage);box-sizing:border-box;overflow:hidden;justify-content:normal;align-items:normal}
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-steps>.step:first-child:not(.ds-rv),.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-steps>.ds-rv+.step:not(.ds-rv){margin-top:calc(-1 * var(--ds-cards,48svh))}
.ds.ds-phone .ds-scene:not([data-kind=grid]) .step .txt{max-width:40rem;margin:0 auto;opacity:1}
/* a fact card in its band: its number, its line and its picture (the cite link stays on the fact's own page and in the
   straight-down reading) */
.ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fact .datafig-foot{display:none}
/* nothing fades on a phone: the card being read is the one on top */
html.js .ds.ds-phone .ds-scene:not([data-kind=grid]) .step:not(.ds-rv){opacity:1!important}
html.js .ds.ds-phone .ds-scene:not([data-kind=grid]) .step:not(.ds-rv):not(.ds-fact) .txt{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}
/* reveal: each opening number is a screen of its own, before the chart's screens */
.ds.ds-phone .ds-scene:not([data-kind=grid]) .step.ds-rv{order:-1;position:relative;top:auto;z-index:2;height:var(--ds-s,var(--ds-vh));display:flex;align-items:center;justify-content:center;min-height:0;padding:0 1.25rem 6svh;background:transparent}
.ds.ds-phone .ds-scene[data-reveal] .ds-steps{padding:0}
/* the snap points: one per step (ka-scenes.js puts them in each scene), and an entry and an exit point around each run
   of steps, so the reader can always scroll on out of the story */
.ds.ds-phone .ds-pt{position:absolute;left:0;width:1px;height:1px;pointer-events:none;visibility:hidden}
.ds.ds-phone .ds-pt.is-step,.ds.ds-phone .step.ds-rv{scroll-snap-align:start;scroll-snap-stop:always}
.ds.ds-phone .ds-pt.is-entry{scroll-snap-align:end}
.ds.ds-phone .ds-pt.is-exit{scroll-snap-align:start}
html.ds-snap{scroll-snap-type:y mandatory;scroll-padding-top:0}
/* a screen too short for two bands (a phone held sideways): the story reads down the page, each figure before its cards */
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]){display:block;padding:0 1rem}
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .ds-fig{position:relative;height:auto;padding:1rem 0 .75rem;background:none}
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .ds-fig .datafig{max-height:none}
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .step,.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .step.ds-rv{position:relative;top:auto;height:auto;margin:0;padding:0 0 .875rem;background:none}
.ds.ds-phone.is-flow .ds-pt{display:none}
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .ds-steps>.step:first-child:not(.ds-rv),.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .ds-steps>.ds-rv+.step:not(.ds-rv){margin-top:0}
.ds.ds-phone.is-flow .ds-scene:not([data-kind=grid]) .step.ds-rv{display:block;padding:1.5rem 0}
/* the site header steps aside while the story fills the screen (keyboard focus brings it back) */
html:has(.ds-phone) #hdr{transition:background-color .2s,border-color .2s,box-shadow .2s,translate .3s var(--ease-out)}
html.ds-in:has(.ds-phone:not(.is-flow)) #hdr:not(:focus-within){translate:0 calc(-100% - 2px)}
html.ds-in:has(.ds-phone:not(.is-flow)) .ds-spine.is-h{top:0}
/* the page dock (Back and Top, ka.css) stays down while the live story fills the screen: its cards are read where the
   dock sits, at the bottom of a phone screen. Keyboard focus inside it still shows it */
html:has(.ds-spine.is-on) .ka-dock:not(:has(:focus-visible)){opacity:0;translate:0 .625rem;pointer-events:none}
@media print{.ds-spine,.ka-comet{display:none!important}
  /* a phone's stage prints down the page: each figure, then its cards */
  .ds.ds-phone .ds-scene:not([data-kind=grid]){display:block}
  .ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fig,.ds.ds-phone .ds-scene:not([data-kind=grid]) .step{position:static;height:auto;margin:0;overflow:visible;background:none}
  .ds.ds-phone .ds-scene:not([data-kind=grid]) .ds-fig .datafig{max-height:none}
  .ds.ds-phone .ds-pt{display:none}}
