:root {
  --cloud: #f7f4ec;
  --paper: #fffefa;
  --warm: #efe9dc;
  --charcoal: #343432;
  --meadow: #344223;
  --sky: #3f6b88;
  --soft-sky: #7fa2be;
  --olive: #556324;
  --rust: #a45c2b;
  --ochre: #c28a3d;
  --grey: #d7d4cc;
  --bar-height: 4.15rem;
  color: var(--charcoal);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cloud);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--sky); }
button, input { font: inherit; }

a:focus-visible,
button:focus-visible,
svg:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--meadow);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.portal-bar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(12rem, auto) minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--bar-height);
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 3vw, 3rem);
  color: #fff;
  background: var(--meadow);
  box-shadow: 0 5px 22px rgb(19 26 12 / 20%);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  background:
    linear-gradient(145deg, transparent 44%, var(--ochre) 45% 55%, transparent 56%),
    linear-gradient(35deg, transparent 44%, var(--soft-sky) 45% 55%, transparent 56%);
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem 0.75rem;
}

.site-nav a {
  padding: 0.35rem 0.1rem;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { border-bottom-color: var(--ochre); }

.language { display: flex; gap: 0.3rem; }
.language a {
  display: grid;
  min-width: 2.4rem;
  min-height: 2.1rem;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 0.35rem;
}
.language a[aria-current="true"] { color: var(--meadow); background: #fff; }

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - var(--bar-height));
  overflow: hidden;
  place-items: end start;
  isolation: isolate;
  color: #fff;
  background: #1b2416;
}

.hero-terrain,
.hero-shade,
.hero-contours {
  position: absolute;
  inset: 0;
}

.hero-terrain {
  z-index: -3;
  background-image: url("../pzs-method/terrain.png");
  background-position: center;
  background-size: cover;
  filter: saturate(0.72) contrast(1.15);
  transform: scale(1.03);
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgb(23 31 16 / 92%) 0%, rgb(23 31 16 / 62%) 48%, rgb(23 31 16 / 12%) 85%),
    linear-gradient(0deg, rgb(12 18 9 / 72%) 0%, transparent 55%);
}

.hero-contours {
  z-index: -1;
  opacity: 0.25;
  background-image:
    repeating-radial-gradient(ellipse at 72% 45%, transparent 0 34px, rgb(255 255 255 / 34%) 35px 36px, transparent 37px 54px);
  mix-blend-mode: overlay;
}

.hero-content {
  width: min(69rem, 92vw);
  margin: 0 auto clamp(6.5rem, 14vh, 10rem);
}

