/* ============================================================
   Slide Rolodex — kiosk carousel
   Brand-themeable via the CSS variables below.
   ============================================================ */
:root {
  --bg-0: #0b0e14;
  --bg-1: #151a24;
  --brand: #2f6bff;
  --brand-2: #16d1c9;
  --ink: #f4f7ff;
  --ink-dim: #9aa6bd;
  --card-radius: 18px;
  --card-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  --stage-pad: 6vh;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Carousel geometry (overridden in JS for exact px spacing) */
  --spacing: 340px;
  --side-rotate: 40deg;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-1) 0%, var(--bg-0) 60%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none; /* we handle gestures ourselves */
}

/* ---------------- Stage & 3D track ---------------- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: grab;
}
.stage.dragging { cursor: grabbing; }

/* Flat container: each card carries its own perspective, so z-index
   reliably controls stacking and the active slide is always on top. */
.track {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: flat;
}

/* A single slide card — 16:9 landscape to match exported slides */
.card {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 54vh;
  width: calc(54vh * 16 / 9);
  max-width: 88vw;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #10131c center/contain no-repeat;
  box-shadow: var(--card-shadow);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.55s ease;
  backface-visibility: hidden;
  outline: 1px solid rgba(255, 255, 255, 0.06);
}
.track.dragging .card { transition: none; }

/* Hidden (out of window) cards are cheap and non-interactive */
.card[hidden] { display: none; }

/* The reflective gloss + darkening on side cards */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(0,0,0,0) 30%);
  opacity: 0.6;
  pointer-events: none;
}
.card .veil {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}

/* Placeholder look (used until real images are supplied) */
.card .ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  color: #fff;
}
.card .ph .num {
  font-size: 8vh;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  opacity: 0.92;
}
.card .ph .title {
  font-size: 2.4vh;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 8px;
}

/* Badges */
.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 1.5vh;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}
.badge.hero { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* Play glyph on video cards */
.playglyph {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12vh;
  height: 12vh;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.playglyph::before {
  content: "";
  border-style: solid;
  border-width: 2.4vh 0 2.4vh 3.8vh;
  border-color: transparent transparent transparent #fff;
  margin-left: 0.8vh;
}

/* The dramatic "pull-out" emphasis */
.card.pulled {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.7s ease;
  box-shadow: 0 40px 120px rgba(47, 107, 255, 0.45), var(--card-shadow);
}

/* ---------------- Hint ---------------- */
.hint {
  position: fixed;
  bottom: calc(var(--stage-pad) + 92px);
  left: 0;
  right: 0;
  text-align: center;
  color: var(--ink-dim);
  font-size: 2vh;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hint.show { opacity: 0.85; animation: pulse 3.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------------- Controls ---------------- */
.controls {
  position: fixed;
  bottom: var(--stage-pad);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 40;
}
.controls.show { opacity: 1; }
.ctl {
  width: 8vh;
  height: 8vh;
  min-width: 56px;
  min-height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 3.4vh;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.ctl:hover { background: rgba(255, 255, 255, 0.16); }
.ctl:active { transform: scale(0.92); }

/* ---------------- Focus (enlarge / video) ---------------- */
.focus {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 12, 0.86);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 0;
  animation: fade 0.3s ease;
}
.focus[hidden] { display: none; }
.focus-media {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
/* Images stretch to fill the whole screen */
.focus-media img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
}
/* Video keeps its aspect ratio so it isn't distorted */
.focus-media video {
  max-width: 100vw;
  max-height: 100vh;
  display: block;
}
.focus-media .ph {
  width: 100vw;
  height: 100vh;
  position: relative;
}
.focus-caption {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4vh;
  margin: 0;
  padding: 0 6vh;
  font-size: 2.6vh;
  color: var(--ink);
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 61;
}
.focus-close {
  position: fixed;
  top: 3vh;
  right: 3vh;
  width: 9vh;
  height: 9vh;
  min-width: 60px;
  min-height: 60px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 5vh;
  line-height: 1;
  cursor: pointer;
  z-index: 61;
}
.unmute {
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 2.2vh;
  font-weight: 600;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  cursor: pointer;
}

/* ---------------- Overview grid ---------------- */
.overview {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(6, 9, 16, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  animation: fade 0.3s ease;
}
.overview[hidden] { display: none; }
.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3vh 4vh 1.5vh;
  font-size: 3vh;
  font-weight: 700;
}
.overview-head .focus-close { position: static; }
.overview-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 2vh 4vh 6vh;
  -webkit-overflow-scrolling: touch;
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #10131c center/cover no-repeat;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}
.thumb:active { transform: scale(0.96); }
.thumb .ph { position: absolute; inset: 0; }
.thumb .ph .num { font-size: 4vh; }
.thumb .ph .title { font-size: 1.4vh; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Respect reduced-motion where the OS asks for it */
@media (prefers-reduced-motion: reduce) {
  .card, .card.pulled { transition-duration: 0.001s; }
  .hint.show { animation: none; }
}
