.history-page {
  --history-red: #b5221b;
  --history-red-dark: #7c130e;
  --history-fire: #b5221b;
  --history-cream: #f5f0e4;
  --history-paper: #e6e1d7;
  --history-ink: #0c0c0b;
  --history-accent: #b5221b;
  --history-other: #77746c;
  --history-green: #2d6b3d;
  --history-leaf: #2d6b3d;
  --history-muted: #77746c;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 82px;
  --sticky-offset: 200px;
  --controls-tuck: 0px;
  --year-col: 7.4rem;
  --card-pad: 1.35rem;
  --card-gap: 1.4rem;
  --spine-x: calc(var(--card-pad) + var(--year-col) + var(--card-gap) / 2);
  color: var(--history-ink);
  background: var(--history-cream);
  line-height: 1.6;
}

.history-page [hidden] {
  display: none !important;
}

.history-page::before {
  z-index: 0;
  opacity: 0.1;
}

/* :where() keeps this at zero extra specificity so the sticky header still wins. */
.history-page > :where(main, footer) {
  position: relative;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.history-page .icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-page :focus-visible {
  outline: 3px solid var(--history-accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ Chrome */

/* Shared site header (styles.css); the history page body text is dark, the header stays light. */
.history-page .site-header {
  z-index: 30;
  color: var(--ink);
}

.history-kicker {
  margin: 0 0 1.25rem;
  color: var(--history-accent);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.history-button {
  display: inline-flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  color: #f5f0e4;
  background: var(--history-accent);
  border: 2px solid var(--history-ink);
  box-shadow: 6px 6px 0 var(--history-ink);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.history-button:hover,
.history-button:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--history-ink);
}

.history-button:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--history-ink);
}

.history-button--dark {
  color: var(--history-ink);
  background: #f5f0e4;
  box-shadow: 6px 6px 0 var(--history-red-dark);
}

/* ------------------------------------------------------------------ Timeline shell + controls */

.timeline-shell {
  padding: clamp(3rem, 5vw, 5rem) var(--page-pad) clamp(5rem, 9vw, 9rem);
  background: var(--history-cream);
}

.next-chapter h2 {
  max-width: 12ch;
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.25rem, 6.2vw, 7rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.timeline-controls {
  position: sticky;
  top: calc(var(--header-h) - var(--controls-tuck));
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "filters stepper"
    "scrub scrub";
  gap: 0.75rem 1rem;
  align-items: center;
  margin-bottom: 4rem;
  padding: 0.75rem 0.9rem 0.6rem;
  color: var(--history-ink);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(12, 12, 11, 0.18);
  box-shadow: 0 14px 30px -24px rgba(12, 12, 11, 0.45);
  backdrop-filter: blur(14px);
}

.timeline-filters {
  grid-area: filters;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timeline-filter,
.year-stepper__btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  color: var(--history-ink);
  background: transparent;
  border: 1px solid rgba(12, 12, 11, 0.22);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.timeline-filter b {
  min-width: 1.6rem;
  padding: 0.05rem 0.3rem;
  background: rgba(12, 12, 11, 0.07);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.timeline-filter:hover,
.year-stepper__btn:hover {
  border-color: var(--history-accent);
}

.timeline-filter.is-active {
  color: #f5f0e4;
  background: var(--history-accent);
  border-color: var(--history-accent);
}

.timeline-filter.is-active b {
  background: rgba(12, 12, 11, 0.22);
}

.timeline-filter:active,
.year-stepper__btn:active {
  transform: scale(0.96);
}

.year-stepper {
  grid-area: stepper;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.year-stepper__btn {
  width: 2.75rem;
  padding: 0;
}

.year-stepper__btn .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.year-readout {
  display: grid;
  min-width: 6.5rem;
  justify-items: center;
  line-height: 1;
}

.year-readout strong {
  color: var(--history-accent);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.85rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.year-readout span {
  margin-top: 0.2rem;
  color: #77746c;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.year-readout span[data-status="burned"] { color: #b5221b; }
.year-readout span[data-status="survived"] { color: #2d6b3d; }
.year-readout span[data-status="other"] { color: #77746c; }

.year-readout.is-ticking strong {
  animation: tick-in 260ms var(--ease-out);
}

@keyframes tick-in {
  from {
    opacity: 0.2;
    transform: translateY(35%);
  }
}

/* Scrubber */

.fate-scrubber {
  grid-area: scrub;
  position: relative;
  height: 46px;
  padding-bottom: 14px;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
}

.fate-scrubber:focus-visible {
  outline-offset: 2px;
}

.fate-scrubber__track {
  display: flex;
  height: 100%;
  align-items: flex-end;
  gap: 2px;
}

.tick {
  position: relative;
  flex: 1 1 0;
  height: 55%;
  background: currentColor;
  opacity: 0.85;
  transition: height 180ms var(--ease-out), opacity 200ms ease;
}

.tick[data-status="burned"] { color: var(--history-fire); }
.tick[data-status="survived"] { color: var(--history-leaf); }
.tick[data-status="other"] { color: var(--history-other); }

.tick[data-label]::after {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  color: #77746c;
  content: attr(data-label);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tick.is-muted {
  height: 22%;
  opacity: 0.22;
}

.tick.is-active {
  height: 100%;
  opacity: 1;
}

.fate-scrubber:hover .tick:not(.is-muted) {
  height: 70%;
}

.fate-scrubber:hover .tick.is-active {
  height: 100%;
}

.fate-scrubber__head {
  position: absolute;
  top: -4px;
  bottom: 10px;
  left: var(--pos, 0%);
  width: 0;
  pointer-events: none;
  transition: left 260ms var(--ease-out);
}

.fate-scrubber.is-dragging .fate-scrubber__head {
  transition: none;
}

.fate-scrubber__head::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 4px;
  content: "";
  background: var(--history-red);
  box-shadow: 0 0 0 2px #f5f0e4;
}

.fate-scrubber__head::after {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 12px;
  height: 12px;
  content: "";
  background: var(--history-red);
  border: 2px solid #f5f0e4;
  border-radius: 50%;
}

.fate-scrubber__tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: var(--tip-x, 50%);
  z-index: 3;
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  color: var(--history-ink);
  background: #f5f0e4;
  border: 2px solid var(--history-ink);
  box-shadow: 4px 4px 0 var(--history-accent);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.fate-scrubber__tip strong {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.fate-scrubber__tip span {
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.fate-scrubber__tip[data-status="burned"] .icon { color: var(--history-fire); }
.fate-scrubber__tip[data-status="survived"] .icon { color: var(--history-green); }
.fate-scrubber__tip[data-status="other"] .icon { color: var(--history-other); }

.fate-scrubber.is-tipping .fate-scrubber__tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ Timeline list */

.timeline-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5rem;
}

.decade-group {
  display: grid;
  grid-template-columns: minmax(9rem, 0.28fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.decade-label {
  position: sticky;
  top: calc(var(--sticky-offset) + 1.5rem);
  display: flex;
  align-self: start;
  align-items: flex-start;
  gap: 1rem;
}

.decade-heading {
  margin: 0;
  color: var(--history-red);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(4.5rem, 8vw, 8rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.03em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.decade-tally {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.decade-tally li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.45rem 0.25rem 0.3rem;
  color: #f5f0e4;
  font-size: var(--text-xs);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.decade-tally [data-status="burned"] { background: var(--history-red); }
.decade-tally [data-status="survived"] { background: var(--history-green); }
.decade-tally [data-status="other"] { color: #f5f0e4; background: var(--history-other); }

.decade-events {
  --fill: 0;
  position: relative;
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.decade-events::before,
.decade-events::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--spine-x) + 1px);
  width: 2px;
  content: "";
  background: rgba(12, 12, 11, 0.2);
}

.decade-events::after {
  width: 4px;
  margin-left: -1px;
  background: var(--history-red);
  transform: scaleY(var(--fill));
  transform-origin: top;
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--year-col) minmax(8rem, 0.3fr) minmax(0, 1fr);
  gap: var(--card-gap);
  align-items: start;
  padding: var(--card-pad);
  background: rgba(245, 240, 228, 0.82);
  border: 2px solid var(--history-ink);
  box-shadow: 6px 6px 0 var(--history-paper);
  scroll-margin-top: calc(var(--sticky-offset) + 1rem);
}

.js .timeline-card[data-reveal] {
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out),
    box-shadow 200ms ease;
}

.timeline-card::before {
  position: absolute;
  top: 1.75rem;
  left: calc(var(--spine-x) - 0.425rem);
  z-index: 2;
  width: 0.85rem;
  aspect-ratio: 1;
  content: "";
  background: var(--history-cream);
  border: 3px solid var(--history-ink);
  border-radius: 50%;
  transition: background-color 240ms ease, transform 240ms var(--ease-out);
}

.timeline-card.is-passed::before {
  background: var(--history-red);
}

.timeline-card.is-passed[data-status="survived"]::before { background: var(--history-leaf); }
.timeline-card.is-passed[data-status="other"]::before { background: var(--history-other); }

.timeline-card.is-current::before {
  transform: scale(1.35);
}

.timeline-card:hover,
.timeline-card:focus-within,
.timeline-card.is-current {
  box-shadow: 9px 9px 0 var(--history-accent);
}

.timeline-card.is-revealed:hover,
.timeline-card.is-revealed.is-current {
  transform: translate(-3px, -3px);
}

.timeline-card:focus {
  outline: none;
}

.timeline-card:focus-visible {
  outline: 3px solid var(--history-red);
}

.timeline-card.is-landed {
  animation: landed 900ms var(--ease-out);
}

@keyframes landed {
  0% { box-shadow: 0 0 0 0 rgba(181, 34, 27, 0.9), 9px 9px 0 var(--history-accent); }
  60% { box-shadow: 0 0 0 14px rgba(181, 34, 27, 0), 9px 9px 0 var(--history-accent); }
  100% { box-shadow: 0 0 0 0 rgba(181, 34, 27, 0), 9px 9px 0 var(--history-accent); }
}

.timeline-card.is-highlight {
  background: var(--history-paper);
}

.timeline-card__year {
  color: var(--history-red);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.6rem, 3.6vw, 3.4rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.8;
}

.timeline-card__status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.55rem;
  color: #f5f0e4;
  background: var(--history-ink);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.timeline-card[data-status="burned"] .timeline-card__status { background: var(--history-red); }
.timeline-card[data-status="survived"] .timeline-card__status { background: var(--history-green); }
.timeline-card[data-status="other"] .timeline-card__status { color: #f5f0e4; background: var(--history-other); }

.timeline-card__flag {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.15rem 0.45rem;
  color: #f5f0e4;
  background: var(--history-accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.timeline-card__copy h3 {
  margin: 0 0 0.5rem;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.6rem, 2.2vw, 2.35rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.timeline-card__detail {
  max-width: 54rem;
  margin: 0;
  color: var(--history-muted);
  font-size: var(--text-body);
  line-height: 1.65;
}

/* ------------------------------------------------------------------ Video (YouTube @gavlegoatlive) */

.timeline-card__videos {
  display: grid;
  min-width: 0;
  max-width: 34rem;
  gap: 1rem;
  margin-top: 1.25rem;
}

.timeline-card__videos.has-many {
  max-width: 48rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.video-slot {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.5rem;
}

.video-slot.is-vertical {
  max-width: 13rem;
}

.video-facade,
.video-slot iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--history-ink);
}

.video-slot.is-vertical .video-facade,
.video-slot.is-vertical iframe {
  aspect-ratio: 9 / 16;
}

.video-slot iframe {
  background: var(--history-ink);
  box-shadow: 5px 5px 0 var(--history-red);
}

.video-facade {
  position: relative;
  padding: 0;
  overflow: hidden;
  color: #f5f0e4;
  background: var(--history-ink);
  box-shadow: 5px 5px 0 var(--history-red);
  cursor: pointer;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.video-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
  transition: transform 500ms var(--ease-out), filter 300ms ease;
}

.video-facade::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(12, 12, 11, 0.75));
}

.video-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  place-items: center;
  background: var(--history-red);
  border: 2px solid #f5f0e4;
  border-radius: 50%;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  transition: transform 200ms var(--ease-out), background-color 200ms ease;
}

.video-facade__play .icon {
  width: 1.4rem;
  height: 1.4rem;
  margin-left: 0.15rem;
}

.video-facade__meta {
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  left: 0.7rem;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.video-facade:hover,
.video-facade:focus-visible {
  box-shadow: 8px 8px 0 var(--history-red);
  transform: translate(-3px, -3px);
}

.video-facade:hover img,
.video-facade:focus-visible img {
  filter: saturate(1.05) contrast(1.05);
  transform: scale(1.04);
}

.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
  transform: translate(-50%, -50%) scale(1.1);
}

.video-facade:active {
  box-shadow: 2px 2px 0 var(--history-red);
  transform: translate(2px, 2px);
}

.video-slot__link {
  width: max-content;
  color: var(--history-red);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  text-transform: uppercase;
}

.video-slot__link:hover {
  color: var(--history-ink);
}


/* Filter crossfade (View Transitions API where supported) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 260ms;
}

/* ------------------------------------------------------------------ Next chapter + prediction */

.next-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  padding: clamp(5rem, 10vw, 10rem) var(--page-pad);
  color: #f5f0e4;
  background: var(--history-red);
  border-block: 2px solid var(--history-ink);
  scroll-margin-top: var(--header-h);
}

.next-chapter h2 {
  max-width: 13ch;
  margin-bottom: 1.6rem;
}

.next-chapter .history-kicker {
  color: rgba(245, 240, 228, 0.82);
}

.next-chapter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  margin-top: 2rem;
}

.history-text-link {
  position: relative;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-text-link::after {
  position: absolute;
  right: 0;
  bottom: -0.35rem;
  left: 0;
  height: 1px;
  content: "";
  background: currentColor;
  transform-origin: left;
  transition: transform 200ms var(--ease-out);
}

.history-text-link:hover::after {
  transform: scaleX(0.4);
}

.prediction {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--history-ink);
  background: var(--history-cream);
  border: 2px solid var(--history-ink);
  box-shadow: 10px 10px 0 var(--history-ink);
}

.prediction h3 {
  margin: 0 0 0.25rem;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.prediction__prompt {
  margin: 0 0 1.2rem;
  color: var(--history-muted);
}

.prediction__options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.prediction__options button {
  display: flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  color: var(--history-ink);
  background: transparent;
  border: 2px solid var(--history-ink);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.prediction__options button .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.prediction__options button:hover {
  box-shadow: 4px 4px 0 var(--history-ink);
  transform: translate(-2px, -2px);
}

.prediction__options button:active {
  box-shadow: none;
  transform: translate(0, 0) scale(0.98);
}

.prediction__options [aria-pressed="true"][data-predict="burned"] { color: #f5f0e4; background: var(--history-red); }
.prediction__options [aria-pressed="true"][data-predict="survived"] { color: #f5f0e4; background: var(--history-green); }
.prediction__options [aria-pressed="true"][data-predict="other"] { color: #f5f0e4; background: var(--history-other); }

.prediction__result {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 2px dashed rgba(12, 12, 11, 0.3);
}

.prediction__verdict {
  margin: 0;
  color: var(--history-muted);
  font-size: var(--text-sm);
}

.has-pick .prediction__verdict {
  color: var(--history-ink);
  font-weight: 700;
}

.odds {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.odds:empty {
  display: none;
}

.odds li {
  display: grid;
  grid-template-columns: 8.5rem 1fr 3rem;
  gap: 0.75rem;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.odds__bar {
  height: 0.9rem;
  background: rgba(12, 12, 11, 0.1);
}

.odds__bar i {
  display: block;
  height: 100%;
  background: var(--history-ink);
  transform: scaleX(var(--share));
  transform-origin: left;
}

.odds [data-status="burned"] .odds__bar i { background: var(--history-red); }
.odds [data-status="survived"] .odds__bar i { background: var(--history-green); }
.odds [data-status="other"] .odds__bar i { background: var(--history-other); }

.odds li:not(.is-picked) {
  opacity: 0.6;
}

.odds__value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.is-animated .odds__bar i {
  animation: bar-grow 800ms var(--ease-out) both;
}

.is-animated .odds li:nth-child(2) .odds__bar i { animation-delay: 80ms; }
.is-animated .odds li:nth-child(3) .odds__bar i { animation-delay: 160ms; }

@keyframes bar-grow {
  from { transform: scaleX(0); }
}

/* ------------------------------------------------------------------ Sources + footer */

.history-sources {
  display: grid;
  grid-template-columns: 0.45fr 1fr;
  gap: 3rem;
  padding: clamp(3rem, 6vw, 6rem) var(--page-pad);
  background: var(--history-paper);
  border-bottom: 2px solid var(--history-ink);
}

.history-sources h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 0.9;
  text-transform: uppercase;
}

.history-sources p {
  max-width: 60rem;
  margin-bottom: 1rem;
  color: var(--history-muted);
  line-height: 1.65;
}

.history-sources a {
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: underline;
  text-underline-offset: 0.35rem;
  text-transform: uppercase;
}

.history-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2rem 3rem;
  align-items: end;
  padding: 4rem var(--page-pad) 2rem;
  color: var(--history-ink);
  background: #f5f0e4;
  border-top: 1px solid rgba(12, 12, 11, 0.18);
}

.history-footer .wordmark span:last-child {
  color: #e23a30;
}

.history-footer nav {
  display: flex;
  gap: 1.4rem;
}

.history-footer nav a,
.history-footer > a:last-child {
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.history-footer nav a:hover,
.history-footer > a:last-child:hover {
  color: var(--history-accent);
}

/* ------------------------------------------------------------------ Responsive */

@media (max-width: 1180px) {
  .timeline-controls {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "filters filters"
      "stepper stepper"
      "scrub scrub";
  }
}

@media (max-width: 980px) {
  .next-chapter {
    grid-template-columns: 1fr;
  }

  .decade-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .decade-label {
    position: static;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .decade-heading {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .decade-tally {
    display: flex;
  }

  .history-sources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .timeline-controls {
    margin-inline: calc(var(--page-pad) * -1);
    margin-bottom: 3rem;
    padding: 0.6rem var(--page-pad) 0.5rem;
    gap: 0.5rem;
    border-inline: 0;
  }

  .timeline-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .timeline-filter {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
  }

  .timeline-filter b,
  .tick:first-child::after {
    display: none;
  }

  .year-stepper {
    justify-content: space-between;
  }

  .timeline-list {
    gap: 3.5rem;
  }

  .decade-heading {
    font-size: 4.5rem;
  }

  .history-page {
    --spine-x: 0.75rem;
  }

  .timeline-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    padding-left: 2.3rem;
  }

  .timeline-card::before {
    top: 1.6rem;
  }

  .timeline-card__year {
    font-size: 3.2rem;
  }

  .timeline-card__copy h3 {
    font-size: 1.9rem;
  }

  .prediction__options {
    grid-template-columns: 1fr;
  }

  .odds li {
    grid-template-columns: 7.5rem 1fr 2.6rem;
    gap: 0.5rem;
  }

  .history-sources {
    gap: 1.5rem;
  }

  .history-footer {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal]:not(.is-revealed) {
    opacity: 1;
    transform: none;
  }

  .fate-scrubber__head {
    transition: none;
  }
}
