/* v33 t146u: the timeline is drawn live. js/timeline.js builds the rod, stones, rings, the 0 stone and the current
   stone as SVG from one shared <defs> (gradients, fractal-noise marble, lighting filters, soft shadows); here are
   their boxes (b05 geometry times --tl-k, stones times --tl-s), the light (glow, rim light, the bead's moving
   highlight) and the type. --tl-k is set by JS (bar width / 1264, floored on phones); --tl-s = stone size (v35 t149u: 0.45, i.e.
   60% of v33's 0.75); --tl-r = the gold rod's thickness (0.6 of v33). The label offsets follow the current stone's radius (39.5 * s). */
.tl { --tl-k: 1; --tl-s: .45; --tl-r: .6; --tl-ink: #f1e8d4; --tl-mute: #efe5d3; --tl-font: "EB Garamond", Georgia, serif;
  --tl-L: calc(33px + var(--tl-s) * 39.5px);   /* the rod line, from the bar top (b05 px); v35: the labels hug the smaller stones */
  --tl-ks: calc(var(--tl-k) * var(--tl-s));
  --tl-mark-px: calc(21.5px * var(--tl-k)); --tl-mark-ls: .03em; --tl-cur-scale: 1.36; --tl-cur-ink: #fbf1dc;
  --tl-up: calc(12 + var(--tl-s) * 39.5); --tl-down: calc(16 + var(--tl-s) * 39.5); --tl-cur-up: calc(20 + var(--tl-s) * 39.5);
  --tl-pill-bg: rgba(24,12,0,.65); --tl-pill-line: rgb(140,108,70); --tl-pill-ink: #f9eee0; --tl-pill-px: calc(20px * var(--tl-k));
  --tl-rim: rgba(255,204,132,.95);
  --tl-halo: 0 0 2px rgba(0,0,0,.9), 0 0 5px rgba(0,0,0,.7);   /* v36: keeps the type legible straight over the map, no box */
  --tl-year-size: clamp(30px, 3.4vw, 48px);
  position: relative; color: var(--tl-ink); font-family: var(--tl-font); user-select: none; -webkit-user-select: none; }
.tl-bar { position: relative; height: calc((65px + var(--tl-s) * 79px) * var(--tl-k)); }
.tl-live .tl-bar { cursor: pointer; touch-action: none; }
.tl-rod { position: absolute; left: 0; top: calc((var(--tl-L) - 9.5px * var(--tl-r)) * var(--tl-k)); width: 100%; height: calc(21px * var(--tl-k) * var(--tl-r)); overflow: visible; }
.tl-nodes { position: absolute; inset: 0; pointer-events: none; }
/* every stone is a box centred on its mark on the rod line */
.tl-node, .tl-handle, .tl-glow { position: absolute; top: calc(var(--tl-L) * var(--tl-k)); left: 0; }
.tl-node { width: 0; height: 0; font-style: normal; }
/* each lit stone and the rod are rendered once into their own layer: label fades, rim light and the moving stone never re-run their filters */
.tl-node > svg, .tl-rod { will-change: transform; }
.tl-handle, .tl-rod, .tl-glow { font-style: normal; }
.tl-node > svg { position: absolute; width: calc(96px * var(--tl-ks)); height: calc(96px * var(--tl-ks)); left: calc(-48px * var(--tl-ks)); top: calc(-48px * var(--tl-ks)); overflow: visible; }
/* rim light: the side of each stone facing the current stone catches its warmth (opacity by distance, set per frame) */
.tl-rim { position: absolute; left: 0; top: calc(-2px * var(--tl-ks)); width: calc(52px * var(--tl-ks)); height: calc(49.2px * var(--tl-ks)); translate: -50% -50%; border-radius: 50%; opacity: 0;
  box-shadow: inset calc(-3.2px * var(--tl-ks)) calc(.6px * var(--tl-ks)) calc(3.6px * var(--tl-ks)) calc(-.6px * var(--tl-ks)) var(--tl-rim); pointer-events: none; will-change: opacity; }
