/* Vertex. Tokens from the approved packet v1: walnut and tan, Archivo (self-hosted), one accent, one radius, one button.
   Static-first: everything below the "JS WALK" marker only applies when engine.js adds .js-walk after capability checks. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #2b2216; --surface: #382d1e; --ink: #e4e2da; --muted: #a39a8b; --accent: #bda38b; --accent-ink: #2b2216;
  --field: #bda38b; --field-ink: #1c150d; --ph: #4a3d2b; --line: rgba(228, 226, 218, .2);
  --step-small: clamp(0.9375rem, 0.92rem + 0.1vw, 1rem);
  --step-ui: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --m: clamp(20px, 5vw, 96px);
  --r: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.55 "Archivo", "Helvetica Neue", Arial, sans-serif; text-wrap: pretty; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.small { font-size: var(--step-small); line-height: 1.4; color: var(--muted); }
.eyebrow { font-size: var(--step-small); line-height: 1.3; letter-spacing: 0; color: rgba(228, 226, 218, .94); }
.lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -.01em; }
.lead-k { color: rgba(228, 226, 218, .86); }
.head-step { font-size: var(--step-head); line-height: 1.05; letter-spacing: -.02em; font-weight: 400; text-wrap: balance; }

/* shared button: one shape, one radius */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; background: var(--accent); color: var(--accent-ink); font: 600 1rem/1.2 "Archivo", sans-serif; text-decoration: none; border: 0; border-radius: var(--r); cursor: pointer; transition: background-color 160ms var(--ease), transform 160ms var(--ease); }
.btn:hover { background: #cdb79f; }
.btn:active { transform: translateY(1px); }

.skip { position: absolute; left: var(--m); top: -80px; z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 14px 20px; border-radius: var(--r); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* header */
.head { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 20px var(--m); font-size: var(--step-ui); background: transparent; transition: background-color 200ms var(--ease); }
.head::before { content: ""; position: absolute; inset: 0 0 -28px 0; z-index: -1; background: linear-gradient(to bottom, rgba(18, 13, 7, .6), rgba(18, 13, 7, 0)); pointer-events: none; transition: opacity 200ms var(--ease); }
.head.is-solid { background: var(--bg); }
.head.is-solid::before { opacity: 0; }
.head .brand { text-decoration: none; letter-spacing: .02em; }
.head ul { display: flex; gap: 32px; }
.head a { text-decoration: none; }
.head nav a[href="#visit"] { color: var(--accent); }
.head a:hover { text-decoration: underline; }

/* arrival (hero): the place carries it */
.arrival { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: #01377e; }
.arr-fig { position: absolute; inset: 0 0 18svh 0; }
.arrival .arr-fig img { object-fit: contain; object-position: 50% 0; background: #01377e; }
.arr-fig img, .vis-fig img, .st-fig img { width: 100%; height: 100%; object-fit: cover; object-position: var(--f); background: var(--ph); }
.arr-fig::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 62% 56% at 6% 84%, rgba(18, 13, 7, .78), rgba(18, 13, 7, 0)); pointer-events: none; }
.arr-fig::after, .vis-fig::after { content: ""; position: absolute; inset: auto 0 0 0; height: 72%; background: linear-gradient(to top, rgba(18, 13, 7, .88) 0%, rgba(18, 13, 7, .55) 45%, rgba(18, 13, 7, 0) 100%); pointer-events: none; }
.arr-copy { position: relative; z-index: 1; width: 100%; padding: 0 var(--m) 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "left tb cta" "name name name"; align-items: end; gap: 22px 40px; }
.arr-copy > .btn { grid-area: cta; }
.arr-left { grid-area: left; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.arr-lead { max-width: 28ch; }
.arr-copy .name { grid-area: name; }
.tb { grid-area: tb; display: grid; grid-auto-flow: column; gap: 4px 36px; font-size: var(--step-ui); line-height: 1.35; }
.tb dt { color: rgba(228, 226, 218, .62); }
.tb dd { color: rgba(228, 226, 218, .95); }
.name { font-weight: 400; font-size: clamp(3.2rem, 11vw, 12.5rem); line-height: 1; letter-spacing: -.02em; white-space: nowrap; transform-origin: left bottom; }
.name span + span::before { content: " "; }

/* walk: static default = stacked rooms with captions */
.walk { background: var(--bg); }
.station { position: relative; }
.st-fig { aspect-ratio: 16 / 9; max-height: 80svh; width: 100%; }
.st-cap { padding: 32px var(--m) 64px; max-width: 46rem; display: flex; flex-direction: column; gap: 12px; }
.st-h { font-size: var(--step-head); line-height: 1.05; letter-spacing: -.02em; font-weight: 400; text-wrap: balance; }
.st-t { max-width: 36rem; color: var(--ink); }
.rail, .counter { display: none; }

/* pause */
.pause { position: relative; padding: clamp(96px, 24svh, 240px) var(--m); background: var(--bg); overflow: visible; }
.pause p { position: relative; z-index: 1; max-width: 18ch; }
.pause.has-fig { min-height: 82svh; display: flex; align-items: flex-end; padding-top: 0; padding-bottom: clamp(48px, 10svh, 110px); }
.pause-fig { position: absolute; inset: 0; overflow: hidden; }
.pause-fig img { width: 100%; height: 100%; object-fit: cover; object-position: var(--f); }
.pause-fig::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18, 13, 7, .78), rgba(18, 13, 7, .15) 70%); pointer-events: none; }

