/* ============================================================
   Story of US - homepage scroll-telling chapters
   Chapter layout families are unique; do not clone one for another.
   ============================================================ */

/* --- Chapter 1: hero --- */

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

.hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ambient-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  will-change: transform;
}

.hero-inner {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 3rem 4rem;
}

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

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

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

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

.hero-title {
  margin-top: 1.6rem;
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  display: grid;
  gap: 0.15em;
}

.hero-lede {
  margin-top: 1.4rem;
  max-width: 58ch;
  font-size: 1.1rem;
  color: var(--ink-body);
}

.hero-ctas {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* --- 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: hidden;
}

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

.count-grid {
  display: grid;
  grid-template-columns: repeat(3, 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;
  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-micro) 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 {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--paper-raised);
}

html.js-enabled .map-dot {
  transform: translate(-50%, -50%) scale(0);
  transition: transform 500ms var(--ease-out);
}

html.js-enabled .map-dots.is-visible .map-dot {
  transform: translate(-50%, -50%) scale(1);
}

.map-dot:hover,
.map-dot:focus-visible {
  animation: dot-pulse 1.6s var(--ease-out);
  z-index: 2;
}

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

.map-dot-tag {
  position: absolute;
  bottom: calc(100% + 8px);
  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-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}

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

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

/* --- Chapter 5: featured stories --- */

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

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

.featured-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: var(--gutter);
  scrollbar-width: none;
}

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

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

.featured-card {
  width: min(78vw, 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);
}

/* Desktop: the gallery pins and pans horizontally (JS-driven) */
@media (min-width: 1024px) {
  html.js-enabled .featured-viewport[data-pinned] {
    overflow: visible;
  }
}

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

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

.closing-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.closing-dots .drift-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  opacity: 0.8;
  animation-delay: var(--d, 0s);
}

.closing-inner {
  position: relative;
  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 {
  padding: 1.05rem 2.6rem;
  font-size: 1.05rem;
}

/* --- Responsive --- */

@media (max-width: 860px) {
  .count-grid {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    text-align: center;
  }

  .map-dot {
    width: 11px;
    height: 11px;
  }
}
