/* Layout: a drawing set — each section is one blueprint sheet with a header strip,
   drawing + notes, and a title block. Redline (red handwriting) = personal notes. */
:root {
  --paper: #0e2a4a;
  --paper-deep: #0a2039;
  --line: #e3ecf8;
  --line-dim: rgba(227, 236, 248, 0.42);
  --line-faint: rgba(227, 236, 248, 0.14);
  --grid: rgba(227, 236, 248, 0.055);
  --red: #ff8070;
  --red-ink: #ff6a57;
  --stamp: #ffb07a;
  --stamp-shadow: rgba(0, 0, 0, 0.75);

  --f-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --f-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --step--1: 0.78rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.9rem, 4.5vw, 2.8rem);
  --step-hero: clamp(5.5rem, 22vw, 15rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  background-attachment: fixed;
  color: var(--line);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 40px 80px;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px dashed var(--red); outline-offset: 3px; }

/* ---------- sheet frame ---------- */
.sheet {
  width: 100%;
  min-width: 0;
  max-width: 1120px;
  border: 1px solid var(--line);
  outline: 1px solid var(--line-dim);
  outline-offset: 6px;
  background: rgba(10, 32, 57, 0.55);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-dim);
  font-family: var(--f-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sheet-no {
  font-weight: 500;
  border: 1px solid var(--line);
  padding: 2px 8px;
}
.sheet-meta { margin-left: auto; color: var(--line-dim); }

.sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px;
  padding: 32px 28px 36px;
  align-items: start;
}
.sheet-body.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.sheet-body.reverse .drawing { order: 2; }

.title-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-top: 1px solid var(--line-dim);
  font-family: var(--f-mono);
  font-size: 0.85rem;
}
.title-block > div {
  padding: 8px 14px 10px;
  border-left: 1px solid var(--line-faint);
}
.title-block > div:first-child { border-left: 0; }
.title-block b {
  display: block;
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--line-dim);
}

/* ---------- type ---------- */
.eyebrow, .label {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--line-dim);
  margin: 0;
}
.sheet-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.notes {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 62ch;
}
.notes p { margin: 0; }
.small { font-size: 0.9rem; color: var(--line-dim); }

.mock {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--line-dim);
  border: 1px dashed var(--line-faint);
  padding: 10px 12px;
}

.redline {
  font-family: var(--f-hand);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--red);
  transform: rotate(-2deg);
  transform-origin: left center;
}

/* ---------- drawings ---------- */
.drawing { margin: 0; min-width: 0; }
.drawing svg { width: 100%; height: auto; overflow: visible; }
.drawing figcaption {
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--line-dim);
}

svg .ink path, svg .hair path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .ink path { stroke: var(--line); stroke-width: 1.6; }
svg .hair path { stroke: var(--line-dim); stroke-width: 1.1; }
svg .dashed { stroke-dasharray: 6 6; }
svg .dim path, svg .dim circle { fill: none; stroke: var(--line-dim); stroke-width: 1; }
svg .dim .fill { fill: var(--line-dim); stroke: none; }
svg .dim text {
  fill: var(--line-dim);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
svg .dim.big path { stroke: var(--red); stroke-width: 1.4; }
svg .dim.big text { fill: var(--red); font-size: 14px; }
svg .redline-svg {
  fill: var(--red);
  font-family: var(--f-hand);
  font-size: 24px;
  font-weight: 500;
}

/* line-drawing animation: only applied when JS has measured paths */
/* lines hide instantly; only the sheet in hand animates them in */
.js-draw svg .draw:not(.dashed) {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}
.js-draw svg .draw.dashed { opacity: 0; }
.js-draw .drawn svg .draw:not(.dashed) {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.2s cubic-bezier(.6, .1, .3, 1) 0.6s;
}
.js-draw .drawn svg .draw.dashed { opacity: 1; transition: opacity 1.2s ease 1.8s; }

/* ---------- photos ---------- */
.photo {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(45deg, var(--line-faint) 0 1px, transparent 1px 10px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
}
.photo figcaption {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--line-dim);
  background: var(--paper);
  padding: 2px 8px;
}
.photo:has(img) figcaption { display: none; }
.photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- cover ---------- */
.cover-body {
  padding: 56px 28px 24px;
  display: grid;
  gap: 6px;
}
.cover-title {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-hero);
  line-height: 0.85;
  margin: 0;
  letter-spacing: -0.02em;
}
.cover-sub {
  font-family: var(--f-display);
  font-size: var(--step-1);
  margin: 6px 0 0;
}
.cover-note { margin-top: 18px; justify-self: start; }

