/* Shared shell: backdrop, stage, arrows, caption.
   Everything that makes a prototype *distinct* lives in its own HTML file. */

:root {
  --bg-0: #06070d;
  --bg-1: #0c1120;

  --glow-a: #4f7cff;
  --glow-b: #b545ff;
  --glow-c: #17d4c4;

  --panel-w: min(520px, 62vw);
  --panel-h: calc(var(--panel-w) * 0.625); /* 16:10 */

  --dur: 0.75s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --ink: #e9edf7;
  --ink-dim: #8c96b0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--bg-1), var(--bg-0) 70%),
    var(--bg-0);
  color: var(--ink);
  font: 400 16px/1.4 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- animated glow behind the glass ------------------------------------ */

.glow {
  position: fixed;
  inset: -25%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}
/* NO filter: blur() and NO scale() in the keyframes.
   Measured on the newer pages: three blurred blobs being scaled = 8.6fps,
   versus 60fps with the glow removed — a blurred layer has to have its blur
   recomputed every frame it is scaled. A radial-gradient with a transparent
   falloff IS a soft blob at zero filter cost, and translate alone animates on
   the compositor. Same fix as wall.css. */
.glow span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(circle closest-side, var(--c), transparent 100%);
  will-change: transform;
}
.glow span:nth-child(1) {
  --c: var(--glow-a);
  width: 62vmax; height: 62vmax;
  left: 0%; top: 4%;
  animation: drift-a 19s ease-in-out infinite alternate;
}
.glow span:nth-child(2) {
  --c: var(--glow-b);
  width: 52vmax; height: 52vmax;
  right: 0%; top: 20%;
  animation: drift-b 23s ease-in-out infinite alternate;
}
.glow span:nth-child(3) {
  --c: var(--glow-c);
  width: 42vmax; height: 42vmax;
  left: 38%; bottom: -2%;
  opacity: 0.7;
  animation: drift-c 27s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate3d(14vw, 8vh, 0); } }
@keyframes drift-b { to { transform: translate3d(-12vw, 12vh, 0); } }
@keyframes drift-c { to { transform: translate3d(8vw, -10vh, 0); } }

@media (prefers-reduced-motion: reduce) {
  .glow span { animation: none; }
}

/* ---- stage ------------------------------------------------------------- */

.carousel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
}

.stage {
  position: relative;
  width: 100%;
  height: calc(var(--panel-h) * 1.6);
  display: grid;
  place-items: center;
  perspective: 1600px;
}

.track {
  position: relative;
  width: var(--panel-w);
  height: var(--panel-h);
  transform-style: preserve-3d;
}

.panel {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform var(--dur) var(--ease),
    opacity var(--dur) var(--ease),
    filter var(--dur) var(--ease);
  /* genuine translucency — the glow reads through every panel */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(3px) saturate(130%);
  -webkit-backdrop-filter: blur(3px) saturate(130%);
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition-duration: 0.01ms; }
}

/* ---- controls ---------------------------------------------------------- */

.controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}
.nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}
.nav:active { transform: scale(0.92); }
.nav:focus-visible {
  outline: 2px solid var(--glow-c);
  outline-offset: 3px;
}
.nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dots { display: flex; gap: 8px; }
.dots b {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.3s, transform 0.3s;
}
.dots b.on { background: var(--ink); transform: scale(1.35); }

/* ---- caption ----------------------------------------------------------- */

.caption {
  text-align: center;
  min-height: 3.4rem;
}
.caption__name {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.caption__result {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.caption.is-in .caption__name { animation: rise 0.5s var(--ease) both; }
.caption.is-in .caption__result { animation: rise 0.5s var(--ease) 0.06s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* ---- page furniture ---------------------------------------------------- */

.label {
  position: fixed;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
}
.label b { font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase; }
.label span { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--ink-dim); }

.back {
  position: fixed;
  top: 22px; left: 22px;
  z-index: 3;
  color: var(--ink-dim);
  font-size: 0.8rem;
  text-decoration: none;
  letter-spacing: 0.08em;
}
.back:hover { color: var(--ink); }
