/* ============================================================
   /timeline — recovery timeline page
   Two layers:
   1. .tl-cinematic — the Week-One player at the top (animated)
   2. .tl-stream    — the full 211-message thread below (SEO body)
   The cinematic gracefully degrades to nothing-special if JS is
   disabled or the user prefers reduced motion; the stream always
   renders.
   ============================================================ */

.prose.tl { max-width: 760px; }

/* ---------- Hero header ---------- */
.tl-hero { margin-bottom: 48px; }
.tl-hero h1 {
  letter-spacing: -0.02em;
  margin: 12px 0 20px;
}
.tl-hero .lede { color: var(--ink-2); }

/* ---------- Cinematic player ---------- */
.tl-cinematic {
  position: relative;
  margin: 56px 0 72px;
  padding: 56px 32px 40px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(77,163,255,0.12), transparent 60%),
    radial-gradient(80% 60% at 50% 120%, rgba(255,255,255,0.03), transparent 60%),
    rgba(11, 11, 14, 0.6);
  overflow: hidden;
}
.tl-cinematic::before {
  /* Subtle starfield */
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(77,163,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.3), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(77,163,255,0.3), transparent 50%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.25), transparent 50%);
  pointer-events: none;
  opacity: 0.7;
}
.tl-cinematic-frame { position: relative; text-align: center; }

.tl-cinematic-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  margin: 0 0 12px;
}
.tl-cinematic-phase {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-style: italic;
  margin: 0 0 32px;
  min-height: 1.4em;
  transition: opacity 320ms ease;
}

.tl-cinematic-clock {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 28px;
}
.tl-cinematic-clock-label {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-4);
  margin-bottom: -8px;
}
.tl-cinematic-clock-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 96px;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--ink-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 32px rgba(77,163,255,0.18);
}

.tl-cinematic-text {
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-1);
  max-width: 520px;
  margin: 0 auto 36px;
  min-height: 4em;
  font-style: italic;
  transition: opacity 320ms ease;
}

.tl-cinematic-controls {
  display: flex; align-items: center; gap: 16px;
  max-width: 480px;
  margin: 0 auto 16px;
}
.tl-cinematic-play {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--ink-1);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.tl-cinematic-play:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); transform: scale(1.05); }
.tl-cinematic-play:active { transform: scale(0.96); }
.tl-cinematic-play:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-color: rgba(77,163,255,0.5);
}
.tl-cinematic-play[disabled] { opacity: 0.35; cursor: default; }
/* Keyboard focus on the (invisible) range input — show a ring on the
   visual track so the user can see where focus lives. */
.tl-cinematic-scrub:focus-visible + .tl-cinematic-track,
.tl-cinematic-scrub:focus-visible ~ .tl-cinematic-track,
.tl-cinematic-controls:has(.tl-cinematic-scrub:focus-visible) .tl-cinematic-track {
  box-shadow: 0 0 0 2px var(--blue), 0 0 12px rgba(77,163,255,0.3);
}
.tl-cinematic-play .tl-icon-play  { display: block;  margin-left: 2px; }
.tl-cinematic-play .tl-icon-pause { display: none; }
.tl-cinematic-play.is-playing .tl-icon-play  { display: none; }
.tl-cinematic-play.is-playing .tl-icon-pause { display: block; }

.tl-cinematic-track {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.tl-cinematic-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(77,163,255,0.6), var(--ink-1));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(77,163,255,0.35);
  transition: width 280ms ease;
}
/* Native range input layered on top of the track for drag-to-scrub */
.tl-cinematic-scrub {
  position: absolute;
  left: 60px;       /* play-button width + gap */
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% - 60px);
  height: 24px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  opacity: 0;       /* invisible — visual is the .tl-cinematic-fill */
}
.tl-cinematic-scrub::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; background: transparent; }
.tl-cinematic-scrub::-moz-range-thumb     { width: 24px; height: 24px; background: transparent; border: 0; }

.tl-cinematic-live {
  font-size: 11px;
  letter-spacing: 0.12em;
  /* WCAG AA: --ink-4 (#4A4A52) on dark bg is only 2.27:1. Bump to --ink-3
     for the live region so screen-reader text + small-print readers pass. */
  color: var(--ink-3);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  margin: 0 0 4px;
}
.tl-cinematic-footnote {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin: 24px 0 0;
}

/* ---------- Phase navigation chips ---------- */
.tl-jump {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 32px;
}
.tl-jump a {
  display: inline-flex;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.tl-jump a:hover { background: rgba(255,255,255,0.04); color: var(--ink-1); border-color: rgba(255,255,255,0.2); }

/* ---------- Calibration paragraph ---------- */
.tl-meta {
  font-size: 14px;
  color: var(--ink-3);
  font-style: italic;
  margin: 0 0 56px;
  padding: 16px 20px;
  border-left: 2px solid rgba(255,255,255,0.12);
}

/* ---------- Phase sections ---------- */
.tl-phase {
  margin: 80px 0;
  scroll-margin-top: 96px;
}
.tl-phase-head {
  margin-bottom: 32px;
}
.tl-phase-head h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 4px 0 12px;
}
.tl-phase-head .tl-lede { color: var(--ink-3); font-size: 15px; }

/* The thread runs as a thin vertical line on the left of each phase */
.tl-stream {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.tl-section {
  position: relative;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin: 32px 0 16px -28px;
  padding-left: 28px;
}
.tl-section::before {
  content: '';
  position: absolute;
  left: -1px; top: 50%;
  width: 12px; height: 1px;
  background: rgba(255,255,255,0.18);
}
.tl-section:first-child { margin-top: 0; }

.tl-msg {
  position: relative;
  margin: 0 0 22px;
  padding: 0;
}
.tl-msg::before {
  content: '';
  position: absolute;
  left: -32px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}
.tl-msg.is-current::before {
  background: #4DA3FF;
  box-shadow: 0 0 0 3px rgba(77,163,255,0.18);
  transform: scale(1.3);
}
.tl-marker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.tl-msg-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-1);
}

/* ---------- Subtle scroll-fade-in ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tl-msg {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 480ms ease, transform 480ms ease;
  }
  .tl-msg.tl-in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Footer ---------- */
.tl-foot {
  margin: 80px 0 0;
  padding: 32px;
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}
.tl-foot a { color: var(--blue); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .tl-cinematic { padding: 40px 20px 28px; margin: 32px 0 48px; }
  .tl-cinematic-clock-num { font-size: 72px; }
  .tl-cinematic-text { font-size: 18px; min-height: 5em; }
  .tl-cinematic-controls { gap: 12px; }
  .tl-cinematic-play { width: 40px; height: 40px; }
  .tl-cinematic-scrub { left: 52px; width: calc(100% - 52px); }
  .tl-phase { margin: 56px 0; }
  .tl-phase-head h2 { font-size: 24px; }
  .tl-stream { padding-left: 22px; }
  .tl-msg::before { left: -25px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tl-cinematic-text,
  .tl-cinematic-phase,
  .tl-cinematic-fill { transition: none; }
}
