/* ============================================================
   Quadrafolio deck — "Terminal Cinema" design system (see DESIGN.md)
   ============================================================ */
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Boldonse";
  src: url("fonts/Boldonse-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --muted-2: rgba(255, 255, 255, 0.5);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.12);
  --field: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.18);
  --glow-opacity: 1;
  --blue: #005dba;
  --pink: #de849c;
  --violet: #9d81b8;
  --orange: #fd6301;

  --mono: "Geist Mono", "SFMono-Regular", Menlo, Monaco, "Courier New", monospace;
  --display: "Boldonse", var(--mono);

  /* type scale (shared with landing) */
  --fs-label: 11px;
  --fs-ui: 13px;
  --fs-input: 16px;
  --fs-body: clamp(14px, 1.5vw, 16px);
  --fs-display: clamp(22px, 4vw, 40px);
  --fs-hero: clamp(30px, 6.2vw, 62px);

  /* tracking */
  --tr-label: 0.26em;
  --tr-ui: 0.04em;
  --tr-display: 0.005em;
}

:root[data-theme="light"] {
  --bg: #f5f2ec;
  --fg: #141414;
  --muted: rgba(20, 20, 20, 0.64);
  --muted-2: rgba(20, 20, 20, 0.52);
  --surface: rgba(20, 20, 20, 0.05);
  --surface-hover: rgba(20, 20, 20, 0.1);
  --field: rgba(255, 255, 255, 0.45);
  --border: rgba(20, 20, 20, 0.16);
  --glow-opacity: 0.6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(40% 35% at 28% 22%, rgba(0, 93, 186, 0.20), transparent 70%),
    radial-gradient(45% 40% at 74% 48%, rgba(222, 132, 156, 0.16), transparent 72%),
    radial-gradient(50% 45% at 50% 90%, rgba(253, 99, 1, 0.18), transparent 72%);
  filter: blur(22px);
  opacity: var(--glow-opacity);
  animation: drift 24s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.12); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.05); }
}

.back {
  position: fixed;
  top: 20px;
  left: 22px;
  z-index: 5;
  color: var(--muted-2);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  transition: color 0.2s ease;
}
.back:hover { color: var(--fg); }

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--fg); transform: translateY(-1px); }
.theme-icon-sun { display: none; }
.theme-toggle[data-theme-state="dark"] .theme-icon-sun { display: block; }
.theme-toggle[data-theme-state="dark"] .theme-icon-moon { display: none; }

/* ---------- gate ---------- */
.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 24px;
  text-align: center;
}
.gate-reel {
  width: 88px;
  height: 88px;
  opacity: 0.9;
  margin-bottom: 26px;
  animation: slowspin 40s linear infinite;
  filter: drop-shadow(0 10px 30px rgba(0, 93, 186, 0.3));
}
@keyframes slowspin { to { transform: rotate(360deg); } }

.gate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.gate-form label {
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted-2);
}
.gate-form input {
  width: min(78vw, 280px);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--fs-input);
  padding: 12px 16px;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gate-form input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(222, 132, 156, 0.18);
}
.gate-form button {
  margin-top: 4px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  padding: 13px 28px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.gate-form button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.gate-form button:disabled { opacity: 0.5; cursor: progress; }

.gate-error {
  min-height: 16px;
  font-size: var(--fs-label);
  letter-spacing: var(--tr-ui);
  color: var(--orange);
}
.gate.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ---------- deck ---------- */
.deck {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
}
.slides {
  position: relative;
  height: 100%;
}
.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8vh 8vw;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}
.slide.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.slide .kicker {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 24px;
}
.slide .title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1.2;
  letter-spacing: var(--tr-display);
  max-width: 20ch;
  color: var(--fg);
}
.slide .body {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: var(--fs-body);
  letter-spacing: var(--tr-ui);
  line-height: 1.65;
  color: var(--muted);
  max-width: 56ch;
}

/* first + last slide variants */
.slide.cover .title, .slide.outro .title {
  font-size: var(--fs-hero);
  max-width: 16ch;
}

.deck-nav {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 22px;
}
.deck-nav button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.deck-nav button:hover { background: var(--surface-hover); border-color: var(--pink); }
.deck-nav button:disabled { opacity: 0.25; cursor: default; }
.counter {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  letter-spacing: var(--tr-ui);
  color: var(--muted-2);
  min-width: 56px;
  text-align: center;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--orange));
  transition: width 0.4s ease;
  z-index: 6;
}

@media (prefers-reduced-motion: reduce) {
  body::before, .gate-reel { animation: none; }
}
