/* Timeline add-on: "Then & now" year scrubber, category pins, counter card */

/* scrubber */
.tl-bar { position: absolute; left: var(--chrome-left); right: calc(var(--pad) + 9.4rem + var(--safe-r)); bottom: calc(var(--pad) + 1.2rem + var(--safe-b)); z-index: 6; display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.6rem .6rem .6rem; border-radius: 99px; }   /* the glass comes from css/ux/glass.css (snapshot glass) */
body.cine .tl-bar { bottom: calc(8dvh + 1rem); z-index: 38; }
.tl-play { position: relative; flex: none; display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: var(--lg-prom); color: var(--lg-prom-fg); box-shadow: var(--lg-prom-sh); }
.tl-play svg { width: 1.5rem; height: 1.5rem; fill: currentColor; stroke: none; }
.tl-play::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); opacity: 0; pointer-events: none; }
/* an invitation, not a loop: the ring pings three times (transform + opacity only) and stops; never under reduced motion */
.tl-play:not(.playing)::after { animation: tl-ping 1.92s var(--ease-out) 3; }
@keyframes tl-ping { 0% { transform: scale(1); opacity: .8; } 60%, 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tl-play::after { animation: none !important; } }
.tl-yr { flex: none; min-width: 6.4rem; display: grid; line-height: 1; }
.tl-yr b { font: 300 3.3rem/1 var(--num); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--lg-fg); }
.tl-yr small { min-height: .8rem; margin-top: .25rem; font-size: max(12px, .66rem); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lg-fg3); }
.tl-track { position: relative; flex: 1; min-width: 0; height: 3.6rem; touch-action: none; cursor: pointer; outline: none; container-type: inline-size; }   /* a size container: the knob's translate reads its width (100cqw) */
.tl-rail { position: absolute; left: 18px; right: 18px; top: .55rem; height: 1.5rem; }
.tl-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgba(245, 245, 247, .22); border-radius: 2px; }
.tl-rail i { position: absolute; top: 50%; width: 1px; height: .55rem; margin: -.275rem 0 0 -.5px; background: rgba(245, 245, 247, .38); }
.tl-rail i.maj { height: 1rem; margin-top: -.5rem; width: 2px; margin-left: -1px; background: rgba(245, 245, 247, .6); }
/* the fill spans the rail and scales from its left end to the knob (js/plus/timeline.js setT writes scaleX; it used to write a width every frame) */
.tl-fill { position: absolute; left: 0; width: 100%; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 255, 255, .4), var(--lg-fg)); transform-origin: 0 50%; transform: scaleX(0); }
.tl-labels { position: absolute; left: 18px; right: 18px; bottom: .1rem; height: 1rem; }
.tl-labels b { position: absolute; transform: translateX(-50%); font-size: max(12px, .72rem); font-weight: 600; letter-spacing: .04em; color: rgba(245, 245, 247, .6); font-variant-numeric: tabular-nums; }
/* the knob: .tl-kpos carries it (translate = the year, written by setT; scale = the drag state, transitioned here), .tl-knob is the bead
   (transform belongs to the magnet's GSAP bump alone, so it has no CSS transition). One owner per property. */
