@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbfbf9;
  --ink: #1f262b;
  --ink-2: #454f56;
  --water-ink: #2d6784;
  --sea-0: #dce9ee;
  --sea-1: #cfe1e8;
  --sea-2: #bfd6e0;
  --coast: #5c7480;
  --block: #efefe9;
  --park: #e3eddc;
  --accent: #b8481c;
  --rule: #d6d9d6;
  --gutter: clamp(16px, 3.5vw, 40px);
  --panel-w: clamp(270px, 29vw, 400px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 "Noto Sans", system-ui, sans-serif;
}

a { color: inherit; text-underline-offset: 0.18em; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---- the top line, which scrolls away */
.top {
  display: flex;
  gap: 0.9em;
  padding: 18px var(--gutter) 0;
  font-size: 0.92rem;
  font-stretch: 87.5%;
  color: var(--ink-2);
}

.top .wordmark { color: var(--ink); font-weight: 650; }

/* ---- cover (a frame: it fits) */
.cover {
  position: relative;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(28px, 7svh, 88px) var(--gutter) clamp(16px, 4svh, 40px);
  overflow: hidden;
}

.cover-inner { max-width: 44rem; }

h1 {
  margin: 0;
  font-size: clamp(2.3rem, min(8vw, 11svh), 5.6rem);
  font-weight: 650;
  font-stretch: 87.5%;
  line-height: 1;
  letter-spacing: -0.015em;
}

.lede {
  margin: 0.5em 0 0;
  font-size: clamp(1.15rem, min(2.6vw, 3.6svh), 1.7rem);
  color: var(--accent);
  font-weight: 550;
}

.intro {
  margin: 0.9em 0 0;
  max-width: 32em;
  color: var(--ink-2);
  font-size: clamp(0.95rem, 2.2svh, 1.05rem);
}

.cover-map {
  align-self: end;
  width: min(100%, 1100px);
  max-height: 100%;
  margin: 12px auto 0;
  display: block;
}

.cover-map .world-sea { fill: var(--sea-0); }
.cover-map .world-land { fill: var(--paper); stroke: var(--coast); stroke-width: 0.8; }
.cover-map .graticule { fill: none; stroke: #bccfd6; stroke-width: 0.6; }
.cover-map .world-edge { fill: none; stroke: var(--coast); stroke-width: 1.2; }

@media (max-height: 520px) {
  .cover-map { display: none; }
}

/* ---- scenes: the stage sticks while the scene scrolls past */
.scene { position: relative; height: calc((var(--travel, 4) + 1) * 100svh); }

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--paper);
}

.stage.landscape {
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  grid-template-rows: minmax(0, 1fr);
}

.map { position: relative; min-height: 0; overflow: hidden; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.panel {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px var(--gutter) 16px;
  border-top: 1px solid var(--rule);
  overflow: hidden;
}

.landscape .panel {
  padding: clamp(20px, 6svh, 56px) 24px 20px;
  border-top: 0;
  border-left: 1px solid var(--rule);
}

.slot { display: grid; }
.slot > * { grid-area: 1 / 1; }

.heads h2 {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 650;
  font-stretch: 87.5%;
  line-height: 1.2;
}

.rf {
  display: block;
  margin-top: 0.2em;
  font-size: 0.8rem;
  font-weight: 400;
  font-stretch: 100%;
  color: var(--ink-2);
}

.captions p,
.captions blockquote { margin: 0; }

.captions { font-size: clamp(0.95rem, 1.2vw, 1.05rem); line-height: 1.45; }

.captions blockquote p { font-size: 1.08em; font-weight: 550; }
.captions blockquote p::before { content: "“"; }
.captions blockquote p::after { content: "”"; }
.captions .who { margin-top: 0.35em; font-size: 0.85rem; color: var(--ink-2); }

.covenant {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1.5px solid var(--accent);
  font-size: 0.85rem;
  line-height: 1.35;
}

.covenant-title { color: var(--accent); font-weight: 650; }
.covenant b { font-weight: 650; margin-right: 0.35em; }

.key {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--ink-2);
}

.key > div { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; }
.key dt { margin: 0; display: flex; }
.key dt svg { width: 18px; height: 18px; overflow: visible; }
.key dd { margin: 0; }
.status-key > div { grid-template-columns: 44px 1fr; align-items: start; }
.status-key dt svg { width: 40px; height: 12px; margin-top: 4px; }
.status-key b { display: block; color: var(--ink); font-weight: 650; }

