@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Libre+Baskerville:wght@400;700&display=swap');


:root {
  --bg: #061814;
  --bg2: #0b241f;
  --paper: #f7f1e6;
  --light: #fff8e8;
  --ink: #10231f;
  --muted: #66736f;
  --accent: #b7d96b;
  --accent2: #78d6bd;
  --radius: 24px;
  --shadow: 0 24px 72px rgba(0,0,0,0.34);
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  overflow-x: hidden;
}

.quarto-title-block,
#title-block-header,
.sidebar,
.quarto-sidebar,
.page-columns > .column-page-left,
.page-columns > .column-page-right {
  display: none !important;
}

.navbar {
  display: flex !important;
}

.story-page {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: clip !important;
  background: var(--bg);
  color: var(--light);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.story-page h1,
.story-page h2,
.story-page h3,
.story-page p,
.story-page figure,
.story-page blockquote {
  margin-top: 0;
}

.story-page h1,
.story-page h2,
.story-page h3 {
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.story-page h1 {
  font-size: clamp(3.4rem, 8vw, 8rem);
  line-height: 0.88;
  color: #fff7e3;
  margin-bottom: 1.35rem;
}

.story-page h1 span {
  display: block;
}

.story-page h2 {
  font-size: clamp(2.2rem, 4.6vw, 4.8rem);
  line-height: 0.98;
  margin-bottom: 1.1rem;
}

.story-page h3 {
  font-size: clamp(1.28rem, 1.7vw, 1.75rem);
  line-height: 1.12;
  margin-bottom: 0.8rem;
}

.story-page p {
  font-size: clamp(1rem, 1.08vw, 1.12rem);
  line-height: 1.72;
}

.story-page a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* Progress bar*/

.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  height: 4px;
  width: 100%;
  background: rgba(255,255,255,0.08);
}

.story-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* Hero/scene sections */

.hero,
.scene {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
}

.hero {
  display: grid;
  align-items: center;
}

.hero::before,
.scene::before {
  content: "";
  position: absolute;
  inset: -4%;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  z-index: -3;
  transform: scale(1.06);
  animation: drift 24s ease-in-out infinite alternate;
}

.hero-shade,
.stage-overlay,
.quote-shade,
.compare-stage::after,
.map-stage::after {
  background:
    linear-gradient(90deg, rgba(6,24,20,0.82), rgba(6,24,20,0.32), rgba(6,24,20,0.72)),
    linear-gradient(0deg, rgba(6,24,20,0.88), transparent 42%, rgba(0,0,0,0.14));
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-content,
.map-intro-content {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.hero-content {
  padding: 12vh 0 9vh;
}

.deck {
  max-width: 670px;
  color: rgba(255,250,236,0.88);
  font-size: clamp(1.08rem, 1.7vw, 1.5rem) !important;
  line-height: 1.46 !important;
  margin-bottom: 1.2rem;
}

.meta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  color: rgba(255,250,236,0.72);
  font-size: 0.95rem;
  font-weight: 700;
}

.logos {
  display: block;
  max-width: min(360px, 70vw);
  max-height: 120px;
  object-fit: contain;
  margin-top: 1.2rem;
}

.scroll-cue {
  margin-top: 2rem;
  color: var(--accent2);
  font-weight: 700;
}

/* Pills / eyebrow labels */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.tags span,
.eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  background: rgba(255,255,255,0.08);
  color: #fff7df;
  font-size: 0.68rem !important;
  line-height: 1 !important;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 1rem;
}

.eyebrow.dark {
  color: var(--ink);
  border-color: rgba(16,35,31,0.18);
  background: rgba(16,35,31,0.06);
}

.scrolly {
  position: relative;
  background: var(--bg);
}

.scrolly-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  z-index: 1;
}

.stage-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  background-size: cover;
  background-position: center;
  transition: opacity 700ms ease, transform 1200ms ease;
}

.stage-bg.active {
  opacity: 1;
  transform: scale(1);
}

.stage-overlay {
  position: absolute;
  inset: 0;
}

.stage-caption {
  position: absolute;
  left: max(24px, calc((100vw - var(--max)) / 2));
  bottom: 10vh;
  width: min(720px, calc(100vw - 48px));
  z-index: 3;
}

.chapter-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.stage-caption h2 {
  color: #fff7e3;
}

.stage-caption p {
  max-width: 620px;
  color: rgba(255,250,236,0.82);
}

.chapter-dots {
  position: absolute;
  right: max(24px, calc((100vw - var(--max)) / 2));
  bottom: 10vh;
  z-index: 4;
  display: grid;
  gap: 0.7rem;
}

