/* ============================================================
   Story of US - homepage editorial motion chapters
   The colored palette stays inside the official 0 mark and data points.
   ============================================================ */

/* --- Chapter 1: fixed brand signature --- */

.hero-chapter {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: clip;
  padding-top: 72px;
}

.hero-inner {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(1.25rem, 4vh, 3rem) clamp(2rem, 7vh, 4.5rem);
}

.hero-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
  user-select: none;
}

.hero-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5.2rem, 17vw, 12.5rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-zero {
  display: inline-flex;
  width: clamp(4.7rem, 14vw, 10.5rem);
}

.hero-cluster {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-title {
  margin-top: clamp(0.7rem, 2.4vh, 1.5rem);
  font-size: clamp(1.75rem, 4.2vw, 3.4rem);
  display: grid;
  gap: 0.15em;
}

.hero-ctas {
  margin-top: clamp(1.1rem, 3vh, 2rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.hero-ctas .button {
  min-height: 48px;
}

.hero-lede {
  margin-top: clamp(1rem, 2.7vh, 1.5rem);
  max-width: 58ch;
  font-size: 1.05rem;
  color: var(--ink-body);
}

/* --- Chapter 2: The Bet --- */

.bet-chapter {
  padding-block: clamp(6rem, 14vh, 10rem);
}

.bet-line {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: none;
  margin: 0;
}

.bet-line-accent {
  color: var(--red);
  font-style: italic;
}

.bet-line-body {
  margin-top: 2rem;
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 62ch;
}

.bet-more {
  display: inline-block;
  margin-top: 2.2rem;
  font-weight: 600;
}

/* --- Chapter 3: the count --- */

.count-chapter {
  overflow: clip;
}

.count-rule {
  margin-bottom: 3.5rem;
}

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

.count-figure {
  display: block;
  font-size: clamp(3.6rem, 9vw, 7.5rem);
}

.count-label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.count-progress {
  margin-top: 3rem;
  font-size: 1.05rem;
  color: var(--ink-body);
}

/* --- Chapter 4: map preview --- */

.mapview-heading {
  max-width: 56ch;
  margin-bottom: 3rem;
}

.map-plate {
  position: relative;
  overflow: clip;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(0.8rem, 2.5vw, 2rem);
}

.us-map {
  width: 100%;
  height: auto;
}

.us-map .map-ocean {
  fill: transparent;
}

.us-map .map-grid path {
  stroke: var(--hairline);
  stroke-width: 0.5;
  fill: none;
}

.us-map .map-state {
  fill: var(--paper-deep);
  stroke: var(--paper);
  stroke-width: 1;
  transition: fill var(--dur-state) var(--ease-out);
}

.us-map .map-coast-notes path {
  display: none;
}

.us-map .map-inset-labels text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--ink-muted);
}

.map-dots {
  position: absolute;
  inset: clamp(0.8rem, 2.5vw, 2rem);
}

.map-dot {
  --map-dot-color: var(--dot-1);
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}

.map-dot::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: var(--map-dot-color);
  border: 2px solid var(--paper-raised);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  transition: transform 500ms var(--ease-out) var(--map-dot-delay, 0ms);
}

.map-dots.is-animated .map-dot::after {
  transform: scale(0);
}

.map-dots.is-animated.is-visible .map-dot::after {
  transform: scale(1);
}

.dot-color-1 { --map-dot-color: var(--dot-1); }
.dot-color-2 { --map-dot-color: var(--dot-2); }
.dot-color-3 { --map-dot-color: var(--dot-3); }
.dot-color-4 { --map-dot-color: var(--dot-4); }
.dot-color-5 { --map-dot-color: var(--dot-5); }
.dot-color-6 { --map-dot-color: var(--dot-6); }
.dot-color-7 { --map-dot-color: var(--dot-7); }
.dot-color-8 { --map-dot-color: var(--dot-8); }

.map-dot-tag {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-state) var(--ease-out), transform var(--dur-state) var(--ease-out);
}

.mapview-cta {
  margin-top: 2.5rem;
}

/* --- Chapter 5: featured stories; native horizontal scroll, never pinned --- */

.featured-chapter {
  background: var(--paper-deep);
  overflow: clip;
}

.featured-heading {
  margin-bottom: 3rem;
}

.featured-viewport {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-inline: var(--gutter);
  padding-bottom: 0.6rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.featured-viewport::-webkit-scrollbar {
  display: none;
}

.featured-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding-bottom: 0.5rem;
}

.featured-card {
  width: min(82vw, 380px);
  scroll-snap-align: start;
  flex: none;
  display: flex;
  flex-direction: column;
}

.featured-media img,
.featured-placeholder {
  aspect-ratio: 4 / 3;
}

.featured-placeholder {
  display: grid;
  place-items: center;
  background: var(--ink-wash);
}

.featured-placeholder .brand-mark {
  width: 72px;
  height: 72px;
  opacity: 0.75;
}

.featured-body {
  padding: 1.4rem 1.5rem 1.7rem;
}

.featured-number {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.7rem;
}

.featured-body h3 {
  margin-bottom: 0.2rem;
}

.featured-meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
}

.featured-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
}

/* --- Chapter 6: closing --- */

.closing-chapter {
  padding-block: clamp(7rem, 18vh, 12rem);
  overflow: clip;
}

.closing-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.closing-inner h2 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
}

.closing-inner p {
  max-width: 46ch;
  margin-bottom: 1.6rem;
}

.closing-cta {
  min-height: 48px;
  padding: 1.05rem 2.6rem;
  font-size: 1.05rem;
}

@media (hover: hover) and (pointer: fine) {
  .map-dot:hover::after,
  .map-dot:focus-visible::after {
    transform: scale(1.24);
  }

  .map-dot:hover .map-dot-tag,
  .map-dot:focus-visible .map-dot-tag {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 860px) {
  .hero-inner {
    justify-content: flex-start;
  }

  .hero-ctas {
    width: min(100%, 300px);
    flex-direction: column;
  }

  .hero-ctas .button {
    width: 100%;
  }

  .count-grid {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    text-align: center;
  }

  .map-plate {
    margin-inline: calc(var(--gutter) * -0.25);
  }
}

@media (max-width: 420px) {
  .hero-chapter {
    align-items: flex-start;
  }

  .hero-inner {
    padding-top: 1rem;
  }

  .hero-num {
    font-size: clamp(4.65rem, 25vw, 6rem);
  }

  .hero-zero {
    width: clamp(4.2rem, 22vw, 5.5rem);
  }

  .hero-title {
    font-size: clamp(1.5rem, 7.4vw, 1.9rem);
  }

  .hero-lede {
    font-size: 0.94rem;
    line-height: 1.52;
  }

  .map-plate {
    padding: 0.45rem;
  }

  .map-dots {
    inset: 0.45rem;
  }
}

@media (max-height: 700px) and (max-width: 860px) {
  .hero-inner {
    padding-block: 0.65rem 1.5rem;
  }

  .hero-title {
    margin-top: 0.45rem;
  }

  .hero-ctas {
    margin-top: 0.75rem;
    gap: 0.5rem;
  }

  .hero-lede {
    margin-top: 0.75rem;
  }
}

@media (min-width: 861px) {
  .featured-track {
    gap: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-dot::after,
  .map-dot-tag,
  .us-map .map-state {
    transition: none;
  }

  .map-dots.is-animated .map-dot::after {
    transform: scale(1);
  }
}
