.vega-history {
  --vega-top: 88px;
  --vega-gutter: max(clamp(20px, 5.25vw, 110px), calc((100% - 1560px) / 2));
  --vega-event-size: 57%;
  --vega-rail-progress: 0;
  --vega-tail: 180px;
  --vega-ink: #221d18;
  --vega-bronze: #8c4c12;
  position: relative;
  color: var(--vega-ink);
  background: #f4eee1;
  scroll-margin-top: var(--vega-top);
}
.vega-history__stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(125deg, #fcfaf4 11%, #f3eadd 56%, #ebe0cb);
  overflow: hidden;
}
.vega-history__field {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(90deg, #8d642f17 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(#8d642f13 1px, transparent 1px) 0 0 / 42px 42px;
  mask-image: linear-gradient(0deg, #0008 0, #000 35%, #000 74%, transparent 100%);
}
.vega-history__circuits {
  position: absolute;
  width: clamp(480px, 66vw, 1290px);
  aspect-ratio: 1;
  inset: auto -12% -67%;
  margin-left: auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 27%, #a16e3252 27.2% 27.35%, transparent 27.55% 48%, #a16e3280 48.2% 48.34%, transparent 48.6%),
    repeating-radial-gradient(circle, transparent 0 33px, #95704130 34px, transparent 35px 46px),
    conic-gradient(from 125deg, #e3ba6740, transparent 16%, transparent 52%, #b6733d35 70%, #f6d18680 88%, #e3ba6740);
  transform: translate3d(0, 0, 0);
}
.vega-history__signal {
  position: absolute;
  inset-block: 26% 8%;
  left: 0;
  width: clamp(92px, 20vw, 300px);
  border-right: 1px solid #a75920a6;
  background: linear-gradient(90deg, transparent, #e7a4461c 87%, #df913946);
  transform: translate3d(-100%, 0, 0);
  mask-image: linear-gradient(transparent, #000 13% 85%, transparent);
}
.vega-history__signal::after {
  content: '';
  position: absolute;
  right: -2px;
  inset-block: 0;
  width: 9px;
  background: repeating-linear-gradient(0deg, transparent 0 36px, #a75317ac 36px 38px, transparent 38px 62px);
}
.vega-history__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .7fr);
  align-items: end;
  gap: clamp(24px, 8vw, 158px);
  padding: clamp(29px, 5.3vh, 66px) var(--vega-gutter) clamp(20px, 3.2vh, 42px);
}
.vega-history__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  color: #6d4a2d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
}
.vega-history__kicker::before {
  content: '';
  width: 18px;
  height: 7px;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 4px);
}
.vega-history__intro h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 72px);
  line-height: 1.02;
  letter-spacing: -.06em;
  font-weight: 800;
}
.vega-history__summary {
  max-width: 480px;
  font-size: clamp(14px, 1vw, 17px);
  line-height: 1.48;
  color: #51483d;
}
.vega-history__summary p { margin: 0 0 9px; }
.vega-history__summary a { color: var(--vega-ink); }
.vega-history__window {
  align-self: stretch;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-padding-inline: var(--vega-gutter);
}
.vega-history__window::-webkit-scrollbar { display: none; }
.vega-history__world {
  display: flex;
  flex: 0 0 100%;
  margin: 0;
  padding: 0 var(--vega-gutter);
  min-width: 0;
  list-style: none;
}
.vega-history__event {
  display: grid;
  align-content: center;
  justify-items: start;
  flex: 0 0 var(--vega-event-size);
  min-width: 0;
  min-height: clamp(240px, 42vh, 420px);
  padding: 10px clamp(25px, 6vw, 120px) 20px 0;
  margin: 0;
  scroll-snap-align: start;
}
.vega-history__event:last-child { flex-basis: 100%; }
.vega-history:not([data-mode='sticky']) .vega-history__world::after {
  content: '';
  flex: 0 0 var(--vega-gutter);
}
.vega-history__year {
  display: block;
  font-size: clamp(112px, min(14.7vw, 25vh), 264px);
  line-height: .94;
  letter-spacing: -.082em;
  font-weight: 350;
  font-variant-numeric: tabular-nums;
  color: #332920;
  transition: opacity .2s ease;
}
.vega-history[data-ready] .vega-history__event:not([data-current]) .vega-history__year { opacity: .35; }
.vega-history__event-copy {
  width: 100%;
  max-width: 34rem;
  min-block-size: clamp(108px, 12vh, 124px);
  margin-top: clamp(10px, 2.5vh, 25px);
  padding-left: clamp(13px, 1.1vw, 22px);
  border-left: 2px solid #ad6721;
}
.vega-history__event h3 {
  font-size: clamp(20px, 2.1vw, 39px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.045em;
  margin: 0 0 7px;
}
.vega-history__event p {
  margin: 0;
  color: #51483d;
  font-size: clamp(13px, 1.125vw, 18px);
  line-height: 1.38;
}
.vega-history__text { position: relative; }

@media (prefers-reduced-motion: no-preference) {
  body:not([data-motion-paused='true']) .vega-history[data-copy-active] [data-current] .vega-history__reveal {
    animation: vega-history-scan-reveal 490ms steps(10, end);
  }

  body:not([data-motion-paused='true']) .vega-history[data-copy-active] [data-current] .vega-history__text::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, #9e551e, #e89833 70%, transparent) top / 100% 1px no-repeat,
      linear-gradient(180deg, #e8983340, transparent 11px);
    clip-path: inset(0 0 calc(100% - 11px));
    animation: vega-history-scan-line 490ms linear both;
    pointer-events: none;
  }
}

@keyframes vega-history-scan-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

@keyframes vega-history-scan-line {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

.vega-history__controls { padding: 9px var(--vega-gutter) clamp(24px, 4.6vh, 58px); }
.vega-history__controls[hidden] { display: none; }
.vega-history__ruler { position: relative; padding-inline: clamp(18px, 2vw, 28px); }
.vega-history__track {
  height: 26px;
  position: relative;
  background:
    repeating-linear-gradient(90deg, #79563384 0 1px, transparent 1px calc(100% / 35)) center / 100% 11px no-repeat,
    linear-gradient(#7956339c, #7956339c) center / 100% 1px no-repeat;
}
.vega-history__fill,
.vega-history__beam {
  position: absolute;
  inset: 0;
  transform-origin: left center;
}
.vega-history__fill { inset-block: 12px; background: #a65017; transform: scaleX(var(--vega-rail-progress)); }
.vega-history__beam {
  transform: translateX(calc(var(--vega-rail-progress) * 100%));
  pointer-events: none;
}
.vega-history__beam::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: -1px;
  background: #a34410;
  box-shadow: 0 0 13px 3px #efaa5580;
}
.vega-history__readout {
  position: absolute;
  inset: -9px clamp(18px, 2vw, 28px) auto;
  font: 700 11px/1 ui-monospace, monospace;
  color: var(--vega-bronze);
  transform: translateX(calc(var(--vega-rail-progress) * 100%));
  pointer-events: none;
  padding-left: 7px;
}
.vega-history__markers { position: relative; height: 42px; }
.vega-history__markers button {
  position: absolute;
  inset-block: 0;
  left: calc(var(--year-position) * 100%);
  min-width: 39px;
  padding: 0 6px;
  transform: translateX(-50%);
  background: transparent;
  border: 1px solid transparent;
  color: #473b30;
  cursor: pointer;
  font: 700 clamp(12px, 1.15vw, 17px)/1 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.vega-history__markers button[aria-current='date'] {
  background: #fbf4e6;
  border-color: #ad7349;
  color: #663613;
}
.vega-history :is(a, button, [tabindex]):focus-visible { outline: 2px solid #633a20; outline-offset: 3px; }

@media (min-width: 901px) and (min-height: 660px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .vega-history[data-mode='sticky'] { min-height: calc(100svh - var(--vega-top) + clamp(860px, 145vh, 1420px) + var(--vega-tail)); }
  .vega-history[data-mode='sticky'] .vega-history__stage { position: sticky; top: var(--vega-top); height: calc(100svh - var(--vega-top)); }
  .vega-history[data-mode='sticky'] .vega-history__window { overflow: clip; scroll-snap-type: none; }
}
@media (max-width: 900px) {
  .vega-history { --vega-event-size: 85%; }
  .vega-history__intro { grid-template-columns: 1fr; gap: 12px; }
  .vega-history__intro h2 { font-size: clamp(30px, 7.6vw, 58px); }
  .vega-history__year { font-size: clamp(86px, 16vw, 153px); }
  .vega-history__event { min-height: 198px; padding-right: 19px; }
  .vega-history__circuits { inset: auto -61% -36%; }
}
@media (max-width: 440px) {
  .vega-history__intro { padding-top: 28px; padding-bottom: 10px; }
  .vega-history__event { min-height: 170px; padding-bottom: 14px; }
  .vega-history__event-copy { min-block-size: 136px; }
}
@media (prefers-reduced-motion: reduce) {
  .vega-history__year { transition: none; }
}
