/* ==========================================================================
   style.css — fixed 2048×1536 stage, layers, chrome, slide components.
   All positions inside .stage are Illustrator artboard pixels.
   ========================================================================== */

:root {
  --stage-w: 2048px;
  --stage-h: 1536px;
  --scale: 0.5;                 /* set by main.js to fit the viewport */

  --letterbox: #3d000a;
  --ink: #231f20;
  --blue: #1a7fe0;
  --red: #e30613;

  --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;

  /* Motion — navigation.js reads --slide-duration for its fallback timer */
  --slide-duration: 950ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--letterbox);
}

body {
  font-family: var(--font-ui);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

button, input, textarea { font: inherit; color: inherit; }
img { display: block; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 6px solid #8fd0ff; outline-offset: 6px; }

/* ---------- Viewport + scaled stage ---------- */
.viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* letterbox: echo the deck's radial glow so bars don't look dead */
  background: radial-gradient(ellipse at 50% 50%, #6e0014 0%, var(--letterbox) 70%);
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-w);
  height: var(--stage-h);
  overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--scale));
  transform-origin: 50% 50%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  contain: layout paint;
}

/* Any full-artboard image */
.layer {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  pointer-events: none;
}

/* ---------- Deck ---------- */
.deck {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0s linear 0.5s;
}
.stage[data-view="deck"] .deck {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease-out) 0.1s, visibility 0s linear 0s;
}

/* Notebook: pages are stacked; navigation.js shows the current one and,
   during a turn, clips the top page along the fold line. */
.book {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
  cursor: grab;
}
.deck.is-dragging .book { cursor: grabbing; }

.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
}
.page.is-shown { visibility: visible; }
.page.is-top   { z-index: 1; }

.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.page > .slide:first-of-type { pointer-events: none; }

.curl {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: var(--stage-w);
  height: var(--stage-h);
  pointer-events: none;
  visibility: hidden;
}
.curl.is-shown { visibility: visible; }
.curl__edge {                 /* soft shadow along the loose edge of the paper */
  fill: none;
  stroke: rgba(0, 0, 0, 0.16);
  stroke-width: 34;
  stroke-linejoin: round;
}

/* ---------- HOME / REF ---------- */
.nav-btn {
  position: absolute;
  z-index: 10;
  top: 1389px;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), filter 0.25s var(--ease-out);
}
.nav-btn::after {             /* 132px touch target */
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
}
.nav-btn img { width: 92px; height: 92px; }
.nav-btn--home { left: 144px; }
.nav-btn--ref  { left: 1812px; }
@media (hover: hover) {
  .nav-btn:hover { transform: scale(1.08); filter: brightness(1.12); }
}
.nav-btn:active { transform: scale(0.88); transition-duration: 0.08s; }
.nav-btn.is-current { filter: drop-shadow(0 0 14px rgba(143, 208, 255, 0.9)); }

/* ---------- Image buttons (Start / Submit / Close) ---------- */
.img-btn {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 999px;
  filter: drop-shadow(0 10px 10px rgba(40, 0, 6, 0.45));
  transition: transform 0.22s var(--ease-spring), filter 0.22s var(--ease-out);
}
@media (hover: hover) { .img-btn:hover { transform: translateY(-3px); filter: drop-shadow(0 14px 14px rgba(40,0,6,.5)) brightness(1.08); } }
.img-btn:active { transform: scale(0.94); filter: drop-shadow(0 4px 5px rgba(40, 0, 6, 0.45)); transition-duration: 0.08s; }
.img-btn[disabled] { opacity: 0.6; pointer-events: none; }

