:root {
  --brown: #491705;
  --page: #ebebea;
  --ink: #1d1d1d;
  --ink-soft: #4a4a4a;
  --gold: #cc9d57;
  --gold-soft: #e6c99a;
  --paper: #f2e3c9;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#walk-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100lvh;
  display: block;
  opacity: 0; transition: opacity .8s ease;
}
.walk-ready #walk-canvas { opacity: 1; }

/* the scroll length is the walk length; walk.js sets the exact height from its timeline */
.scroll-track { height: 3060vh; }

.stage { position: fixed; inset: 0; pointer-events: none; }

.intro {
  position: absolute;
  left: clamp(20px, 5vw, 72px);
  top: 50%; transform: translateY(-50%);
  max-width: min(440px, 34vw);
}
.kicker {
  margin: 0 0 16px;
  font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brown);
}
.intro h1 {
  margin: 0 0 18px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 3.8vw, 58px); line-height: 1.04; letter-spacing: -.01em;
  color: var(--ink);
}
.lede { margin: 0; font-size: clamp(16px, 1.25vw, 19px); color: var(--ink-soft); }

.hint {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.hint span {
  width: 1px; height: 38px; background: linear-gradient(var(--ink), transparent);
  animation: drip 1.8s ease-in-out infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.rise {
  position: absolute;
  left: clamp(20px, 5vw, 72px); top: 50%; transform: translateY(-50%);
  max-width: min(400px, 30vw);
  margin: 0; opacity: 0;
  font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.12; color: var(--ink);
}

.room {
  position: absolute;
  left: clamp(20px, 4vw, 56px); top: calc(56px + clamp(16px, 4vh, 40px));
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 22px 16px 18px;
  border-left: 2px solid var(--gold);
  background: rgba(46, 14, 3, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease;
}
.room.on { opacity: 1; transform: none; }
.room .name { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 2.3vw, 34px); line-height: 1.1; color: #fbf3e4; }
.room .dims { font-size: 15px; color: var(--gold-soft); }
.room .dims:empty { display: none; }

.outro {
  position: absolute;
  left: clamp(20px, 5vw, 72px); bottom: clamp(28px, 8vh, 90px);
  max-width: min(500px, 88vw);
  padding: 28px 30px 26px;
  background: #2e0e03;
  opacity: 0;
}
.outro::before { content: ""; display: block; width: 56px; height: 2px; background: var(--gold); margin-bottom: 18px; }
.outro h2 {
  margin: 0 0 12px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(26px, 2.6vw, 38px); line-height: 1.1; color: #fbf3e4;
}
.outro p { margin: 0 0 20px; font-size: 16px; color: var(--gold-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.btn {
  display: inline-block; text-decoration: none;
  padding: 12px 18px; border-radius: 4px;
  font-size: 15px; font-weight: 500;
  color: var(--paper); border: 1px solid rgba(230, 201, 154, .55);
}
.btn:hover { border-color: var(--gold-soft); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #2a1206; }
.btn.primary:hover { background: var(--gold-soft); }
.btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.outro .note { margin: 0; font-size: 13px; color: rgba(230, 201, 154, .75); }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(29, 29, 29, .1); }
#progress-bar { height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* phones: text goes to the bottom, plan sits above it */
@media (max-width: 760px), (max-aspect-ratio: 5/4) {
  .intro { top: auto; bottom: 96px; transform: none; max-width: none; right: 20px; }
  .intro h1 { font-size: clamp(30px, 8vw, 44px); }
  .hint { bottom: 22px; }
  .room { top: 68px; left: 16px; padding: 12px 16px 12px 14px; }
  .outro { left: 12px; right: 12px; bottom: 14px; max-width: none; padding: 20px 18px 18px; }
  .outro h2 { font-size: 24px; }
  .outro p { font-size: 15px; margin-bottom: 14px; }
  .rise { top: auto; bottom: 110px; transform: none; max-width: none; right: 20px; font-size: clamp(24px, 6.5vw, 34px); }
}

/* no WebGL: the plan and the clip instead */
.fallback-webgl { display: none; }
.no-webgl #walk-canvas, .no-webgl .stage, .no-webgl .scroll-track { display: none; }
.no-webgl .fallback-webgl { display: grid; gap: 20px; max-width: 900px; margin: 0 auto; padding: calc(56px + 32px) 20px 48px; color: var(--ink); }
/* ?debug=1: what the device reports, for diagnosing a real phone from a screenshot */
.walk-debug { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 46vh; overflow: auto; margin: 0; padding: 10px 12px; background: rgba(0,0,0,.86); color: #9fe79f; font: 11px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.fallback-webgl img, .fallback-webgl video { width: 100%; height: auto; border-radius: 4px; }
.fallback { padding: 48px 20px; text-align: center; }
.fallback a { color: var(--gold-soft); }

@media (prefers-reduced-motion: reduce) {
  .hint span { animation: none; }
  #walk-canvas { transition: none; }
}

/* frame-by-frame capture: no CSS transitions between frames */
.capture .room, .capture #walk-canvas { transition: none; }
.clip .hint, .clip .progress, .clip .outro .actions, .clip .outro .note, .clip .sitebar { display: none; }