/* details: the one dense section, on tan */
.details { position: relative; background: var(--field); color: var(--field-ink); padding: clamp(40px, 8svh, 96px) var(--m) clamp(72px, 14svh, 160px); }
.details .small { color: rgba(28, 21, 13, .78); }
.details::before { content: ""; position: absolute; left: 0; right: 0; top: -22svh; height: 22svh; background: linear-gradient(to bottom, rgba(189, 163, 139, 0), var(--field)); pointer-events: none; }
.det-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 56px var(--m); align-items: start; }
.det-main { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 40px; }
.det-plan { grid-column: 5 / -1; display: flex; flex-direction: column; gap: 16px; }
.specs { display: block; }
.spec { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 11px 0; }
.spec dt { font-size: var(--step-small); }
.spec dd { font-size: var(--step-lead); font-variant-numeric: tabular-nums; text-align: right; }
.mats { font-size: var(--step-lead); line-height: 1.3; }
.mats .k { display: block; font-size: var(--step-small); margin-bottom: 6px; }
svg.plan { width: 100%; height: auto; overflow: visible; }
.route-list { display: none; }
.det-plan .mats { margin-top: 28px; }
svg.plan .room rect { fill: none; stroke: var(--field-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
svg.plan .lvl { font: 600 3.6px "Archivo", sans-serif; fill: var(--field-ink); }
svg.plan .room text { font: 400 3.3px "Archivo", sans-serif; fill: var(--field-ink); }
svg.plan .seg { stroke: var(--field-ink); stroke-width: .55; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
svg.plan .stop { font: 400 3.4px "Archivo", sans-serif; fill: var(--field-ink); }
svg.plan .vx circle { fill: var(--field-ink); }
svg.plan .vx text { font: 600 3.2px "Archivo", sans-serif; fill: var(--field); }
svg.plan .vx text.stop { font: 400 3.4px "Archivo", sans-serif; fill: var(--field-ink); }

/* visit: card on a photograph */
.visit::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26svh; z-index: 1; background: linear-gradient(to bottom, var(--field), rgba(189, 163, 139, 0)); pointer-events: none; }
.visit { position: relative; min-height: 100svh; display: flex; align-items: center; padding: clamp(80px, 12svh, 140px) var(--m); overflow: hidden; background: var(--bg); }
.vis-fig { position: absolute; inset: 0; }
.card { position: relative; z-index: 1; width: min(40rem, 100%); background: var(--surface); padding: clamp(24px, 4vw, 56px); border-radius: var(--r); display: flex; flex-direction: column; gap: 20px; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
form .field:nth-child(n+3), form .demo-note, form .btn, form .form-msg { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: var(--step-small); letter-spacing: .04em; }
.opt { color: var(--muted); }
input, textarea { width: 100%; background: transparent; color: var(--ink); font: inherit; border: 0; border-bottom: 1px solid rgba(228, 226, 218, .45); border-radius: 0; padding: 10px 0; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-bottom-color: var(--accent); }
textarea { resize: vertical; }
.demo-note { font-size: var(--step-small); color: var(--ink); padding-left: 14px; border-left: 2px solid var(--accent); }
.form-msg { min-height: 1.5em; font-size: var(--step-small); }
.form-msg.err { color: #f0b9a0; }
form .btn { align-self: flex-start; }

/* footer: the back of the card */
.foot { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px var(--m); padding: clamp(56px, 10svh, 120px) var(--m) 40px; background: #231b10; }
.foot-card { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 10px; }
.foot-meta { grid-column: 7 / -1; display: flex; flex-direction: column; gap: 14px; }
.credits li { font-size: var(--step-small); color: var(--muted); }
.foot a { color: var(--ink); }

@media (max-width: 900px) {
  .det-main, .det-plan, .foot-card, .foot-meta { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  svg.plan { display: none; }
  .route-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: var(--step-body); }
  .route-list li { display: flex; gap: 12px; align-items: baseline; }
  .route-list .n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--field-ink); color: var(--field); font-size: .8em; font-weight: 600; flex: none; }
  .head ul { gap: 18px; }
  form { grid-template-columns: 1fr; }
  .name { white-space: normal; font-size: clamp(3rem, 21.5vw, 6.5rem); }
  .name span { display: block; }
  .name span + span::before { content: none; }
  .arr-copy { grid-template-columns: 1fr; grid-template-areas: "left" "name" "cta"; gap: 18px; }
  .arr-copy > .btn { justify-self: start; }
  .tb { display: none; }
  .arr-fig { inset: 76px 0 auto 0; height: 34svh; }
  .arrival .arr-fig img { object-fit: contain; object-position: 50% 50%; }
  .sheet-lines { display: none; }
  .arr-fig img, .vis-fig img, .st-fig img { object-position: var(--fm); }
  .st-fig { aspect-ratio: 4 / 5; max-height: none; }
  .spec dd { font-size: 1.125rem; }
}

/* intro: the approach. Static default = each clip shown as its drawing and its finished photograph, with the caption */
.intro { position: relative; background: var(--bg); }
.intro-track { display: none; }
.is-item { padding: clamp(48px, 9svh, 110px) 0 0; }
.is-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 var(--m); }
.is-pair figure { aspect-ratio: 16 / 9; overflow: hidden; }
.is-pair img { width: 100%; height: 100%; object-fit: cover; object-position: var(--f); background: var(--ph); }
.is-item .st-cap { padding-bottom: 24px; }
@media (max-width: 640px) { .is-pair { grid-template-columns: 1fr; } }
.pre-js .arrival, .js-intro .arrival { display: none; }
.pre-js .intro-track, .js-intro .intro-track { display: block; height: calc(var(--intro) * 1svh); }
.pre-js .intro-static { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js-intro .intro-static { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: #01377e; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-stage::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56%; background: linear-gradient(to top, rgba(18, 13, 7, .8) 0%, rgba(18, 13, 7, .42) 55%, rgba(18, 13, 7, 0) 100%); pointer-events: none; opacity: var(--veil, 1); }
.intro-caps { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.intro-cap { position: absolute; left: var(--m); bottom: clamp(28px, 7svh, 72px); max-width: min(34rem, calc(100vw - 2 * var(--m))); opacity: 0; visibility: hidden; display: flex; flex-direction: column; gap: 12px; will-change: transform, opacity; }

/* JS WALK: pinned stage, only when engine.js has passed its capability checks */
.js-walk .walk-track { height: calc(var(--n) * 160svh); }
.js-walk .walk-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.js-walk .stations { position: absolute; inset: 0; }
.js-walk .station { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.js-walk .station:first-child { opacity: 1; }
.js-walk .st-fig { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; height: 100%; overflow: hidden; }
.js-walk .st-fig img { transform-origin: var(--f); will-change: transform; }
.js-walk .st-fig::after { content: ""; position: absolute; inset: auto 0 0 0; height: 70%; background: radial-gradient(ellipse 46% 70% at 100% 100%, rgba(18, 13, 7, .82), rgba(18, 13, 7, 0)), linear-gradient(to top, rgba(18, 13, 7, .86) 0%, rgba(18, 13, 7, .5) 50%, rgba(18, 13, 7, 0) 100%); pointer-events: none; }
.js-walk .st-cap { position: absolute; left: var(--m); bottom: clamp(28px, 7svh, 72px); padding: 0; max-width: min(34rem, calc(100vw - 2 * var(--m))); will-change: transform, opacity; }
.js-walk .counter { display: block; position: absolute; top: 76px; right: var(--m); font-size: var(--step-ui); font-variant-numeric: tabular-nums; }
.js-walk .rail { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; position: absolute; right: var(--m); bottom: clamp(28px, 7svh, 72px); }
.rail svg.mini { width: clamp(200px, 21vw, 320px); height: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(18, 13, 7, .85)); }
.rail .vx { cursor: pointer; }
.rail-cur { font-size: var(--step-body); line-height: 1.2; color: var(--ink); text-align: right; }
.rail-cur .rn { font-variant-numeric: tabular-nums; color: var(--accent); margin-right: .3em; }
.rail .room rect { fill: none; stroke: rgba(228, 226, 218, .6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rail .seg { stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.rail .vx circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: fill 200ms var(--ease); }
.rail .vx.on circle { fill: var(--accent); }
.rail ol { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rail:focus-within ol { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; background: rgba(18, 13, 7, .82); padding: 10px 14px; }
.rail a { display: inline-flex; gap: 10px; padding: 2px 0; font-size: var(--step-ui); text-decoration: none; color: rgba(228, 226, 218, .78); font-variant-numeric: tabular-nums; }
.rail a.on, .rail a:hover { color: var(--ink); }
.rail .l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail a.on .l, .rail a:hover .l, .rail a:focus-visible .l { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
@media (min-width: 641px) {
  .js-walk .st-cap.pos-tl { bottom: auto; top: 112px; }
  .js-walk .st-cap.sz-m .st-h { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem); }
}
.js-walk .st-fig::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 62% 52% at 4% 12%, rgba(18, 13, 7, .78), rgba(18, 13, 7, 0)); opacity: 0; pointer-events: none; z-index: 1; }
@media (min-width: 641px) { .js-walk .station:has(.st-cap.pos-tl) .st-fig::before { opacity: 1; } }
@media (max-width: 640px) {
  .js-walk .rail { right: auto; left: var(--m); bottom: 14px; align-items: flex-start; flex-direction: row; }
  .js-walk .st-cap { bottom: 104px; }
  .rail svg.mini { width: 150px; }
  .rail-cur { font-size: var(--step-ui); text-align: left; }
  .js-walk .counter { top: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .head, .rail .vx circle { transition: none; }
}

/* the drafting sheet: the first screen. Construction lines draw themselves, the detailed drawing fades in under them, the title rises. Only with JS and motion allowed (.pre-js). */
.pre-js .intro-canvas { animation: canvasIn 1.4s 1.7s both; }
@keyframes canvasIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-lines { position: absolute; z-index: 1; left: 0; top: 0; width: max(100vw, 177.78svh); height: max(56.25vw, 100svh); transform-origin: 0 0; pointer-events: none; animation: linesOut 1.4s 3.5s forwards; }
@keyframes linesOut { to { opacity: 0; } }
.sheet-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ln { fill: none; stroke: #e8f1ff; stroke-width: 3; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw var(--t) var(--d) var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sheet-glow { position: absolute; left: -200px; top: -200px; width: 400px; height: 400px; border-radius: 50%; z-index: 1; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: rgba(255, 176, 90, .2); filter: blur(72px); will-change: transform, opacity; }
.sheet { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; pointer-events: none; }
.sheet .btn, .sheet .name, .sheet .arr-left, .sheet .tb { pointer-events: auto; }
.sheet .name .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.sheet .name .w > span { display: inline-block; transform: translateY(108%); animation: rise .9s var(--ease) calc(.25s + var(--i) * .1s) forwards; }
@keyframes rise { to { transform: none; } }
.sheet .arr-eyebrow, .sheet .arr-lead, .sheet .btn, .sheet .tb > div { opacity: 0; transform: translateY(12px); animation: fadeUp .9s var(--ease) forwards; }
.sheet .arr-eyebrow { animation-delay: .7s; }
.sheet .arr-lead { animation-delay: .85s; }
.sheet .btn { animation-delay: 1.05s; }
.sheet .tb > div:nth-child(1) { animation-delay: 1.9s; } .sheet .tb > div:nth-child(2) { animation-delay: 2.02s; } .sheet .tb > div:nth-child(3) { animation-delay: 2.14s; } .sheet .tb > div:nth-child(4) { animation-delay: 2.4s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }


.arrival .arr-fig::before, .arrival .arr-fig::after { display: none; }

/* sound toggle: a plain text control in the header, like the links beside it */
.snd { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-underline-offset: .2em; }
.snd:hover { text-decoration: underline; }
.snd[aria-pressed="true"] { color: var(--accent); }