.tl-kpos { position: absolute; left: 18px; top: .55rem; width: 1.9rem; height: 1.9rem; margin: -.2rem 0 0 -.95rem; pointer-events: none; transition: scale var(--dur-quick) var(--ease-spring); }
.tl-track.drag .tl-kpos { scale: 1.18; }
.tl-knob { position: absolute; inset: 0; border-radius: 50%; background: var(--lg-prom); border: 0; box-shadow: inset 0 1px 0 #fff, 0 0 0 .4rem rgba(255, 255, 255, .22), 0 .3rem 1rem rgba(0, 0, 0, .5); pointer-events: none; }
.tl-track:focus-visible .tl-knob { outline: 2px solid var(--lg-fg); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .tl-kpos { transition: none; } }

/* road / metro stretches */
.tl-seg { transition: opacity .48s ease; pointer-events: none; }

/* places: one marker style, a frosted bead. It blooms in (scale 0 to 1 plus a soft white glow ring) when its year passes, then settles to 60%.
   The dot is centred by flex on the pin's 0x0 box (no transform on the label, so its text stays sharp). Transform and opacity only. */
.tlp { position: absolute; left: -.35rem; top: 0; width: max-content; height: 0; display: flex; align-items: center; gap: .55rem; pointer-events: none; }
.tlp i { position: relative; flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .85), transparent 45%), var(--c); box-shadow: inset 0 -2px 3px -1px rgba(0, 0, 0, .28), 0 0 0 1.5px rgba(255, 255, 255, .7), 0 2px 5px rgba(0, 0, 0, .45); opacity: 0; scale: 0; }
.tlp.rg i {   /* a class, not [style*="--ring"]: a style-attribute selector restyles every pin whose position is written */
 background: #fff; border: 3px solid var(--ring); box-sizing: border-box; width: .85rem; height: .85rem; }
.tlp.on i { opacity: .6; scale: 1; }
.tlp.fresh i { animation: tlp-bloom .92s var(--ease-out) both; }
.tlp.fresh i::after { content: ""; position: absolute; inset: -.55rem; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .7), transparent 68%); animation: tlp-glow .92s var(--ease-out) both; pointer-events: none; }
@keyframes tlp-bloom { 0% { scale: 0; opacity: 0; } 35% { scale: 1.8; opacity: 1; } 100% { scale: 1; opacity: .6; } }
@keyframes tlp-glow { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
.tlp.lab i { opacity: 1; }
.tlp b { font: 600 max(.82rem, 12px)/1 var(--sans); white-space: nowrap; color: #f5f5f7; text-shadow: 0 0 2px #0e0b14, 0 0 6px rgba(14, 11, 20, .95), 0 1px 12px rgba(14, 11, 20, .8); opacity: 0; visibility: hidden; transition: opacity .32s; }
.tlp.lab b { opacity: 1; visibility: visible; }
.tlp.lab { z-index: 2; }
#lv-map:not(.dark) .tlp i { box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(20, 20, 30, .4); }
@media (prefers-reduced-motion: reduce) { .tlp.fresh i { animation: none; scale: 1; opacity: .6; } }

/* milestone ticks on the scrubber: the thumb snaps to them */
.tl-ms { position: absolute; top: 50%; width: .62rem; height: .62rem; margin: -1.15rem 0 0 -.31rem; background: var(--lg-fg); border: 0; border-radius: 3px; transform: rotate(45deg); box-shadow: 0 0 0 1.5px var(--lg-tint); pointer-events: none; }

/* Mirai's plate glows more as the years pass: one glow drawn once under the plate (.tl-glow, js/plus/timeline.js) whose opacity follows the
   year, instead of a box-shadow re-painted every frame. Under .tl-hero the plate keeps its own quiet shadow (this outranks markers.css
   .tl-hero .hg-med; the Day map's own plate rule still outranks this, and the Day map shows no glow, as before). */
.tl-glow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 1.1rem; pointer-events: none; opacity: 0; box-shadow: 0 0 3.2rem .5rem rgba(255, 255, 255, .85); }
.tl-hero .tl-glow { will-change: opacity; }
.tl-hero .hero.hg .hg-med { box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(255, 255, 255, .7), 0 .6rem 1.3rem -.5rem rgba(0, 0, 0, .65); }
#lv-map:not(.dark) .tl-glow { display: none; }

/* counter card: the figures are deltas */
body #lv-map .info.mm [data-k] b.bump { animation: tl-bump .48s var(--ease); }
@keyframes tl-bump { 0% { opacity: .55; transform: translateY(3px); } 100% { opacity: 1; transform: none; } }
body #lv-map .info.mm .mm-fig b i { font-style: normal; }
body #lv-map .info.mm .mm-fig span i { font-style: normal; }
body #lv-map .info.mm .mm-fig b s { text-decoration: none; font: 600 .5em/1 var(--sans); vertical-align: .55em; margin-right: .08em; color: var(--text-mid); }

/* captions during the Then & now moment sit above the scrubber */
body.tl-on.cine #caption { bottom: calc(8dvh + 7.4rem); }

@media (max-width: 1100px), (max-height: 800px) {
  .tl-bar { gap: .7rem; padding-right: 1.2rem; }
  .tl-play { width: 3.6rem; height: 3.6rem; }
  .tl-yr { min-width: 5.2rem; } .tl-yr b { font-size: 2.7rem; }
}

/* during the presentation the big caption tells the story; the card keeps only the figures */
body.cine .info.mm p.mm-line { display: none; }

body.tl-on.cine #caption { bottom: calc(8dvh + 9.2rem); }
