/* ============================================ */
/*  DESIGN TOKENS — Bright Tropical Reef         */
/* ============================================ */
:root {
  /* Ocean palette */
  --c-teal-deep: #04546b;
  --c-teal: #0c8ca8;
  --c-teal-bright: #2bb8d4;
  --c-teal-pale: #b8e8f0;
  --c-aqua: #5fd9e3;

  /* Coral / warm accents */
  --c-coral: #ff7058;
  --c-coral-soft: #ffb89c;
  --c-sand: #f5e9d3;

  /* Neutrals */
  --c-bg: #f4fbfc;
  --c-bg-alt: #e7f5f8;
  --c-ink: #0a2935;
  --c-ink-mute: #4a6d7a;
  --c-ink-dim: #8aa5af;

  /* Anomaly ramp */
  --c-anom-cold: #1a6e9a;
  --c-anom-neutral: #f0ede0;
  --c-anom-hot: #d63a1f;

  /* Variability Accent*/
  --c-amber: #d99a3c;
  --c-amber-deep: #b87a1e;
  --c-amber-pale: rgba(217, 154, 60, 0.18);
  --c-bleach-bg: #a8d4dd;
  --c-micro-bg: #82c0ce;
  --c-deep-blue: #0c3a52;

  /* Type */
  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Inter", -apple-system, system-ui, sans-serif;

  /* Spacing */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 5rem;
  --s-7: 8rem;
}

/* ============================================ */
/*  RESET & BASE                                  */
/* ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--c-ink);
}

p {
  margin: 0 0 var(--s-3) 0;
}

strong {
  font-weight: 600;
  color: var(--c-teal-deep);
}

em {
  font-style: italic;
  color: var(--c-coral);
  font-variation-settings: "opsz" 144;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--c-teal);
  font-weight: 500;
  margin-bottom: var(--s-3);
}

/* ============================================ */
/*  SECTION 1 · INTRO                             */
/* ============================================ */
.intro {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6) var(--s-4);
  overflow: hidden;
  isolation: isolate;

  /* Base gradient — sunlit shallows fading down */
  background: linear-gradient(180deg,
      var(--c-teal-pale) 0%,
      var(--c-teal-bright) 50%,
      var(--c-teal-bright) 100%);
  /* ← stays at teal-bright at bottom */
}

/* ── Guided walkthrough box  ── */
.intro__walkthrough {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  display: inline-block;
  padding: 0.4rem 0.7rem;
  background: color-mix(in srgb, var(--c-teal-bright) 60%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--c-teal-bright) 80%, transparent);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.intro__walkthrough:hover {
  background: color-mix(in srgb, var(--c-teal-bright) 85%, transparent);
  color: #fff;
}

/* Layer 1: animated caustics (light dappling on water) */
.intro__water {
  position: absolute;
  inset: -20%;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0%, transparent 25%),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.12) 0%, transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(95, 217, 227, 0.25) 0%, transparent 25%);
  filter: blur(40px);
  animation: water-drift 14s ease-in-out infinite alternate;
}

@keyframes water-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-3%, 2%) scale(1.05);
  }
}

/* Layer 2: floating bubbles */
.intro__bubbles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Fade out intro's decoration at its bottom edge for seamless transition */
.intro::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 25vh;
  background: linear-gradient(180deg,
      transparent 0%,
      var(--c-teal-bright) 100%);
  z-index: 5;
  /* above the water animation, below the content */
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.35) 35%,
      rgba(255, 255, 255, 0.1) 70%,
      rgba(255, 255, 255, 0.05) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset -2px -3px 6px rgba(43, 184, 212, 0.2),
    0 0 8px rgba(255, 255, 255, 0.3);
  animation: rise linear infinite;
}

/* Each bubble: position, size, speed, delay vary so they don't march in sync */
.bubble--1 {
  left: 8%;
  width: 18px;
  height: 18px;
  animation-duration: 7s;
  animation-delay: 0s;
}

.bubble--2 {
  left: 18%;
  width: 28px;
  height: 28px;
  animation-duration: 9s;
  animation-delay: 2s;
}

.bubble--3 {
  left: 32%;
  width: 12px;
  height: 12px;
  animation-duration: 6s;
  animation-delay: 1s;
}

.bubble--4 {
  left: 50%;
  width: 36px;
  height: 36px;
  animation-duration: 11s;
  animation-delay: 3s;
}

.bubble--5 {
  left: 67%;
  width: 16px;
  height: 16px;
  animation-duration: 7s;
  animation-delay: 0.5s;
}

.bubble--6 {
  left: 81%;
  width: 24px;
  height: 24px;
  animation-duration: 8s;
  animation-delay: 2.5s;
}

.bubble--7 {
  left: 92%;
  width: 10px;
  height: 10px;
  animation-duration: 5s;
  animation-delay: 1.5s;
}


@keyframes rise {
  0% {
    transform: translateY(0) translateX(0) scale(0.8);
    opacity: 0;
  }

  10% {
    opacity: 0.95;
  }

  50% {
    transform: translateY(-50vh) translateX(15px) scale(1);
    opacity: 0.8;
  }

  90% {
    opacity: 0.7;
  }

  100% {
    transform: translateY(-110vh) translateX(-10px) scale(1.1);
    opacity: 0;
  }
}

/* Layer 3: content */
.intro__content {
  position: relative;
  z-index: 3;
  max-width: 760px;
  text-align: center;
}

.intro__title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-4);
  color: var(--c-teal-deep);
  font-variation-settings: "opsz" 144;
}