.chapter-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.12);
  transition: 250ms ease;
}

.chapter-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}

.scrolly-steps {
  position: relative;
  z-index: 2;
  width: min(430px, calc(100vw - 40px));
  margin-left: max(24px, calc((100vw - var(--max)) / 2));
  margin-top: -88svh;
  padding: 18vh 0 42vh;
  display: grid;
  gap: 70vh;
}

.scroll-step {
  background: rgba(255,250,236,0.92);
  color: var(--ink);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.2vw, 1.8rem);
  box-shadow: var(--shadow);
  opacity: 0.72;
  transform: translateY(14px) scale(0.985);
  transition: 420ms ease;
}

.scroll-step.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Clean intro variant */

#biodiversity-evidence-scrolly {
  background: var(--paper) !important;
  color: var(--ink) !important;
}

#biodiversity-evidence-scrolly .stage-overlay {
  background:
    linear-gradient(
      90deg,
      rgba(247,241,230,0.98) 0%,
      rgba(247,241,230,0.96) 31%,
      rgba(247,241,230,0.74) 44%,
      rgba(6,24,20,0.20) 60%,
      rgba(6,24,20,0.76) 100%
    ) !important;
}

#biodiversity-evidence-scrolly .stage-caption {
  display: none !important;
}

#biodiversity-evidence-scrolly .scrolly-steps {
  width: min(590px, calc(100vw - 40px)) !important;
  margin-left: max(56px, calc((100vw - var(--max)) / 2)) !important;
  margin-top: -100svh !important;
  padding-top: 15vh !important;
  padding-bottom: 42vh !important;
  gap: 82vh !important;
}

#biodiversity-evidence-scrolly .scroll-step {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  color: var(--ink) !important;
  opacity: 0.22 !important;
  transform: translateY(18px) !important;
  max-width: 560px !important;
}

#biodiversity-evidence-scrolly .scroll-step.active {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

#biodiversity-evidence-scrolly .scroll-step .eyebrow.dark {
  background: rgba(16,35,31,0.08) !important;
  border-color: rgba(16,35,31,0.12) !important;
  color: var(--ink) !important;
  margin-bottom: 1.35rem !important;
}

#biodiversity-evidence-scrolly .scroll-step h3 {
  font-size: clamp(2.25rem, 4.2vw, 4.25rem) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.07em !important;
  max-width: 620px !important;
  margin-bottom: 1.35rem !important;
  color: var(--ink) !important;
}

#biodiversity-evidence-scrolly .scroll-step h3::after {
  content: "";
  display: block;
  width: 76px;
  height: 3px;
  background: var(--accent);
  margin-top: 1.35rem;
}

#biodiversity-evidence-scrolly .scroll-step p:not(.eyebrow) {
  font-size: clamp(1.08rem, 1.35vw, 1.36rem) !important;
  line-height: 1.55 !important;
  max-width: 570px !important;
  color: #152a25 !important;
  text-wrap: pretty;
}

#biodiversity-evidence-scrolly .chapter-dots {
  right: max(56px, calc((100vw - var(--max)) / 2)) !important;
  top: 29vh !important;
  bottom: auto !important;
  gap: 1.28rem !important;
}

#biodiversity-evidence-scrolly .chapter-dot {
  position: relative;
  width: 18px !important;
  height: 18px !important;
  border: 2px solid rgba(255,255,255,0.70) !important;
  background: transparent !important;
}

#biodiversity-evidence-scrolly .chapter-dot::after {
  position: absolute;
  left: 34px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,250,236,0.88);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.96rem;
}

#biodiversity-evidence-scrolly .chapter-dot:nth-child(1)::after { content: "01"; }
#biodiversity-evidence-scrolly .chapter-dot:nth-child(2)::after { content: "02"; }
#biodiversity-evidence-scrolly .chapter-dot:nth-child(3)::after { content: "03"; }

#biodiversity-evidence-scrolly .chapter-dot.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 7px rgba(183,217,107,0.18);
  transform: scale(1) !important;
}

#biodiversity-evidence-scrolly .chapter-dot.active::after {
  color: var(--accent);
}

#biodiversity-evidence-scrolly .stage-bg {
  background-position: center right !important;
  filter: saturate(1.02) contrast(1.02);
}

/* Case study cards */

.map-intro {
  display: grid;
  align-items: center;
}

.map-intro-content {
  max-width: 920px;
}

.map-intro-content h2 {
  color: #fff7e3 !important;
}

.map-intro-content p:not(.eyebrow) {
  max-width: 700px;
  color: rgba(255,250,236,0.84);
}

