/* Home page time bar. Uses the shared tokens from css/style.css. */


.timebar { position: absolute; z-index: 6; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 999px; background: rgba(12, 19, 34, .55); border: 1px solid rgba(92, 225, 230, .22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 40px -16px rgba(92, 225, 230, .6); touch-action: pan-y; }
.timebar[hidden] { display: none; }
.tb-play { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(92, 225, 230, .55); background: rgba(92, 225, 230, .1); color: var(--cyan-hi);
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, box-shadow .2s; }
.tb-play:hover { background: rgba(92, 225, 230, .22); box-shadow: 0 0 16px rgba(92, 225, 230, .5); }
.tb-play svg { width: 12px; height: 12px; fill: currentColor; }
.tb-play .pause { display: none; }
.tb-play[aria-pressed="true"] .play { display: none; }
.tb-play[aria-pressed="true"] .pause { display: block; }
.tb-end { font: 500 12px/1 var(--display); letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.tb-today { color: var(--cyan-hi); text-shadow: 0 0 10px rgba(92, 225, 230, .6); }

.tb-track { position: relative; height: 30px; cursor: pointer; touch-action: pan-y; }
.tb-line, .tb-fill { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; }
.tb-line { background: linear-gradient(90deg, rgba(92, 225, 230, .15), rgba(92, 225, 230, .35)); }
.tb-fill { background: linear-gradient(90deg, #A99BFF, #39FF14 40%, #F5B547 70%, var(--cyan-hi)); transform-origin: left; box-shadow: 0 0 10px rgba(92, 225, 230, .7); }
.tb-ticks { position: absolute; inset: 0; }
.tb-tick { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--c); background: #070B14; transition: background .3s, box-shadow .3s, transform .2s; }
.tb-tick::before { content: ''; position: absolute; inset: -9px; } /* bigger tap target */
.tb-tick.past { background: var(--c); box-shadow: 0 0 8px var(--c); }
.tb-tick:hover { transform: scale(1.5); }
.tb-handle { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; cursor: grab;
  background: radial-gradient(circle, #fff 0, var(--cyan-hi) 35%, var(--cyan) 70%); box-shadow: 0 0 0 4px rgba(92, 225, 230, .18), 0 0 18px var(--cyan); }
.tb-handle:active { cursor: grabbing; }
.tb-handle:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.tb-date { position: absolute; bottom: 100%; margin-bottom: 4px; transform: translateX(-50%); font: 500 12px/1 var(--display); color: var(--cyan-hi);
  white-space: nowrap; pointer-events: none; text-shadow: 0 0 8px rgba(92, 225, 230, .7); }
.tb-pop { position: absolute; bottom: calc(100% + 26px); transform: translate(-50%, 6px); width: max-content; max-width: min(260px, 70vw);
  padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; color: var(--text); pointer-events: none;
  background: rgba(12, 19, 34, .9); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s, transform .25s; }
.tb-pop.on { opacity: 1; transform: translate(-50%, 0); }
.tb-pop strong { display: block; font: 500 12px/1.3 var(--display); color: var(--cyan-hi); }
.tb-pop span { display: block; color: var(--soft); margin-top: 3px; }

/* One event caption at a time, placed in the scene beside what's happening, with a thin glowing leader line. */
.tb-cap { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; width: max-content; max-width: min(340px, 82vw); will-change: transform; }
.tb-cap > .in { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; font-size: 14px; line-height: 1.3; color: var(--text);
  background: rgba(12, 19, 34, .72); border: 1px solid color-mix(in srgb, var(--c, #5CE1E6) 45%, transparent);
  box-shadow: 0 0 24px -8px var(--c, #5CE1E6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .4s ease, transform .4s ease; }
.tb-cap.on > .in { opacity: 1; transform: none; }
.tb-cap strong { font: 500 13px/1 var(--display); color: var(--cyan-hi); white-space: nowrap; }
.tb-cap .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, #5CE1E6); box-shadow: 0 0 10px var(--c, #5CE1E6); }
.tb-lead { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .4s ease; }
.tb-lead.on { opacity: 1; }
.tb-lead line { stroke: var(--c, #5CE1E6); stroke-width: 1; stroke-opacity: .7; filter: drop-shadow(0 0 3px var(--c, #5CE1E6)); }
.tb-lead circle { fill: var(--c, #5CE1E6); filter: drop-shadow(0 0 5px var(--c, #5CE1E6)); }
@media (max-width: 899px) {
  .timebar { gap: 8px; padding: 8px 12px; }
  .tb-end { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-pop, .tb-cap > .in, .tb-tick, .tb-lead { transition: none; }
}

/* Thunder click overlay and the sound toggle. */
.thunder-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }
.tb-sound { position: fixed; z-index: 50; left: 14px; bottom: 14px; width: 36px; height: 36px; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); background: rgba(12, 19, 34, .7); border: 1px solid var(--line-2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: color .2s, box-shadow .2s; }
.tb-sound svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tb-sound[aria-pressed="true"] { color: var(--cyan-hi); box-shadow: 0 0 14px rgba(92, 225, 230, .45); }
/* Text the lightning touches glows, then eases back. Colour and size never change, so it stays readable. */
h1 span, #hero-line, .door, .btn, .tb-cap .in, .wordmark { transition: text-shadow .8s ease, box-shadow .8s ease; }
.zap { text-shadow: 0 0 10px var(--zap), 0 0 22px var(--zap) !important; transition: text-shadow .08s ease, box-shadow .08s ease !important; }
.btn.zap, .door.zap { box-shadow: 0 0 18px var(--zap) !important; }
@media (prefers-reduced-motion: reduce) { .zap { text-shadow: none !important; box-shadow: none !important; } }

/* Scroll drives the journey: the hero is pinned for about 2.5 screen-heights (CSS sticky, no library). */
.hero-pin { position: relative; height: 450vh; height: 450svh; } /* 2.5 screens of growth + 1 screen hold at Today */
.hero-pin > .hero { position: sticky; top: 0; }
.hero-pin.no-pin { height: auto; }
.hero-pin.no-pin > .hero { position: relative; }
.tb-hint { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -10px); display: inline-flex; align-items: center; gap: 8px;
  font: 500 12px/1 var(--display); letter-spacing: .06em; color: var(--cyan-hi); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 10px rgba(92, 225, 230, .6); transition: opacity .6s ease, transform .6s ease; }
.tb-hint.gone { opacity: 0; transform: translate(-50%, -2px); }
.tb-hint .mouse { width: 14px; height: 21px; border: 1.5px solid var(--cyan-hi); border-radius: 8px; position: relative; box-shadow: 0 0 8px rgba(92, 225, 230, .5); }
.tb-hint .mouse::after { content: ''; position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; margin-left: -1px; border-radius: 2px; background: var(--cyan-hi);
  animation: tb-wheel 1.6s ease-in-out infinite; }
@keyframes tb-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@media (pointer: coarse) { .tb-hint .mouse { border-radius: 50%; width: 10px; height: 10px; } .tb-hint .mouse::after { display: none; } }
.tb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tb-list li { padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c); color: var(--soft); }
.tb-list time { color: var(--cyan-hi); font: 500 13px/1.4 var(--display); margin-right: 6px; }
.tb-list strong { color: var(--text); margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .tb-hint .mouse::after { animation: none; } }

/* The shared stylesheet makes <body> the scroller (height 100% + overflow-x hidden). Let the window scroll here, so the pin and scroll position work. */
html, body { height: auto; }
body { overflow-x: clip; min-height: 100%; }

/* Reduced motion: playing shows a static glow on the bar instead of crackling static. */
.timebar.charged .tb-fill { box-shadow: 0 0 16px rgba(157, 240, 242, .9); }
.timebar.charged .tb-handle { box-shadow: 0 0 0 4px rgba(92, 225, 230, .3), 0 0 26px var(--cyan); }
/* Patch 1.0.1: phones show 'Today' once (the date above the slider), not again at the right end. */
@media (max-width: 899px) { .tb-today { display: none; } }
/* Patch 1.0.1: 44 px tap area for the play button without changing its look. */
.tb-play { position: relative; }
.tb-play::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