.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 32px;
  padding: 24px 28px 32px;
}
.drawing-list ol {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 0.9rem;
}
.drawing-list li { border-bottom: 1px solid var(--line-faint); }
.drawing-list a {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  text-decoration: none;
}
.drawing-list a:hover { color: var(--red); }
.drawing-list span { color: var(--line-dim); min-width: 4.5ch; }

.revisions table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.revisions td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: top;
}
.revisions td:first-child { width: 3ch; }

.revisions tr.current td { color: var(--red); }

/* ---------- clocks ---------- */
.clocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-dim);
}
.clock { padding: 12px 14px; display: grid; gap: 2px; }
.clock + .clock { border-left: 1px solid var(--line-dim); }
.clock-time {
  font-family: var(--f-mono);
  font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ---------- proposal ---------- */
.spec {
  margin: 0;
  display: grid;
  border-top: 1px solid var(--line-faint);
}
.spec > div {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-faint);
}
.spec dt {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--line-dim);
  padding-top: 3px;
}
.spec dd { margin: 0; }

/* revision cloud, the architect's "this part changes" mark */
.cloud {
  position: relative;
  display: inline-block;
  padding: 2px 10px;
  color: var(--red);
  font-family: var(--f-hand);
  font-size: 1.4rem;
  line-height: 1.2;
}
.cloud svg {
  position: absolute;
  inset: -6px -8px;
  width: calc(100% + 16px);
  height: calc(100% + 12px);
  overflow: visible;
  pointer-events: none;
}
.cloud svg path { fill: none; stroke: var(--red); stroke-width: 1.3; }

.approve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  min-height: 110px;
  padding-top: 8px;
}
.btn {
  font: 500 0.82rem/1 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: var(--line);
  border: 0;
  padding: 16px 22px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--red); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: default; background: var(--line); }

.stamp {
  display: grid;
  justify-items: center;
  padding: 10px 22px 8px;
  border: 3px double var(--red-ink);
  color: var(--red-ink);
  font-family: var(--f-mono);
  text-transform: uppercase;
  transform: rotate(-8deg);
}
.stamp span { font-size: 1.7rem; font-weight: 500; letter-spacing: 0.18em; line-height: 1; }
.stamp small { font-size: 0.7rem; letter-spacing: 0.12em; margin-top: 4px; }
.stamp.thud { animation: thud 0.45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes thud {
  from { transform: rotate(-8deg) scale(2.2); opacity: 0; }
  to   { transform: rotate(-8deg) scale(1); opacity: 1; }
}

/* ---------- finale ---------- */
.finale {
  width: 100%;
  max-width: 1120px;
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
  padding-block: 40px 20px;
}
.finale-cz {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.finale-en { margin: 0; color: var(--line); max-width: 52ch; font-size: 1.1rem; }
.finale-sign { margin: 8px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  body { gap: 40px; padding-block: 24px 56px; font-size: 16px; }
  .sheet { outline-offset: 4px; }
  .sheet-body,
  .sheet-body.reverse,
  .cover-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 24px 18px 28px; }
  .sheet-body.reverse .drawing { order: 0; }
  .cover-body { padding: 36px 18px 16px; }
  .sheet-head { padding: 10px 14px; }
  .sheet-meta { margin-left: 0; flex-basis: 100%; }
  .title-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-block > div { border-left: 0; border-top: 1px solid var(--line-faint); }
  .title-block > div:nth-child(even) { border-left: 1px solid var(--line-faint); }
  .clock-time { font-size: 1.5rem; }
  .revisions td:nth-child(2) { width: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stamp.thud { animation: none; }
}

/* ---------- language switcher ---------- */
.drawing-list em { font-style: normal; }
.lang {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 10;
  display: flex;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.lang button {
  font: 500 0.72rem/1 var(--f-mono);
  letter-spacing: 0.1em;
  color: var(--line-dim);
  background: transparent;
  border: 0;
  padding: 9px 11px;
  cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line-faint); }
.lang button:hover { color: var(--line); }
.lang button[aria-pressed="true"] { color: var(--paper); background: var(--line); }

/* ---------- photo layouts ---------- */
.photo.tall { aspect-ratio: 4 / 5; }
.drawing .survey { margin-top: 28px; max-width: 360px; }
.survey-cap {
  margin: 8px 0 0;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--line-dim);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.photo-grid .photo { aspect-ratio: 3 / 4; }
.photo-grid .photo:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.notes .spec { margin-top: 2px; }
.notes .photo.tall { max-width: 340px; }

/* ---------- A-001 legend ---------- */
.legend-body {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 2fr);
  gap: 40px;
  padding: 32px 28px 36px;
  align-items: start;
}
.legend-intro { display: grid; gap: 14px; max-width: 34ch; }
.legend-intro p { margin: 0; }
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
}
.legend li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "sw term" "sw when" "sw def";
  align-content: start;
  column-gap: 14px;
  row-gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-faint);
}
.swatch {
  grid-area: sw;
  width: 44px;
  height: 30px;
  margin-top: 4px;
  border: 1px solid var(--line);
}
.legend li:nth-child(5n+1) .swatch { background: repeating-linear-gradient(45deg, var(--line-dim) 0 1px, transparent 1px 6px); }
.legend li:nth-child(5n+2) .swatch { background: repeating-linear-gradient(45deg, var(--line-dim) 0 1px, transparent 1px 6px), repeating-linear-gradient(-45deg, var(--line-dim) 0 1px, transparent 1px 6px); }
.legend li:nth-child(5n+3) .swatch { background: radial-gradient(var(--line-dim) 1px, transparent 1.5px) 0 0 / 6px 6px; }
.legend li:nth-child(5n+4) .swatch { background: repeating-linear-gradient(0deg, var(--line-dim) 0 1px, transparent 1px 5px); }
.legend li:nth-child(5n+5) .swatch { background: var(--line-faint); }
.term {
  grid-area: term;
  font-family: var(--f-hand);
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--red);
}
.when {
  grid-area: when;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--line-dim);
}
.def { grid-area: def; font-size: 0.95rem; margin-top: 4px; }