/* Map story */

.map-story {
  position: relative !important;
  min-height: 620vh !important;
  background: var(--bg) !important;
  color: var(--light);
}

.map-stage {
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  z-index: 1 !important;
  background: #06110f;
  overflow: hidden !important;
}

.map-stage .leaflet,
.map-stage .leaflet-container,
.map-stage .html-widget {
  width: 100% !important;
  height: 100vh !important;
  min-height: 100vh !important;
}

.map-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.map-stage .leaflet-control-container {
  position: relative;
  z-index: 900;
}

.map-stage .leaflet-control-layers,
.map-stage .leaflet-control-attribution,
.map-stage .legend {
  font-family: Inter, system-ui, sans-serif !important;
}

.map-steps {
  position: relative !important;
  z-index: 10 !important;
  width: min(440px, calc(100vw - 40px));
  margin-left: max(24px, calc((100vw - var(--max)) / 2));
  margin-top: -100vh !important;
  padding-top: 36vh !important;
  padding-bottom: 90vh !important;
  display: grid !important;
  gap: 78vh !important;
  pointer-events: none !important;
}

.map-step {
  pointer-events: auto !important;
  background: rgba(255,250,236,0.92);
  color: var(--ink);
  padding: 1.25rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.24) !important;
  opacity: 0.82;
  transform: translateY(12px) scale(0.985);
  transition: opacity 420ms ease, transform 420ms ease;
}

.map-step.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.map-step p {
  font-size: 0.96rem !important;
  line-height: 1.55 !important;
}


.leaflet-container img,
.leaflet-control img,
.leaflet-tile,
.leaflet-image-layer {
  max-width: none !important;
}

.leaflet-image-layer {
  width: auto !important;
  height: auto !important;
  object-fit: unset !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  image-rendering: auto !important;
}

/* Belt section */

.metric-scene {
  padding: clamp(4rem, 8vw, 7rem) max(24px, calc((100vw - var(--max)) / 2));
  background:
    radial-gradient(circle at top right, rgba(183,217,107,0.13), transparent 30rem),
    var(--bg);
  color: var(--light);
}

.metric-intro {
  max-width: 760px;
  margin-bottom: 3rem;
}

.metric-intro h2 {
  color: #fff7e3 !important;
}

.metric-intro p:not(.eyebrow) {
  color: rgba(255,250,236,0.82);
}

.workflow-scrolly {
  position: relative;
  min-height: 560vh;
  margin: 2.5rem 0 4rem;
}

.workflow-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  align-content: center;
  overflow: hidden;
  margin-inline: calc(max(24px, calc((100vw - var(--max)) / 2)) * -1);
  padding-left: max(24px, calc((100vw - var(--max)) / 2));
  background:
    radial-gradient(circle at 80% 20%, rgba(183,217,107,0.10), transparent 25rem),
    radial-gradient(circle at 20% 85%, rgba(120,214,189,0.08), transparent 24rem);
}

.workflow-rail {
  width: min(var(--max), calc(100vw - 48px));
  margin: 0 auto 1.35rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.workflow-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

.workflow-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 120ms linear;
}

.workflow-count {
  display: inline-flex;
  gap: 0.28rem;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.workflow-track {
  display: flex;
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.6rem);
  width: max-content;
  padding-right: max(24px, calc((100vw - var(--max)) / 2));
  will-change: transform;
  transition: transform 120ms linear;
}

.workflow-card {
  width: min(78vw, 820px);
  min-height: min(62vh, 560px);
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.1fr);
  overflow: hidden;
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 28px;
  background: rgba(255,255,255,0.055);
  box-shadow: 0 22px 70px rgba(0,0,0,0.24);
  opacity: 0.72;
  transform: scale(0.955);
  transition: opacity 360ms ease, transform 360ms ease, background 360ms ease;
}

.workflow-card.is-active {
  opacity: 1;
  transform: scale(1);
  background: rgba(255,255,255,0.085);
}

.workflow-card.is-past {
  opacity: 0.62;
}

.workflow-thumb {
  min-height: 280px;
  border-radius: 22px;
  border: 1px solid rgba(255,250,236,0.38);
  background:
    linear-gradient(135deg, rgba(183,217,107,0.16), rgba(120,214,189,0.08)),
    rgba(255,255,255,0.035);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0;
  overflow: hidden;
}

