/* /land — the interactive explorer. Self-contained: the same warm-dark
   tokens and voices as styles.css, none of its layout, so the two never
   fight. The scene is a full-viewport canvas; everything else is a thin
   HTML layer over it (captions, controls, the start overlay). */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Archivo:wdth,wght@62..125,400..900&family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..700&display=swap');

:root {
  --bg: #0d0a08;
  --bg-2: #171310;
  --bg-3: #1f1a15;
  --fg: #f0e8d8;
  --fg-2: #c9bfa9;
  --fg-3: #8a7f6a;
  --fg-4: #5a5145;
  --line: #2e2820;
  --line-2: #3d362b;
  --accent: oklch(0.72 0.13 54);
  --accent-2: oklch(0.83 0.10 54);
  --ok: oklch(0.72 0.2 145);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display: 'Archivo', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
body {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ── the scene ─────────────────────────────────────────────────────── */
#scene { position: fixed; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; }
#scene.is-hover { cursor: pointer; }
#scene.is-drag { cursor: grabbing; }

/* film grain + scanlines, the site's texture, kept faint */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 2; opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.75 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-2%, 1%); } 66% { transform: translate(1%, -2%); } 100% { transform: translate(0, 0); } }
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 3px);
  opacity: 0.3;
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ── VU meter, the site's live indicator ───────────────────────────── */
.vu { display: inline-flex; align-items: flex-end; gap: 2px; height: 9px; flex-shrink: 0; }
.vu span { width: 2px; height: 100%; background: currentColor; transform-origin: bottom; transform: scaleY(0.18); transition: transform 0.08s linear; }
.vu--ok { color: var(--ok); }

/* ── HUD ───────────────────────────────────────────────────────────── */
.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3);
}
.hud-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-2); white-space: nowrap; }
.hud-brand strong { font-weight: 500; color: var(--fg); letter-spacing: 0.08em; }
.hud-brand .sep { color: var(--fg-4); }
.hud-right { display: inline-flex; align-items: center; gap: 18px; white-space: nowrap; }
.hud-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--line-2);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.hud-btn:hover { border-color: var(--accent); color: var(--accent); }
.hud-btn[aria-pressed="false"] .vu span { transform: scaleY(0.18) !important; }
.hud-link { color: var(--fg-2); border-bottom: 1px solid var(--line-2); transition: color 0.15s, border-color 0.15s; }
.hud-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── caption panel ─────────────────────────────────────────────────── */
.caption {
  position: absolute; left: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px));
  padding: 20px 22px 18px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translateY(12px); opacity: 0; transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}
.caption.on { opacity: 1; transform: none; }
.caption::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--node-c, var(--accent)); opacity: 0.9; }
.cap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cap-idx { font-size: 10px; letter-spacing: 0.14em; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.cap-idx b { font-weight: 500; color: var(--accent); }
.cap-kind { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--node-c, var(--accent)); }
.cap-title {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -0.02em; color: var(--fg);
  margin-bottom: 12px;
}
.cap-title em { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal; color: var(--accent); }
.cap-blurb { font-size: 13px; line-height: 1.6; color: var(--fg-2); max-width: 46ch; }
.cap-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cap-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border: 1px solid var(--line-2);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cap-link:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-3); }
.cap-link--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cap-link--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cap-link span { transition: transform 0.15s var(--easing); }
.cap-link:hover span { transform: translate(2px, -2px); }

.hint {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-4);
  white-space: nowrap; opacity: 0; transition: opacity 0.4s;
}
.hint.on { opacity: 1; }

/* records on the music station */
.cap-albums { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cap-album { display: flex; flex-direction: column; gap: 5px; width: 84px; }
.cap-album img, .cap-album-blank { display: block; width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line-2); background: var(--bg-3); }
.cap-album-t { font-size: 9px; letter-spacing: 0.04em; color: var(--fg-3); line-height: 1.3; }
.cap-album:hover .cap-album-t { color: var(--accent); }

/* ── the braid strip: the track, and where you are on it ─────────── */
.braid { width: 240px; height: 38px; opacity: 0.9; }

/* ── floating labels over the scene (branch mouths, exhibit in reach) ── */
.floats { position: absolute; inset: 0; pointer-events: none; }
.float {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 7px 10px 6px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); border: 1px solid var(--line-2);
  border-left: 3px solid var(--node-c, var(--accent));
  font-size: 12px; color: var(--fg); white-space: nowrap; pointer-events: auto; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.2s;
}
.float small { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-4); }
.float .float-n { font-size: 10px; color: var(--node-c, var(--accent)); margin-right: 8px; }
.float.on, .float:hover { background: var(--bg-3); border-color: color-mix(in srgb, var(--node-c, var(--accent)) 60%, var(--line-2)); }
.float.dim { opacity: 0.55; }
.float--exhibit { border-left-color: var(--accent); }

/* ── a fork: the question, and the answers ─────────────────────────── */
.forkbox {
  position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 12px); width: min(720px, calc(100vw - 40px));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}
