/* ═══════════════════════════════════════════════════════════
   CREATIVE ENHANCEMENTS — Cinegma Films
   Features: Page Transitions, Parallax DOF, Sound Toggle,
   Color Grade Switcher, Cursor Spotlight, Now Showing Marquee
   ═══════════════════════════════════════════════════════════ */

/* ── 1. CINEMATIC PAGE TRANSITIONS ── */
#pageTransition {
  position: fixed; inset: 0; z-index: 11000;
  pointer-events: none;
}
#pageTransition .pt-bar {
  position: absolute; left: 0; right: 0;
  height: 0; background: #060606;
  transition: height 0.45s cubic-bezier(.7,0,.3,1);
  z-index: 2;
}
#pageTransition .pt-top { top: 0; }
#pageTransition .pt-bottom { bottom: 0; }
#pageTransition .pt-flash {
  position: absolute; inset: 0;
  background: rgba(240,236,228,0.06);
  opacity: 0; z-index: 1;
  transition: opacity 0.15s;
}

/* Leave: bars close in */
#pageTransition.active .pt-bar { height: 52vh; }
#pageTransition.active .pt-flash { opacity: 1; }

/* Enter: bars open out */
#pageTransition.enter .pt-bar { height: 52vh; }
#pageTransition.enter {
  animation: ptEnter 0.55s cubic-bezier(.3,0,.7,1) forwards;
}
@keyframes ptEnter {
  0% { opacity: 1; }
  100% { opacity: 1; }
}
#pageTransition.enter .pt-bar {
  animation: ptBarsOpen 0.55s cubic-bezier(.3,0,.7,1) forwards;
}
@keyframes ptBarsOpen {
  0% { height: 52vh; }
  100% { height: 0; }
}

/* ── 4. PARALLAX DEPTH-OF-FIELD ── */
@media (hover: hover) and (pointer: fine) {
  #hero .hero-eyebrow,
  #hero .hero-title,
  #hero .hero-sub,
  #hero .hero-badges,
  #hero .hero-ctas {
    will-change: transform;
    transition: transform 0.15s ease-out;
  }
}

/* ── 5. SOUND TOGGLE BUTTON ── */
#soundToggle {
  position: fixed; bottom: 32px; left: 32px; z-index: 460;
  display: flex; align-items: center; gap: 8px;
  background: rgba(8,8,8,0.85);
  border: 1px solid rgba(240,236,228,0.15);
  color: rgba(240,236,228,0.45);
  padding: 10px 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
#soundToggle:hover {
  color: rgba(240,236,228,0.8);
  border-color: rgba(240,236,228,0.3);
}
#soundToggle.sound-on {
  color: var(--gold, #ff7f11);
  border-color: rgba(255,127,17,0.4);
}
#soundToggle.sound-on .sound-off-line { display: none; }
#soundToggle .sound-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}
@media (hover: none), (pointer: coarse) {
  #soundToggle { display: none; }
}

/* ── 6. COLOR GRADE SWITCHER ── */
#gradeSwitcher {
  position: fixed; top: 50%; right: 0; z-index: 480;
  transform: translateY(-50%);
  display: flex; align-items: center;
  flex-direction: row-reverse;
}
.gs-toggle {
  background: rgba(8,8,8,0.85);
  border: 1px solid rgba(240,236,228,0.15);
  border-right: none;
  color: rgba(240,236,228,0.45);
  padding: 12px 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.3s, border-color 0.3s;
}
.gs-toggle:hover { color: rgba(240,236,228,0.8); border-color: rgba(240,236,228,0.3); }
.gs-panel {
  background: rgba(8,8,8,0.95);
  border: 1px solid rgba(240,236,228,0.12);
  border-right: none;
  padding: 16px 18px;
  opacity: 0; pointer-events: none;
  transform: translateX(10px);
  transition: opacity 0.3s, transform 0.3s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#gradeSwitcher.open .gs-panel {
  opacity: 1; pointer-events: all;
  transform: translateX(0);
}
.gs-title {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(240,236,228,0.4);
  margin-bottom: 12px;
  font-family: 'DM Sans', sans-serif;
}
.gs-options { display: flex; flex-direction: column; gap: 4px; }
.gs-option {
  background: none; border: 1px solid rgba(240,236,228,0.08);
  color: rgba(240,236,228,0.5);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}