.form-status {
  position: absolute;
  margin: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 34px;
  font-weight: 600;
  min-height: 1.3em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.form-status[data-state="error"] { color: #ffd2d8; }
.form-status[data-state="ok"]    { color: #bfe6ff; }

/* ==========================================================================
   START SCREEN
   ========================================================================== */
.start {
  position: absolute;
  inset: 0;
  z-index: 20;
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out), visibility 0s linear 0s;
}
.stage[data-view="deck"] .start {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out), transform 0.8s var(--ease-out), visibility 0s linear 0.8s;
}
/* the frame stays put when switching, so only fade the start-specific art */
.stage[data-view="deck"] .start__frame { opacity: 0; }

.start__btn {
  left: 724px;
  top: 668px;
  width: 600px;
  height: 180px;
  background: linear-gradient(180deg, #2ba6f7 0%, #0d6fd8 100%);
  color: #fff;
  font-size: 84px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


/* ==========================================================================
   PLEDGE (slides 5 & 6)
   ========================================================================== */
.pledge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --kx: 854.5px;            /* knob centre x (artboard px) — set by Pledge */
}
.pledge__fx {               /* clip box = inner rounded panel of the artwork */
  position: absolute;
  left: 186px;
  top: 776px;
  width: 1676px;
  height: 428px;
  border-radius: 48px;
  overflow: hidden;
}
.pledge__cells { position: absolute; inset: 0; }

.cell {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
}
.cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cell__red { opacity: 0; transform: scale(0.6); }
.cell.is-red .cell__red   { opacity: 1; transform: none; }
.cell.is-red .cell__white { opacity: 0; transform: scale(1.25); }
.cell--fixed .cell__red   { opacity: 1; transform: none; }

.pledge__track {
  position: absolute;
  left: 600px;
  top: 1078px;
  width: 856px;
  height: 74px;
}
.pledge__track img { position: absolute; inset: 0; }
.pledge__track-on {
  /* reveal width = knob centre − track left */
  clip-path: inset(0 calc(856px - (var(--kx) - 600px)) 0 0 round 37px);
}

.pledge__zone {
  position: absolute;
  left: 540px;
  top: 1000px;
  width: 980px;
  height: 470px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.pledge.is-dragging .pledge__zone { cursor: grabbing; }
.pledge.is-locked .pledge__zone { pointer-events: none; }

.pledge__knob {
  position: absolute;
  top: 1052px;
  left: calc(var(--kx) - 78.5px);
  width: 157px;
  height: 157px;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.pledge__knob::after {        /* larger hit area for fingers */
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
}
.pledge__knob img { width: 157px; height: 157px; }
.pledge.is-dragging .pledge__knob { cursor: grabbing; }
.pledge.is-locked .pledge__knob { pointer-events: none; }

.pledge__hand {
  position: absolute;
  top: 1027px;
  left: calc(var(--kx) - 163.5px);
  width: 442px;
  height: 509px;
}

.pledge__mark {
  position: absolute;
  left: 1480px;
  top: 885px;
  width: 370px;
  height: 205px;
  opacity: 0;
  transform: scale(0.6) rotate(-6deg);
}
.pledge.is-complete .pledge__mark { opacity: 1; transform: none; }

/* ==========================================================================
   FEEDBACK (slide 7)
   ========================================================================== */
.feedback__input {
  position: absolute;
  left: 265px;
  top: 462px;
  width: 1518px;
  height: 624px;
  padding: 40px 48px;
  border: 2px solid var(--ink);
  border-radius: 44px;
  background: #fff;
  color: var(--ink);
  font-size: 40px;
  line-height: 1.45;
  resize: none;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.2s var(--ease-out);
}
.feedback__input:focus { box-shadow: 0 0 0 8px rgba(143, 208, 255, 0.75), 0 30px 60px -30px rgba(0, 0, 0, 0.6); }
.feedback__submit { left: 862px; top: 1180px; }
.feedback__status { top: 1296px; }

/* ==========================================================================
   REFERENCE (slide 8)
   ========================================================================== */
.ref__close {
  left: 1694px;
  top: 393px;
  border-radius: 50%;
}
.ref__close img { width: 76px; height: 76px; }
.ref__close::after { content: ""; position: absolute; inset: -22px; border-radius: 50%; }