.tl-node.ring .tl-rim { width: calc(52.4px * var(--tl-ks)); height: calc(50px * var(--tl-ks)); }
.tl-node.zero .tl-rim { width: calc(61px * var(--tl-ks)); height: calc(59px * var(--tl-ks)); }
.tl-node.ring .tl-rim-in { top: calc(.4px * var(--tl-ks)); left: calc(-.8px * var(--tl-ks)); width: calc(26px * var(--tl-ks)); height: calc(26px * var(--tl-ks));
  box-shadow: inset calc(2.2px * var(--tl-ks)) 0 calc(2.4px * var(--tl-ks)) calc(-.6px * var(--tl-ks)) var(--tl-rim); }
.tl-node.lit-l .tl-rim { scale: -1 1; }
.tl-lab { position: absolute; top: calc(var(--tl-L) * var(--tl-k)); translate: -50% 0; white-space: nowrap; font-size: var(--tl-mark-px); line-height: 0; color: var(--tl-mute);
  font-variant-caps: small-caps; letter-spacing: var(--tl-mark-ls); font-variant-numeric: lining-nums; font-weight: 400; text-shadow: var(--tl-halo); transition: opacity .25s ease, color .25s ease; }
.tl-lab.up { margin-top: calc(var(--tl-up) * -1px * var(--tl-k)); }
.tl-lab.down { margin-top: calc(var(--tl-down) * 1px * var(--tl-k)); }
.tl-lab.hid { opacity: 0; }
/* the mark under the current stone: its label rises to the pill's height, larger and lit */
.tl-lab.cur { margin-top: calc(var(--tl-cur-up) * -1px * var(--tl-k)); font-size: calc(var(--tl-mark-px) * var(--tl-cur-scale)); color: var(--tl-cur-ink); z-index: 3; }
/* the current stone's light: warm air above it, behind the stones; it breathes, and trails the motion (JS) */
.tl-glow { width: calc(300px * var(--tl-ks)); height: calc(300px * var(--tl-ks)); margin: calc(-183.5px * var(--tl-ks)) 0 0 calc(-150px * var(--tl-ks)); border-radius: 50%; pointer-events: none; will-change: transform;
  background: radial-gradient(closest-side, rgba(255,214,152,.96) 0%, rgba(255,204,138,.9) 5%, rgba(250,188,118,.76) 10%, rgba(240,172,102,.6) 15%, rgba(230,158,88,.48) 20%, rgba(220,144,74,.38) 25%, rgba(210,134,64,.3) 30%, rgba(196,120,54,.21) 38%, rgba(182,106,44,.14) 46%, rgba(166,96,40,.09) 55%, rgba(150,86,34,.05) 65%, rgba(140,80,30,.025) 75%, rgba(140,80,30,.008) 87%, rgba(140,80,30,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, rgba(0,0,0,.35) 62%, transparent 74%); mask-image: linear-gradient(to bottom, #000 50%, rgba(0,0,0,.35) 62%, transparent 74%); }
.tl-glow::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: .22; animation: tl-breathe 3.6s ease-in-out infinite; }
@keyframes tl-breathe { 0%, 100% { opacity: 0; } 50% { opacity: .22; } }
.tl-handle { width: calc(120px * var(--tl-ks)); height: calc(120px * var(--tl-ks)); margin: calc(-60px * var(--tl-ks)) 0 0 calc(-60px * var(--tl-ks)); padding: 0; border: 0; border-radius: 50%; display: block;
  background: none; z-index: 2; will-change: transform; }
.tl-handle > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tl-z0 { opacity: 0; transition: opacity .25s ease; will-change: opacity; }
.tl-handle.zero .tl-z0 { opacity: 1; }
/* the bead's highlight: a soft lamp reflection that drifts across the face as it travels (JS) */
.tl-spec { position: absolute; left: 50%; top: 50%; width: calc(40px * var(--tl-ks)); height: calc(22px * var(--tl-ks)); margin: calc(-36px * var(--tl-ks)) 0 0 calc(-24px * var(--tl-ks)); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,250,238,.5), rgba(255,246,228,.18) 55%, rgba(255,246,228,0)); pointer-events: none; will-change: transform; }
.tl-pill { position: absolute; left: 0; top: calc((var(--tl-L) - (16.5px + var(--tl-s) * 39.5px)) * var(--tl-k)); translate: -50% -50%; height: calc(30px * var(--tl-k)); box-sizing: border-box; display: flex; align-items: center;
  padding: 0 calc(15px * var(--tl-k)); border-radius: 999px; white-space: nowrap; z-index: 3; will-change: transform;
  font: 400 var(--tl-pill-px)/1 var(--tl-font); font-variant-caps: small-caps; font-variant-numeric: lining-nums; letter-spacing: .02em; color: var(--tl-pill-ink); background: var(--tl-pill-bg);
  box-shadow: inset 0 0 0 calc(1.5px * var(--tl-k)) var(--tl-pill-line); pointer-events: none; }
