/*
 * The decades as a time-lapse — home page §G.
 *
 * An axonometric city in the register of §C's diagram, redrawn by era so
 * each decade reads at a glance (the plan is in js/decades.js): ink-brick
 * blocks and streetcar fingers, then cars and a ring of houses, freeways
 * cutting through and lots, glass towers and a mall, light rail returning
 * along the old streets, infill, towers. The eight decades are stations on
 * a strip map; a range input scrubs between them.
 *
 * Motion, in one place: a timing scale of four steps (--ms-flip 120,
 * --ms-swap 240, --ms-rise 480, --ms-draw 960; a decade turns over --ms-turn
 * = --ms-draw) and three curves: --ease-land for what arrives (an opacity
 * flip, a cluster settling), --ease-rise for a building topping out and for
 * text landing, --ease-swap for a front moving across the ground (a line
 * drawing or retreating), --ease-move for a building coming down. Every
 * still thing gets one class toggled per decade and a transition carries
 * it: a building rises out of its footprint and collapses back into it, a
 * line draws along its geometry and retreats the way it came, a flat thing
 * fades — each delayed by its own --din / --dout so a decade's growth
 * ripples out from the core and a freeway's blocks fall as the ribbon
 * reaches them. Moving things are CSS animations on offset-path polylines in
 * a second, promoted SVG; a mover out of its era is paused and hidden, one
 * leaving fades at the turn, one arriving fades in at the landing, and one
 * that spans both eras never stops. The two SVGs ride in one .tl-cam that
 * breathes — a slow composited push-in — so the eight states read as one
 * shot. No script runs per frame except the year counter, for --ms-turn at
 * a decade turn.
 */

.timelapse {
  --ms-flip: 120ms;
  --ms-swap: 240ms;
  --ms-rise: 480ms;
  --ms-draw: 960ms;
  --ms-turn: 960ms;
  --ease-land: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-rise: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-swap: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  display: grid;
  gap: 1.25rem;
  margin: 0.5rem 0 2.25rem;
}
@media (min-width: 960px) {
  .timelapse { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; }
  .tl-stage { grid-column: 1; grid-row: 1; }
  .tl-readout { grid-column: 2; grid-row: 1; }
  .tl-strip { grid-column: 1 / -1; grid-row: 2; }
}

/* ── The stage ────────────────────────────────────────────────────────── */

