:root {
  --bg: #0d0f14;
  --ink: #f4f1ea;
  --muted: #a7a092;
  --gold: #d9b46a;
  --accent: #7aa2ff;
  --card: #15181f;
  --line: #2a2e38;
  font-family: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.hidden { display: none !important; }

/* ---------- Crosshair ---------- */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 5;
  transition: transform 0.12s ease, background 0.12s ease;
}
#crosshair.active {
  transform: scale(1.8);
  background: var(--gold);
}

/* ---------- Interaction prompt ---------- */
#prompt {
  position: fixed;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
  pointer-events: none;
  z-index: 5;
}
#prompt b { color: var(--gold); }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 5;
  font-family: 'Inter', system-ui, sans-serif;
  pointer-events: none;
}
#hud-wing {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
#hud-controls {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
#hud-controls b { color: var(--ink); }

/* ---------- Perf overlay ---------- */
#perf {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 6;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #cfe8d0;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  pointer-events: none;
  min-width: 116px;
}
#perf .perf-k { color: #7b8a7c; display: inline-block; width: 52px; }
#perf b { color: #8effa0; }

/* ---------- Start overlay: a dark veil over the live scene ---------- */
#start {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 7, 0.82);
  backdrop-filter: blur(4px);
  transition: opacity 0.6s ease;
}

/* ---------- Black loading screen ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050608;
  transition: opacity 1s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-copy {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: #8a8378;
  animation: loaderPulse 1.8s ease-in-out infinite;
}
@keyframes loaderPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
#start.lifting { opacity: 0; pointer-events: none; }
.start-inner {
  text-align: center;
  padding: 32px;
  max-width: 560px;
}
.start-kicker {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 18px;
  opacity: 0.9;
}
.start-inner h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0 0 26px;
  color: var(--ink);
}
#loading {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
  min-height: 16px;
}
#enter-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--gold);
  padding: 12px 46px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.2s ease;
}
#enter-btn:disabled { opacity: 0.3; cursor: default; }
#enter-btn:not(:disabled):hover { background: var(--gold); color: #07080c; }
.start-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-top: 30px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.start-controls b { color: var(--ink); font-weight: 600; }
.start-tour {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.start-tour b { color: var(--gold); }

/* ---------- Detail overlay ---------- */
#detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(4px);
}
.detail-card {
  position: relative;
  display: flex;
  gap: 0;
  width: min(1040px, 92vw);
  max-height: 88vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
#detail-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
#detail-close:hover { background: rgba(0, 0, 0, 0.75); }

.detail-media {
  flex: 1 1 58%;
  background: #07080c;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 18px;
}
.detail-media img,
.detail-media video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}
.detail-media iframe.yt {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
}
.detail-media audio { width: 90%; }
.detail-media .audio-art,
.detail-media .nohost {
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  padding: 30px;
}
.detail-media .big-icon {
  font-size: 72px;
  display: block;
  margin-bottom: 14px;
}

.detail-info {
  flex: 1 1 42%;
  padding: 44px 34px 30px;
  overflow-y: auto;
  font-family: 'Inter', system-ui, sans-serif;
}
.detail-medium {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #07080c;
  background: var(--gold);
  padding: 3px 10px;
  border-radius: 3px;
}
.detail-info h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 30px;
  margin: 14px 0 4px;
  line-height: 1.15;
}
.detail-brand {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 18px;
}
.detail-info p {
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
}
.detail-meta {
  margin: 20px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; color: var(--ink); }
.detail-rights {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-bottom: 22px;
  line-height: 1.5;
}
.detail-source {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--accent);
  padding: 9px 18px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.detail-source:hover { background: var(--accent); color: #07080c; }

@media (max-width: 760px) {
  .detail-card { flex-direction: column; max-height: 92vh; }
  .detail-media { min-height: 200px; }
}