.intro__title em {
  color: var(--c-coral);
}

.intro__lede {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--c-teal-deep);
  max-width: 580px;
  margin: 0 auto var(--s-6) auto;
  line-height: 1.65;
  opacity: 0.85;
}

/* Scroll cue */
.intro__scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-teal-deep);
  opacity: 0.6;
}

.intro__scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, var(--c-teal-deep) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
  opacity: 0.5;
}

.intro__scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--c-coral);
  animation: scroll-pulse 2.2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    transform: translateY(400%);
    opacity: 0;
  }
}

.intro__byline {
  margin: 0.75rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #b8e8f0;
}

/* ============================================ */
/*  SCROLLYTELLING LAYOUT                         */
/*  Two columns: sticky graphic | scrolling text */
/* ============================================ */
.scrolly {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-bottom: var(--s-7);
  background: var(--c-teal-bright);
}

.scrolly__graphic {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graphic-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.graphic-inner svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scrolling text column */
.scrolly__steps {
  position: relative;
  padding: 0 var(--s-5);
  display: flex;
  flex-direction: column;
}

.step {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
  padding: var(--s-5) 0;
  opacity: 0.3;
  transition: opacity 0.6s ease;
}

.step.is-active {
  opacity: 1;
}

.step__title {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 500;
  margin-bottom: var(--s-3);
  color: var(--c-teal-deep);
  font-variation-settings: "opsz" 144;
}

.step p {
  font-size: 1.05rem;
  color: var(--c-teal-deep);
  opacity: 0.8;
  line-height: 1.7;
}

.step strong {
  color: #e54a2e;
  font-weight: 600;
}

.interaction-hint {
  font-style: italic;
  font-weight: 300;
  font-size: 0.92rem;
  color: white;
  /* opacity: 0.65; */
  letter-spacing: 0.02em;
  margin-top: var(--s-2);
  display: block;
}

/* Mobile: stack columns */
@media (max-width: 900px) {
  .scrolly {
    grid-template-columns: 1fr;
  }

  .scrolly__graphic {
    height: 60vh;
  }

  .scrolly__steps {
    padding: 0 var(--s-4);
  }

  .step {
    max-width: 100%;
    min-height: 80vh;
  }
}

/* ============================================ */
/*  DIVE · empty transition section              */
/* ============================================ */
.dive {
  position: relative;
  height: 80vh;
  background: var(--c-teal-bright);
  /* matches both neighbors */
}

/* ============================================ */
/*  DIVE OVERLAY · scroll-driven bubble layer    */
/* ============================================ */
#dive-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  /* JS will set this based on scroll */
  transition: opacity 0.05s linear;
  overflow: hidden;
}

/* Individual bubble — created by JS, animated by CSS */
.dive-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.4) 35%,
      rgba(255, 255, 255, 0.1) 75%,
      rgba(255, 255, 255, 0.05) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset -2px -3px 6px rgba(43, 184, 212, 0.25),
    0 0 8px rgba(255, 255, 255, 0.3);
  bottom: -80px;
  will-change: transform, opacity;
  animation: dive-bubble-rise linear forwards;
}