@media (max-width: 820px) {
  .legend-body { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 18px 28px; }
  .legend { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- A-301 photo record ---------- */
.photo-record {
  display: grid;
  gap: 12px;
  padding: 0 28px 32px;
}
.record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.record-grid .photo { aspect-ratio: 4 / 5; }
.record-grid .photo:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}
@media (max-width: 820px) {
  .photo-record { padding: 0 18px 28px; }
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-grid .photo:first-child { grid-row: auto; aspect-ratio: 4 / 3; }
}

/* ---------- deck: sheets held one at a time ---------- */
html, body { height: 100%; }
html { scroll-behavior: auto; }
body { overflow: hidden; display: block; padding-block: 0; }

.deck {
  position: fixed;
  top: calc(54px + env(safe-area-inset-top, 0px));
  bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
}

.page {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: 1120px;
  margin-inline: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background-color: var(--paper-deep);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--line);
  outline: 1px solid var(--line-dim);
  outline-offset: -7px;
  box-shadow: 0 18px 50px rgba(3, 12, 24, 0.55);
  transform-origin: 30% 110%;
  transform: translate3d(calc(var(--depth, 0) * var(--stack-step, 7px)), calc(var(--depth, 0) * var(--stack-step, 7px)), 0);
  transition: transform 0.75s cubic-bezier(.65, .05, .25, 1), opacity 0.6s ease;
}
.page:focus { outline: 1px solid var(--line-dim); }
.page.is-past {
  transform: translate3d(-115%, -6%, 0) rotate(-9deg);
  opacity: 0;
  pointer-events: none;
}
.deck.no-anim .page,
.deck.no-anim .page > * { transition: none; }
html.js .deck { visibility: hidden; }
html.js .deck.ready { visibility: visible; }

.finale { padding: 0; }
.finale-inner {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 48px 24px;
}

