/* ==========================================================================
   02 · A Legacy of Growth (Legacy)
   Milestone rail: native horizontal scroll + scroll-snap (touch), mouse drag
   from core.js [data-drag-scroll], progress line from js/sections/legacy.js.
   ========================================================================== */
.legacy {
  position: relative;
  overflow: hidden;
  padding: 80px 0 64px;
  background-image: linear-gradient(to right in oklab, var(--crimson), var(--royal));
}
@media (min-width: 768px) {
  .legacy {
    padding: 100px 0 67px;
  }
}

/* ---- Background stage (1440×650): GHC graphic element at 8% opacity ---- */
.legacy__stage {
  position: absolute;
  top: 0;
  left: -200px;
  width: 1440px;
  height: 650px;
}
@media (min-width: 768px) {
  .legacy__stage {
    left: 50%;
    translate: -50% 0;
  }
}
.legacy__art {
  position: absolute;
  top: -595px;
  left: -202.15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2235.353px;
  height: 2169.549px;
}
.legacy__art-rotate {
  flex: none;
  rotate: -20.5deg;
}
.legacy__art-img {
  position: relative;
  width: 1767.58px;
  height: 1655.38px;
  opacity: 0.08;
}
.legacy__art-img img {
  object-fit: cover;
}

/* ---- Heading ---- */
.legacy__inner {
  position: relative;
}
.legacy__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
}
.legacy__eyebrow {
  color: rgba(255, 255, 255, 0.75);
}
.legacy__eyebrow .eyebrow__index {
  border-color: var(--navy-60);
}
.legacy__title {
  margin-top: 24px;
  font-weight: var(--fw-regular);
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--white);
}
@media (min-width: 768px) {
  .legacy__title {
    font-size: 64px;
    line-height: 76px;
  }
}
.legacy__range {
  font-size: 12px;
  line-height: 16px;
  color: var(--white);
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---- Rail ---- */
.legacy__rail {
  /* Left edge of the rail lines up with the page container */
  --rail-pad: 20px;
  position: relative;
  margin-top: 40px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-pad);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.legacy__rail:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.legacy__rail.is-dragging {
  cursor: grabbing;
}
@media (min-width: 768px) {
  .legacy__rail {
    --rail-pad: 40px;
    margin-top: 58px;
  }
}
@media (min-width: 1280px) {
  .legacy__rail {
    --rail-pad: max(56px, calc((100vw - 1440px) / 2 + 56px));
  }
}
.legacy__track {
  display: flex;
  gap: 16px;
  width: max-content;
  padding-inline: var(--rail-pad);
}
.legacy__item {
  scroll-snap-align: start;
}

/* ---- Milestone card ---- */
.legacy__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  width: min(400px, calc(100vw - 56px));
  height: 100%;
  min-height: 268px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 0.5s var(--ease-out-expo),
    border-color 0.5s var(--ease-out-expo),
    translate 0.5s var(--ease-out-expo);
}
.legacy__card:hover {
  translate: 0 -4px;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}
@media (min-width: 768px) {
  .legacy__card {
    width: 400px;
  }
}
.legacy__card-year {
  font-weight: var(--fw-news);
  font-size: 56px;
  line-height: 64px;
  letter-spacing: -0.04em;
}
@media (min-width: 768px) {
  .legacy__card-year {
    font-size: 72px;
    line-height: 80px;
  }
}
.legacy__card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legacy__card-title {
  font-weight: var(--fw-regular);
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.02em;
}
.legacy__card-text {
  font-weight: var(--fw-news);
  font-size: 16px;
  line-height: 20px;
  opacity: 0.72;
}

/* ---- Scroll progress line ---- */
.legacy__progress {
  position: relative;
  margin-top: 32px;
}
.legacy__progress-track {
  position: relative;
  width: 160px;
  height: 1px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}
.legacy__progress-track.is-hidden {
  visibility: hidden;
}
.legacy__progress-thumb {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transform-origin: left;
  transform: scaleX(0);
}