.tl-stage {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--map-ground);
  overflow: hidden;
  /* The few colours the periods need beyond the site's: ink-brick for
     1920's blocks, glass for 1975's towers, the countryside, asphalt and
     rails, the blue roofs of the infill. Route colours are used ONLY for
     the transit lines and what runs on them. */
  --tl-brick: #7E4A3F;
  --tl-brick-2: #A2655A;
  --tl-brick-top: #E9D9D3;
  --tl-new: #7D9BB8;
  --tl-new-2: #A4BBD1;
  --tl-new-top: #D7E6F3;
  --tl-glass: #9DB6CB;
  --tl-glass-2: #C3D4E2;
  --tl-glass-top: #F1F6FA;
  --tl-field: #E3E8DD;
  --tl-fieldline: #D2D9CC;
  --tl-asphalt: #8F99A4;
  --tl-asphalt-2: #AAB3BC;
  --tl-rail: #7A8591;
  --tl-smoke: #8E98A3;
  --tl-strip: #D6CFB3;
  --tl-tree: #7FB58C;
  --tl-bike: #3F8F5E;
  --tl-car: var(--ink-3);
  --tl-car-2: var(--ink-4);
  --tl-plane: var(--ink-2); --tl-shadow: #1B1F24; --tl-shadow-a: 0.13; --tl-kerb: #C9D1D8; --tl-bank: #D0D8C8; --tl-win: #4A2E28; --tl-win-a: 0.55; --tl-slab: #B9BFC4; --tl-slab-2: #D5D9DC; --tl-slab-top: #F0F2F3; --tl-house: #F2EEE8; --tl-house-2: #D9D3CB; --tl-house-top: #FBF9F6; --tl-roof-green: #B9D8B6;
}
@media (prefers-color-scheme: dark) {
  .tl-stage { --tl-shadow: #000000; --tl-shadow-a: 0.38; --tl-kerb: #222C38; --tl-bank: #182018; --tl-win: #E8C77A; --tl-win-a: 0.7; --tl-slab: #3A424B; --tl-slab-2: #4B545E; --tl-slab-top: #1A2027; --tl-house: #2E3640; --tl-house-2: #222932; --tl-house-top: #161B22; --tl-roof-green: #2A5A3A;
    --tl-brick: #5A352D;
    --tl-brick-2: #7A473C;
    --tl-brick-top: #2A1F1D;
    --tl-new: #2F4E6B;
    --tl-new-2: #3E668A;
    --tl-new-top: #142230;
    --tl-glass: #2B4B66;
    --tl-glass-2: #3A6184;
    --tl-glass-top: #0F1B26;
    --tl-field: #121A14;
    --tl-fieldline: #1A241C;
    --tl-asphalt: #2C3542;
    --tl-asphalt-2: #3A4554;
    --tl-rail: #4A5564;
    --tl-smoke: #6B7682;
    --tl-strip: #3A382C;
    --tl-tree: #2E6B3E;
    --tl-bike: #4FBF87;
    --tl-car: var(--ink-2);
    --tl-car-2: var(--ink-3);
    --tl-plane: var(--ink);
  }
}
.tl-city, .tl-traffic, .tl-poster {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 960 / 600;
}
/* The camera: both SVGs ride in one wrapper that pushes in three per cent
   over 26 s and back — one composited transform, so the raster is never
   touched — and holds under reduced motion or when nothing should move. */
.tl-cam {
  position: relative;
  transform-origin: 50% 56%;
  will-change: transform;
  animation: tl-breath 26s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}
.tl-cam[data-still] { animation-play-state: paused; }
@keyframes tl-breath { from { transform: scale(1); } to { transform: scale(1.03); } }
/* The traffic rides over the still city in its own layer: a promoted
   transform keeps its per-frame repaint off the city's raster. */