.pager {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pager button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--line);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  padding: 11px 16px;
  cursor: pointer;
}
.pager button:hover:not([disabled]) { background: var(--line); color: var(--paper); }
.pager button[disabled] { opacity: 0.3; cursor: default; }
#pager-next:not([disabled]) { background: var(--line); color: var(--paper); }
#pager-next:not([disabled]):hover { background: var(--red); border-color: var(--red); }
#pager-no { color: var(--line-dim); min-width: 13ch; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .page { --stack-step: 3px; }
  .deck { top: calc(52px + env(safe-area-inset-top, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .pager { gap: 8px; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .pager button { padding: 10px 12px; }
  #pager-no { min-width: 0; font-size: 0.68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .page { transition: none; }
}
.page > * { transition: opacity 0.35s ease 0.3s; }
.page.is-future > * { opacity: 0; transition: opacity 0.2s ease; }
.pager-mid { display: grid; justify-items: center; gap: 3px; }
#pager-more { color: var(--red); font-size: 0.66rem; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { #pager-more { animation: none; } }

/* ---------- A-301 route plan ---------- */
svg .map-labels text { font-size: 11px; letter-spacing: 0.2em; }
svg .route path { fill: none; stroke: var(--red); stroke-width: 1.6; stroke-dasharray: 5 5; }
svg .pin circle { fill: var(--paper-deep); stroke: var(--red); stroke-width: 1.4; }
svg .pin text { fill: var(--red); font-family: var(--f-mono); font-size: 11px; font-weight: 500; }
.six-days { width: 100%; max-width: 420px; height: auto; overflow: visible; }

.stops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
  padding: 0 28px 32px;
}
.stop { margin: 0; display: grid; gap: 10px; align-content: start; }
.stop .photo { aspect-ratio: 4 / 5; }
.stop-cap {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.stop-no {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  border: 1.4px solid var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--red);
  font: 500 0.72rem/1 var(--f-mono);
}
.stop-cap b { font-weight: 400; font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 820px) {
  .stops { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 18px 28px; gap: 18px 12px; }
}

/* ---------- cover fits one screen, no scroll ---------- */
.page.cover {
  container-type: size;
  grid-template-rows: auto 1fr auto auto;
}
.cover .cover-body {
  padding: clamp(10px, 3.5cqh, 56px) 28px clamp(4px, 1.5cqh, 24px);
  align-content: center;
  gap: clamp(2px, 0.8cqh, 6px);
}
.cover .cover-title { font-size: clamp(2.8rem, min(14vw, 11vh), 9rem); }
@supports (font-size: 1cqh) {
  .cover .cover-title { font-size: clamp(2.8rem, min(17cqw, 15cqh), 10.5rem); }
}
.cover .cover-sub { margin: 0; }
.cover .cover-note { margin-top: clamp(4px, 1.6cqh, 18px); }
.cover .cover-grid { padding: clamp(8px, 2.4cqh, 24px) 28px clamp(10px, 3cqh, 32px); gap: clamp(12px, 3cqh, 32px); }
.cover .drawing-list ol { margin-top: clamp(4px, 1.2cqh, 12px); }
.cover .drawing-list a { padding: clamp(1px, 0.6cqh, 8px) 0; }
.cover .revisions table { margin-top: clamp(4px, 1.2cqh, 12px); }
.cover .revisions td { padding-block: clamp(2px, 0.7cqh, 7px); }

@media (max-width: 820px) {
  .cover .cover-body { padding-inline: 18px; }
  .cover .cover-grid { padding-inline: 18px; }
  .cover .title-block { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cover .title-block > div:nth-child(2),
  .cover .title-block > div:nth-child(5) { display: none; }
  .cover .title-block > div { border-top: 0; border-left: 1px solid var(--line-faint); }
  .cover .title-block > div:first-child { border-left: 0; }
}
@media (max-width: 820px) and (max-height: 920px) {
  .cover .revisions { display: none; }
}
svg .dim.trip path { stroke: var(--line); stroke-width: 1.3; }
svg .dim.trip text { fill: var(--line); }
.six-days .link { fill: none; stroke: var(--line-dim); stroke-width: 1; stroke-dasharray: 3 4; }
@media (max-width: 820px) and (max-height: 700px) {
  .cover .cover-body { padding-top: 6px; }
  .cover .drawing-list a { padding-block: 0; }
}

/* ---------- photo date stamps, no captions ---------- */
.photo-when {
  position: absolute;
  right: 9px;
  bottom: 7px;
  z-index: 1;
  font: 500 0.74rem/1 var(--f-mono);
  letter-spacing: 0.08em;
  color: var(--stamp);
  text-shadow: 0 1px 3px var(--stamp-shadow);
}
.photo:not(:has(img)) .photo-when { display: none; }
.stop .stop-no {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: var(--paper-deep);
}
svg .place-labels text { font-size: 10px; letter-spacing: 0.14em; }
a.coords { text-decoration: none; border-bottom: 1px dotted var(--line-dim); }
a.coords:hover { color: var(--red); border-bottom-color: var(--red); }
svg .dim text.coord { font-size: 10px; }
svg a:hover text.coord { fill: var(--red); }

/* ---------- access gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  place-items: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
body.locked .gate { display: grid; }
body.locked .deck,
body.locked .pager { visibility: hidden !important; }
.gate-sheet {
  width: min(100%, 560px);
  background-color: var(--paper-deep);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--line);
  outline: 1px solid var(--line-dim);
  outline-offset: -7px;
  box-shadow: 0 18px 50px rgba(3, 12, 24, 0.55);
  transition: transform 0.75s cubic-bezier(.65, .05, .25, 1), opacity 0.6s ease;
}
.gate.leaving .gate-sheet { transform: translate3d(-115%, -6%, 0) rotate(-9deg); opacity: 0; }
.gate-body { display: grid; gap: 14px; padding: 32px 28px 28px; }
.gate-title {
  margin: 0;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1;
}
.gate-q { font-size: 1.05rem; }
.gate-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gate-row input {
  flex: 1 1 180px;
  min-width: 0;
  font: 400 1rem var(--f-mono);
  color: var(--line);
  background: transparent;
  border: 1px solid var(--line-dim);
  padding: 13px 14px;
}
.gate-row input:focus { outline: none; border-color: var(--line); }
.gate-row input::placeholder { color: var(--line-dim); }
.gate-msg {
  min-height: 1.6em;
  margin: 0;
  font-family: var(--f-hand);
  font-size: 1.45rem;
  color: var(--red);
}
.gate-sheet.shake { animation: shake 0.4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .gate-sheet { transition: none; }
  .gate-sheet.shake { animation: none; }
}
.lang { z-index: 500; }
.drawing-list li { display: flex; gap: 16px; padding: 8px 0; }
.cover .drawing-list li { padding: clamp(1px, 0.6cqh, 8px) 0; }
html, body { overscroll-behavior-x: none; }
.page { overflow-x: hidden; touch-action: pan-y; }

/* only the top few sheets are painted; gone and deep sheets are skipped */
.page { transition: transform 0.75s cubic-bezier(.65, .05, .25, 1), opacity 0.6s ease, visibility 0s linear 0s; }
.page.is-past { visibility: hidden; transition: transform 0.75s cubic-bezier(.65, .05, .25, 1), opacity 0.6s ease, visibility 0s linear 0.75s; }
.page.is-deep { visibility: hidden; }
.page:not(.is-current) { box-shadow: 0 6px 16px rgba(3, 12, 24, 0.35); }
@media (max-width: 820px) {
  .page.is-current { box-shadow: 0 10px 28px rgba(3, 12, 24, 0.5); }
}
.photo img { opacity: 0; transition: opacity 0.45s ease; }
.photo img.loaded { opacity: 1; }

/* ---------- light mode for phones: cheap, smooth flips ---------- */
body { background-attachment: scroll; }
.page.is-current, .page.is-near { will-change: transform; }
@media (max-width: 820px), (pointer: coarse) {
  .page,
  .page.is-past {
    box-shadow: none;
    transition: transform 0.5s cubic-bezier(.3, .7, .2, 1), opacity 0.4s ease, visibility 0s linear 0s;
  }
  .page.is-past {
    transform: translate3d(-110%, 0, 0);
    transition: transform 0.5s cubic-bezier(.3, .7, .2, 1), opacity 0.4s ease, visibility 0s linear 0.5s;
  }
  .page.is-current { box-shadow: 0 8px 22px rgba(3, 12, 24, 0.45); }
  .page > *,
  .page.is-future > * { transition: none; }
  #pager-more { animation: none; }
}
/* keep the neighbours fully painted underneath, so a flip only moves a ready picture */
.page.is-future.is-near > * { opacity: 0.01; }
.page.is-past.is-near { visibility: visible; }
@media (max-width: 820px), (pointer: coarse) {
  .page.is-past.is-near { transition: transform 0.5s cubic-bezier(.3, .7, .2, 1), opacity 0.4s ease; }
}

/* hand-drawn "click here" next to the approve button */
.approve-hint { display: inline-flex; align-items: flex-end; gap: 4px; transform: rotate(-4deg); }
.approve-hint svg { width: 64px; height: 36px; overflow: visible; }
.approve-hint path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.approve-hint .redline { transform: none; font-size: 1.6rem; white-space: nowrap; }
.approve-hint .arrow-up { display: none; }
@media (max-width: 820px) {
  .approve { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; }
  .approve-hint { transform: rotate(-3deg); margin-left: 70px; align-items: flex-start; }
  .approve-hint .arrow-side { display: none; }
  .approve-hint .arrow-up { display: block; width: 34px; height: 44px; }
  .approve-hint .redline { margin-top: 24px; }
}
svg .skier circle, svg .skier path { fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; }
.map-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--line-dim);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-faint);
}
.map-link:hover { color: var(--red); border-bottom-color: var(--red); }