.gs-option:hover { color: var(--white, #f0ece4); border-color: rgba(240,236,228,0.3); }
.gs-option.active {
  color: var(--gold, #ff7f11);
  border-color: rgba(255,127,17,0.4);
  background: rgba(255,127,17,0.06);
}

/* Color grade body filters */
body[data-grade="teal"]::after {
  background: radial-gradient(ellipse 92% 82% at 50% 48%, transparent 54%, var(--grade-vignette, rgba(0,30,40,.3)) 100%) !important;
}
body[data-grade="noir"] {
  filter: var(--grade-filter, none);
}
body[data-grade="noir"]::after {
  background: radial-gradient(ellipse 92% 82% at 50% 48%, transparent 54%, var(--grade-vignette, rgba(0,0,0,.45)) 100%) !important;
}
body[data-grade="arthouse"]::after {
  background: radial-gradient(ellipse 92% 82% at 50% 48%, transparent 54%, var(--grade-vignette, rgba(10,5,0,.35)) 100%) !important;
}
body[data-grade="teal"] section,
body[data-grade="arthouse"] section {
  filter: var(--grade-filter, none);
}
body[data-grade="teal"] nav,
body[data-grade="arthouse"] nav,
body[data-grade="teal"] #pageTransition,
body[data-grade="arthouse"] #pageTransition,
body[data-grade="noir"] #pageTransition {
  filter: none !important;
}
/* Grain opacity linked to grade */
body[data-grade="noir"]::before { opacity: 0.06 !important; }
body[data-grade="arthouse"]::before { opacity: 0.05 !important; }
body[data-grade="teal"]::before { opacity: 0.04 !important; }

/* ── 9. CURSOR SPOTLIGHT ON LAURELS / AWARDS ── */
.cursor-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(
    circle 180px at var(--spot-x, 50%) var(--spot-y, 50%),
    transparent 0%,
    rgba(8,8,8,0.7) 100%
  );
  mix-blend-mode: multiply;
}
.cursor-spotlight.active {
  opacity: 1;
}
/* Dim the section content so spotlight reveals */
#laurels-wall:has(.cursor-spotlight.active),
.aw-grid:has(.cursor-spotlight.active) {
  /* Fallback handled by the overlay itself */
}

@media (max-width: 600px) {
  #gradeSwitcher { display: none; }
}

/* ── 8. OPENING CREDITS (about.html) ── */
.credits-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: #040404;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.credits-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.credits-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.credit-card {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  position: absolute;
}
.credit-card.show {
  opacity: 1;
  transform: translateY(0);
}
.credit-card.hide {
  opacity: 0;
  transform: translateY(-15px);
}
.credit-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.08em;
  color: #f0ece4;
  line-height: 1;
  margin-bottom: 10px;
}
.credit-role {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: rgba(240,236,228,0.5);
  letter-spacing: 0.05em;
}
.credit-divider {
  width: 40px; height: 1px;
  background: rgba(240,236,228,0.25);
  margin: 16px auto 0;
  transform: scaleX(0);
  transition: transform 0.5s ease 0.2s;
}
.credit-card.show .credit-divider {
  transform: scaleX(1);
}
.credits-skip {
  position: absolute;
  bottom: 28px; right: 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,236,228,0.35);
  background: none;
  border: 1px solid rgba(240,236,228,0.15);
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  z-index: 10001;
}
.credits-skip:hover {
  color: rgba(240,236,228,0.7);
  border-color: rgba(240,236,228,0.4);
}