.tl-live .tl-handle { cursor: grab; touch-action: none; }
/* v35: the stone is small now; an invisible 44px hit area keeps it easy to grab and tap */
.tl-live .tl-handle::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(44px, 60%); height: max(44px, 60%); translate: -50% -50%; border-radius: 50%; }
.tl-drag .tl-handle { cursor: grabbing; }
.tl-handle:focus-visible { outline: 1.5px solid #f2b85a; outline-offset: calc(-26px * var(--tl-ks)); }
@media (prefers-reduced-motion: reduce) { .tl-glow::after { animation: none; } }
.tl-year { margin: 0; text-align: center; font-family: var(--tl-font); font-weight: 400; letter-spacing: .02em; font-size: var(--tl-year-size); line-height: 1.05; color: var(--tl-ink);
  font-variant-numeric: lining-nums; white-space: nowrap; text-shadow: var(--tl-halo), 0 2px 10px rgba(0,0,0,.55); }
/* where it sits: Explore (black, full width), the Spin card (dark card; a dark band over the light picker),
   the story page (on its own ivory paper, v27; the year overlapping the globe) */
/* v36 t150u: the map view (landing) shows Explore's timeline: the same full-width band, padding, "The Year" kicker
   and halo, floating straight over the map (no plaque). The roll picker keeps its own dark band (css/wheel.css). */
.ex-time, .spin-tl { padding: 14px clamp(30px, 4.6vw, 80px) 0; }
/* v48 t174u: landing .spin-tl sits on the restored dark card, so it keeps the default light ink.
   The picker's small dark plaque stays off (css/wheel.css); ink plus a cream halo on the light picker ground. */
body.is-wheel .spin-tl .tl { --tl-ink: #2b2116; --tl-mute: #3a2a18; --tl-cur-ink: #2b2116;
  --tl-halo: 0 0 3px rgba(248,240,222,.95), 0 1px 6px rgba(248,240,222,.85), 0 0 12px rgba(248,240,222,.65); }
.spin-tl { position: absolute; z-index: 5; top: 16px; left: 0; right: 0; pointer-events: none; }
.rs-tl { position: absolute; left: 0; right: 0; top: var(--top); z-index: 6; pointer-events: none; padding: 0 clamp(26px, 4.2vw, 72px); }
/* the story page: the same stones on ivory paper (the "p" set in the defs: softer, warmer shadows), dark-ink labels, the glow as warm tint */
.rs-tl .tl { --tl-halo: 0 0 0 transparent; --tl-ink: #2b2116; --tl-mute: #3a2a18; --tl-cur-ink: #2b2116; --tl-pill-bg: #2b2116; --tl-pill-line: rgba(176,128,60,.9); --tl-pill-ink: #f6e7c6; --tl-rim: rgba(255,178,96,.6); }
.rs-tl .tl-glow { mix-blend-mode: normal; background: radial-gradient(closest-side, rgba(255,190,96,.62), rgba(246,170,80,.42) 14%, rgba(232,150,64,.22) 30%, rgba(220,140,60,.09) 52%, rgba(220,140,60,0) 80%); }
/* v38 t156u: the story page writes the year once. While the big year sits on the globe the pill fades out (it comes back on the
   cards without the globe, where it is the only year). */
.rs-tl .tl-pill { transition: opacity .3s ease; } /* centred on the current stone (translate is on .tl-pill) */
.rs-tl .tl-glow { display: none; }
/* v46 t169u/t170u: the year lives in the pill on every page; hide the old "The Year 1140 CE" caption */
.tl-year { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0 !important; pointer-events: none; margin: 0 !important; }
/* v39 t158u: the current stone is BACKLIT, as if an LED ring were hidden behind it. One pre-rendered radial gradient
   (no blur filter, no canvas): a hot amber-white band hugging the rim, then a gaussian falloff, exp(-3.6 d^2) rescaled to
   reach exactly 0 (stops every 1/24 of the reach, so no ring edge and no banding), visible to about 0.7 r past the rim and exactly 0 at
   0.85 r (box radius 74 of the 120-unit handle box, rim at 40). Its centre sits 1.5 units low, a little warm spill on the paper under the stone.
   The breathe is a second layer (the hot band) fading by opacity only, on its own compositor layer; nothing repaints. */
.tl-handle { overflow: visible; }
.tl-aura { position: absolute; top: calc(var(--tl-L) * var(--tl-k)); left: 0;
  width: calc(148px * var(--tl-ks)); height: calc(148px * var(--tl-ks));
  margin: calc(-72.5px * var(--tl-ks)) 0 0 calc(-74px * var(--tl-ks));
  border-radius: 50%; pointer-events: none; z-index: 1; will-change: transform;
  background: radial-gradient(closest-side,
    rgb(255,214,132) 0, rgb(255,214,132) 50.00%, rgba(255,214,132,0.980) 54.1%, rgba(253,209,126,0.974) 56.0%, rgba(252,204,120,0.955) 57.9%,
    rgba(250,200,114,0.925) 59.8%, rgba(249,195,108,0.884) 61.7%, rgba(247,190,101,0.834) 63.6%, rgba(246,186,95,0.777) 65.5%, rgba(244,181,89,0.714) 67.5%,
    rgba(242,176,83,0.648) 69.4%, rgba(241,171,77,0.580) 71.3%, rgba(239,166,71,0.512) 73.2%, rgba(238,162,65,0.445) 75.1%, rgba(236,157,58,0.382) 77.0%,
    rgba(235,152,52,0.323) 78.9%, rgba(233,148,46,0.268) 80.9%, rgba(232,143,40,0.219) 82.8%, rgba(230,138,34,0.176) 84.7%, rgba(230,138,34,0.138) 86.6%,
    rgba(230,138,34,0.105) 88.5%, rgba(230,138,34,0.078) 90.4%, rgba(230,138,34,0.055) 92.3%, rgba(230,138,34,0.036) 94.3%, rgba(230,138,34,0.021) 96.2%,
    rgba(230,138,34,0.009) 98.1%, rgba(230,138,34,0.000) 100.0%); }
.tl-aura::after { content: ""; position: absolute; inset: 0; border-radius: 50%; will-change: opacity; animation: tl-aura 3.6s ease-in-out infinite;
  background: radial-gradient(closest-side, rgba(255,232,170,0) 49%, rgba(255,236,180,.85) 54.5%, rgba(255,222,150,.45) 61%, rgba(250,200,110,.12) 69%, rgba(250,200,110,0) 77%); }
@keyframes tl-aura { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tl-aura::after { animation: none; opacity: .7; } }
/* v42 t161u: .rs-tl .tl-year is visually hidden above; the pill carries the year */
@media (max-width: 740px) {
  .tl { --tl-mark-px: max(12px, calc(20.5px * var(--tl-k))); --tl-pill-px: max(11.5px, calc(19px * var(--tl-k))); }
  .spin-tl { top: 8px; }
  body:has(#spin-tl .tl) .crest { display: none; }   /* the timeline takes the crest's place at the top */
  .rs-tl { padding: 0 18px; }
}
/* the Spin card's own year line gives way to the timeline's year */
body:has(#spin-tl .tl) .result .year-label, body:has(#spin-tl .tl) #year { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* v29: Explore's big year gets the mockup's small-caps kicker */
#ex-time .tl-year::before, body:not(.is-wheel) #spin-tl .tl-year::before { content: "The Year"; display: block; margin-bottom: 2px; font-size: 15px; line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .14em; color: var(--tl-mute); text-shadow: var(--tl-halo); }
@media (max-width: 740px) { #ex-time .tl-year::before, body:not(.is-wheel) #spin-tl .tl-year::before { font-size: 12.5px; } }
/* v30: on the roll picker the plaque must stay clear of the place name under it: a smaller timeline, the year in the pill */
@media (min-width: 741px) { body.is-wheel .spin-tl .tl { --tl-kmax: .6; } body.is-wheel .spin-tl .tl-year { display: none; } }
