/* ============================================================
   The Atelier — cinematic dark. The canvas is the room;
   the cards are captions floating in it.
   ============================================================ */

:root {
  --purple-900: #2E1A34;
  --purple-800: #472850;
  --purple: #7A4686;
  --purple-300: #B08CB8;
  --purple-200: #D3BFD8;
  --purple-100: #EFE7F1;
  --gold-800: #86642F;
  --gold-700: #A87E3F;
  --gold: #C69A58;
  --gold-300: #DDC194;
  --teal: #6FB3BF;
  --mauve: #C9A9B5;
  --plum: #593640;
  --ink: #201826;
  --ink-deep: #17111C;
  --text: #EFE7F1;
  --text-dim: #B8AEC0;

  --font-display: "Ubuntu", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Ubuntu Mono", Consolas, monospace;
  --font-body: "Mulish", system-ui, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold-800); color: #fff; }

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(23,17,28,.55) 100%);
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 44px);
}
.topbar-brand img { height: 26px; width: auto; display: block; }
.topbar-guide {
  font-size: 13px; font-weight: 700; color: var(--gold-300); text-decoration: none;
  border: 1px solid rgba(198,154,88,.4); padding: 7px 14px; border-radius: 6px;
  transition: background .25s, color .25s;
  background: rgba(23,17,28,.4);
  backdrop-filter: blur(6px);
}
.topbar-guide:hover { background: var(--gold); color: var(--ink-deep); }

/* ---------- stage rail ---------- */
.stage-rail {
  position: fixed; left: clamp(12px, 2.4vw, 32px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px;
  z-index: 80;
}
.stage-rail a {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.stage-rail i {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  transition: all .3s var(--ease-out);
  flex: 0 0 auto;
}
.stage-rail span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
.stage-rail a:hover span { opacity: 1; transform: none; }
.stage-rail a.active i { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(198,154,88,.7); }
.stage-rail a.active span { opacity: 1; transform: none; color: var(--gold-300); }
@media (max-width: 760px) { .stage-rail { display: none; } }

/* ---------- stages ---------- */
main { position: relative; z-index: 10; }

.stage {
  min-height: 160svh;
  display: flex; align-items: center;
  padding: 0 clamp(20px, 5vw, 72px);
  position: relative;
}
.stage:first-child { min-height: 120svh; }
.stage:last-child { min-height: 140svh; }

.card {
  max-width: 470px;
  background: rgba(32, 24, 38, .66);
  border: 1px solid rgba(198, 154, 88, .18);
  border-radius: 18px;
  padding: clamp(26px, 3vw, 40px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  margin-left: clamp(0px, 6vw, 90px);
}
.stage.in .card { opacity: 1; transform: none; }
.stage:nth-child(even) .card { margin-left: auto; margin-right: clamp(0px, 6vw, 90px); }

.card-intro { max-width: 560px; }
.eyebrow {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .18em; color: var(--gold-300); margin: 0 0 18px;
}
h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.02;
  letter-spacing: -0.02em; margin: 0 0 18px; color: #fff;
}
.intro-sub { color: var(--text-dim); font-size: 16.5px; }
.intro-hint {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); margin-top: 24px;
}

.stage-no {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 10px;
}
h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.015em;
  margin: 0 0 14px; color: #fff;
}
.card > p { color: var(--text-dim); font-size: 15.5px; margin: 0 0 18px; }

.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0; border-top: 1px solid rgba(198,154,88,.16);
  font-size: 13.5px; color: var(--text-dim);
}
.facts li span {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: var(--gold-300); min-width: 86px;
  font-variant-numeric: tabular-nums;
}
.facts li em { color: var(--mauve); font-style: italic; }

.close-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(198,154,88,.16); }
.close-line { color: var(--purple-200) !important; font-family: var(--font-display); font-size: 17px !important; }
.close-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn-gold, .btn-line {
  display: inline-block; padding: 12px 22px;
  font-size: 14px; font-weight: 700; border-radius: 8px; text-decoration: none;
  transition: transform .25s var(--ease-out), background .25s, color .25s, box-shadow .25s;
}
.btn-gold { background: var(--gold); color: var(--ink-deep); }
.btn-gold:hover { background: var(--gold-300); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(198,154,88,.3); }
.btn-line { color: var(--gold-300); border: 1.5px solid rgba(198,154,88,.4); }
.btn-line:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 10;
  padding: 40px clamp(20px, 5vw, 72px) 48px;
  background: linear-gradient(180deg, transparent, rgba(23,17,28,.9) 30%);
}
.footer p { margin: 0 0 8px; color: var(--text-dim); font-size: 13.5px; max-width: 80ch; }
.footer-credit { opacity: .65; }

@media (max-width: 760px) {
  .stage { min-height: 130svh; padding: 0 16px; }
  .card { margin: 0 auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { opacity: 1; transform: none; transition: none; }
}
