/* ==========================================================================
   scene-timeline.css — 06 MISSION LOG "FORTY YEARS ON STATION"
   Chart-recorder tape: moving paper track, fixed amber playhead, log readout.
   Markup built by js/scene-timeline.js (GUARDIAN.scenes.timeline).
   ========================================================================== */

#timeline-mount {
  display: flex;
  align-items: center;
}

.tl-root {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: 24px;
}

/* --------------------------------------------------------------------------
   LOG READOUT (above the strip)
   -------------------------------------------------------------------------- */

.tl-readout {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-height: 22px;
  margin-bottom: 34px;
  padding: 0 2px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tl-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--amber);
  white-space: nowrap;
}
.tl-tag-dot {
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.tl-slot {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tl-line {
  color: var(--green);
  letter-spacing: 0.04em;
}
.tl-line::after {
  content: "▮";
  margin-left: 3px;
  color: var(--green);
  animation: blink 1.1s steps(1) infinite;
}
.tl-line--dim { color: var(--ghost); opacity: 0.45; }

.tl-pos {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--amber);
  opacity: 0.8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   TAPE STRIP — chart-recorder paper
   -------------------------------------------------------------------------- */

.tl-tape { position: relative; }

.tl-strip {
  position: relative;
  height: 140px;
  overflow: hidden;
  border-top: 1px solid var(--green-dim);
  border-bottom: 1px solid var(--green-dim);
  background: linear-gradient(180deg,
    rgba(12, 18, 16, 0.85),
    rgba(5, 8, 7, 0.92) 55%,
    rgba(12, 18, 16, 0.85));
  box-shadow:
    inset 0 0 34px rgba(0, 255, 136, 0.05),
    inset 0 1px 0 rgba(0, 255, 136, 0.06),
    inset 0 -1px 0 rgba(0, 255, 136, 0.06);
}

/* edge fades so entries dissolve in/out of the viewport */
.tl-strip::before,
.tl-strip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}
.tl-strip::before { left: 0;  background: linear-gradient(90deg,  #050807, rgba(5, 8, 7, 0)); }
.tl-strip::after  { right: 0; background: linear-gradient(270deg, #050807, rgba(5, 8, 7, 0)); }

/* paper grid rides the track: minor/major vertical ticks + horizontal rules */
.tl-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 260%;
  will-change: transform;
  background:
    repeating-linear-gradient(90deg,  rgba(0, 255, 136, 0.085) 0 1px, rgba(0, 0, 0, 0) 1px 78px),
    repeating-linear-gradient(90deg,  rgba(0, 255, 136, 0.035) 0 1px, rgba(0, 0, 0, 0) 1px 13px),
    repeating-linear-gradient(180deg, rgba(0, 255, 136, 0.028) 0 1px, rgba(0, 0, 0, 0) 1px 17px);
}
/* pen baseline */
.tl-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 255, 136, 0.10);
}

/* --------------------------------------------------------------------------
   PLAYHEAD — fixed at center, never moves
   -------------------------------------------------------------------------- */

.tl-ph {
  position: absolute;
  left: 50%;
  top: -12px;
  bottom: -10px;
  width: 0;
  z-index: 3;
  pointer-events: none;
}
.tl-ph-line {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--amber);
  box-shadow:
    0 0 10px rgba(255, 176, 0, 0.55),
    0 0 26px rgba(255, 176, 0, 0.18);
}
.tl-ph-cap {
  position: absolute;
  top: -3px;
  left: -7px;
  width: 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.6);
}

/* --------------------------------------------------------------------------
   TAPE ENTRIES — year numeral + line-art glyph (state colors set inline by JS)
   -------------------------------------------------------------------------- */

.tl-entry {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transform: translateX(-50%);
  color: #E6F2EA;            /* future state default — JS overrides per p */
  opacity: 0.38;
  white-space: nowrap;
  user-select: none;
}
.tl-entry-idx {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  opacity: 0.75;
}
.tl-entry-year {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  line-height: 0.9;
  letter-spacing: 0.03em;
}
.tl-entry-glyph {
  width: 26px;
  height: 26px;
  display: block;
}
.tl-entry-glyph path,
.tl-entry-glyph circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* index hash tying the entry to the paper edge */
.tl-entry-mark {
  position: absolute;
  bottom: 0;
  left: 50%;
  margin-left: -0.5px;
  width: 1px;
  height: 10px;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   RECORDER CHROME LABELS
   -------------------------------------------------------------------------- */

.tl-meta {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(0, 255, 136, 0.30);
  white-space: nowrap;
}
.tl-meta--tl { top: -17px; left: 2px; }
.tl-meta--tr { top: -17px; right: 2px; }
.tl-meta--bl { bottom: -19px; left: 2px; }
.tl-meta--br { bottom: -19px; right: 2px; }

/* --------------------------------------------------------------------------
   SCREEN-READER LOG (visually hidden full text)
   -------------------------------------------------------------------------- */

.tl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  list-style: none;
}

/* --------------------------------------------------------------------------
   MOBILE (mode 'mobile' — simplified)
   -------------------------------------------------------------------------- */

.tl-root--mobile .tl-strip { height: 112px; }
.tl-root--mobile .tl-entry-year { font-size: 32px; }
.tl-root--mobile .tl-entry-glyph { width: 21px; height: 21px; }
.tl-root--mobile .tl-entry-idx,
.tl-root--mobile .tl-pos,
.tl-root--mobile .tl-meta { display: none; }
.tl-root--mobile .tl-readout {
  font-size: 11.5px;
  gap: 10px;
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   REDUCED MOTION
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .tl-line::after,
  .tl-tag-dot { animation: none; }
}
