:root {
  --bg: #07090c;
  --paper: #f1eadc;
  --mute: #c8d2d8;
  --dim: #aeb8be;
  --water: #143f4e;
  --water-lit: #1a5c6c;
  --land: #c6b496;
  --line: #e4d3ae;
  --guest: #ffe566;
  --guest-ink: #0a0804;
  --heat: #e07a48;
  --card: #101418;
  --plate: #101418;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: "Source Sans 3", sans-serif;
}

html {
  scroll-snap-type: none;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--bg);
}

.stage-wrap {
  position: relative;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 55% 48%, transparent 58%, rgba(7, 9, 12, 0.22) 100%);
}

.stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scale-pin {
  position: absolute;
  right: 48px;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  padding: 5px 10px;
  background: var(--plate);
  border: 0;
  white-space: nowrap;
  transition: opacity 0.28s ease;
}

.viz-label {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  padding: 9px 16px;
  background: #07090c;
  color: #ffffff;
  border: 1px solid #d8c9a8;
}

#pin-ocean {
  color: #c5eef4;
  border-color: #7ec8d4;
}

.scale-pin.pin-gold {
  color: #ffe566;
}

.scale-pin.is-on {
  opacity: 1;
}

.hud {
  position: absolute;
  right: 12.5rem;
  top: 3vh;
  text-align: right;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 16.5rem;
  padding: 10px 12px 11px;
  background: var(--plate);
  z-index: 4;
}

.hud.is-on {
  opacity: 1;
  transform: none;
}

.hud-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}

.hud-country {
  font-family: Fraunces, serif;
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--paper);
}

.hud-share {
  font-family: Fraunces, serif;
  font-size: clamp(1.85rem, 5.2vh, 3.35rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 2px 0 6px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.hud-meta {
  font-size: 0.84rem;
  color: var(--paper);
  line-height: 1.3;
}

.spark.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spark {
  position: absolute;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%) translateY(12px);
  width: min(440px, 72vw);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  padding: 12px 14px 10px;
  background: var(--plate);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.spark-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  font-weight: 600;
  margin-top: 6px;
}

.spark svg {
  width: 100%;
  height: 96px;
}

.spark.is-on #spark-now {
  animation: sparkPulse 1.6s ease-in-out infinite;
}

@keyframes sparkPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.storm {
  position: absolute;
  inset: 0;
  background: #050607;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.storm.is-on {
  opacity: 0.9;
}

.storm-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Fraunces, serif;
  font-size: clamp(5rem, 18vw, 14rem);
  letter-spacing: -0.04em;
  opacity: 0;
  pointer-events: none;
  color: var(--paper);
  transform: scale(1.28);
}

.storm-num.is-on {
  opacity: 0.95;
  transform: scale(1);
  animation: slam 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slam {
  0% {
    opacity: 0;
    transform: scale(1.42);
    filter: blur(10px);
  }
  58% {
    opacity: 1;
    transform: scale(0.97);
    filter: blur(0);
  }
  100% {
    opacity: 0.95;
    transform: scale(1);
  }
}

.storm-flash {
  position: absolute;
  inset: 0;
  background: #f1eadc;
  opacity: 0;
  pointer-events: none;
}

.storm-flash.is-on {
  animation: flash 0.5s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

.progress {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.counter {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--mute);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  background: var(--plate);
  padding: 3px 6px;
}

.progress button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.progress button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a353c;
  transform: translate(-50%, -50%);
}

.progress button.is-on::after {
  background: var(--paper);
  width: 9px;
  height: 9px;
}

.steps {
  position: relative;
  z-index: 2;
  margin-top: -100vh;
}

.step {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 8vh 7rem 8vh 2.4rem;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.step-card {
  width: min(30rem, calc(100vw - 14rem));
  padding: 1.45rem 1.6rem 1.6rem;
  background: var(--card);
  border-left: 2px solid var(--line);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.45s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.is-on .step-card {
  opacity: 1;
  transform: none;
}

.step.is-on .kicker {
  animation: riseIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step.is-on h2 {
  animation: riseIn 0.7s 0.06s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step.is-on p {
  animation: riseIn 0.75s 0.14s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step.is-on p + p {
  animation-delay: 0.22s;
}

.step-title.is-on h1 {
  animation: titleIn 1.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes titleIn {
  0% {
    opacity: 0;
    transform: translateY(22px);
    letter-spacing: -0.08em;
  }
  100% {
    opacity: 1;
    transform: none;
    letter-spacing: -0.03em;
  }
}

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
  color: var(--line);
  margin: 0 0 12px;
}

h1,
h2 {
  font-family: Fraunces, serif;
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.step p {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--mute);
}

.step p + p {
  margin-top: 0.85rem;
}

.step .lead {
  color: var(--paper);
  font-size: 1.28rem;
}

.to-sources {
  margin-top: 1.15rem;
}

.to-sources a {
  color: var(--line);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(228, 211, 174, 0.45);
}

.to-sources a:hover,
.to-sources a:focus-visible {
  border-bottom-color: var(--line);
}

.credits {
  position: relative;
  z-index: 3;
  padding: 12vh 8vw 10vh;
  border-top: 1px solid #1b262c;
  background: #06080b;
  color: var(--mute);
  font-size: 0.95rem;
  line-height: 1.5;
  scroll-snap-align: start;
}

.credits:focus {
  outline: none;
}

.credits h2 {
  color: var(--paper);
  margin-bottom: 1rem;
}

.credits h3 {
  font-family: Fraunces, serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--paper);
  margin: 1.6rem 0 0.4rem;
}

.credits a {
  color: var(--line);
}

.credits ul {
  padding-left: 1.1rem;
}

.credits li {
  margin: 0.35rem 0;
}

.scroll-hint {
  position: absolute;
  left: 8vw;
  bottom: 6vh;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--plate);
  padding: 5px 10px;
  z-index: 3;
  pointer-events: none;
  animation: hintPulse 2.4s ease-in-out infinite;
}

@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 0.9;
    transform: translateY(4px);
  }
}

.scroll-hint.is-gone {
  opacity: 0;
  animation: none;
}

@media (max-width: 820px) {
  .step {
    align-items: flex-end;
    padding: 0 5vw 6vh;
  }

  .hud {
    right: auto;
    left: 4vw;
    top: 3.5vh;
    text-align: left;
    max-width: min(20rem, 78vw);
  }

  .hud-share {
    font-size: 2.6rem;
  }

  .progress {
    display: none;
  }

  .scale-pin {
    right: 12px;
  }

  .storm-num {
    font-size: 5.5rem;
    align-items: flex-start;
    padding-top: 18vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: y mandatory;
  }

  .hud,
  .spark,
  .storm-num,
  .step-card,
  .scroll-hint,
  .step.is-on .kicker,
  .step.is-on h2,
  .step.is-on p,
  .step-title.is-on h1 {
    transition: none;
    animation: none;
  }

  .step-card {
    opacity: 1;
    transform: none;
  }

  .storm-num {
    transform: none;
  }
}
