:root {
  --bg: #050807;
  --panel: rgba(8, 14, 11, 0.78);
  --line: rgba(120, 255, 170, 0.16);
  --text: #cfe3d6;
  --dim: #7c9486;
  --accent: #5dff9a;
  --warn: #ff4b3e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.brand {
  font-family: var(--mono);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  text-shadow: 0 0 12px rgba(93, 255, 154, 0.45);
}

/* ---------------------------------------------------------------- menu */
.menu {
  min-height: 100%;
  padding: 56px clamp(20px, 6vw, 80px) 40px;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(40, 140, 80, 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 110%, rgba(20, 90, 60, 0.16), transparent 50%),
    var(--bg);
}

.menu header { margin-bottom: 44px; }

.menu h1 {
  margin: 14px 0 8px;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.menu .lede { color: var(--dim); max-width: 52ch; line-height: 1.5; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0a110d;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(93, 255, 154, 0.5);
  box-shadow: 0 10px 40px rgba(30, 255, 120, 0.12);
  outline: none;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
}

.card .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 16px 16px;
  background: linear-gradient(to top, rgba(3, 6, 5, 0.95) 40%, transparent);
}

.card h2 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.45; }

.card .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--accent);
  border: 1px solid var(--line);
}

.card.soon {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-style: dashed;
  background: repeating-linear-gradient(135deg, #070b09 0 10px, #08100c 10px 20px);
}

.menu footer {
  margin-top: 48px;
  font-size: 12px;
  color: var(--dim);
  font-family: var(--mono);
}

/* -------------------------------------------------------------- viewer */
.viewer { overflow: hidden; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  z-index: 5;
}

.hud .spacer { flex: 1; }

.hud select, .hud button {
  font: 500 13px var(--sans);
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.hud button:hover, .hud select:hover { border-color: rgba(93, 255, 154, 0.5); }
.hud button[aria-pressed="true"] { color: var(--accent); }

.credits {
  position: fixed;
  left: 18px;
  bottom: 12px;
  font-size: 11px;
  color: var(--dim);
  z-index: 5;
  max-width: 70vw;
}

.hint {
  position: fixed;
  right: 18px;
  bottom: 12px;
  font: 11px var(--mono);
  color: var(--dim);
  z-index: 5;
}

#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 10;
  transition: opacity 0.8s ease;
}

#loader.done { opacity: 0; pointer-events: none; }

#loader .box { width: min(320px, 70vw); text-align: center; }
#loader .label { font: 12px var(--mono); letter-spacing: 0.25em; color: var(--accent); text-transform: uppercase; }
#loader .bar { margin-top: 14px; height: 2px; background: rgba(93, 255, 154, 0.12); overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width 0.2s; }
#loader .err { margin-top: 14px; color: var(--warn); font-size: 13px; }

@media (max-width: 640px) {
  .hud { flex-wrap: wrap; gap: 8px; }
  .hint { display: none; }
}