.workflow-thumb img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.workflow-copy {
  display: grid;
  align-content: center;
  padding: clamp(0.7rem, 1.6vw, 1.4rem);
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-number {
  width: fit-content;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.workflow-copy h3 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.9;
  margin-bottom: 1rem;
  color: #fff7e3;
  max-width: 100%;
  overflow-wrap: break-word;
}

.workflow-copy p {
  max-width: 100%;
  color: rgba(255,250,236,0.78);
  font-size: clamp(0.98rem, 1.05vw, 1.12rem) !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

.workflow-card.is-active .workflow-copy p {
  color: rgba(255,250,236,0.92);
}

/* Closing and further reading */

.section-light {
  background:
    radial-gradient(circle at top left, rgba(120,214,189,0.13), transparent 32rem),
    var(--paper);
  color: var(--ink);
}

.closing {
  padding: clamp(6rem, 10vw, 10rem) 24px;
}

.closing-content {
  width: min(820px, 100%);
  margin: 0 auto;
  color: var(--ink);
  opacity: 1;
  transform: none;
}

.closing-content h2 {
  max-width: 760px;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.95;
  margin-bottom: 2.5rem;
  color: var(--ink);
}

.closing-content p:not(.eyebrow) {
  max-width: 720px;
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  line-height: 1.75;
  color: rgba(16,35,31,0.82);
  margin-bottom: 1.6rem;
}

.further-reading {
  padding: clamp(4rem, 8vw, 7rem) 24px;
  background:
    radial-gradient(circle at top right, rgba(183,217,107,0.13), transparent 30rem),
    var(--bg);
}

.further-reading .dark-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 2rem;
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  color: var(--light);
}

.further-reading h2,
.further-reading h3 {
  color: var(--light);
  margin-bottom: 1.5rem;
}

.further-reading ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.further-reading li {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,250,236,0.86);
  line-height: 1.5;
}

.further-reading li:first-child {
  border-top: none;
}

.further-reading li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}

.further-reading a {
  color: rgba(255,248,232,0.92);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s ease;
}

.further-reading a:hover {
  color: var(--accent);
}

.further-reading a::after {
  content: " ↗";
  opacity: 0.6;
}

.stories-related-panel {
  clear: both;
  position: relative;
  z-index: 20;
  background: #fff;
  color: #111;
}

.back-to-top,
#quarto-back-to-top {
  z-index: 9999;
}


.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 680ms ease, transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes drift {
  from { transform: scale(1.06) translate3d(-0.5%, -0.3%, 0); }
  to { transform: scale(1.1) translate3d(0.5%, 0.4%, 0); }
}

@media (max-width: 900px) {
  .story-page h1 {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }

  .scrolly-steps,
  .map-steps {
    width: min(540px, calc(100vw - 32px));
    margin-inline: auto;
  }

  .chapter-dots {
    right: 18px;
  }

  .map-ui {
    display: none;
  }

  #biodiversity-evidence-scrolly .stage-overlay {
    background:
      linear-gradient(0deg, rgba(247,241,230,0.96), rgba(247,241,230,0.78) 46%, rgba(6,24,20,0.35)) !important;
  }

  #biodiversity-evidence-scrolly .scrolly-steps {
    width: min(540px, calc(100vw - 32px)) !important;
    margin-inline: auto !important;
    margin-top: -100svh !important;
    padding-top: 22vh !important;
    gap: 72vh !important;
  }

  #biodiversity-evidence-scrolly .scroll-step {
    background: rgba(255,250,236,0.92) !important;
    border-radius: 22px !important;
    padding: 1.35rem !important;
    box-shadow: var(--shadow) !important;
  }

  #biodiversity-evidence-scrolly .scroll-step h3 {
    font-size: clamp(1.7rem, 8vw, 2.8rem) !important;
  }

  #biodiversity-evidence-scrolly .scroll-step p:not(.eyebrow) {
    font-size: 1rem !important;
  }

  #biodiversity-evidence-scrolly .chapter-dots {
    display: none !important;
  }

  .workflow-scrolly {
    min-height: auto;
    margin: 2rem 0 3rem;
  }

  .workflow-stage {
    position: relative;
    height: auto;
    overflow: visible;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  .workflow-rail {
    display: none;
  }

  .workflow-track {
    width: 100%;
    display: grid;
    gap: 1rem;
    padding: 0;
    transform: none !important;
  }

  .workflow-card {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr;
    opacity: 1;
    transform: none;
  }

  .workflow-thumb {
    min-height: 200px;
  }

  .workflow-copy h3 {
    font-size: clamp(2rem, 12vw, 3.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero::before,
  .scene::before {
    animation: none;
  }

  .reveal,
  .map-step,
  .scroll-step,
  .stage-bg,
  .workflow-card,
  .workflow-track {
    transition: none;
  }
}
