/* Creative sticky-era timeline — scroll-driven chapters */

.tl-hud {
  position: fixed;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 3.2rem;
  pointer-events: none;
}
.tl-hud-year {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-soft);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.tl-hud-year span {
  display: inline;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-left: 0.35rem;
}
.tl-hud-track {
  position: relative;
  width: 2px;
  height: min(36vh, 280px);
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: visible;
}
.tl-hud-fill {
  position: absolute;
  left: 0; top: 0; width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--mars-hot), var(--gold));
  border-radius: 2px;
  transition: height 0.08s linear;
}
.tl-hud-dot {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 10px; height: 10px;
  margin-left: -5px; margin-top: -5px;
  border-radius: 50%;
  background: var(--mars-hot);
  box-shadow: 0 0 0 3px rgba(3,2,3,0.85), 0 0 16px rgba(227,93,58,0.55);
  transition: top 0.08s linear;
}
.tl-hud-era {
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 8rem;
}

.tl-hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 3rem) max(1.25rem, calc((100% - var(--max)) / 2)) 3.5rem;
  max-width: none;
}
.tl-hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 1.1rem;
  max-width: 12ch;
  text-shadow: 0 12px 50px rgba(0,0,0,0.45);
}
.tl-hero-lede {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-style: italic;
  color: var(--sand);
  max-width: 28em;
  margin-bottom: 1.75rem;
}
.tl-era-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  pointer-events: auto;
}
.tl-era-pills button {
  pointer-events: auto;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  color: var(--mute);
  padding: 0.5rem 0.9rem;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}
.tl-era-pills button:hover,
.tl-era-pills button.active {
  color: var(--cream);
  border-color: var(--mars);
  background: rgba(184,69,44,0.18);
}

.tl-main {
  width: 100%;
  padding: 0 0 4rem;
  padding-left: max(4rem, calc((100% - var(--max)) / 2 + 2rem));
  padding-right: max(1.25rem, calc((100% - var(--max)) / 2));
}

/* Each era is a long scroll runway with sticky left title */
.tl-era {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.5rem 2.5rem;
  margin-bottom: 12vh;
  min-height: 120vh;
  position: relative;
}
.tl-era-sticky {
  position: sticky;
  top: calc(var(--nav-h) + 2.5rem);
  align-self: start;
  padding-top: 0.5rem;
}
.tl-era-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--mars-hot);
  margin-bottom: 0.6rem;
}
.tl-era-sticky h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.tl-era-sticky p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--mute);
  max-width: 16ch;
  line-height: 1.45;
}

.tl-era-track {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-bottom: 20vh;
  border-left: 1px solid rgba(255,255,255,0.08);
  padding-left: 1.75rem;
  position: relative;
}
.tl-era-track::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(227, 93, 58, 0.55) 15%,
    rgba(201, 168, 92, 0.4) 70%,
    transparent
  );
  opacity: 0.85;
}

.tl-card {
  position: relative;
  background: rgba(10, 7, 8, 0.62);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.1);
  padding: 1.45rem 1.4rem 1.35rem;
  max-width: 520px;
  transform: translateY(28px);
  opacity: 0.35;
  transition: transform 0.55s var(--ease), opacity 0.55s var(--ease), border-color 0.3s;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.tl-card::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 5px);
  top: 1.55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--panel-hard);
  border: 2px solid rgba(227, 93, 58, 0.7);
  box-shadow: 0 0 0 4px rgba(3,2,3,0.8);
}
.tl-card.in-view {
  transform: translateY(0);
  opacity: 1;
}
.tl-card.featured {
  border-color: rgba(201, 168, 92, 0.35);
  background: linear-gradient(145deg, rgba(184,69,44,0.14), rgba(10,7,8,0.7));
}
.tl-card.featured::before {
  background: var(--mars-hot);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(3,2,3,0.8), 0 0 18px rgba(227,93,58,0.5);
}
.tl-card time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.tl-card h3 {
  font-size: 1.35rem;
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}
.tl-card p {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--sand);
  line-height: 1.55;
}
.tl-tag {
  display: inline-block;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--mute);
}
.tl-tag.pre {
  border-color: var(--line-strong);
  color: var(--mars-hot);
  background: rgba(184,69,44,0.1);
}
.tl-tag.post {
  border-color: #5a4a68;
  color: #c4b0d8;
  background: rgba(100,80,120,0.12);
}

/* Stagger cards slightly for depth */
.tl-card:nth-child(even) {
  margin-left: min(4vw, 2.5rem);
}
.tl-card:nth-child(3n) {
  margin-left: min(8vw, 4.5rem);
}

.tl-end {
  width: min(var(--max), 100%);
  margin: 4rem auto 2rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  text-align: left;
}
.tl-end h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
  .tl-hud { display: none; }
  .tl-main {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .tl-era {
    grid-template-columns: 1fr;
    min-height: auto;
    margin-bottom: 4rem;
  }
  .tl-era-sticky {
    position: relative;
    top: auto;
    padding-bottom: 0.5rem;
  }
  .tl-era-sticky p { max-width: none; }
  .tl-card:nth-child(even),
  .tl-card:nth-child(3n) {
    margin-left: 0;
  }
  .tl-era-track {
    padding-bottom: 2rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tl-card {
    transform: none;
    opacity: 1;
    transition: none;
  }
  .tl-hud-fill, .tl-hud-dot { transition: none; }
}