.compact .panel { gap: 9px; padding-top: 12px; padding-bottom: 10px; }
.compact .key { font-size: 0.78rem; gap: 3px; }
.compact .covenant { padding: 6px 9px; font-size: 0.78rem; }
.compact .captions { font-size: 0.9rem; }
.compact .status-key > div { grid-template-columns: 40px 1fr; }
.compact .status-key dd { font-size: 0.76rem; }

/* ---- map drawing: geography */
.block { fill: var(--block); }
.road { fill: var(--paper); }
.kerb { fill: none; stroke: #b3b3ab; }
.footprint { fill: #deded7; stroke: #8b8b83; }
.footprint.named { fill: #d2d2ca; }
.coolroom { fill: #dde9ef; stroke: #6f8b98; }
.plaza { fill: #f4f4ef; }
.generalised { fill: #d7d7d0; opacity: 0; }
.generalised.city { fill: #e2e2dc; }
.land { fill: var(--paper); }
.city-block { fill: #e5e5df; }
.park { fill: var(--park); }
.water { fill: var(--sea-0); stroke: var(--coast); }
.sea-0 { fill: var(--sea-0); }
.sea-1 { fill: var(--sea-1); }
.sea-2 { fill: var(--sea-2); }
.coastline { fill: none; stroke: var(--coast); }
.island { fill: var(--paper); stroke: var(--coast); }
.river { fill: none; stroke: #86a8b7; }
.farm { fill: #eef0e4; }
.urban { fill: #e0e0d9; }
.locator { fill: none; stroke: var(--ink); }
.world-sea { fill: var(--sea-0); }
.graticule { fill: none; stroke: #bcd0d7; }
.world-land { fill: #f7f7f3; stroke: #7b929c; }
.world-edge { fill: none; stroke: var(--coast); }
.world-places { fill: var(--ink-2); }
.hatch-line { stroke: #c4c9c4; stroke-width: 1; }

/* ---- map drawing: ink (a fixed size on screen) */
.pict { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.sym .pict { fill: var(--paper); }
.sym.commons .pict { stroke-width: 1.7; }
.sym.device .pict { stroke: var(--water-ink); }
.sym.check .pict { stroke: var(--ink); stroke-width: 1.7; }
.town { fill: var(--ink); }

.lab text {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 12.5px;
  font-stretch: 87.5%;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3.2px;
  stroke-linejoin: round;
}

.lab.place text { font-size: 12.5px; }
.lab.strong text { font-weight: 650; }
.lab.street text { font-size: 10.5px; letter-spacing: 0.22em; fill: var(--ink-2); stroke: var(--paper); }
.lab.water text { font-style: italic; font-size: 13px; letter-spacing: 0.12em; fill: var(--water-ink); stroke: var(--sea-0); }
.lab.tag text { font-size: 11px; fill: var(--ink-2); }
.lab.locator-label text { font-size: 10.5px; fill: var(--ink-2); }

.callout-box { fill: var(--paper); stroke: var(--ink); stroke-width: 0.9; }
.callout .leader { fill: none; stroke: var(--ink); stroke-width: 0.9; }
.callout text { font-family: "Noto Sans", system-ui, sans-serif; font-size: 11.5px; font-stretch: 87.5%; fill: var(--ink); }
.callout .callout-title { font-weight: 650; font-size: 12px; }
.callout .strike { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; }
.callout .callout-result { fill: var(--accent); font-weight: 650; }

.flow-line { fill: none; stroke: var(--accent); stroke-linecap: round; }
.flow-label {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 11.5px;
  font-stretch: 87.5%;
  font-weight: 550;
  fill: var(--accent);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
  text-anchor: middle;
}

.north-arrow { fill: var(--ink); }
.north text, .scalebar text { font-family: "Noto Sans", system-ui, sans-serif; font-size: 10.5px; fill: var(--ink-2); }
.scalebar .bar { fill: none; stroke: var(--ink); stroke-width: 1.2; }

/* ---- plate V */
.terra { fill: #f7f7f3; }
.unsurveyed-fill { stroke: none; }
.terra-detail .footprint { stroke-width: 0.6; }
.survey { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.survey.faint { stroke: #a1aaaf; }
.survey.proposed { stroke: var(--accent); }
.lab.region text { font-size: clamp(15px, 2.3vw, 26px); font-weight: 600; letter-spacing: 0.3em; fill: var(--ink); fill-opacity: 0.62; stroke-width: 4px; }
.lab.region-sub text { font-size: 13px; fill: var(--ink-2); }
.lab.feature text { font-size: 12px; font-weight: 650; }
.lab.status text { font-size: 10.5px; fill: var(--ink-2); }

/* ---- key swatches */
.k-flow { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.k-locator { fill: none; stroke: var(--ink); stroke-width: 1.1; }
.k-dot { fill: var(--ink-2); }
.s-solid { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.s-restricted { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 9 3 1.5 3; }
.s-dashed { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 7 5; }
.s-dotted { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 1.2 3.6; stroke-linecap: round; }
.s-hatch { stroke: #a1aaaf; stroke-width: 0.8; }
.s-proposed { fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 16 6; }
.defs { position: absolute; }

/* ---- close */
.close {
  width: min(1120px, 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(56px, 10vw, 112px) 0 72px;
}

.close h2 { margin: 0 0 20px; font-size: 1.35rem; font-weight: 650; font-stretch: 87.5%; }

.imprint-grid { display: grid; gap: 28px; }
@media (min-width: 820px) { .imprint-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.key.full { font-size: 0.88rem; gap: 7px; }
.key.full > div { grid-template-columns: 44px 1fr; }
.key.full dt svg { width: 40px; height: 16px; }
.imprint p { margin: 0 0 1em; max-width: 38em; }
.imprint p:first-child { color: var(--ink-2); font-size: 0.92rem; }

.film { display: block; width: 100%; max-width: 960px; margin: 40px 0 0; background: var(--sea-0); aspect-ratio: 16 / 9; }
.back { margin: 28px 0 0; }

/* ---- reduced motion: stills in the flow */
.still { margin: 0 0 48px; }
.still .stage { position: relative; height: min(100svh, 860px); }

/* ---- capture mode: only the stage, filling the frame */
html[data-capture] .top,
html[data-capture] .cover,
html[data-capture] .close { display: none; }
html[data-capture] body { overflow: hidden; }
html[data-capture] .scene { height: auto; }
html[data-capture] .stage { position: fixed; inset: 0; height: 100vh; }
.endcard { display: none; }
html[data-capture] .endcard {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--paper);
  opacity: 0;
}
.endcard p { margin: 0; }
.endcard-mark { font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 650; font-stretch: 87.5%; }
.endcard-line { margin-top: 0.4em !important; font-size: clamp(1rem, 2.4vw, 1.4rem); color: var(--accent); font-weight: 550; }
.endcard-url { margin-top: 1.4em !important; font-size: clamp(0.95rem, 2vw, 1.15rem); color: var(--ink-2); }

/* ---- added detail */
.garden { fill: #e9eee3; }
.lane { fill: #f1f1ec; }
.yard { fill: #e4eadc; }
.house { fill: #e2e2db; stroke: #9a9a92; }
.tree { fill: #d7e4cc; stroke: #8fa883; }
.lab.terrain text { font-size: 10.5px; letter-spacing: 0.3em; fill: #8a7a62; }
.contour { fill: none; stroke: #cdbda4; }
.survey.contour { stroke: #cdbda4; }
.road-line { fill: none; stroke: #a9aaa4; }
.rail { fill: none; stroke: var(--ink); }
.rail-ticks { fill: none; stroke: var(--ink); }
.callout-result text { fill: var(--accent); font-weight: 650; }
.callout-result .rule { stroke: var(--rule); stroke-width: 1; fill: none; }
.arterial-casing { fill: none; stroke: #c9c9c1; stroke-linecap: round; stroke-linejoin: round; }
.arterial { fill: none; stroke: var(--paper); stroke-linecap: round; stroke-linejoin: round; }
.flow-head { fill: var(--accent); }
.lab.aggregate text { font-size: 12px; font-weight: 650; fill: var(--accent); }
.callout text { font-size: 12.5px; }
.callout .callout-title { font-size: 13px; }

/* compact layouts: the map stays dominant */
.compact .covenant { display: block; padding: 5px 8px; }
.compact .covenant span { display: inline; }
.compact .covenant span + span + span::before { content: " · "; color: var(--ink-2); }
.compact .covenant-title::after { content: ": "; }
.compact .status-key dd span { display: none; }
.compact .status-key { gap: 2px; }

/* portrait: a fixed split, so the map never changes size as the panel's text changes */
.stage:not(.landscape) { grid-template-rows: minmax(0, 1fr) min(45%, 430px); }
/* the square film carries the plate, its caption and the covenant; the legend is on the page */
html[data-capture="square"] .key { display: none; }
html[data-capture="square"] .stage:not(.landscape) { grid-template-rows: minmax(0, 1fr) 37%; }
