/* ============================================================
   RESET / BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0b0d;
  --bg-alt: #111114;
  --fg: #f4f2ee;
  --fg-dim: #a8a5a0;
  --accent: #ff5a3c;
  --card-bg: #16161a;
  --border: #2a2a2f;
  /* Montserrat stands in for Gotham (paid) -- same geometric proportions,
     free via Google Fonts. Swap here if you get a licensed Gotham later. */
  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-snap-type: y mandatory;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.screen {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

/* ============================================================
   SCREEN 1 -- HERO
   ============================================================ */
.hero-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.marquee-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.marquee-row {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marquee-left 60s linear infinite;
}

.marquee-row[data-dir="right"] { animation-name: marquee-right; }

.marquee-row img {
  width: 17vw;
  min-width: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  flex-shrink: 0;
  filter: saturate(0.65) brightness(0.8);
  /* each tile fades in on its own -- see heroMarquee in main.js, which
     sets a staggered transition-delay per tile before adding is-visible */
  opacity: 0;
  transition: opacity 1s ease;
}

.marquee-row img.is-visible { opacity: 1; }

@keyframes marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.hero-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 34, 0.86), rgba(6, 10, 26, 0.93));
}

.hero-title {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-title h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 1.3s ease 0.2s;
}

.hero-title p {
  margin-top: 0.6rem;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 400;
  color: var(--fg-dim);
  opacity: 0;
  transition: opacity 1.3s ease 1.1s;
}

.hero-title.is-visible h1,
.hero-title.is-visible p {
  opacity: 1;
}

/* ============================================================
   SCREENS 2-4 -- CHAPTERS
   ============================================================ */
.chapter-screen {
  height: 100vh;
  display: flex;
  align-items: center;
}

.chapter-bg {
  position: absolute;
  inset: -8%;
  background: linear-gradient(135deg, #1c1c24, #101014);
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.55) saturate(1.1);
  transform: scale(1.15);
}

.chapter-bg-tint {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 13, 0.4);
}

.chapter-content {
  position: relative;
  z-index: 2;
  width: min(1180px, 88vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chapter-index {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 700;
}

.chapter-text h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.chapter-text p {
  color: var(--fg-dim);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.watch-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.watch-link:hover {
  border-color: var(--accent);
  background: rgba(255, 90, 60, 0.08);
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-size: 0.6rem;
}

.chapter-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.chapter-slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}

.chapter-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.chapter-slideshow img.is-active { opacity: 1; }

.chapter-slideshow.placeholder-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #232329, #17171b);
  color: var(--fg-dim);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 760px) {
  .chapter-screen {
    height: auto;
    min-height: 100vh;
    padding: 6rem 0;
  }

  .chapter-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .chapter-text h2 {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }

  .chapter-text p {
    font-size: 0.95rem;
  }
}

/* ============================================================
   EVERYTHING ELSE
   ============================================================ */
.everything-else {
  scroll-snap-align: start;
  padding: 8rem 6vw 6rem;
  background: var(--bg-alt);
}

.section-heading {
  max-width: 640px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.section-heading p {
  color: var(--fg-dim);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  max-width: 1800px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #232329, #17171b);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-body { padding: 1.4rem; }

.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; font-weight: 700; }

.card p {
  color: var(--fg-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* the CTA link now lives inside the card-detail popup, not on the card
   face itself -- clicking anywhere on the card opens that popup */
.card-body .card-link { display: none; }

.card-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.card-link:hover { border-color: var(--accent); color: var(--accent); }

/* .card-link's own `display` above beats the browser's default [hidden]
   rule (same specificity, author rule wins) -- this restores it so the
   popup's CTA link actually disappears when JS hides it */
.card-link[hidden] { display: none; }

/* ============================================================
   CARD DETAIL POPUP
   ============================================================ */
.card-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.card-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.card-modal-content {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.3s ease;
}

.card-modal.is-open .card-modal-content {
  transform: translateY(0) scale(1);
}

.card-modal-media { aspect-ratio: 16 / 10; }
.card-modal-media .card-media { width: 100%; height: 100%; aspect-ratio: unset; }

.card-modal-body { padding: 1.75rem; }

.card-modal-body h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.6rem 0 1rem;
}

.card-modal-body p {
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 3rem 6vw;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
  position: relative;
  width: min(90vw, 960px);
  aspect-ratio: 16 / 9;
  z-index: 1;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.lightbox.is-open .lightbox-content {
  transform: scale(1);
}

.lightbox-frame { width: 100%; height: 100%; background: #000; }
.lightbox-frame iframe { width: 100%; height: 100%; border: 0; }

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.4rem;
  cursor: pointer;
}