.forkbox.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.fork-q {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: clamp(22px, 3vw, 34px); line-height: 1; letter-spacing: -0.02em; color: var(--fg); text-align: center;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
}
.fork-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fork-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px 11px 12px; background: color-mix(in srgb, var(--bg-2) 88%, transparent); border: 1px solid var(--line-2);
  border-left: 3px solid var(--node-c, var(--accent));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; color: var(--fg); transition: border-color 0.15s, background 0.15s, transform 0.15s var(--easing);
}
.fork-btn .fork-n { font-size: 10px; color: var(--node-c, var(--accent)); }
.fork-btn .fork-to { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-4); }
.fork-btn:hover, .fork-btn.on { background: var(--bg-3); border-color: color-mix(in srgb, var(--node-c, var(--accent)) 60%, var(--line-2)); transform: translateY(-2px); }
.fork-hint { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-4); }

/* ── an exhibit beside the road, opened ───────────────────────────── */
.exhibit {
  position: absolute; right: 20px; top: 64px; bottom: 84px; width: min(420px, calc(100vw - 40px));
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: auto; transform: translateX(16px); opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}
.exhibit.on { opacity: 1; pointer-events: auto; transform: none; }
.exhibit::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--node-c, var(--accent)); opacity: 0.9; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ex-kind { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--node-c, var(--accent)); }
.ex-close { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); padding: 4px 0; }
.ex-close:hover { color: var(--accent); }
.ex-media { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--bg-3); border: 1px solid var(--line); overflow: hidden; }
.ex-media img, .ex-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ex-media--square { aspect-ratio: 1; max-width: 220px; }
.ex-title { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.05; letter-spacing: -0.02em; color: var(--fg); }
.ex-sub { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.ex-text { font-size: 13px; line-height: 1.6; color: var(--fg-2); }
.ex-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* ── driving: continue / look ─────────────────────────────────────── */
.drive { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 8px; }
.drive-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.drive-btn span { color: var(--fg-4); }
.drive-btn kbd { font: inherit; font-size: 9px; padding: 2px 5px; border: 1px solid var(--line-2); color: var(--fg-3); }
.drive-btn:hover { border-color: var(--accent); color: var(--accent); }
.drive-btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.drive-btn--primary span { color: var(--bg); }
.drive-btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.hud-found { font-size: 10px; letter-spacing: 0.14em; color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* the ending: the route you took */
.cap-recap { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--fg-2); }
.cap-recap b { font-weight: 500; color: var(--accent); }

/* ── start overlay ─────────────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.5s var(--easing);
}
.boot.off { opacity: 0; pointer-events: none; }
.boot-card { width: min(640px, calc(100vw - 40px)); padding: 32px 34px 28px; background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid var(--line-2); position: relative; }
.boot-card::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0.85; }
.boot-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 18px; }
.boot-title {
  font-family: var(--display); font-stretch: 125%; font-weight: 900;
  font-size: clamp(40px, 7vw, 76px); line-height: 0.95; letter-spacing: -0.03em; color: var(--fg);
  margin-bottom: 16px;
}
.boot-title em { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal; color: var(--accent); }
.boot-lead { font-size: 14px; line-height: 1.65; color: var(--fg-2); max-width: 52ch; margin-bottom: 22px; }
.boot-console { font-size: 11px; line-height: 1.8; color: var(--fg-3); min-height: calc(3 * 1.8em); margin-bottom: 22px; white-space: pre-wrap; }
.boot-console .cursor { display: inline-block; width: 7px; height: 1em; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.boot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.boot-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border: 1px solid var(--line-2);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.boot-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-3); }
.boot-btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.boot-btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.boot-foot { margin-top: 18px; font-size: 10px; letter-spacing: 0.06em; color: var(--fg-4); }
.boot-foot a { color: var(--fg-3); border-bottom: 1px solid var(--line-2); }
.boot-foot a:hover { color: var(--accent); border-color: var(--accent); }

/* no JavaScript: the nodes as a plain list, nothing lost */
.nojs { position: fixed; inset: 0; z-index: 20; overflow: auto; padding: 40px 24px; background: var(--bg); }
.nojs h1 { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 40px; margin-bottom: 16px; }
.nojs ul { list-style: none; display: grid; gap: 10px; max-width: 60ch; }
.nojs a { color: var(--accent); border-bottom: 1px solid var(--line-2); }

/* ── phone ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .hud-top { padding: 12px 14px; }
  .hud-brand .sep, .hud-brand-sub { display: none; }
  .hud-right { gap: 10px; }
  .hud-btn { padding: 7px 8px; }
  .caption {
    left: 12px; right: 12px; width: auto;
    padding: 14px 14px 12px;
  }
  .cap-title { font-size: 24px; }
  .cap-blurb { font-size: 12px; }
  .braid { display: none; }
  .hud-found { display: none; }
  .caption { bottom: 76px; max-height: 46vh; overflow: auto; }
  .forkbox { bottom: 76px; }
  .fork-opts { flex-direction: column; align-items: stretch; }
  .exhibit { left: 12px; right: 12px; top: 56px; bottom: 76px; width: auto; padding: 14px; }
  .drive { left: 12px; right: 12px; bottom: 14px; justify-content: flex-end; }
  .float { font-size: 11px; padding: 6px 8px 5px; }
  .hint { display: none; }
  .boot-card { padding: 24px 20px 22px; }
  .boot-console { display: none; }
}
