@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #1F2C25;        /* hedge-dark green, from the email signature */
  --field: #277A4B;      /* grass (darkened from #2F8A57 for 4.5:1 text contrast) */
  --rape: #E9C33F;       /* oilseed rape yellow */
  --estuary: #2E6A8C;    /* Humber blue */
  --stone: #5E6D64;      /* chalk-wold grey green */
  --paper: #F3F5F1;      /* pale sage */
  --line: #D5DBD5;
  --white: #FFFFFF;
  --red: #B4442E;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
section[id] { scroll-margin-top: 16px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 6px; font-weight: 650;
}
.skip:focus { top: 12px; color: var(--white); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "tnum" 0;
}

a { color: var(--estuary); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--rape); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 22px; padding-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand svg { flex: none; }
.top nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.top nav a { color: var(--ink); text-decoration: none; padding: 10px 0; }
.top nav a:hover { text-decoration: underline; }
@media (max-width: 720px) { .top nav .opt { display: none; } }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(24px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 0.45em;
  max-width: 16ch;
  text-wrap: balance;
}
.lede { font-size: 1.2rem; line-height: 1.5; max-width: 44ch; margin: 0 0 1.6rem; color: #33443A; }

.actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.btn {
  display: inline-block; background: var(--ink); color: var(--white);
  padding: 0.8em 1.25em; border-radius: 6px; text-decoration: none; font-weight: 650;
}
.btn:hover { background: var(--field); color: var(--white); }
.quiet { color: var(--ink); font-weight: 550; }

/* The map + scorecard, the one loud element */
.plate {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.plate svg.map { display: block; width: 100%; height: auto; }
.card {
  border-top: 1px solid var(--line);
  padding: 16px 20px 14px;
  font-size: 0.9rem;
  line-height: 1.35;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-head strong { font-size: 0.98rem; }
.score { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--field); line-height: 1; }
.card ol { list-style: none; margin: 0; padding: 0; }
.card li { display: grid; grid-template-columns: 3.1em 1fr; gap: 6px; padding: 5px 0; border-top: 1px solid #E7EBE7; }
.card li b { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.card li.plus b { color: var(--field); }
.card li.minus b { color: var(--red); }
.card li.check b { color: #84680C; font-weight: 600; }
.card .note { margin: 8px 0 0; color: var(--stone); font-size: 0.76rem; }


.card li { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .card li { animation: tick 0.45s ease-out both; }
  .card li:nth-child(1) { animation-delay: 0.5s; }
  .card li:nth-child(2) { animation-delay: 0.8s; }
  .card li:nth-child(3) { animation-delay: 1.1s; }
  .card li:nth-child(4) { animation-delay: 1.4s; }
  .card li:nth-child(5) { animation-delay: 1.7s; }
  .map .target { animation: draw 1.2s ease-out 0.1s both; }
  @keyframes tick { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
  @keyframes draw { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
}

/* Sections */
section.band { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
section.band.white { background: var(--white); }

h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 760;
  margin: 0 0 0.6em;
  max-width: 24ch;
  text-wrap: balance;
}
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 0.4em; font-weight: 700; }
p { margin: 0 0 1em; max-width: var(--measure); }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Data sources list */
.sources { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.sources li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sources span { color: var(--stone); }
@media (max-width: 520px) { .sources li { grid-template-columns: 1fr; } }

.limits { margin-top: 2.2rem; padding: 18px 20px; border-left: 4px solid var(--rape); background: #FBF6E2; }
.limits h3 { margin-bottom: 0.5em; }
.limits ul { margin: 0; padding-left: 1.1em; }
.limits li { margin: 0.3em 0; max-width: 62ch; }

/* Process: a real sequence, so it is numbered */
.steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 14px; }
.steps li::before { content: counter(step); display: block; font-weight: 800; font-size: 1.6rem; color: var(--field); line-height: 1; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.steps p { font-size: 1rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Audience columns */
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); margin-top: 1.5rem; }
.who ul { margin: 0.6rem 0 0; padding-left: 1.1em; }
.who li { margin: 0.35em 0; }
@media (max-width: 760px) { .who { grid-template-columns: 1fr; } }

.owners { margin-top: clamp(36px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }

.rules { margin: 1.2rem 0 0; padding: 0; list-style: none; }
.rules li { padding: 12px 0 12px 30px; border-bottom: 1px solid var(--line); position: relative; max-width: 64ch; }
.rules li::before { content: ""; position: absolute; left: 4px; top: 1.05em; width: 12px; height: 12px; border-radius: 3px; background: var(--field); }

/* Contact */
.contact { background: var(--ink); color: var(--white); padding: clamp(52px, 8vw, 96px) 0; }
.contact h2 { color: var(--white); }
.contact p { color: #D7DED8; }
.contact a { color: var(--white); }
.contact .btn { background: var(--rape); color: var(--ink); }
.contact .btn:hover { background: var(--white); color: var(--ink); }
.contact .tel { font-size: 1.15rem; font-weight: 600; }

footer { background: var(--ink); color: #AEB9B1; font-size: 0.88rem; padding: 0 0 36px; }
footer .wrap { border-top: 1px solid #3A4A41; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
footer p { margin: 0; }
footer a { color: #D7DED8; display: inline-block; padding: 6px 0; }

/* Plain document pages */
.doc { padding-top: 24px; padding-bottom: 72px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); max-width: 20ch; }
.doc h2 { font-size: 1.35rem; margin-top: 2rem; }
.doc ul { max-width: var(--measure); padding-left: 1.1em; }

/* ---------- 3D journey hero ---------- */
.journey, .hero-fallback { display: none; }
html:not(.has3d) .hero-fallback { display: grid; }
html.has3d .journey { display: block; position: relative; height: calc(100vh - var(--head, 88px)); height: calc(100svh - var(--head, 88px)); min-height: 460px; max-height: 1100px; }
html.has3d .hero-fallback { display: grid; grid-template-columns: minmax(0, 1fr); padding-top: clamp(40px, 7vw, 88px); }
html.has3d .hero-fallback .plate { display: none; }

.stage { position: relative; height: 100%; overflow: hidden; background: #DCE7EC; }
.fade { position: absolute; inset: 0; background: #E9EEE6; opacity: 0; pointer-events: none; }
.pause {
  position: absolute; right: max(var(--gutter), 4vw); bottom: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(31, 44, 37, 0.25); background: rgba(255, 255, 255, 0.88); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.pause:hover { background: var(--white); }
.pause .i-play, .pause.is-paused .i-pause { display: none; }
.pause.is-paused .i-play { display: block; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: rgba(255, 255, 255, 0.88); border: 1px solid rgba(31, 44, 37, 0.25);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue svg { animation: bob 2.4s ease-in-out infinite; }
  @keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
}
html.still .pause { display: none; }
canvas.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html:not(.scene-ready) .stage { background: linear-gradient(#A9C7DC, #DCE7EC 55%, #B7CDA0 56%); }

.intro {
  position: absolute; inset: 0 0 auto 0; padding-top: clamp(16px, 4vh, 48px); padding-bottom: 80px;
  background: linear-gradient(180deg, rgba(238, 241, 234, 0.82) 0%, rgba(238, 241, 234, 0.55) 70%, rgba(238, 241, 234, 0) 100%);
}
.intro h1 { max-width: 15ch; }
.intro .lede { max-width: 46ch; color: #2A3A31; }
@media (max-width: 720px) {
  .intro .lede { font-size: 1.02rem; }
  .intro h1 { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
}
@media (max-height: 700px) and (min-width: 721px) { .intro h1 { font-size: 2.6rem; } }

.lbl {
  position: absolute; left: 0; top: 0; translate: -50% calc(-100% - 10px);
  background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 5px 10px; font-size: 0.86rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.lbl small { display: block; font-weight: 450; font-size: 0.78rem; color: var(--stone); }
.lbl-ink { background: var(--ink); color: var(--white); translate: -50% -50%; }
.lbl-blue { color: var(--estuary); border-color: var(--estuary); translate: -50% -50%; }

.score-card {
  position: absolute; right: max(var(--gutter), 4vw); top: clamp(24px, 13%, 140px);
  width: min(480px, 38vw); max-height: calc(100% - 60px); overflow: hidden;
  background: var(--white); border: 1px solid var(--ink); border-radius: 10px;
  box-shadow: 0 18px 44px rgba(31, 44, 37, 0.22);
  padding: 16px 18px 12px; font-size: 0.9rem; line-height: 1.35;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .7, .2, 1);
}
.score-card.on { opacity: 1; transform: none; pointer-events: auto; }
.score-card .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.score-card .card-head strong { font-size: 1rem; }
.score-card .muted { color: var(--stone); }
.score-card .score { font-size: 2.3rem; font-weight: 800; color: var(--field); line-height: 1; font-variant-numeric: tabular-nums; }
.rules-list { list-style: none; margin: 0; padding: 0; }
.rules-list li {
  display: grid; grid-template-columns: 3.2em 1fr; gap: 6px; padding: 0; max-height: 0; overflow: hidden;
  border-top: 1px solid transparent; opacity: 0; transform: translateX(-8px);
  transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s, border-color 0.4s;
}
.rules-list li.on { max-height: 4.5em; padding: 6px 0; opacity: 1; transform: none; border-top-color: #E7EBE7; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.rules-list b { text-align: right; font-variant-numeric: tabular-nums; }
.rules-list .plus b { color: var(--field); }
.rules-list .minus b { color: var(--red); }
.rules-list .check b { color: #84680C; font-weight: 600; }
.score-card .note { margin: 8px 0 0; color: var(--stone); font-size: 0.78rem; }

.fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.8s cubic-bezier(.3, .7, .2, 1), opacity 0.6s ease 0.2s; }
.fold > div { overflow: hidden; min-height: 0; }
.score-card.report .fold { grid-template-rows: 1fr; opacity: 1; }
.doc-type { margin: 0 0 2px; color: var(--stone); font-size: 0.8rem; font-weight: 600; }
.report-head h2 { font-size: 1.35rem; margin: 0 0 12px; max-width: none; }
.routes { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.routes li { display: grid; grid-template-columns: 9.5em 2.2em 1fr; align-items: center; gap: 10px; }
.routes b { font-variant-numeric: tabular-nums; text-align: right; }
.routes i { display: block; height: 8px; border-radius: 4px; background: #E7EBE7; position: relative; overflow: hidden; }
.routes i::after { content: ""; position: absolute; inset: 0; width: 0; border-radius: 4px; transition: width 1s cubic-bezier(.3, .7, .2, 1) 0.35s; }
.score-card.report .routes i::after { width: calc(var(--w) * 100%); }
.routes .g { color: var(--field); } .routes i.g::after { background: var(--field); }
.routes .a { color: #84680C; } .routes i.a::after { background: var(--rape); }
.score-card .card-head { border-top: 2px solid transparent; transition: border-color 0.6s, padding 0.8s; }
.score-card.report .card-head { border-top-color: var(--ink); padding-top: 10px; }
.report-checks h3 { font-size: 0.92rem; margin: 12px 0 4px; }
.report-checks ul { margin: 0; padding-left: 1.1em; }
.report-checks li { margin: 2px 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.captions { position: absolute; left: max(var(--gutter), 4vw); bottom: 26px; width: min(440px, calc(100% - 2 * var(--gutter) - 150px)); }
.captions ol { list-style: none; margin: 0 0 10px; padding: 0; position: relative; min-height: 1.6em; }
.captions li { position: absolute; left: 0; bottom: 0; font-weight: 650; font-size: 1rem; color: var(--ink);
  background: rgba(255, 255, 255, 0.9); padding: 5px 10px; border-radius: 6px; opacity: 0; transition: opacity 0.3s; }
.captions li.on { opacity: 1; }
.progress { height: 4px; background: rgba(31, 44, 37, 0.18); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

.controls { position: absolute; right: max(var(--gutter), 4vw); bottom: 22px; display: flex; gap: 8px; align-items: center; }
.controls .play, .controls .skip-journey, .stage-cta {
  font: inherit; font-weight: 650; font-size: 0.92rem; border-radius: 6px; padding: 9px 14px; cursor: pointer; text-decoration: none; min-height: 40px;
}
.controls .play { background: var(--ink); color: var(--white); border: 0; }
.controls .play:hover { background: var(--field); }
.controls .skip-journey { color: var(--ink); background: rgba(255, 255, 255, 0.9); }
.stage-cta { position: absolute; top: 16px; right: max(var(--gutter), 4vw); background: var(--rape); color: var(--ink);
  opacity: 0; transform: translateY(-8px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.stage-cta.on { opacity: 1; transform: none; pointer-events: auto; }
.stage-cta:hover { background: var(--ink); color: var(--white); }

html.still .captions, html.still .controls { display: none; }

@media (max-width: 760px), (max-aspect-ratio: 19/20) {
  .score-card, .score-card.report { left: 12px; right: 12px; width: auto; top: auto; bottom: 72px; max-height: calc(100% - 230px);
    padding: 12px 14px 10px; font-size: 0.84rem; }
  .score-card .score { font-size: 1.9rem; }
  .score-card .fold-checks { display: none; }
  .routes li { grid-template-columns: 8.5em 2em 1fr; }
  .report-head h2 { font-size: 1.1rem; margin-bottom: 8px; }
  .captions { width: auto; right: 12px; left: 12px; bottom: 60px; }
  .captions li { font-size: 0.86rem; }
  .controls { bottom: 12px; left: 12px; right: auto; }
  .controls .play, .controls .skip-journey, .stage-cta { font-size: 0.82rem; padding: 7px 11px; min-height: 34px; }
  .stage-cta { top: 14px; right: 12px; }
  .lbl { font-size: 0.74rem; padding: 3px 7px; }
}

/* reduced motion: one still frame, the report beside the intro */
html.still .intro { bottom: 0; padding-top: clamp(24px, 6vh, 64px);
  background: linear-gradient(90deg, rgba(238, 241, 234, 0.95) 0%, rgba(238, 241, 234, 0.9) 48%, rgba(238, 241, 234, 0) 62%); }
html.still .lbl { display: none; }
@media (max-width: 760px), (max-aspect-ratio: 19/20) {
  html.still .intro { background: rgba(238, 241, 234, 0.9); }
  html.still .score-card { display: none; }
}