.eyebrow,
.map-kicker {
  margin: 0 0 0.65rem;
  color: var(--rust);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #e7b778; }
.hero h1 {
  max-width: 11ch;
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 11vw, 9.5rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.84;
  text-wrap: balance;
}

.hero-dek {
  max-width: 39rem;
  margin: 1.7rem 0 0;
  color: #f6f1e5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.35;
}

.hero-byline { margin: 1.5rem 0 0; color: #d9e0ce; font-size: 0.9rem; }
.scroll-cue {
  position: absolute;
  bottom: 1.7rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.scroll-cue span { font-size: 1.35rem; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(0.4rem); } }

.prose {
  width: min(69rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.opening { padding: clamp(5rem, 12vw, 10rem) 0; }
.standfirst {
  max-width: 48rem;
  margin: 0;
  color: var(--meadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  line-height: 1.16;
  text-wrap: balance;
}

.opening-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.75fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: start;
  margin-top: 4rem;
  font-size: 1.08rem;
  line-height: 1.72;
}

blockquote {
  margin: 0;
  padding: 1.2rem 0 1.2rem 1.5rem;
  color: var(--rust);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.4;
  border-left: 0.3rem solid var(--ochre);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(4rem, 9vw, 7rem);
  border-block: 1px solid var(--grey);
}
.stat-strip div { padding: 1.35rem 1rem; border-right: 1px solid var(--grey); }
.stat-strip div:last-child { border-right: 0; }
.stat-strip strong { display: block; color: var(--sky); font-size: clamp(1.7rem, 4vw, 3rem); }
.stat-strip span { display: block; margin-top: 0.25rem; font-size: 0.82rem; }

.scrolly {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 0.75fr);
  align-items: start;
  background: #182015;
}

.map-stage {
  position: sticky;
  top: 0;
  display: grid;
  height: 100svh;
  overflow: hidden;
  place-items: center;
  background: #20261d;
}

.map-stage::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  box-shadow: inset -40px 0 70px rgb(10 14 8 / 30%), inset 0 -55px 70px rgb(10 14 8 / 35%);
}

.map-heading {
  position: absolute;
  z-index: 5;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 2rem);
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  color: #fff;
  background: rgb(31 42 25 / 88%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 0.55rem;
  backdrop-filter: blur(10px);
}
.map-kicker { margin: 0; color: #e7b778; }
.map-progress { margin: 0; font-size: 0.78rem; }

#map {
  width: 100%;
  height: 100%;
  background: #d9d5ca;
  cursor: default;
  touch-action: none;
  user-select: none;
}
#map.is-zoomed { cursor: grab; }
#map.is-panning { cursor: grabbing; }
.map-layer path { vector-effect: non-scaling-stroke; transition: fill-opacity 500ms ease, opacity 500ms ease, stroke-opacity 500ms ease, filter 500ms ease; }

#terrain { filter: sepia(0.12) saturate(0.63) contrast(0.92); transition: opacity 650ms ease, filter 650ms ease; }
#aoi-layer { fill: none; stroke: #f7f4ec; stroke-width: 2; stroke-dasharray: 7 6; opacity: 0.8; pointer-events: none; }
#standard-layer { fill: var(--ochre); fill-opacity: 0.58; stroke: #6e4d20; stroke-width: 1.4; fill-rule: evenodd; }
#extension-layer { fill: var(--rust); fill-opacity: 0.76; stroke: #673617; stroke-width: 1.5; fill-rule: evenodd; }
#water-polygons { fill: var(--soft-sky); fill-opacity: 0.94; stroke: var(--sky); stroke-width: 1.4; fill-rule: evenodd; }
#water-lines { fill: none; stroke: var(--sky); stroke-width: 2.5; stroke-linecap: round; }
#standard-layer path, #extension-layer path { cursor: pointer; }

.map-stage[data-scene="terrain"] #terrain { opacity: 1; filter: sepia(0.08) saturate(0.45) contrast(1.1); }
.map-stage[data-scene="terrain"] #water-polygons,
.map-stage[data-scene="terrain"] #water-lines { opacity: 0.2; }
.map-stage[data-scene="terrain"] #standard-layer,
.map-stage[data-scene="terrain"] #extension-layer { opacity: 0.04; }
.map-stage[data-scene="water"] #terrain { opacity: 0.62; }
.map-stage[data-scene="water"] #water-polygons,
.map-stage[data-scene="water"] #water-lines { opacity: 1; filter: drop-shadow(0 0 6px rgb(247 244 236 / 75%)); }
.map-stage[data-scene="water"] #standard-layer,
.map-stage[data-scene="water"] #extension-layer { opacity: 0.04; }
.map-stage[data-scene="baseline"] #terrain { opacity: 0.55; }
.map-stage[data-scene="baseline"] #standard-layer { opacity: 1; filter: drop-shadow(0 3px 5px rgb(25 25 20 / 40%)); }
.map-stage[data-scene="baseline"] #extension-layer { opacity: 0.04; }
.map-stage[data-scene="slope"] #terrain { opacity: 0.7; }
.map-stage[data-scene="slope"] #standard-layer { opacity: 0.14; }
.map-stage[data-scene="slope"] #extension-layer { opacity: 1; filter: drop-shadow(0 3px 5px rgb(25 25 20 / 50%)); }
.map-stage[data-scene="result"] #terrain { opacity: 0.52; }
.map-stage[data-scene="result"] #standard-layer,
.map-stage[data-scene="result"] #extension-layer { opacity: 1; }
.map-stage[data-scene="all"] #terrain { opacity: 0.42; }

.zoom-controls {
  position: absolute;
  z-index: 6;
  top: 5.6rem;
  left: 1rem;
  display: grid;
  grid-template-columns: 1.85rem;
  gap: 0.2rem;
  padding: 0.25rem;
  background: rgb(255 254 250 / 92%);
  border: 1px solid var(--grey);
  border-radius: 0.5rem;
  box-shadow: 0 5px 18px rgb(20 20 18 / 22%);
}
.zoom-controls button {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  color: var(--meadow);
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--grey);
  border-radius: 0.3rem;
}
.zoom-controls button:hover:not(:disabled) { background: var(--warm); }
.zoom-controls button:disabled { cursor: default; opacity: 0.42; }

.map-legend {
  position: absolute;
  z-index: 5;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  padding: 0.7rem 0.85rem;
  color: #fff;
  font-size: 0.76rem;
  background: rgb(31 42 25 / 88%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}
.key::before {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
  content: "";
  background: var(--key);
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 2px;
}
.key.water { --key: var(--soft-sky); }
.key.standard { --key: var(--ochre); }
.key.extension { --key: var(--rust); }
.map-detail {
  position: absolute;
  z-index: 6;
  right: 1rem;
  bottom: 4rem;
  width: min(23rem, calc(100% - 2rem));
  padding: 0.7rem 0.85rem;
  color: var(--charcoal);
  font-size: 0.82rem;
  background: rgb(255 254 250 / 94%);
  border-left: 0.3rem solid var(--rust);
  border-radius: 0.3rem;
  box-shadow: 0 7px 22px rgb(20 20 18 / 24%);
}
.map-detail strong { color: var(--meadow); }

.story-rail { padding: 28vh clamp(1rem, 3vw, 2.5rem) 28vh; }
.scene {
  min-height: 66vh;
  margin-bottom: 20vh;
  padding: clamp(1.35rem, 3vw, 2.2rem);
  color: #dce4d4;
  background: rgb(39 51 32 / 82%);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 0.85rem;
  box-shadow: 0 20px 55px rgb(0 0 0 / 22%);
  opacity: 0.5;
  transform: translateY(1.4rem);
  transition: opacity 350ms ease, transform 350ms ease, border-color 350ms ease;
}
.scene.active { border-color: rgb(231 183 120 / 80%); opacity: 1; transform: translateY(0); }
.scene:last-child { margin-bottom: 0; }
.scene-number { margin: 0 0 2.5rem; color: #93a286; font-family: Georgia, serif; font-size: 2.7rem; }
.scene .eyebrow { color: #e7b778; }
.scene h2 {
  margin: 0 0 1.3rem;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  font-weight: 500;
  line-height: 1.06;
}
.scene > p:not(.eyebrow, .scene-number, .scene-note) { font-size: 1rem; line-height: 1.67; }
.scene-note { color: #bcc8b2; font-size: 0.78rem; }
.mini-metric { display: grid; gap: 0.2rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgb(255 255 255 / 20%); }
.mini-metric strong { color: #e7b778; font-size: 2rem; }
.mini-metric.rust strong { color: #e28c55; }
.mini-metric span { color: #cbd5c4; font-size: 0.8rem; }
.inline-link { display: inline-block; margin-top: 1rem; color: #fff; font-weight: 750; }

.media-break {
  position: relative;
  min-height: min(78rem, 92svh);
  margin: 0;
  overflow: hidden;
  background: #232a20;
}
.media-break img { width: 100%; height: 92svh; object-fit: cover; filter: saturate(0.45) contrast(1.12); }
.media-break::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgb(16 22 13 / 90%), transparent 70%); }
.media-break figcaption {
  position: absolute;
  z-index: 2;
  bottom: clamp(2rem, 8vw, 7rem);
  left: 50%;
  display: grid;
  width: min(69rem, calc(100% - 2.5rem));
  gap: 0.6rem;
  color: #edf1e9;
  transform: translateX(-50%);
}
.media-break .eyebrow { color: #e7b778; }
.media-break strong { max-width: 18ch; color: #fff; font-family: Georgia, serif; font-size: clamp(2.2rem, 6vw, 5.5rem); font-weight: 500; line-height: 1; }
.media-break figcaption > span:last-child { max-width: 42rem; line-height: 1.55; }

.method { padding: clamp(5rem, 12vw, 10rem) 0; }
.section-heading { max-width: 48rem; }
.section-heading h2,
.downloads h2 {
  margin: 0;
  color: var(--meadow);
  font-family: Georgia, serif;
  font-size: clamp(2.3rem, 6vw, 5rem);
  font-weight: 500;
  line-height: 1;
  text-wrap: balance;
}
.method-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 5rem 0 0; padding: 0; list-style: none; counter-reset: method; }
.method-flow li { min-height: 17rem; padding: 1.4rem; border-top: 1px solid var(--grey); border-right: 1px solid var(--grey); }
.method-flow li:first-child { border-left: 1px solid var(--grey); }
.method-flow li > span { display: block; margin-bottom: 3rem; color: var(--rust); font-family: Georgia, serif; font-size: 2rem; }
.method-flow strong { display: block; color: var(--meadow); font-size: 1.1rem; }
.method-flow p { font-size: 0.86rem; line-height: 1.55; }

.result-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(22rem, 1.2fr);
  gap: clamp(2rem, 8vw, 7rem);
  align-items: center;
  padding: clamp(5rem, 11vw, 9rem) max(1.25rem, calc((100vw - 69rem) / 2));
  color: #e4eadf;
  background: var(--meadow);
}
.result-section .eyebrow { color: #e7b778; }
.result-copy h2 { margin: 0; color: #fff; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4.5rem); font-weight: 500; line-height: 1; }
.result-copy > p:last-child { line-height: 1.65; }
.area-chart { padding: clamp(1.2rem, 3vw, 2rem); background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 15%); border-radius: 0.75rem; }
.bar-row { display: grid; grid-template-columns: 8.5rem minmax(8rem, 1fr) 6.5rem; gap: 0.8rem; align-items: center; margin-bottom: 1.5rem; font-size: 0.82rem; }
.bar-row strong { text-align: right; }
.bar-track { height: 1.25rem; overflow: hidden; background: rgb(255 255 255 / 12%); border-radius: 999px; }
.bar { display: block; width: var(--value); height: 100%; transform: scaleX(0); transform-origin: left; transition: transform 900ms cubic-bezier(.2,.75,.25,1); }
.result-section.visible .bar { transform: scaleX(1); }
.standard-bar { background: var(--ochre); }
.extension-bar { background: #d8753e; }
.area-chart > p { margin: 2rem 0 0; color: #c6d0c0; font-size: 0.76rem; line-height: 1.5; }

.downloads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.65fr); gap: clamp(2rem, 8vw, 7rem); padding: clamp(5rem, 12vw, 10rem) 0; }
.downloads > div:first-child > p:last-child { max-width: 42rem; font-size: 1.05rem; line-height: 1.65; }
.download-actions { display: grid; align-content: start; gap: 0.75rem; }
.download-actions a { display: inline-block; padding: 0.9rem 1rem; font-weight: 750; text-align: center; text-decoration: none; border-radius: 0.45rem; }
.primary-button { color: #fff; background: var(--sky); border: 1px solid var(--sky); }
.secondary-button { color: var(--meadow); background: var(--paper); border: 1px solid var(--meadow); }
.text-button { color: var(--sky); }
.legal-note { grid-column: 1 / -1; margin-top: 2rem; padding: 1rem 1.2rem; background: #f8eadc; border-left: 0.35rem solid var(--rust); }

footer { padding: 2rem max(1.25rem, calc((100vw - 69rem) / 2)); color: #edf1e9; background: #20291a; }
footer p { margin: 0.4rem 0; font-size: 0.82rem; }
footer a { color: #fff; }

@media (max-width: 980px) {
  :root { --bar-height: auto; }
  .portal-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.2rem; }
  .site-nav a { white-space: nowrap; }
  .scrolly { display: block; }
  .map-stage { z-index: 2; height: 58svh; min-height: 28rem; }
  .story-rail { position: relative; z-index: 3; width: min(38rem, calc(100% - 1.5rem)); margin: -5rem auto 0; padding: 0 0 12vh; }
  .scene { min-height: 55vh; margin-bottom: 35vh; background: rgb(39 51 32 / 95%); }
  .scene:last-child { margin-bottom: 0; }
  .method-flow { grid-template-columns: repeat(2, 1fr); }
  .method-flow li:nth-child(3) { border-left: 1px solid var(--grey); }
}

@media (max-width: 680px) {
  .hero-content { margin-bottom: 6.8rem; }
  .hero h1 { font-size: clamp(3.6rem, 19vw, 6.2rem); }
  .opening-grid, .result-section, .downloads { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip div:nth-child(2) { border-right: 0; }
  .stat-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--grey); }
  .map-stage { min-height: 24rem; }
  .map-heading { align-items: start; }
  .map-kicker { max-width: 18rem; }
  .map-detail { right: 0.65rem; bottom: 5.2rem; }
  .map-legend { right: 0.65rem; bottom: 0.65rem; left: 0.65rem; }
  .zoom-controls { top: 5.3rem; left: 0.65rem; }
  .story-rail { margin-top: -3rem; }
  .scene { min-height: auto; margin-bottom: 40vh; }
  .method-flow { grid-template-columns: 1fr; }
  .method-flow li, .method-flow li:nth-child(3) { min-height: auto; border-left: 1px solid var(--grey); }
  .method-flow li > span { margin-bottom: 1.5rem; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .downloads { gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
