/* ══════════════════════════════════════════════════════════════════════════
   CINEMATIC.CSS — AES Audiovisual  |  Film-grade visual layer
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── CINEMATIC INTRO ──────────────────────────────────────────────────── */
#cin-intro {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: all;
}
#cin-intro.cin-exit {
  animation: cin-intro-exit 0.9s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes cin-intro-exit {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 1; transform: scale(1.015); }
  100% { opacity: 0; transform: scale(1.03); pointer-events: none; }
}

/* letterbox bars that retract */
.cin-bar-top,
.cin-bar-bottom {
  position: absolute;
  left: 0; right: 0;
  background: #000;
  z-index: 2;
}
.cin-bar-top    { top: 0;    height: 20%;  animation: cin-bar-top    0.7s cubic-bezier(0.76,0,0.24,1) 0.85s forwards; }
.cin-bar-bottom { bottom: 0; height: 20%;  animation: cin-bar-bottom 0.7s cubic-bezier(0.76,0,0.24,1) 0.85s forwards; }
@keyframes cin-bar-top    { to { height: 0; } }
@keyframes cin-bar-bottom { to { height: 0; } }

/* logo */
.cin-logo-wrap {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.cin-logo-img {
  height: 72px;
  opacity: 0;
  filter: drop-shadow(0 0 40px rgba(255,107,0,0.9)) brightness(1.1);
  animation: cin-logo-in 0.6s ease 0.15s forwards;
}
@keyframes cin-logo-in {
  from { opacity: 0; transform: scale(0.82) translateY(8px); filter: drop-shadow(0 0 0px rgba(255,107,0,0)) brightness(1); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   filter: drop-shadow(0 0 40px rgba(255,107,0,0.9)) brightness(1.1); }
}

/* horizontal line that extends */
.cin-rule {
  width: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 0%, rgba(255,107,0,0.8) 30%, rgba(255,107,0,0.8) 70%, transparent 100%);
  animation: cin-rule-grow 0.55s ease 0.45s forwards;
  box-shadow: 0 0 10px rgba(255,107,0,0.4);
}
@keyframes cin-rule-grow { to { width: 280px; } }

/* subtitle line */
.cin-sub {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255,107,0,0.5);
  opacity: 0;
  animation: cin-sub-in 0.4s ease 0.65s forwards;
}
@keyframes cin-sub-in { to { opacity: 1; } }

/* film counter — corner */
.cin-counter {
  position: absolute;
  bottom: 22%;
  right: 3rem;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: rgba(255,107,0,0.45);
  z-index: 3;
}
.cin-scene-label {
  position: absolute;
  bottom: 22%;
  left: 3rem;
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
  z-index: 3;
}

/* grain on the intro */
#cin-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
  animation: cin-grain 0.4s steps(3) infinite;
  pointer-events: none;
  z-index: 4;
}
@keyframes cin-grain {
  0%   { background-position: 0 0; }
  33%  { background-position: -60px 25px; }
  66%  { background-position: 40px -50px; }
  100% { background-position: 0 0; }
}

/* ─── PAGE ENTRANCE ─────────────────────────────────────────────────────── */
.cin-page-in {
  animation: cin-page-in 0.75s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
@keyframes cin-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── PAGE TRANSITION (exit) ────────────────────────────────────────────── */
#cin-page-trans {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.76,0,0.24,1);
}
#cin-page-trans.active {
  opacity: 1;
  pointer-events: all;
}

/* ─── LETTERBOX BARS (permanent cinematic crop) ─────────────────────────── */
#cin-letterbox-top,
#cin-letterbox-bottom {
  position: fixed;
  left: 0; right: 0;
  height: 0;
  background: #000;
  z-index: 99990;
  pointer-events: none;
  transition: height 0.45s cubic-bezier(0.76,0,0.24,1);
}
#cin-letterbox-top    { top: 0; }
#cin-letterbox-bottom { bottom: 0; }
body.cin-transitioning #cin-letterbox-top,
body.cin-transitioning #cin-letterbox-bottom { height: 6vh; }

/* ─── VIGNETTE ──────────────────────────────────────────────────────────── */
#cin-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(
    ellipse 90% 90% at 50% 50%,
    transparent 50%,
    rgba(0,0,0,0.52) 100%
  );
}

/* ─── AMBIENT SPOTLIGHT — disabled ──────────────────────────────────────── */
#cin-spotlight { display: none; }

/* ─── ENHANCED HERO ANIMATIONS ──────────────────────────────────────────── */
/* hero comes into focus on load */
.cin-hero-blur .hero-content,
.cin-hero-blur.hero-content,
.cin-page-hero-blur > .hero-tag,
.cin-page-hero-blur > h1,
.cin-page-hero-blur > p,
.cin-page-hero-blur > .hero-pills {
  animation: cin-focus-in 1.1s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
@keyframes cin-focus-in {
  from { filter: blur(8px); opacity: 0; transform: scale(0.975) translateY(12px); }
  to   { filter: blur(0);   opacity: 1; transform: scale(1)     translateY(0); }
}

/* staggered focus-in for page hero children */
.cin-page-hero-blur > .hero-tag  { animation-delay: 0.1s; }
.cin-page-hero-blur > h1          { animation-delay: 0.25s; }
.cin-page-hero-blur > p           { animation-delay: 0.45s; }
.cin-page-hero-blur > .hero-pills { animation-delay: 0.6s; }

/* ─── PARALLAX TARGET CLASSES ────────────────────────────────────────────── */
/* applied via JS — no explicit styles needed; transform set dynamically */

/* ─── SCENE NUMBER DECORATION ───────────────────────────────────────────── */
.cin-scene-num {
  position: absolute;
  top: 50%;
  right: -3.5rem;
  transform: translateY(-50%) rotate(90deg);
  font-family: 'Courier New', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: rgba(255,107,0,0.2);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── SCAN LINE EFFECT (sections) ───────────────────────────────────────── */
.cin-scan-target {
  overflow: hidden;
}
.cin-scan-target::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(255,107,0,0.4), transparent);
  transform: translateY(-100%);
  pointer-events: none;
}
.cin-scan-target.cin-scan-active::after {
  animation: cin-scan-sweep 1.4s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
@keyframes cin-scan-sweep {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(10000%); opacity: 0; }
}

/* ─── ENHANCED NOISE (slightly more cinematic grain) ────────────────────── */
.cin-grain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  animation: cin-grain 0.5s steps(2) infinite;
  mix-blend-mode: screen;
}
