:root {
  --background: #0c0f12;
  --ink: #ede8df;

  --coral: #d9573d;
  --teal: #3fa89b;
  --mustard: #e0a63c;
  --gray: #8b8a84;

  --muted: #b8b3ab;
  --quiet: #8b8a84;
  --line: #35383a;
  --cream: #ede8df;
}


/* =========================================================
   base
========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: "Lora", serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

main {
  overflow: clip;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Lora", serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

strong {
  font-weight: 700;
}


/* =========================================================
   intro
========================================================= */

.hero {
  width: min(620px, calc(100% - 40px));
  margin: 0 auto;
  padding: 5.75rem 0 2rem;
  text-align: center;
}

.kicker {
  margin-bottom: 1rem;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.hero h1 {
  margin-bottom: 1.4rem;
  color: var(--ink);
  font-size: clamp(3.35rem, 6.5vw, 5.25rem);
  line-height: 0.98;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
}

.hero-copy {
  max-width: 580px;
  margin: 0 auto;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.62;
}

.scroll-cue {
  display: inline-block;
  margin-top: 1.9rem;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
}


/* =========================================================
   editorial text
========================================================= */

.section-heading {
  width: min(560px, calc(100% - 40px));
  margin: 0 auto 3rem;
  text-align: left;
}

.section-number {
  margin-bottom: 0.8rem;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.section-heading h2 {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: clamp(2.25rem, 4.5vw, 3.45rem);
  line-height: 1.05;
}

.section-heading p:last-child {
  max-width: 540px;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.68;
}

.chart-hint {
  margin: 0.7rem 0 0;
  color: var(--quiet);
  font-family: "Lora", serif;
  font-size: 0.70rem;
  line-height: 1.4;
}

/* =========================================================
   continuous d3 story
========================================================= */

.dizi-story {
  position: relative;
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.story-chart-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 0.35rem;
  background: var(--background);
}

.story-chart {
  position: relative;
  width: 100%;
  height: 330px;
  background: var(--background);
  border-bottom: 1px solid var(--line);
}

#story-viz {
  display: block;
  width: 100%;
  height: 100%;
}

.story-copy {
  width: min(560px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 0.8rem;
}

.story-step {
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 2.2rem;
  text-align: left;
  opacity: 0.12;
  transform: translateY(5px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

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

.story-step .section-number {
  margin-bottom: 0.75rem;
}

.story-step h2 {
  max-width: 560px;
  margin-bottom: 1rem;
  color: var(--ink);
  font-family: "Lora", serif;
  font-size: clamp(2.2rem, 4.4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.story-step > p:last-child {
  max-width: 540px;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}


/* =========================================================
   d3 labels
========================================================= */

.cluster-title {
  font-family: "Lora", serif;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.cluster-count {
  font-family: "Lora", serif;
  font-size: 9px;
  text-anchor: middle;
  fill: var(--quiet);
}

.chart-axis text {
  font-family: "Lora", serif;
  font-size: 9px;
  fill: var(--quiet);
}

.chart-axis path,
.chart-axis line {
  stroke: var(--line);
}

.axis-title {
  font-family: "Lora", serif;
  font-size: 9px;
  fill: var(--quiet);
}

.story-node {
  cursor: pointer;
}

.story-node,
.note-node {
  stroke: transparent;
  stroke-width: 14px;
  paint-order: stroke fill;
  pointer-events: all;
}

.question-label {
  font-family: "Lora", serif;
  font-size: 10px;
  font-weight: 700;
  fill: var(--coral);
  pointer-events: none;
}

.question-detail {
  font-family: "Lora", serif;
  font-size: 8px;
  fill: var(--muted);
  pointer-events: none;
}


.question-leader {
  fill: none;
  stroke: var(--coral);
  stroke-width: 0.9;
  stroke-opacity: 0.55;
  pointer-events: none;
}

.question-stack-label {
  font-family: "Lora", serif;
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--coral);
  pointer-events: none;
}

.question-stack-detail {
  font-family: "Lora", serif;
  font-size: 9px;
  fill: var(--muted);
  pointer-events: none;
}

.favorite-label {
  font-family: "Lora", serif;
  font-size: 10px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}



.story-legend {
  font-family: "Lora", serif;
  font-size: 9px;
  fill: var(--muted);
}

.story-legend-line {
  stroke-width: 3;
  stroke-linecap: round;
}

/* =========================================================
   notes
========================================================= */

.notes-section {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 6.5rem 0 8rem;
}

.notes-viz-wrap {
  position: relative;
  width: 100%;
  height: 560px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#notes-viz {
  display: block;
  width: 100%;
  height: 100%;
}

.theme-group {
  cursor: pointer;
}

.theme-label {
  fill: var(--coral);
  font-family: "Lora", serif;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.theme-count {
  fill: var(--quiet);
  font-family: "Lora", serif;
  font-size: 8px;
  text-anchor: middle;
}

.theme-leader {
  stroke: var(--mustard);
  stroke-opacity: 0.9;
  stroke-width: 0.8;
}

.note-node {
  cursor: pointer;
}


/* =========================================================
   methodology
========================================================= */

.methodology {
  padding: 5rem 24px 7rem;
}

.methodology-inner {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 2.1rem 2.15rem 2.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11161a;
}

.methodology .section-number {
  color: var(--mustard);
}

.methodology h2 {
  margin-bottom: 1.55rem;
  color: var(--ink);
  font-family: "Lora", serif;
  font-size: clamp(2.15rem, 4.3vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.methodology p {
  margin-bottom: 1.15rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.72;
}

.methodology strong {
  color: var(--ink);
}

.methodology-tech {
  margin-top: 1.8rem;
  margin-bottom: 0 !important;
  color: var(--quiet) !important;
  font-size: 0.78rem !important;
}


/* =========================================================
   tooltip
========================================================= */

.tooltip {
  position: absolute;
  width: 230px;
  padding: 0.82rem 0.9rem;
  border: 1px solid #b9b3aa;
  border-radius: 5px;
  background: var(--cream);
  color: var(--background);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  font-family: "Lora", serif;
  font-size: 0.74rem;
  line-height: 1.48;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.tooltip strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.tooltip-muted {
  color: #6d6a66;
}

.tooltip-note {
  display: block;
  margin-top: 0.48rem;
  padding-top: 0.48rem;
  border-top: 1px solid #c4beb5;
  color: #222528;
}


/* =========================================================
   finale
========================================================= */

.finale {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 24px 4.5rem;
}

.finale-inner {
  width: min(760px, 100%);
  text-align: center;
}

.final-number-wrap {
  position: relative;
  width: 100%;
  height: 215px;
  margin: 0 auto 0.5rem;
}

#final-number-viz {
  display: block;
  width: 100%;
  height: 100%;
}

.final-number-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.final-show-dot {
  cursor: default;
  pointer-events: none;
}

.finale h2 {
  margin: 0.8rem 0 0;
  color: var(--ink);
  font-family: "Lora", serif;
  font-size: clamp(2.5rem, 5vw, 3.9rem);
  font-weight: 700;
  line-height: 1;
}

.final-note {
  max-width: 540px;
  margin: 1.45rem auto 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.65;
}

.final-hint {
  margin-top: 1.3rem;
  color: var(--quiet);
  font-size: 0.7rem;
}


/* =========================================================
   responsive
========================================================= */

@media (max-width: 700px) {

  .hero {
    width: calc(100% - 30px);
    padding: 4.5rem 0 1.8rem;
  }

  .hero h1 {
    font-size: clamp(2.85rem, 14vw, 4.1rem);
  }

  .hero-copy {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .dizi-story {
    width: calc(100% - 18px);
    padding-bottom: 3rem;
  }

  .story-chart-wrap {
    top: 0;
    padding-top: 0;
  }

  .story-chart {
    height: 275px;
  }

  .story-copy {
    width: calc(100% - 26px);
    padding-top: 0.5rem;
  }

  .story-step {
    min-height: 44vh;
    padding-top: 1.7rem;
  }

  .story-step h2 {
    font-size: clamp(2rem, 9.5vw, 2.7rem);
  }

  .story-step > p:last-child {
    font-size: 0.96rem;
    line-height: 1.6;
  }

  .notes-section {
    width: calc(100% - 22px);
    padding: 5rem 0 6rem;
  }

  .notes-viz-wrap {
    height: 700px;
  }

  .methodology {
    padding: 4rem 16px 5rem;
  }

  .methodology-inner {
    padding: 1.55rem 1.4rem 1.7rem;
    border-radius: 11px;
  }

  .methodology h2 {
    font-size: clamp(2rem, 8.8vw, 2.65rem);
  }

  .methodology p {
    font-size: 0.9rem;
  }

  .finale {
    min-height: 80vh;
    padding: 4.5rem 16px 5rem;
  }

  .final-number-wrap {
    height: 170px;
  }

  .finale h2 {
    font-size: clamp(2.3rem, 11vw, 3.25rem);
  }

  .tooltip {
    width: min(220px, calc(100vw - 30px));
  }
}

