:root {
  --bg: #081016;
  --text: #f5f5f5;
  --muted: #8ea3b3;
  --accent: #ffb703;
  --step-bg: rgba(8, 16, 22, 0.75);
  --card: rgba(6, 9, 14, 0.9);
  --max-width: 1100px;
  --transition: 400ms ease;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1823, #05070b 50%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: #FFF;
  text-decoration: underline;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: #FFF;
}

img {
  margin-bottom: 1rem;
}

h2 {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  margin: 0;
  padding: 0;
}

.intro {
  min-height: calc(100vh - 5rem);
  padding: 4rem 0 3rem;
}

.screen-block {
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-block[data-bg] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.screen-block[data-bg] > * {
  position: relative;
  z-index: 2;
}


.screen-block[data-bg]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--article-bg-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: translateY(8%);
  transition: opacity 600ms ease, transform 600ms ease;
  z-index: 0;
}

.screen-block[data-bg].is-active::before {
  opacity: 1;
  transform: translateY(0);
}

.screen-block {
  min-height: 100vh;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.intro__text {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
  margin: 0 auto;
}

.intro__text p {
  margin-bottom: 1rem;
}

.scene {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text);
  line-height: 1.7;
  flex-direction: column;
  text-align: center;
  font-size: 1.5rem;
}

.scene p + p {
  margin-top: 1rem;
}

.scene__footnote {
  font-size: 1.05rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.5rem auto 0;
  text-align: center;
  line-height: 1.7;
}

.scene__footnote--large {
  font-size: 1.35rem;
  color: var(--text);
  font-style: normal;
}

.intro__text .stat {
  margin: 1.75rem auto 1rem;
  color: var(--text);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.intro__text .stat strong {
  font-size: clamp(2.8rem, 14vw, 15.5rem);
  color: var(--accent);
  display: inline-block;
  line-height: 1.1;
}

.intro__text .stat span {
  display: block;
  margin-top: 0.4rem;
  text-align: center;
  font-size: 1.5rem;
}

.intro__text .byline {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-align: center;
}

.course-note {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1rem;
}

.flow-arrow {
  font-size: 2rem;
  text-align: center;
  color: var(--accent);
  animation: bounce 1.5s infinite;
  margin-bottom: 1.5rem;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

.scrolly__figure {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.figure__image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-position: center;
  transition: filter var(--transition);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  --slide-duration: 900ms;
}

.figure__image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--next-background, none);
  background-size: cover;
  background-position: center;
  transform: translateY(100%);
  transition: transform var(--slide-duration) cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
  pointer-events: none;
}

.figure__image.is-sliding::before {
  transform: translateY(0);
}

.figure__map {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.figure__map.is-active {
  opacity: 1;
  pointer-events: none;
}

.figure__image--map {
  background-image: none !important;
  background-color: #03070b;
  pointer-events: none;
}

.figure__image--map::before {
  display: none;
}

.figure__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 7, 11, 0.1),
    rgba(5, 7, 11, 0.8) 60%
  );
  pointer-events: none;
  z-index: 2;
}

.figure__image--map::after {
  background: none;
}

.figure__caption {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--max-width), 90vw);
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.4;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.scrolly__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.scrolly {
  position: relative;
  margin-top: 1rem;
}

.scrolly__article {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 35vh;
  padding-bottom: 60vh;
}

.references-article {
  background: rgba(4, 7, 12, 0.78);
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.4);
  margin: 4rem auto;
  width: min(960px, 100%);
}

.references-article .references {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.references-article ol {
  padding-left: 1.5rem;
  line-height: 1.6;
}

.step {
  background: rgba(4, 7, 12, 0.78);
  padding: 1.75rem;
  border-radius: 1.25rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  width: min(640px, 95%);
  margin: 0 auto;
  /* min-height: 60vh; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: box-shadow var(--transition), background-color var(--transition);
}

.step--map {
  width: 100%;
  padding: 45vh 0;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
  gap: 0;
  margin: 0;
  visibility: hidden;
}

body.map-active .scrolly__content {
  pointer-events: none;
}

.step.is-active {
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.45);
}

.step h2 {
  font-size: 1.45rem;
  margin-bottom: 0.75rem;
}

.step p {
  color: var(--text);
  margin-bottom: 0.5rem;
}

#map {
  width: 100%;
  height: 100%;
}

.todo {
  color: var(--accent);
  font-size: 0.9rem;
}

.map-story {
  margin-top: 4rem;
  background: var(--card);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35);
  flex-direction: column;
  gap: 1rem;
}

.map-story__text {
  margin-bottom: 0;
}

.embed-placeholder {
  padding: 2rem;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-deep-dive {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.data-deep-dive + .data-deep-dive {
  margin-top: 2rem;
}

.data-card {
  background: rgba(3, 6, 11, 0.9);
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
  flex-direction: column;
  gap: 1rem;
  width: min(720px, 100%);
  margin: 0 auto;
}

.data-card h3 {
  font-size: 1.4rem;
}

.source-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .scrolly__content {
    padding: 0 1rem 3rem;
  }

  .scrolly__article {
    padding-top: 30vh;
    padding-bottom: 50vh;
  }

  .step--map {
    width: 100%;
  }

  .data-card {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
