@import url('https://fonts.googleapis.com/css2?family=Saira+Stencil+One&display=swap');
/* Responsive version (Nov 4, 2026); same file for the Costs and Benefits pages.
   Two arrangements, chosen by the space available (layout.js picks the chart layout the same way):
   - overlay, the default (portrait or narrow screens): the sticky chart fills the screen under the header and each
     step is a white card scrolling over its bottom part;
   - columns (landscape and at least 600px wide): text column left, sticky chart right, as on the original pages. */
:root {
  --ink: #1f2328;
  --muted: #5f6670;
  --line: #e4e6ea;
  --dot: #9aa1aa;
  --blue: #2f6db5;
  --blue-soft: #dbe7f5;
  --red: #c0392b;
  --bg: #ffffff;
  --card: #ffffff;
  --hdr: 92px;            /* measured and set by layout.js */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden;
  font: 18px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Calibri, Helvetica, Arial, sans-serif;
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.brand { font-weight: 700; font-size: 19px; letter-spacing: -.01em; line-height: 1.3; }
.tabs {
  display: flex; gap: 2px; margin: 4px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.tabs.more-l:not(.more-r) { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
.tab {
  display: flex; align-items: center; min-height: 44px; padding: 0 10px; scroll-snap-align: center;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; font-size: 15px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }
.tab[aria-disabled="true"] { cursor: default; }

/* ---------- story: overlay arrangement (default) ---------- */
.story { display: grid; }
.chart-wrap, .steps { grid-area: 1 / 1; min-width: 0; }
.chart { position: sticky; top: var(--hdr); margin: 0; height: calc(100svh - var(--hdr)); }
.chart svg { display: block; width: 100%; height: 100%; }
.steps { position: relative; z-index: 2; pointer-events: none; }
.cover {
  min-height: calc(100svh - var(--hdr)); background: var(--bg); pointer-events: auto;
  display: flex; flex-direction: column; justify-content: center; padding: 0 24px 12svh;
}
.step {   /* Nov 6 (Bjorn's Android): 100lvh, the screen without the address bar; with 100svh the step was shorter than the
             screen once the bar slid away, and the previous card showed at the top */
  min-height: calc(100lvh - var(--hdr)); display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left));
}
.card {
  pointer-events: auto; width: 100%; max-width: 560px; margin: 0 auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(20,30,40,.16); padding: 14px 18px;
}
.step p { margin: 0; font-size: 18px; line-height: 1.45; }
.step p.aside { font-size: 16px; color: var(--muted); margin-top: 10px; }
.step a { padding: 10px 0; }           /* finger-sized tap area without changing the line */
.step ul { margin: 0; padding-left: 20px; }
.step li { margin-bottom: 6px; }
.cover h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.15; margin: 0 0 18px; letter-spacing: -.01em; }
.cover .cue { color: var(--muted); font-size: 18px; margin: 0; }
.blue { color: var(--blue); }
.red { color: var(--red); }
.green { color: #3c8d5a; }

/* ---------- story: columns arrangement (landscape, at least 600px wide) ---------- */
@media (min-width: 600px) and (orientation: landscape) {
  .top { padding: 14px 32px 0; }
  .brand { font-size: 22px; line-height: 1.55; }
  .tabs { gap: 6px; margin: 10px -32px 0; padding: 0 32px; }
  .tab { padding: 0 14px; font-size: 16px; }
  .story { grid-template-columns: minmax(280px, 33%) 1fr; max-width: 1400px; margin: 0 auto; padding: 0 32px; }
  .steps { grid-area: 1 / 1; padding: 0 0 45vh; pointer-events: auto; }
  .chart-wrap { grid-area: 1 / 2; }
  .chart { top: calc(var(--hdr) + 8px); height: calc(100vh - var(--hdr) - 36px); padding-left: 28px; }
  .cover { min-height: calc(100vh - var(--hdr)); background: none; padding: 0 0 8vh; }
  .step { min-height: 62vh; justify-content: center; padding: 0; opacity: .3; transition: opacity .4s; }
  .step.active { opacity: 1; }
  .card { max-width: none; margin: 0; background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .step p { margin: 0 0 14px; font-size: 21px; line-height: 1.5; }
  .step p.aside { font-size: 17px; margin-top: 22px; }
}
/* short landscape screens (phones on their side): one header row, smaller text column */
@media (orientation: landscape) and (max-height: 500px) {
  .top { padding-top: 0; }
  .brand { display: none; }
  .tabs { margin-top: 0; }
  .story { grid-template-columns: minmax(220px, 34%) 1fr; padding: 0 max(16px, env(safe-area-inset-left)); }
  .chart { padding-left: 16px; height: calc(100vh - var(--hdr) - 16px); }
  .step p { font-size: 17px; }
}

/* ---------- notes ---------- */
.notes { max-width: 900px; margin: 0 auto; padding: 20px 16px 48px; font-size: 16px; color: var(--muted); overflow-wrap: anywhere; }
.notes summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 17px; min-height: 44px; display: flex; align-items: center; }
.notes details { margin-bottom: 8px; }
.notes ol { padding-left: 22px; }
.notes li { margin: 8px 0; }
.notes a { color: var(--blue); }
.notes a.cite { font-weight: 600; font-size: 16px; }
.refs { list-style: none; padding-left: 0; }
.refs li { margin: 6px 0; padding-left: 1.6em; text-indent: -1.6em; }
.byline { margin-top: 24px; font-style: italic; text-align: right; }
#notes { scroll-margin-top: calc(var(--hdr) + 12px); }
@media (min-width: 600px) and (orientation: landscape) { .notes { padding: 20px 32px 60px; font-size: 15px; } }

/* ---------- chart text (sizes in chart units; layout.js sets --fs above 1 when a wide chart is shown small) ---------- */
#chart { --fs: 1; }
.axis text { font-size: calc(17px * var(--fs)); fill: var(--muted); }
.axis path, .axis line { stroke: #c9cdd2; }
.grid line { stroke: var(--line); }
.axis-title { font-size: calc(17px * var(--fs)); fill: var(--muted); }
.lab { font-size: calc(16px * var(--fs)); fill: var(--ink); }
.lab-b { font-size: calc(17px * var(--fs)); font-weight: 700; }
/* tall charts are denser: a thin white outline keeps labels readable where they cross a line */
#chart.tall .lab, #chart.tall .axis-title { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.bar-lab { font-size: calc(16px * var(--fs)); font-weight: 700; fill: var(--ink); text-anchor: middle; }
.bar-name { font-size: calc(16px * var(--fs)); fill: var(--muted); text-anchor: end; }
.icon-lab { font-size: 18px; fill: var(--muted); text-anchor: middle; }
.tag-lab { font-size: calc(16px * var(--fs)); font-weight: 700; fill: white; text-anchor: middle; }
.model-lab { font-size: 22px; font-weight: 700; fill: white; text-anchor: middle; }
.cover-big { font-size: 64px; font-weight: 700; fill: #2b4f7e; text-anchor: middle; }
.cover-sub { font-size: 22px; fill: var(--muted); text-anchor: middle; }
.person-name { font-size: calc(20px * var(--fs)); font-weight: 700; fill: var(--ink); text-anchor: middle; }
.person-sub { font-size: calc(16px * var(--fs)); fill: var(--muted); text-anchor: middle; }
.stamp { font: 34px 'Saira Stencil One', Impact, 'Arial Black', sans-serif; fill: #3c8d5a; text-anchor: middle; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .step { transition: none; } }

/* ---------- snapping (Nov 4, Bjorn's choice after testing on his Android phone and his computer) ----------
   Every screen size, phones to computers: each swipe, wheel turn, trackpad swipe or arrow key moves exactly one step,
   and a fast scroll can't skip a step. Upright screens stop with the next card just in view at the bottom; landscape
   screens stop with the step's text in the middle of the text column. The notes scroll freely.
   (A gentle "proximity" version for computers was tried first: Bjorn found it harder to navigate.) */
html { scroll-snap-type: y mandatory; scroll-padding-top: var(--hdr); }
.cover { scroll-snap-align: start; }
.step { scroll-snap-align: end; scroll-snap-stop: always; }
.notes { scroll-snap-align: start; }
@media (min-width: 600px) and (orientation: landscape) {
  .step { scroll-snap-align: center; }
}

/* Nov 8 (David point 12): a visible way back to the map (to the result the visitor came from), and on phones all five tabs fit
   in one row: no sideways scrolling, no fade; the text shrinks a little on the narrowest phones */
.top p.back { margin: 0 0 2px; line-height: 1.3; }
.back-map { font-size: 14px; font-weight: 500; color: var(--blue); text-decoration: none; }
.back-map:hover { text-decoration: underline; }
@media (max-width: 599px) {
  .tabs, .tabs.more-r, .tabs.more-l.more-r, .tabs.more-l:not(.more-r) { -webkit-mask-image: none; mask-image: none; justify-content: space-between; gap: 0; overflow: visible; }
  .tab { padding: 0 2px; font-size: clamp(10.5px, 3.45vw, 15px); }
}
.refs, .refs a { overflow-wrap: anywhere; }   /* Nov 8: long DOI links wrap on the narrowest phones */

/* Nov 8 (Bjorn, Android Chrome): no blue tap square on links and tabs */
a, button, summary { -webkit-tap-highlight-color: transparent; }