.tl-traffic {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

/* Ground */
.tl-sky { fill: var(--map-ground); }
.tl-land { fill: var(--tl-field); }
.tl-fieldgrid { fill: none; stroke: var(--tl-fieldline); stroke-width: 0.8; }
.tl-park { fill: var(--cp-park); }
.tl-plot { fill: var(--cp-plot); }
.tl-lot { fill: var(--tl-asphalt-2); }
.tl-stripes { fill: none; stroke: var(--surface); stroke-width: 0.9; opacity: 0.8; }
.tl-kerb { fill: none; stroke: var(--tl-kerb); stroke-width: 7; stroke-linecap: square; }
.tl-kerb--art { stroke-width: 10; }
.tl-street--art { stroke-width: 8; }
.tl-street-centre { fill: none; stroke: var(--tl-kerb); stroke-width: 0.9; stroke-dasharray: 4 3; }
.tl-xing { fill: none; stroke: var(--tl-kerb); stroke-width: 1.1; stroke-linecap: butt; }
.tl-street { fill: none; stroke: var(--cp-street); stroke-width: 5; stroke-linecap: square; }
.tl-street--stub { stroke-width: 3.5; stroke-linecap: butt; }
.tl-street-bulb { fill: var(--cp-street); }
.tl-rail { fill: none; stroke: var(--tl-rail); stroke-width: 1; }
.tl-strip { fill: var(--tl-strip); }
.tl-runway { fill: var(--tl-asphalt-2); }
.tl-runway-line { fill: none; stroke: var(--surface); stroke-width: 1; stroke-dasharray: 5 4; }
.tl-apron { fill: var(--ground-3); }

/* Blocks: white tops, pale faces. 1920 in ink-brick, 1975 in glass, the
   infill beside the stations blue-roofed, 2040's towers with the accent on
   the roof. The top keeps a hairline so stacked blocks read apart. */
/* Houses are <symbol>s instanced by <use>. Inside the use-shadow tree a rule
   can only match the polygons' own classes — nothing from the <use> element's
   ancestry — so these select by face + kind, and the tokens reach them by
   inheritance from .tl-stage. */
.b-s { fill: var(--tl-shadow, #1B1F24); opacity: var(--tl-shadow-a, 0.13); }
.h-row.b-l { fill: var(--tl-brick-2); }
.h-row.b-r { fill: var(--tl-brick); }
.h-row.b-t { fill: var(--tl-brick-top); stroke: var(--tl-brick); stroke-width: 0.6; }
.h-ranch.b-l, .h-split.b-l { fill: var(--tl-house-2); }
.h-ranch.b-r, .h-split.b-r { fill: var(--tl-house); }
.h-ranch.b-t, .h-split.b-t { fill: var(--tl-house-top); stroke: var(--tl-house-2); stroke-width: 0.6; }
.h-ridge { fill: none; stroke: var(--tl-house-2); stroke-width: 0.8; stroke-linecap: round; }
.b-c { fill: none; stroke: var(--tl-brick); stroke-width: 0.7; }
.tl-b .b-l { fill: var(--ground-3); }
.tl-b .b-r { fill: var(--rule-2); }
.tl-b .b-t { fill: var(--surface); stroke: var(--rule-2); stroke-width: 0.6; }
.tl-b--brick .b-l { fill: var(--tl-brick-2); }
.tl-b--brick .b-r { fill: var(--tl-brick); }
.tl-b--brick .b-t { fill: var(--tl-brick-top); stroke: var(--tl-brick); }
.tl-b--stack .b-l { fill: var(--ink-3); }
.tl-b--stack .b-r { fill: var(--ink-2); }
.tl-b--stack .b-t { fill: var(--ink-4); stroke: none; }
.tl-b--shed .b-l { fill: var(--rule-2); }
.tl-b--shed .b-r { fill: var(--ink-4); }
.tl-b--shed .b-t { fill: var(--ground-2); stroke: var(--rule-2); }
.tl-b--terminal .b-t { fill: var(--tl-brick-top); }
.tl-b--mall .b-l { fill: var(--rule); }
.tl-b--mall .b-r { fill: var(--rule-2); }
.tl-b--mall .b-t { fill: var(--ground-2); stroke: var(--rule-2); }
.tl-b--glass .b-l { fill: var(--tl-glass-2); }
.tl-b--glass .b-r { fill: var(--tl-glass); }
.tl-b--glass .b-t { fill: var(--tl-glass-top); stroke: var(--tl-glass); }
.tl-b--new .b-l { fill: var(--tl-new-2); }
.tl-b--new .b-r { fill: var(--tl-new); }
.tl-b--new .b-t { fill: var(--tl-new-top); stroke: var(--tl-new); }
.tl-b--tower .b-l { fill: var(--ground-3); }
.tl-b--tower .b-r { fill: var(--ink-4); }
.tl-b--tower .b-t { fill: var(--accent-bg); stroke: var(--accent); stroke-width: 0.8; }
.tl-b--slab .b-l { fill: var(--tl-slab-2); }
.tl-b--slab .b-r { fill: var(--tl-slab); }
.tl-b--slab .b-t { fill: var(--tl-slab-top); stroke: var(--tl-slab); }
/* What a type carries beyond its faces: its shadow (b-s), window and floor
   rows (b-w), a cornice (b-c), a planted roof deck (b-g). */
.tl-b .b-s { fill: var(--tl-shadow); opacity: var(--tl-shadow-a); }
.tl-b .b-w { fill: none; stroke: var(--tl-win); stroke-width: 1.1; stroke-dasharray: 1.6 1.9; opacity: var(--tl-win-a); }
.tl-b--glass .b-w { stroke: var(--tl-glass-top); stroke-dasharray: none; stroke-width: 0.7; opacity: 0.8; }
.tl-b--slab .b-w { stroke: var(--tl-win); stroke-dasharray: 3.2 1.4; stroke-width: 1.2; }
.tl-b--new .b-w, .tl-b--tower .b-w { stroke: var(--tl-new-top); stroke-dasharray: 1.4 1.4; stroke-width: 0.8; opacity: 0.7; }
.tl-b--tower .b-w { stroke: var(--surface); }
.tl-b .b-c { fill: none; stroke: var(--tl-brick-top); stroke-width: 1.2; opacity: 0.9; }
.tl-b .b-g { fill: var(--tl-roof-green); }
/* Houses: the row houses in a paler brick, the ranches and splits in
   clapboard, every ridge a hairline. */
.tl-h .b-l.h-row { fill: var(--tl-brick-2); }
.tl-h .b-r.h-row { fill: var(--tl-brick); }
.tl-h .b-t.h-row { fill: var(--tl-brick-top); stroke: var(--tl-brick); stroke-width: 0.45; }
.tl-h .b-l { fill: var(--tl-house); }
.tl-h .b-r { fill: var(--tl-house-2); }
.tl-h .b-t { fill: var(--tl-house-top); stroke: var(--ink-4); stroke-width: 0.45; }
.tl-h .h-ridge { fill: none; stroke: var(--ink-4); stroke-width: 0.7; stroke-linecap: round; }
.tl-h .b-c { stroke-width: 0.8; }
/* Trees: a canopy over its own shadow. */
.tl-canopy .t-c { fill: var(--tl-tree); }
.tl-canopy .b-s { fill: var(--tl-shadow); opacity: var(--tl-shadow-a); }

/* Roads and lines. The freeway is a ribbon: a dark edge under a lighter
   bed, a dashed centre on top. */
.tl-bank { fill: none; stroke: var(--tl-bank); stroke-width: 24; stroke-linecap: butt; }
.tl-bank.at { stroke-width: 32; }
.tl-freeway { fill: none; stroke: var(--tl-asphalt); stroke-width: 12; stroke-linecap: butt; stroke-linejoin: round; }
.tl-freeway.at { stroke-width: 19; }
.tl-ramp { fill: none; stroke: var(--tl-asphalt); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.tl-freeway-line { fill: none; stroke: var(--surface); stroke-width: 1.1; stroke-dasharray: 6 5; opacity: 0.85; }
.tl-blvd { fill: none; stroke: var(--cp-street); stroke-width: 9; }
.tl-median { fill: none; stroke: var(--tl-tree); stroke-width: 2.4; }
.tl-trees { fill: var(--tl-tree); }
.tl-asphalt { fill: none; stroke: var(--tl-asphalt-2); stroke-width: 3; stroke-linecap: round; }
.tl-tram { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.tl-stop { fill: var(--surface); stroke-width: 1.8; }
.tl-busline { fill: none; stroke: var(--line-orange); stroke-width: 1.8; stroke-dasharray: 5 3; stroke-linecap: round; }
.tl-brt { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.tl-brt-stop { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.tl-lrt { fill: none; stroke-width: 4.4; stroke-linecap: round; stroke-linejoin: round; }
/* A station is a platform plate laid along the line. */
.tl-station { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.tl-bikelane { fill: none; stroke: var(--tl-bike); stroke-width: 1.2; stroke-dasharray: 3 2.5; }
/* Route colours, for the lines and what runs on them only. */
.rc-red { stroke: var(--line-red-lit); }
.rc-blue { stroke: var(--line-blue-lit); }
.rc-green { stroke: var(--line-green-lit); }
.rc-purple { stroke: var(--line-purple-lit); }
/* Vehicles, people, planes and smoke: css/decades-fleet.css. */

/*
 * Still things. Hidden until their era, shown through it (.on, set by the
 * script), hidden again after it (.gone). A building rises out of its
 * footprint — scaled from the ground line of its own box, shadow and all —
 * and collapses back into it; every house is its own <use> and does the
 * same; a tree grows from its trunk; a flat thing fades; a .tl-draw line draws
 * itself along its geometry and retreats the way it came. The transition on
 * each state is the one that carries the change INTO that state, so an
 * arrival waits its --din and a departure its --dout, and both use the right
 * curve. Arriving, the opacity flips first (--ms-flip) so the mass is solid
 * while it rises; leaving, it flips last, so the thing is solid while it
 * comes down and vanishes only at the ground.
 */
.tl-city [data-era-in] {
  opacity: 0;
  transform: scaleY(0.04);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: opacity var(--ms-flip) var(--ease-swap) calc(var(--ms-swap) - var(--ms-flip)), transform var(--ms-swap) var(--ease-move);
}
.tl-city [data-era-in].on {
  opacity: 1;
  transform: none;
  transition: opacity var(--ms-flip) var(--ease-land) var(--din, 0ms), transform var(--ms-rise) var(--ease-rise) var(--din, 0ms);
}
.tl-city [data-era-in].gone {
  opacity: 0;
  transform: scaleY(0.04);
  transition: opacity var(--ms-flip) var(--ease-swap) calc(var(--dout, 0ms) + var(--ms-swap) - var(--ms-flip)), transform var(--ms-swap) var(--ease-move) var(--dout, 0ms);
}
/* A tree grows out of its trunk rather than rising as a slab (origin set per tree). */
.tl-city .tl-grow[data-era-in] { transform: scale(0.2); }
.tl-city .tl-grow[data-era-in].on { transform: none; }
.tl-city .tl-grow[data-era-in].gone { transform: scale(0.2); }
/* Flat things do not rise; they fade in place. */
.tl-city .tl-flat[data-era-in] { transform: none; transition: opacity var(--ms-swap) var(--ease-swap); }
.tl-city .tl-flat[data-era-in].on { transition: opacity var(--ms-rise) var(--ease-land) var(--din, 0ms); }
.tl-city .tl-flat[data-era-in].gone { transition: opacity var(--ms-swap) var(--ease-swap) var(--dout, 0ms); }
/* Lines that draw themselves in: the dash is the whole length (--len, set
   per element) and the offset runs it out; leaving, it runs back the way it
   came and the opacity flips only once the line has gone. A .tl-draw--fwd
   line retreats from its START instead (the freeway under the boulevard
   that repaves it from the same end). A freeway widens in place: .at, set
   by the script from data-era-at, carries its second stroke width. */
.tl-city .tl-draw[data-era-in] {
  opacity: 1;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset var(--ms-draw) var(--ease-swap), opacity var(--ms-flip) var(--ease-swap) calc(var(--ms-draw) - var(--ms-flip)), stroke-width var(--ms-rise) var(--ease-swap);
}
.tl-city .tl-draw[data-era-in].on {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--ms-draw) var(--ease-swap) var(--din, 0ms), opacity var(--ms-flip) var(--ease-land) var(--din, 0ms), stroke-width var(--ms-rise) var(--ease-swap) var(--din, 0ms);
}
.tl-city .tl-draw[data-era-in].gone {
  opacity: 0;
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset var(--ms-draw) var(--ease-swap) var(--dout, 0ms), opacity var(--ms-flip) var(--ease-swap) calc(var(--dout, 0ms) + var(--ms-draw) - var(--ms-flip)), stroke-width var(--ms-rise) var(--ease-swap);
}
.tl-city .tl-draw--fwd[data-era-in].gone { stroke-dashoffset: calc(-1 * var(--len)); }
/* Scrubbing by hand: the same curves at --ms-swap (lines at --ms-rise), the
   opacity flips kept short, and a third of the stagger, so the control
   feels attached to the picture. Property order follows the rules above. */
.tl-city[data-hand] [data-era-in] { transition-duration: var(--ms-flip), var(--ms-swap); transition-delay: calc(var(--ms-swap) - var(--ms-flip)), 0ms; }
.tl-city[data-hand] [data-era-in].on { transition-delay: calc(var(--din, 0ms) * 0.3), calc(var(--din, 0ms) * 0.3); }
.tl-city[data-hand] [data-era-in].gone { transition-delay: calc(var(--dout, 0ms) * 0.3 + var(--ms-swap) - var(--ms-flip)), calc(var(--dout, 0ms) * 0.3); }
.tl-city[data-hand] .tl-flat[data-era-in] { transition-duration: var(--ms-swap); transition-delay: 0ms; }
.tl-city[data-hand] .tl-flat[data-era-in].on { transition-delay: calc(var(--din, 0ms) * 0.3); }
.tl-city[data-hand] .tl-flat[data-era-in].gone { transition-delay: calc(var(--dout, 0ms) * 0.3); }
.tl-city[data-hand] .tl-draw[data-era-in] { transition-duration: var(--ms-rise), var(--ms-flip), var(--ms-swap); transition-delay: 0ms, calc(var(--ms-rise) - var(--ms-flip)), 0ms; }
.tl-city[data-hand] .tl-draw[data-era-in].on { transition-delay: calc(var(--din, 0ms) * 0.3), calc(var(--din, 0ms) * 0.3), calc(var(--din, 0ms) * 0.3); }
.tl-city[data-hand] .tl-draw[data-era-in].gone { transition-delay: calc(var(--dout, 0ms) * 0.3), calc(var(--dout, 0ms) * 0.3 + var(--ms-rise) - var(--ms-flip)), 0ms; }

/* Moving things — the gating, clocks and keyframes of every mover — are
   css/decades-fleet.css (js/decades-fleet.js draws them). */

/* The year on the picture, and the era's name under it, on the stage's
   top-left: Barlow figures, a mono caption, the way a plate is lettered. */
.tl-yearmark {
  position: absolute;
  inset-block-start: 0.6rem;
  inset-inline-start: 0.9rem;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transform-origin: 0 70%;
}
.tl-caption {
  position: absolute;
  inset-block-start: calc(0.6rem + clamp(2.6rem, 5vw, 4rem) + 0.35rem);
  inset-inline-start: 0.9rem;
  margin: 0;
  padding: 0.2rem 0.45rem;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  pointer-events: none;
}

/* Without the script the stage holds the baked poster of 1920 — the same
   drawing, from the same code (site/tools/bake-decades.mjs) — and the
   readout and strip stay hidden; the ledger beneath is the section. */
.timelapse.is-static .tl-readout, .timelapse.is-static .tl-strip { display: none; }
.timelapse.is-static .tl-stage { grid-column: 1 / -1; }

/* ── The readout ──────────────────────────────────────────────────────── */

.tl-readout {
  padding: 1rem 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-inline-start: 6px solid var(--line-green-lit);
  min-block-size: 16rem;
  transform-origin: 0 0;
}
.tl-readout__years {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tl-readout__years span { display: inline-block; transform-origin: 0 70%; }
.tl-readout h3 { font-size: 1.75rem; line-height: 1.05; margin: 0 0 0.6rem; transform-origin: 0 70%; }
.tl-readout__blurb { color: var(--ink-2); font-size: 0.9375rem; margin: 0 0 0.9rem; }
.tl-params {
  margin: 0;
  display: grid;
  gap: 0.35rem 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
  font-size: 0.8125rem;
}
.tl-params div { display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem; align-items: baseline; }
.tl-params dt { color: var(--ink-3); }
.tl-params dd { margin: 0; color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tl-params dd.text { font-family: var(--ui); }

/* ── The strip map ────────────────────────────────────────────────────── */

.tl-strip {
  --era-c: var(--line-green-lit);
  --at: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1.25rem;
  align-items: center;
}
.tl-track { position: relative; padding-block: 0.6rem 0; }
/* The range sits over the line and the rings only, so the year buttons
   beneath stay clickable; a click on the line snaps to the nearest station. */
.tl-scrub {
  position: absolute;
  inset: 0 0 auto 0;
  block-size: 1.6rem;
  inline-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.tl-scrub:focus-visible + .tl-stations { outline: 2px solid var(--accent); outline-offset: 6px; }
.tl-stations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  position: relative;
}
/* The line, run through the whole row; ink fills from the first station
   to the current decade on the year counter's clock — linear, over the
   turn — so the strip reads as a progress, not a decoration. */
.tl-stations::before {
  content: "";
  position: absolute;
  inset-block-start: 0.45rem;
  inset-inline: 6%;
  block-size: 6px;
  background: var(--era-c);
}
.tl-stations::after {
  content: "";
  position: absolute;
  inset-block-start: 0.45rem;
  inset-inline-start: 6%;
  block-size: 6px;
  inline-size: 88%;
  transform: scaleX(calc(var(--at, 0) / 7));
  transform-origin: 0 50%;
  background: var(--ink);
  pointer-events: none;
  transition: transform var(--ms-turn) linear;
}
.tl-strip[data-hand] .tl-stations::after { transition-duration: var(--ms-swap); }
.tl-stations li { position: relative; text-align: center; }
.tl-stations button {
  all: unset;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  inline-size: 100%;
  cursor: pointer;
  padding-block: 0.25rem 0.1rem;
  color: var(--ink-2);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* The station: a ring on the line; the current one filled. */
.tl-stations button::before {
  content: "";
  inline-size: 1rem;
  block-size: 1rem;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--era-c);
  box-sizing: border-box;
  transition: background var(--ms-swap) var(--ease-swap), transform var(--ms-swap) var(--ease-swap);
}
.tl-stations button:hover { color: var(--ink); }
.tl-stations button[aria-current="true"] { color: var(--ink); }
.tl-stations button[aria-current="true"]::before { background: var(--ink); border-color: var(--ink); transform: scale(1.2); }
.tl-stations button:focus-visible::before { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 619.98px) {
  .tl-stations button { font-size: 0.8125rem; }
}

/* Under 480px the strip map gives way to a plate-styled select: eight
   stations across a 358px track are 43px apart, under the tap floor. */
.tl-pick { display: none; }
@media (max-width: 479.98px) {
  .tl-track { display: none; }
  .tl-pick {
    display: flex;
    align-items: center;
    gap: 0;
    min-inline-size: 0;
  }
  .tl-pick > span {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    padding: 0 0.8rem;
    background: var(--ink);
    color: var(--ground);
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    flex: none;
  }
  .tl-select {
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 auto;
    min-inline-size: 0;
    min-block-size: 2.75rem;
    padding: 0.5rem 2.4rem 0.45rem 0.9rem;
    border: 2px solid var(--ink);
    border-radius: 0;
    background-color: var(--surface);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: 0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.2rem) 50%, calc(100% - 0.85rem) 50%;
    background-size: 0.35rem 0.35rem;
    background-repeat: no-repeat;
  }
  .tl-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tl-strip { grid-template-columns: minmax(0, 1fr) auto; }
}

.tl-play {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  min-inline-size: 6.5rem;
  min-block-size: 2.75rem;
}
.tl-play:hover { border-color: var(--ink); }
.tl-play[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* The eight side by side, beneath — the no-script content, kept as the ledger. */
.eras-ledger { margin-top: 1.5rem; border-top: 2px solid var(--ink); }
.eras-ledger summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}
.eras-ledger summary::-webkit-details-marker { display: none; }
.eras-ledger summary::before {
  content: "+";
  font-family: var(--mono);
  font-size: 1.1rem;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ink);
  flex: none;
}
.eras-ledger[open] summary::before { content: "−"; }
.eras-ledger summary small { font-family: var(--ui); font-weight: 400; font-size: 0.875rem; color: var(--ink-3); }
/* Without the script the ledger is the section: show it open, hide the summary's toggle. */
.eras-ledger:not([data-js]) summary::before { display: none; }

/* ── Motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .tl-city [data-era-in] { transition: none !important; }
  .tl-stations button::before { transition: none; }
  .tl-stations::after { transition: none; }
  /* A still frame of each decade: the camera holds, nothing moves (the
     traffic's own rule is in decades-fleet.css), the scrubber still
     changes the decade. */
  .tl-cam { animation: none; }
}
