:root {
  color-scheme: light dark;
  --ink: #eef3f0;
  --muted: #b9c7c0;
  --accent: #7fb8a6;
  --scrim-top: rgba(8, 14, 12, 0.55);
  --scrim-bottom: rgba(8, 14, 12, 0.75);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #0b100e;
  color: var(--ink);
  overflow: hidden;
}

.hidden { display: none !important; }

/* ---- Landing / intake ---- */
#landing.screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a2620 0%, #0b100e 75%);
  padding: 1.5rem;
}
.landing-inner { max-width: 520px; text-align: center; }
.brand { font-size: 2.4rem; font-weight: 300; letter-spacing: 0.08em; margin: 0 0 0.6rem; color: var(--ink); }
.tagline { color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 2.2rem; }
.intake-q { font-size: 1rem; color: var(--ink); margin: 0 0 1rem; }
.intake-optional { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.intake-options { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-bottom: 1rem; }
.choice-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink);
  padding: 0.8rem 1.3rem;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 150px;
}
.choice-btn:hover, .choice-btn:focus-visible { background: rgba(127, 184, 166, 0.18); border-color: var(--accent); }
.choice-sub { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; font-weight: 400; }
.skip-link {
  background: none; border: none; color: var(--muted); text-decoration: underline;
  font-size: 0.85rem; cursor: pointer; margin-top: 0.4rem;
}
.skip-link:hover { color: var(--ink); }
#mode-pick { margin-top: 1.6rem; }

/* ---- Scene (real Three.js WebGL canvas — see scene3d.js) ---- */
#scene.screen { position: relative; height: 100vh; width: 100vw; }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--scrim-top) 0%, transparent 30%, transparent 60%, var(--scrim-bottom) 100%);
  pointer-events: none;
}

.scene-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 1.2rem; pointer-events: none; }
.scene-ui > * { pointer-events: auto; }

.scene-topbar { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-btn {
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--ink);
  padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.85rem; cursor: pointer;
  backdrop-filter: blur(4px);
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.6); }

.scene-directions { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.4rem; }
.dir-btn {
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.3); color: var(--ink);
  padding: 0.75rem 1.4rem; border-radius: 999px; font-size: 0.9rem; cursor: pointer;
  backdrop-filter: blur(4px); transition: background 0.2s ease;
}
.dir-btn:hover, .dir-btn:focus-visible { background: rgba(127, 184, 166, 0.35); border-color: var(--accent); }

.audio-panel { display: flex; justify-content: center; align-items: center; gap: 0.8rem; padding-bottom: 2.6rem; }
.audio-start-btn {
  background: rgba(127, 184, 166, 0.25); border: 1px solid var(--accent); color: var(--ink);
  padding: 0.7rem 1.4rem; border-radius: 999px; font-size: 0.9rem; cursor: pointer;
}
.audio-start-btn:hover { background: rgba(127, 184, 166, 0.4); }
.audio-controls { display: flex; align-items: center; gap: 0.6rem; background: rgba(0, 0, 0, 0.4); padding: 0.4rem 0.9rem; border-radius: 999px; backdrop-filter: blur(4px); }
#audio-volume { width: 120px; accent-color: var(--accent); }

/* Ambiance mode: UI dims to near-invisible after load so it truly runs
   quietly in the background — reappears on hover/focus/touch. */
body.mode-ambiance .scene-ui { opacity: 0.35; transition: opacity 0.4s ease; }
body.mode-ambiance .scene-ui:hover,
body.mode-ambiance .scene-ui:focus-within { opacity: 1; }

/* ---- Credits ---- */
.credits {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  font-size: 0.68rem; color: var(--muted); text-align: center;
  padding: 0.3rem 0.6rem; background: rgba(0, 0, 0, 0.5);
  pointer-events: none; /* only the links themselves should catch clicks —
    the bar can visually overlap scene controls above it on short viewports
    without stealing their clicks */
}
.credits a { color: var(--muted); pointer-events: auto; }
.credits a:hover { color: var(--ink); }
#scene:not(.hidden) ~ .credits, #landing:not(.hidden) ~ .credits { display: block; }

@media (max-width: 640px) {
  .scene-directions { flex-wrap: wrap; }
  .dir-btn { padding: 0.65rem 1.1rem; font-size: 0.82rem; }
  .intake-options { flex-direction: column; align-items: stretch; }
  .choice-btn { min-width: 0; }
}