@keyframes dive-bubble-rise {
  0% {
    transform: translateY(0) translateX(0) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  85% {
    opacity: 0.9;
  }

  100% {
    transform: translateY(-110vh) translateX(15px) scale(1.4);
    opacity: 0;
  }
}

/* ============================================ */
/*  SECTION 2 · MAP STAGE                        */
/* ============================================ */
.map-stage {
  width: 100%;
  height: 100%;
  position: relative;
}

.map-stage svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ocean — slightly lighter than the section bg to show contrast */
.map-ocean {
  fill: var(--c-teal-pale);
  opacity: 0.4;
}

/* Land masses */
.map-land {
  fill: var(--c-sand);
  stroke: var(--c-teal-deep);
  stroke-width: 0.4px;
  stroke-opacity: 0.3;
}

/* Subtle latitude/longitude lines */
.map-graticule {
  fill: none;
  stroke: var(--c-teal-deep);
  stroke-width: 0.4px;
  stroke-opacity: 0.1;
}

/* Reef location dots */
.reef-dot {
  fill: var(--c-coral);
  fill-opacity: 0.85;
  stroke: white;
  stroke-width: 1.5px;
  stroke-opacity: 0.7;
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

.reef-dot:hover {
  fill-opacity: 1;
  stroke-width: 2.5px;
}

/* Tooltip — appears on dot hover */
.reef-tooltip {
  position: absolute;
  background: white;
  color: var(--c-teal-deep);
  padding: var(--s-1) var(--s-2);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(4, 84, 107, 0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.reef-tooltip.reef-tooltip--fixed {
  position: fixed;
}

.reef-tooltip.is-visible {
  opacity: 1;
}



/* ============================================ */
/*  SECTION 2 · BRUSH ANIMATION                  */
/* ============================================ */

/* The pulsing GBR dot before brush starts */
.reef-dot--gbr-active {
  fill: white;
  stroke: var(--c-coral);
  stroke-width: 3px;
}

/* Pulse animation applied via class */
.reef-dot--pulse {
  animation: gbr-pulse 0.6s ease-in-out 2;
  /* runs twice */
}

@keyframes gbr-pulse {

  0%,
  100% {
    r: 6;
    fill-opacity: 0.85;
  }

  50% {
    r: 12;
    fill-opacity: 1;
  }
}

/* Brush rectangle — animated from a corner */
.gbr-brush {
  fill: rgba(255, 112, 88, 0.10);
  stroke: var(--c-coral);
  stroke-width: 2px;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

/* Class-based dimming — overrides hover transitions reliably */
.reef-dot.is-dimmed {
  fill-opacity: 0.2 !important;
  pointer-events: none;
}

/* ============================================ */
/*  SECTION 2 · SST DATA OVERLAY                 */
/* ============================================ */

/* The SST data image, positioned over the brush area */
.sst-image {
  pointer-events: none;
  /* tooltip handled by a transparent rect on top */
  opacity: 0;
  /* JS will fade it in */
  transition: opacity 0.6s ease;
}

.sst-image.is-visible {
  opacity: 1;
}

/* The desaturation/dim overlay covering the area outside the brush.
   It's a path with a "hole" cut out where the brush is. */
.spotlight-overlay {
  fill: rgba(247, 247, 250, 0.65);
  /* pale wash — slight dim without darkening */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.spotlight-overlay.is-visible {
  opacity: 1;
}

/* Tooltip for the SST data area */
.sst-tooltip {
  position: absolute;
  background: white;
  color: var(--c-teal-deep);
  padding: var(--s-2) var(--s-3);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(4, 84, 107, 0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
  line-height: 1.4;
}

.sst-tooltip.is-visible {
  opacity: 1;
}

.sst-tooltip__year {
  font-family: var(--f-display);
  font-size: 1.1rem;
  display: block;
}

.sst-tooltip__value {
  color: var(--c-coral);
  font-weight: 600;
}

/* ============================================ */
/*  SECTION 2 · SST CONTROLS                     */
/*  Year slider + anomaly toggle                  */
/* ============================================ */

.sst-controls {
  margin-top: var(--s-3);
  padding: var(--s-3);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(4, 84, 107, 0.08);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  max-width: 460px;
}

.sst-controls.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sst-controls__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-2);
}

.sst-year-display {
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--c-teal-deep);
  font-variation-settings: "opsz" 144;
  line-height: 1;
}

.sst-toggle {
  background: var(--c-teal-deep);
  color: white;
  border: none;
  padding: var(--s-1) var(--s-3);
  border-radius: 4px;
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.sst-toggle:hover {
  background: var(--c-coral);
}

.sst-toggle:active {
  transform: scale(0.97);
}

.sst-toggle.is-anomaly {
  background: var(--c-coral);
}

.sst-toggle.is-anomaly:hover {
  background: var(--c-teal-deep);
}

.sst-year-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(90deg,
      var(--c-teal-bright) 0%,
      var(--c-coral) 100%);
  border-radius: 2px;
  outline: none;
}

.sst-year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: white;
  border: 3px solid var(--c-teal-deep);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.sst-year-slider::-webkit-slider-thumb:hover {
  border-color: var(--c-coral);
  transform: scale(1.15);
}

.sst-year-slider:active::-webkit-slider-thumb {
  background: var(--c-teal-pale);
}

.sst-year-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border: 3px solid var(--c-teal-deep);
  border-radius: 50%;
  cursor: pointer;
}

/* Disable interaction during the auto-animation */
.sst-year-slider:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sst-year-slider:disabled::-webkit-slider-thumb {
  border-color: var(--c-ink-dim);
}

/* ============================================ */
/*  SECTION 2 · SST LEGEND                       */
/* ============================================ */

.sst-legend {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.sst-legend__label {
  font-size: 0.85rem;
  color: var(--c-teal-deep);
  font-family: var(--f-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  min-width: 2.5em;
}

.sst-legend__label:last-child {
  text-align: right;
}

.sst-legend__bar {
  flex: 1;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(4, 84, 107, 0.15);
  /* Default colors set by JS to match current mode */
}

/* SST mode: inferno colormap */
.sst-legend__bar.is-sst {
  background: linear-gradient(90deg,
      #000004 0%,
      #420a68 25%,
      #932667 50%,
      #dd513a 75%,
      #fca50a 90%,
      #fcffa4 100%);
}

/* Anomaly mode: diverging blue → white → red */
.sst-legend__bar.is-anomaly {
  background: linear-gradient(90deg,
      #2166ac 0%,
      #67a9cf 25%,
      #f7f7f7 50%,
      #ef8a62 75%,
      #b2182b 100%);
}

/* Standalone legend (for Step 2 — no slider, no toggle, just colors) */
.sst-legend-standalone {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(4, 84, 107, 0.08);
  border-radius: 6px;
  max-width: 460px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.sst-legend-standalone.is-visible {
  opacity: 1;
}

.sst-unit-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 3px;
}

#sst-unit-step2 {
  margin-left: 12px;
}

.sst-unit-btn {
  border: none;
  background: transparent;
  font-family: var(--f-body);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--c-teal-deep);
  cursor: pointer;
}

.sst-unit-btn.is-active {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ============================================ */
/*  SECTION · CASCADING EFFECTS                  */
/* ============================================ */

.effects {
  background: var(--c-bg);
  padding: var(--s-7) var(--s-4);
  position: relative;
}

.effects__intro {
  max-width: 720px;
  margin: 0 auto var(--s-6) auto;
  text-align: center;
}

.effects__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: var(--s-3);
  font-variation-settings: "opsz" 144;
}

.effects__lede {
  font-size: 1.05rem;
  color: var(--c-ink-mute);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.effects__grid {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  perspective: 1500px;
  /* Required for 3D flip effect */
}

/* ----- Card structure ----- */

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  /* Square cards */
  cursor: pointer;
  outline: none;
}

.card:focus-visible {
  outline: 3px solid var(--c-coral);
  outline-offset: 4px;
  border-radius: 8px;
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card.is-flipped .card__inner {
  transform: rotateY(180deg);
}

.card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Safari */
  padding: var(--s-4);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(4, 84, 107, 0.08);
}

.card__face--back {
  transform: rotateY(180deg);
}

/* ----- Color schemes ----- */

.card--human .card__face {
  background: #fff4ec;
  color: #c25a2b;
}

.card--human .card__face--back {
  background: #c25a2b;
  color: #fff4ec;
}

.card--ecosystem .card__face {
  background: #eef5ee;
  color: #3a7d44;
}

.card--ecosystem .card__face--back {
  background: #3a7d44;
  color: #eef5ee;
}

/* ----- Front face content ----- */

.card__face--front {
  justify-content: space-between;
  align-items: flex-start;
}

.card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  opacity: 0.7;
}

.card__icon {
  align-self: center;
  margin: var(--s-3) 0;
}

.card__icon svg {
  width: 64px;
  height: 64px;
  color: currentColor;
}

.card__topic {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "opsz" 144;
  align-self: flex-start;
}

.card__hint {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.55;
  align-self: flex-start;
  margin-top: var(--s-1);
}

/* ----- Back face content ----- */

.card__face--back .card__topic {
  margin-bottom: var(--s-3);
}

/* Topic name on flipped cards — tinted lighter for prominence */
.card--human .card__face--back .card__topic {
  color: #ffe0c8;
  /* soft warm cream, tinted orange */
}

.card--ecosystem .card__face--back .card__topic {
  color: #d4ebd4;
  /* soft pale mint, tinted green */
}

.card__body {
  font-family: var(--f-body);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.card__body strong {
  color: inherit;
  font-weight: 600;
  /* Subtle underline for emphasis since the color is the same */
  border-bottom: 1.5px solid currentColor;
}

/* ----- Hover state ----- */

.card:not(.is-flipped):hover .card__inner {
  transform: translateY(-4px) rotateY(0);
  box-shadow: 0 8px 24px rgba(4, 84, 107, 0.15);
}

/* ----- Responsive ----- */

@media (max-width: 700px) {
  .effects__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================ */
/*  SECTION · CONCLUSION                         */
/* ============================================ */

.conclusion {
  padding: var(--s-7) var(--s-4);
  background: var(--c-bg);
}

.conclusion__box {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5);
  background: linear-gradient(180deg,
      var(--c-teal-pale) 0%,
      /* full reef color at top */
      var(--c-teal-pale) 30%,
      /* holds saturation through the headline */
      #d4eaee 55%,
      /* starting to drain */
      #e8f3f5 75%,
      /* draining further */
      var(--c-bg) 100%
      /* ends matching page background */
    );
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.conclusion__box .eyebrow {
  color: var(--c-teal-deep);
  text-align: center;
  display: block;
}

.conclusion__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  margin: 0 auto var(--s-5) auto;
  font-variation-settings: "opsz" 144;
  color: var(--c-teal-deep);
  max-width: 580px;
}

.conclusion__title em {
  color: var(--c-coral);
  font-style: italic;
  font-variation-settings: "opsz" 144;
}

.conclusion__body {
  max-width: 580px;
  margin: 0 auto;
}

.conclusion__body p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--c-teal-deep);
  margin-bottom: var(--s-3);
}

.conclusion__body strong {
  color: var(--c-coral);
  font-weight: 600;
}

.conclusion__handoff {
  margin-top: var(--s-4);
  font-style: italic;
  color: var(--c-teal-deep) !important;
  text-align: center;
}

/* Coral reefs framing the conclusion */
.conclusion {
  position: relative;
  /* needed so .reef can position absolutely inside */
}

.conclusion__reef {
  position: absolute;
  top: var(--s-7);
  /* matches .conclusion padding-top — reef starts at top of box */
  bottom: var(--s-7);
  /* matches .conclusion padding-bottom — reef ends at bottom */
  width: 160px;
  pointer-events: none;
  z-index: 1;
}

.conclusion__reef--left {
  left: 0;
}

.conclusion__reef--right {
  right: 0;
  transform: scaleX(-1);
  /* not strictly needed since the SVG mirrors itself,
                              but a fallback in case you want to swap to same SVG */
}

/* The coral SVG itself uses currentColor for stroke + circle fills.
   We apply a CSS gradient mask so the color fades vertically. */
.conclusion__reef svg {
  width: 100%;
  height: 100%;
  display: block;
  /* Use a CSS mask to fade out top-to-bottom — but really we want
     a fade from full-color at top to white at bottom (matching the box).
     Easier: just apply an alpha gradient mask */
}

.reef-coral {
  stroke: var(--c-coral);
  fill: var(--c-coral);
}

/* Wrap the reef in a vertical gradient: coral at top → very pale at bottom */
/* We achieve this by setting the SVG's color via CSS mask + filter */


.conclusion__box {
  position: relative;
  z-index: 2;
  /* sit above the reef */
}

/* On smaller screens, hide the side reefs so they don't crowd content */
@media (max-width: 900px) {
  .conclusion__reef {
    display: none;
  }
}

/* ============================================ */
/*  SECTION 3 · BLEACHING CHART                  */
/* ============================================ */

.bleach-stage {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--c-bg);
  border-radius: 4px;
}

.bleach-stage svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Axes */
.bleach-axis path,
.bleach-axis line {
  stroke: rgba(4, 84, 107, 0.25);
  shape-rendering: crispEdges;
}

.bleach-axis text {
  fill: var(--c-teal-deep);
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.bleach-axis-label {
  fill: var(--c-ink-mute);
  font-family: var(--f-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
}

/* Threshold line */
.bleach-threshold-line {
  stroke: var(--c-coral);
  stroke-width: 1.5px;
  stroke-dasharray: 6 4;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.bleach-threshold-line.is-visible {
  opacity: 1;
}

.bleach-threshold-label {
  fill: var(--c-coral);
  font-family: var(--f-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.bleach-threshold-label.is-visible {
  opacity: 1;
}

/* Danger zone shading */
.bleach-danger-zone {
  fill: var(--c-coral);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.bleach-danger-zone.is-visible {
  opacity: 0.1;
}

/* Lines & points */
.bleach-line {
  fill: none;
  stroke-width: 2.5px;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.bleach-line.is-visible {
  opacity: 1;
}

.bleach-line--2016 {
  stroke: var(--c-teal-deep);
}

.bleach-line--2022 {
  stroke: var(--c-coral);
}

.bleach-point {
  stroke: white;
  stroke-width: 1.5px;
  cursor: pointer;
  transition: r 0.3s ease, fill 0.4s ease;
}

.bleach-point--2016 {
  fill: var(--c-teal-deep);
}

.bleach-point--2022 {
  fill: var(--c-coral);
}

.bleach-point--above-threshold {
  /* Used when we want to highlight points that crossed the threshold */
  fill: var(--c-coral) !important;
}

/* Annotation (e.g. "6 weeks above threshold") */
.bleach-annotation {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.bleach-annotation.is-visible {
  opacity: 1;
}

.bleach-annotation text {
  fill: var(--c-coral);
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  font-variation-settings: "opsz" 144;
}

.bleach-annotation line {
  stroke: var(--c-coral);
  stroke-width: 1px;
  stroke-dasharray: 3 3;
}

/* Tooltip */
.bleach-tooltip {
  position: absolute;
  background: white;
  color: var(--c-teal-deep);
  padding: var(--s-1) var(--s-2);
  border-radius: 4px;
  font-size: 0.8rem;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(4, 84, 107, 0.2);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.bleach-tooltip.is-visible {
  opacity: 1;
}

.bleach-tooltip__date {
  display: block;
  font-family: var(--f-display);
  font-size: 0.9rem;
  font-weight: 500;
}

.bleach-tooltip__temp {
  color: var(--c-coral);
  font-weight: 600;
}

/* Toggle buttons */
.bleach-toggle {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
  max-width: 280px;
}

.bleach-toggle__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(4, 84, 107, 0.15);
  padding: var(--s-1) var(--s-2);
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-ink-mute);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.bleach-toggle__btn:hover {
  border-color: rgba(4, 84, 107, 0.35);
}

.bleach-toggle__btn.is-active {
  background: white;
  border-color: var(--c-teal-deep);
  color: var(--c-teal-deep);
  font-weight: 600;
}

/* Color swatches inside the buttons */
.bleach-toggle__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  /* default — overridden below */
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.bleach-toggle__btn.is-active .bleach-toggle__swatch {
  opacity: 1;
}

.bleach-toggle__swatch--2016 {
  background: var(--c-teal-deep);
}

.bleach-toggle__swatch--2022 {
  background: var(--c-coral);
}

.bleach-annotation-2022 {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.bleach-annotation-2022.is-visible {
  opacity: 1;
}

.bleach-annotation-2022 text {
  fill: var(--c-coral);
  /* matches 2022 color */
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  font-variation-settings: "opsz" 144;
}

.bleach-annotation-2022 line {
  stroke: var(--c-coral);
  stroke-width: 1px;
  stroke-dasharray: 3 3;
}

#bleaching {
  background: #a8d4dd;
}

.interaction-hint--pale-bg {
  color: var(--c-hint-deep);
  opacity: 0.85;
}

.bleach-caption {
  fill: var(--c-teal-deep);
  font-family: var(--f-body);
  font-size: 14px;
  font-style: italic;
  opacity: 0.85;
}

/* ============================================ */
/*  INTERSTITIAL TRANSITION BLOCKS                */
/* ============================================ */
.interstitial {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7) var(--s-4);
  text-align: center;
  background-color: #a8d4dd;
}

.interstitial__inner {
  max-width: 680px;
}

.interstitial__lead {
  font-family: var(--f-display);
  font-variation-settings: "opsz" 144;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.3;
  color: var(--c-teal-deep);
  margin-bottom: var(--s-3);
}

.interstitial__sub {
  font-family: var(--f-body);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.7;
  color: var(--c-ink-mute);
  max-width: 540px;
  margin: 0 auto;
}

/* the new variability hue, introduced here for the first time */
.interstitial--microvar em,
.interstitial--microvar strong {
  color: var(--c-amber-deep);
  font-style: normal;
  font-weight: 500;
}

/* ============================================ */
/*  MICRO-VARIATIONS SECTION                      */
/* ============================================ */
.scrolly--microvar {
  background: var(--c-micro-bg);
}

.scrolly--microvar .step strong {
  color: var(--c-amber-deep);
  font-weight: 600;
}

.microvar-stage {
  width: 100%;
  height: 100%;
}

/* the interstitial bridges the two: teal at top → deeper teal at bottom */
.interstitial--microvar {
  background: linear-gradient(180deg,
      var(--c-bleach-bg) 0%,
      var(--c-micro-bg) 100%);
}

/* ============================================ */
/*  MICRO-VARIATIONS CHART                        */
/* ============================================ */
.mv-axis text {
  font-family: var(--f-body);
  font-size: 11px;
  fill: var(--c-ink-mute);
}

.mv-axis path,
.mv-axis line {
  stroke: rgba(255, 255, 255, 0.45);
}

.mv-raw-line {
  fill: none;
  stroke: var(--c-teal-deep);
  stroke-width: 2px;
}

.mv-raw-point {
  fill: var(--c-teal-deep);
}

.mv-mean {
  stroke: var(--c-ink-mute);
  stroke-width: 1.5px;
  stroke-dasharray: 2 3;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mv-mean.is-visible {
  opacity: 0.8;
}

/* safe / threshold band — amber */
.mv-thresh {
  stroke: var(--c-amber-deep);
  stroke-width: 2px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mv-thresh.is-visible {
  opacity: 1;
}

.mv-thresh-label,
.mv-true-label {
  font-family: var(--f-body);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mv-thresh-label {
  fill: var(--c-amber-deep);
}

.mv-true-label {
  fill: var(--c-coral-deep);
}

.mv-thresh-label.is-visible,
.mv-true-label.is-visible {
  opacity: 1;
}

/* 2020 true-spread band — coral, the bleaching-danger callback */
.mv-true {
  stroke: var(--c-coral-deep, #c43d22);
  stroke-width: 2.5px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mv-true.is-visible {
  opacity: 1;
}

.mv-true-label {
  fill: var(--c-coral-deep, #c43d22);
}

/* shaded overshoot — variation beyond the safe margin */
.mv-excess {
  fill: var(--c-amber);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mv-excess.is-visible {
  opacity: 0.2;
}

.microvar-stage {
  position: relative;
}

.mv-raw-point {
  fill: var(--c-teal-deep);
  cursor: crosshair;
}

.mv-axis-label {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  fill: var(--c-teal-deep);
}

.mv-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--c-teal-deep);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.mv-tooltip.is-visible {
  opacity: 1;
}

.mv-tooltip__date {
  display: block;
  font-weight: 600;
}

.mv-tooltip__temp {
  display: block;
  color: var(--c-coral-deep);
}

.microvar-controls {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.microvar-controls.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.microvar-toggle {
  align-self: flex-start;
  display: inline-flex;
  background: rgba(4, 84, 107, 0.08);
  border-radius: 999px;
  padding: 3px;
}

.microvar-toggle__btn.is-active {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.microvar-toggle__btn {
  border: none;
  background: transparent;
  font-family: var(--f-body);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--c-teal-deep);
  cursor: pointer;
  transition: background 0.2s ease;
}

.microvar-slider {
  width: 100%;
  accent-color: var(--c-coral-deep, #c43d22);
  cursor: pointer;
}

.microvar-window-label {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-teal-deep);
}

/* ============================================ */
/*  INTERSTITIAL TRANSITION BLOCKS 2              */
/* ============================================ */
.interstitial--meso {
  background: linear-gradient(180deg,
      var(--c-micro-bg) 0%,
      var(--c-deep-blue) 100%);
}

.interstitial--meso .interstitial__lead {
  color: #f0f6f8;
}

.interstitial--meso .interstitial__sub {
  color: #c4d6dd;
}

/* the deep section — dark blue, light text */
.scrolly--meso {
  background: var(--c-deep-blue);
}

.scrolly--meso .step__title {
  color: #f0f6f8;
}

.scrolly--meso .step p {
  color: #c4d6dd;
}

.scrolly--meso .step strong {
  color: var(--c-coral, #e8593a);
}

.meso-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.meso-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================ */
/*  MESOPHOTIC CHART                              */
/* ============================================ */
.meso-axis path,
.meso-axis line {
  stroke: rgba(255, 255, 255, 0.3);
}

.meso-axis text {
  fill: #cfe0e6;
  font-family: var(--f-body);
  font-size: 12px;
}

.meso-axis-label {
  fill: #e8f1f4;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
}

.meso-line {
  fill: none;
  stroke: #bfe9f0;
  stroke-width: 2.5px;
}

.meso-line--projected {
  stroke-dasharray: 5 4;
  opacity: 0.85;
}

.meso-threshold-line {
  stroke: var(--c-coral, #e8593a);
  stroke-width: 2px;
  stroke-dasharray: 4 3;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.meso-threshold-line.is-visible {
  opacity: 1;
}

.meso-threshold-label {
  fill: var(--c-coral, #e8593a);
  font-family: var(--f-body);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.meso-threshold-label.is-visible {
  opacity: 1;
}

.meso-danger {
  fill: var(--c-coral, #e8593a);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.meso-danger.is-visible {
  opacity: 0.16;
}

.meso-crossing {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.meso-crossing.is-visible {
  opacity: 1;
}

.meso-crossing-guide {
  stroke: var(--c-coral, #e8593a);
  stroke-width: 1px;
  stroke-dasharray: 2 3;
  opacity: 0.7;
}

.meso-crossing-dot {
  fill: var(--c-coral, #e8593a);
}

.meso-crossing-label {
  fill: var(--c-coral, #e8593a);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
}

.meso-focus-dot {
  fill: #fff;
  stroke: var(--c-coral, #e8593a);
  stroke-width: 2px;
}

.meso-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(8, 40, 60, 0.92);
  color: #eaf4f7;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.15s ease, left 0.08s linear, top 0.08s linear;
  white-space: nowrap;
  z-index: 10;
}

.meso-tooltip.is-visible {
  opacity: 1;
}

.meso-tooltip__year {
  display: block;
  font-weight: 600;
}

.meso-tooltip__temp {
  display: block;
  color: #f3b8a8;
}

.interaction-hint--note {
  color: var(--c-ink-dim);
  /* lighter/grayer than the first hint */
}

/* ============================================ */
/*  FINAL — EXPLORE THE REEFS + ACT               */
/* ============================================ */
.section--explore {
  background: var(--c-bg);
  padding: var(--s-7) var(--s-4);
}

.explore__inner {
  max-width: 1180px;
  margin: 0 auto;
}

.explore__lead {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: var(--s-5);
  max-width: 18ch;
}

.explore__row {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.explore__row--map {
  grid-template-columns: 1.5fr 1fr;
}

/* map gets more width */
.explore__row--bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  width: 100%;
}

.explore__row--bottom .explore__box {
  min-height: 440px;
}

.explore__box {
  background: var(--c-bg);
  border: 1px solid var(--c-teal-pale);
  border-radius: 16px;
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.explore__box h3 {
  font-size: 1.25rem;
  margin-bottom: var(--s-1);
}

.explore__sub {
  color: var(--c-ink-mute);
  font-size: 0.95rem;
  margin-bottom: var(--s-3);
}

/* map */
.explore__map {
  position: relative;
  flex: 1;
  min-height: 400px;
  border-radius: 12px;
  background: var(--c-bg-alt);
  border: 1px dashed var(--c-teal-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink-dim);
  overflow: hidden;
}

.explore__map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.explore__controls {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
}

.explore__slider {
  flex: 1;
  min-width: 160px;
  accent-color: var(--c-teal);
}

.explore__year {
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-mute);
}

.explore__toggle {
  display: inline-flex;
  border: 1px solid var(--c-teal-pale);
  border-radius: 999px;
  overflow: hidden;
}

.explore__toggle button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: var(--s-1) var(--s-3);
  color: var(--c-ink-mute);
}

.explore__toggle button[aria-pressed="true"] {
  background: var(--c-teal-deep);
  color: #fff;
}

/* guesser */
.explore__readout {
  font-family: var(--f-display);
  font-size: 3rem;
  color: var(--c-teal-deep);
  margin: var(--s-1) 0 var(--s-2);
}

.explore__cta {
  align-self: flex-start;
  margin-top: var(--s-3);
  background: var(--c-coral);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: var(--s-1) var(--s-4);
  font: 500 0.95rem var(--f-body);
  cursor: pointer;
}

.explore__cta:hover {
  background: var(--c-coral-deep, #c43d22);
}

.explore__reveal {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-teal-pale);
  color: var(--c-ink-mute);
  font-size: 0.95rem;
}

.explore__reveal[hidden] {
  display: none;
}

.explore__source {
  display: block;
  font-size: 0.8rem;
  color: var(--c-ink-dim);
  margin-top: var(--s-1);
}

/* gallery */
.explore__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  /* two equal rows */
  gap: var(--s-2);
  flex: 1;
  /* fill the taller box */
  min-width: 0;
}

.explore__shot {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: var(--c-bg-alt);
  border: 1px dashed var(--c-teal-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink-dim);
  font-size: 0.85rem;
}

.explore__row--bottom {
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.explore__box {
  overflow: hidden;
}

/* ways to help / policies */
.explore__actions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.explore__actions li {
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--c-teal-pale);
  font-size: 0.95rem;
}

.explore__actions li:last-child {
  border-bottom: 0;
}

.explore__policy {
  margin-top: var(--s-3);
  padding: var(--s-3);
  border-radius: 12px;
  background: var(--c-teal-pale);
  color: var(--c-teal-deep);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* responsive: stack on narrow screens */
@media (max-width: 820px) {

  .explore__row--map,
  .explore__row--bottom {
    grid-template-columns: 1fr;
  }

  .explore__map {
    min-height: 300px;
  }
}

.reef-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--c-teal-pale);
  border-radius: 8px;
  background: var(--c-bg);
}

.reef-label {
  background: var(--c-teal-deep);
  color: #fff;
  padding: var(--s-1) var(--s-2);
  border-radius: 4px;
  font-family: var(--f-display);
  font-size: 0.95rem;
}

.reef-back {
  background: #fff;
  color: var(--c-teal-deep);
  border: 1px solid var(--c-teal-pale);
  border-radius: 4px;
  padding: var(--s-1) var(--s-2);
  font-size: 0.82rem;
  cursor: pointer;
}

.reef-back:hover {
  background: var(--c-teal-pale);
}

.reef-back:hover {
  background: var(--c-teal-pale);
}

.reef-unit {
  display: inline-flex;
  border: 1px solid var(--c-teal-pale);
  border-radius: 6px;
  overflow: hidden;
}

.reef-unit button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  padding: 2px 8px;
  color: var(--c-ink-mute);
  line-height: 1.6;
}

.reef-unit button.is-active {
  background: var(--c-teal-pale);
  color: var(--c-teal-deep);
  font-weight: 600;
}

.reef-legend {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 0.72rem;
  color: var(--c-ink-mute);
}

.reef-legend__bar {
  width: 120px;
  height: 8px;
  border-radius: 2px;
}

.reef-legend__bar.is-sst {
  background: linear-gradient(90deg, #000004, #781c6d, #ed6925, #fcffa4);
}

/* inferno */
.reef-legend__bar.is-anomaly {
  background: linear-gradient(90deg, #2166ac, #f7f7f7, #b2182b);
}

/* RdBu_r */

.reef-controls-2 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.reef-legend {
  flex: 1;
  /* legend takes up the whole bottom row */
}

.reef-legend__bar {
  flex: 1;
  /* gradient stretches across the available space */
}

/* ============================================ */
/*  REEF BLEACHING GUESSER                      */
/* ============================================ */
.guesser-scene {
  width: 100%;
  background: linear-gradient(180deg, #eaf6f9 0%, #d8eef4 100%);
  border-radius: 8px;
  margin-bottom: var(--s-2);
  overflow: hidden;
}

.guesser-scene svg {
  width: 100%;
  height: auto;
  display: block;
}

.guesser-readout {
  font-family: var(--f-display);
  font-size: 1.4rem;
  color: var(--c-teal-deep);
  margin: var(--s-1) 0 var(--s-3);
}

/* ============================================ */
/*  IMAGES AND ARTICLES                         */
/* ============================================ */
/* --- Gallery images + captions --- */
.explore__shot {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.explore__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.explore__shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.72rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
}

.explore__credit {
  opacity: 0.8;
  font-style: italic;
}

/* --- Action steps --- */
.explore__actions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.explore__actions li {
  margin-bottom: var(--s-3);
  line-height: 1.5;
}

.explore__actions strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--c-deep-blue, #04546b);
}

/* ============================================ */
/*  SECTION · WATER STRESS CARDS                 */
/* ============================================ */

.stress-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.stress-cards-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
  max-width: 640px;
}

.stress-card {
  flex: 1;
  background: white;
  border: 1px solid rgba(4, 84, 107, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stress-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stress-card__year {
  font-family: var(--f-display);
  font-size: 2.4rem;
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  color: var(--c-teal-deep);
  margin-bottom: 1.2rem;
  line-height: 1;
}

.stress-card__year--hot {
  color: var(--c-coral);
}

.stress-row {
  margin-bottom: 1rem;
  padding: 0.35rem;
  border-radius: 6px;
  transition: background 0.4s ease;
}

.stress-row.is-highlighted {
  background: rgba(224, 92, 58, 0.06);
}

.stress-row__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
  gap: 0.5rem;
}

.stress-row__label {
  font-family: var(--f-body);
  font-size: 0.72rem;
  color: var(--c-ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stress-row__value {
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-teal-deep);
  white-space: nowrap;
}

.stress-bar__track {
  position: relative;
  height: 5px;
  background: rgba(4, 84, 107, 0.1);
  border-radius: 3px;
  margin-bottom: 0.3rem;
  overflow: visible;
}

.stress-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  width: 0%;
}

/* the tick marking the 20-yr mean */
.stress-bar__mean {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 13px;
  background: rgba(4, 84, 107, 0.35);
  border-radius: 1px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.4s ease 0.7s;
}

.stress-bar__mean.is-visible {
  opacity: 1;
}

.stress-row__caption {
  font-size: 0.72rem;
  color: var(--c-ink-mute);
}

.stress-row__caption.is-above {
  color: var(--c-coral);
  font-weight: 500;
}

.stress-row__caption.is-below {
  color: var(--c-teal-deep);
}

#stress {
  background: #a8d4dd;
  position: relative;
}

#stress::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(180deg,
      transparent 0%,
      #f4fbfc 100%);
  pointer-events: none;
}

/* ============================================ */
/*  INDICATOR EXPLAINER CARDS                    */
/* ============================================ */
.ind-wrap {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  align-items: flex-start;
}

.ind-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(4, 84, 107, 0.35);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ind-card:hover {
  border-color: rgba(4, 84, 107, 0.6);
}

.ind-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 8px;
}

.ind-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ind-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ind-icon--chl {
  background: rgba(42, 122, 84, 0.18);
  color: #1e6640;
}

.ind-icon--adg {
  background: rgba(176, 106, 16, 0.18);
  color: #8a5008;
}

.ind-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-teal-deep);
}

.ind-unit {
  font-size: 0.68rem;
  color: var(--c-ink-mute);
  margin-top: 2px;
}

.ind-chevron {
  font-size: 14px;
  color: var(--c-teal-deep);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.ind-card.is-open .ind-chevron {
  transform: rotate(180deg);
}

.ind-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.ind-card.is-open .ind-body {
  max-height: 300px;
}

.ind-body-inner {
  padding: 0 14px 14px;
}

.ind-divider {
  height: 1px;
  background: rgba(4, 84, 107, 0.2);
  margin-bottom: 12px;
}

.ind-body p {
  font-size: 0.78rem;
  color: var(--c-ink);
  line-height: 1.7;
  margin: 0 0 8px;
}

.ind-body p:last-child {
  margin: 0;
}

.ind-body strong {
  font-weight: 600;
  color: var(--c-teal-deep);
}

/* ============================================ */
/*  INTERSTITIAL · stress transition             */
/* ============================================ */
.interstitial--stress {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(180deg,
      var(--c-deep-blue) 0%,
      #a8d4dd 100%);
}

.interstitial--stress .interstitial__lead {
  color: #f0f6f8;
}

.interstitial--stress .interstitial__sub {
  color: #c4d6dd;
}