:root {
  --ink: #060f33;
  --paper: #ffffff;
  --accent: #0889ea;
  --accent-text: #0567b3;
  --accent-on-dark: #4db0f5;
  --red: #d82149;
  --red-on-dark: #f0385f;
  --yellow: #ffc200;
  --muted: #5b6280;
  --line: #e5e7ee;
  --flow: #dde1ea;
  --flow-hi: #b3bacb;
  --soft: #f2f4f8;
  --display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
b, strong { font-weight: 700; }
.accent { color: var(--accent-text); }
.dark .accent { color: var(--accent-on-dark); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }
h1 em, h2 em, .closing-line em { font-style: italic; font-weight: 400; }
h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }

.wrap { max-width: 760px; margin: 0 auto; padding-inline: 24px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }

.src {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  margin: 10px 0 0;
}
.src a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.src a:hover { color: var(--accent-text); }
.dark .src, .dark .src a { color: #9aa0b8; }

.step-num {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.step-num::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--yellow);
  vertical-align: middle;
  margin: -2px 10px 0 0;
}

/* ---------- header ---------- */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px 24px;
  max-width: 1240px;
  margin: 0 auto;
  color: var(--paper);
}
.site-header { width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { height: 30px; width: 30px; border-radius: 7px; display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; }
.header-link { font-size: 13px; color: #b9bdd0; text-decoration: none; }
.header-link:hover { color: var(--yellow); }
@media (max-width: 560px) { .header-link { display: none; } }
@media (max-width: 759px) {
  .hero.dark { justify-content: flex-start; padding-top: 300px; }
  .kicker { margin-bottom: 10px; }
  .lede { margin-bottom: 20px; }
}

/* ---------- dark sections ---------- */
.dark { background: var(--ink); color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 96px;
}
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: relative; max-width: 1192px; width: 100%; margin: 0 auto; pointer-events: none; }
.hero-copy > * { pointer-events: auto; }
.kicker { font-size: 14px; color: #9aa0b8; margin: 0 0 16px; }
.hero h1 { font-size: clamp(52px, 8.5vw, 116px); line-height: 1; letter-spacing: -0.02em; }
.hero h1 em { color: var(--red-on-dark); }
.lede { font-family: var(--display); font-size: clamp(20px, 2.6vw, 30px); margin: 12px 0 32px; }
.hero-count { font-size: clamp(17px, 1.8vw, 21px); max-width: 30ch; margin: 0 0 20px; color: #d3d6e3; }
.hero-count strong { font-family: var(--display); font-size: 1.3em; }
.replay {
  font: 700 13px var(--display);
  color: var(--paper);
  background: transparent;
  border: 1px solid #3a4262;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}
.replay:hover { border-color: var(--yellow); color: var(--yellow); }
.hero-src { position: absolute; left: max(24px, calc((100% - 1240px) / 2 + 24px)); bottom: 24px; right: 140px; max-width: 520px; margin: 0; }
.scroll-cue { right: max(24px, calc((100% - 1240px) / 2 + 24px)) !important; }
.scroll-cue {
  position: absolute; right: 24px; bottom: 20px;
  font: 700 13px var(--display); color: #b9bdd0; text-decoration: none;
}
.scroll-cue:hover { color: var(--yellow); }

/* ---------- scrollytelling ---------- */
.flows { padding: 96px 0 64px; }
.scrolly {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 24px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 48px;
}
.graphic { grid-column: 2; grid-row: 1; }
.graphic-inner {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 32px;
}
.steps { grid-column: 1; grid-row: 1; padding-block: 30vh 40vh; }
.step {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.25;
  transition: opacity 0.4s ease;
}
.step.is-active { opacity: 1; }
.step h2 { font-size: clamp(26px, 3vw, 36px); }
.step p { margin: 0 0 12px; }
.figs { list-style: none; margin: 0 0 12px; padding: 0; }
.figs li { padding: 8px 0; border-top: 1px solid var(--line); }
.figs li b { font-family: var(--display); font-size: 20px; margin-right: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters button {
  font: 700 13px var(--display);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chart-title { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.chart-title strong { color: var(--accent-text); }
.chart-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.k-loop { background: var(--accent); }
.k-kept { background: var(--ink); }
.k-gone { background: var(--red); }

.flow-wrap { position: relative; }
.flow-view { transition: opacity 0.35s ease; }
.flow-view.is-muted { opacity: 0.12; pointer-events: none; }
.flow-view.is-narrow .sankey { display: none; }
.flow-view:not(.is-narrow) .flow-blocks { display: none; }

/* mobile flow: five stacked blocks */
.flow-blocks { padding-top: 4px; }
.stage-title { font: 700 11px var(--display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 5px; }
.stage-bar { display: flex; gap: 2px; height: 14px; }
.seg { display: block; height: 100%; min-width: 3px; border-radius: 4px; transition: opacity 0.4s ease; }
.stage-labels { list-style: none; margin: 5px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; line-height: 1.35; }
.stage-labels li { transition: opacity 0.4s ease; white-space: nowrap; }
.stage-labels i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.stage-labels b { font-family: var(--display); }
.stage-arrow { color: var(--flow-hi); font-size: 13px; line-height: 1; margin: 5px 0 4px 2px; }
.flow-blocks .dim { opacity: 0.18; }
.flow-blocks .stage + .stage-arrow { display: none; }
.flow-blocks .stage { margin-bottom: 12px; }

/* material comparison (filters) */
.mat-compare {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px 18px;
  box-shadow: 0 16px 40px -24px rgba(6, 15, 51, 0.35);
}
.mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-title { font-family: var(--display); font-size: 22px; margin: 0; }
.mc-title b { font-weight: 700; }
.mc-close { font: 700 12px var(--display); color: var(--ink); background: none; border: 1px solid #cfd3de; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.mc-close:hover { border-color: var(--ink); }
.mc-row { display: grid; grid-template-columns: minmax(96px, 170px) 1fr 52px; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.mc-track { position: relative; height: 14px; }
.mc-bar { position: absolute; left: 0; top: 0; bottom: 0; background: #cfd3de; border-radius: 0 4px 4px 0; }
.mc-row.is-on .mc-bar { background: var(--accent); }
.mc-row.is-on .mc-name, .mc-row.is-on .mc-val { font-weight: 700; }
.mc-eu { position: absolute; top: -4px; bottom: -4px; border-left: 2px dashed var(--ink); }
.mc-val { font-family: var(--display); font-weight: 700; text-align: right; }
.mc-legend { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.mc-eu-key { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--ink); vertical-align: -2px; margin: 0 6px 0 2px; }
.mc-facts { font-size: 15px; margin: 0 0 8px; }
.mc-note { font-size: 12px; color: var(--muted); margin: 0; }
@media (max-width: 560px) {
  .mat-compare { padding: 14px 16px; }
  .mc-head { margin-bottom: 8px; }
  .mc-title { font-size: 16px; }
  .mc-close { padding: 4px 10px; font-size: 11px; }
  .mc-row { grid-template-columns: 88px 1fr 40px; gap: 8px; padding: 3px 0; font-size: 12px; line-height: 1.2; }
  .mc-track { height: 10px; }
  .mc-legend { margin: 4px 0 8px; font-size: 11px; }
  .mc-facts { font-size: 13px; margin: 0; }
  .mc-note { display: none; }
}

/* ---------- photo bands ---------- */
.photo-band {
  position: relative;
  margin: 0;
  min-height: 78vh;
  min-height: 78svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}
.photo-band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  opacity: 0.5;
  mix-blend-mode: luminosity;
  transform: scale(1.06);
  transition: transform 1.6s ease-out;
}
.photo-band.in-view img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) { .photo-band img { transform: none; transition: none; } }
.photo-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 15, 51, 0.1) 0%, rgba(6, 15, 51, 0.15) 45%, rgba(6, 15, 51, 0.92) 100%);
}
.band-copy { position: relative; z-index: 1; width: 100%; padding-block: 0 56px; }
.band-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(64px, 11vw, 150px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--yellow);
  margin: 0 0 12px;
}
.band-num span { font-weight: 400; font-style: italic; font-size: 0.32em; letter-spacing: 0; color: var(--paper); margin-left: 8px; }
.band-line { font-family: var(--display); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.25; max-width: 30ch; margin: 0 0 20px; }
.photo-band .src, .photo-band .src a { color: #b9bdd0; }

.sankey { width: 100%; }
.sankey svg { display: block; width: 100%; height: auto; overflow: visible; }
.sankey .link { transition: opacity 0.5s ease; }
.sankey .node rect { transition: opacity 0.5s ease; }
.sankey .label { font-family: var(--body); font-size: 13px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; transition: opacity 0.5s ease; }
.sankey .label .val { font-family: var(--display); font-weight: 700; }
.sankey .label .name { fill: var(--muted); }
.sankey .loop-flow { stroke-dasharray: 2 14; stroke-linecap: round; animation: loopflow 1.2s linear infinite; pointer-events: none; }
@keyframes loopflow { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .sankey .loop-flow { animation: none; display: none; } }

.table-view { margin-top: 24px; font-size: 14px; }
.table-view summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 14px; }
.table-scroll { overflow-x: auto; }
.table-view table { border-collapse: collapse; margin-top: 16px; width: 100%; min-width: 480px; }
.table-view th, .table-view td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view thead th { font-family: var(--display); font-size: 12px; }

/* mobile scrolly: chart sticky on top, cards scroll over */
@media (max-width: 900px) {
  .flows { padding-top: 48px; }
  .scrolly { display: block; padding-inline: 0; }
  .graphic { position: sticky; top: 0; height: 100vh; height: 100svh; z-index: 1; background: var(--paper); }
  .graphic-inner { position: static; min-height: 0; height: 100%; padding: 16px 16px 0; justify-content: flex-start; }
  .steps { position: relative; z-index: 2; margin-top: -55vh; padding: 0 16px 20vh; pointer-events: none; }
  .step { min-height: 100vh; justify-content: flex-end; opacity: 1; }
  .card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 12px 28px -16px rgba(6, 15, 51, 0.35);
  }
  .step h2 { font-size: 21px; margin-bottom: 6px; }
  .step p { font-size: 14px; line-height: 1.45; margin-bottom: 6px; }
  .step .step-num { font-size: 11px; margin-bottom: 6px; }
  .card .src { display: none; }
  .figs { margin: 0; }
  .figs li { padding: 3px 0; font-size: 14px; line-height: 1.4; border-top: 0; }
  .figs li b { font-size: 15px; }
  .filters { flex-wrap: nowrap; gap: 6px; margin-bottom: 8px; }
  .filters button { font-size: 12px; padding: 6px 11px; }
  .chart-title { font-size: 11px; line-height: 1.4; margin-bottom: 4px; }
  .chart-key { font-size: 11px; gap: 2px 10px; margin-bottom: 10px; }
  .chart-key i { width: 8px; height: 8px; margin-right: 4px; }
  .stage-title { font-size: 10px; margin-bottom: 4px; }
  .stage-bar { height: 12px; }
  .stage-labels { font-size: 12px; margin-top: 4px; gap: 0 10px; }
  .graphic .src { font-size: 11px; margin-top: 4px; }
}

/* ---------- comparison ---------- */
.compare, .threat { padding-block: 96px; }
.compare { border-top: 1px solid var(--line); }
.intro { max-width: 62ch; margin: 0 0 32px; }
.compare-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; gap: 48px; } }
.country-pick { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.country-pick select {
  font: 500 14px var(--body);
  padding: 6px 30px 6px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.ranking svg, .trend svg, .extraction svg { display: block; width: 100%; height: auto; overflow: visible; }
.ranking .row { cursor: default; }
.ranking text, .trend text, .extraction text { font-family: var(--body); font-size: 12px; fill: var(--ink); }
.ranking .name { font-size: 13px; }
.ranking .val { font-family: var(--display); font-weight: 700; font-size: 12px; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.ranking .muted, .trend .muted, .extraction .muted { fill: var(--muted); }
.axis line, .axis path { stroke: var(--line); }
.axis text { fill: var(--muted); font-size: 11px; }
.trend-block { background: var(--soft); border-radius: 16px; padding: 28px; position: sticky; top: 24px; }
.trend-block p { margin: 0 0 12px; font-size: 16px; }
.trend-block p.src { font-size: 12px; margin: 10px 0 0; }

/* ---------- threat ---------- */
.threat { border-top: 1px solid var(--line); }
.threat-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: end; }
@media (max-width: 900px) { .threat-grid { grid-template-columns: 1fr; gap: 48px; } }
.stat { border-top: 2px solid var(--ink); padding-top: 20px; }
.stat-num { font-family: var(--display); font-weight: 700; font-size: clamp(72px, 10vw, 128px); line-height: 1; margin: 0 0 12px; }
.stat-num span { color: var(--red); }
.stat-label { font-size: 20px; margin: 0; max-width: 24ch; }

/* ---------- closing ---------- */
.closing { padding-block: 128px; text-align: center; }
.closing-line { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 56px); line-height: 1.15; margin: 0 0 56px; }
.closing-line em { color: #c3c8da; }
.cta-block p { font-size: 19px; color: #d3d6e3; max-width: 40ch; margin: 0 auto 32px; }
.cta {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cta:hover { background: var(--yellow); color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { padding: 56px 0 calc(48px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--muted); }
.method h3 { font-size: 14px; color: var(--ink); }
.method ul { padding-left: 18px; margin: 0 0 32px; max-width: 90ch; }
.method li { margin-bottom: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-text); }
.copy { text-align: center; margin: 0; padding-inline: 24px; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(6, 15, 51, 0.25);
}
.tooltip b { font-family: var(--display); }
.tooltip .tt-muted { color: #a9aec4; }
.tooltip .tt-red { color: #ff7d95; }
.tooltip .tt-blue { color: var(--accent-on-dark); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
