/* ============================================================================
   DVP Home v2 — "The Premiere"
   Additive layer over home.css. Two signature moves:
     (1) Opening Title Sequence  — a directed cold-open on black.
     (2) Director's Monitor hero — the hero framed as a reference monitor
         (bezel, corner brackets, running timecode, REC dot, waveform, scanline).
   Plus cinematic image washes behind Services / Tools / About.
   Nothing here is required by the base page; this file only styles the extra
   premiere chrome the homepage adds (title sequence, monitor HUD, dividers,
   stat counters, washes). Load AFTER home.css.
   ========================================================================== */

:root {
  --v2-accent: #ff7338;
  --v2-pink: #ff2d78;
  --v2-teal: #39f5d4;
  --v2-bezel: #03060b;
}

/* Prevent a scrollbar flash while the title sequence covers the screen. */
body.ts-lock { overflow: hidden; }

/* ============================================================================
   1. OPENING TITLE SEQUENCE
   Full-screen black overlay that plays ONCE, then removes itself (JS adds
   .is-done, which fades it out; JS then sets [hidden]).
   ========================================================================== */
.title-sequence {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, #05080d 0%, #000 70%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.title-sequence[hidden] { display: none; }

/* film-gate flicker + faint grain while the sequence plays */
.title-sequence::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  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='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: .06;
  animation: tsFlicker 3.6s steps(2) infinite;
}

.ts-ident {
  position: absolute;
  font-family: var(--font-mono);
  letter-spacing: .55em;
  text-transform: uppercase;
  font-size: clamp(9px, 1.5vw, 14px);
  color: rgba(247, 239, 225, .82);
  padding-left: .55em;
  opacity: 0;
  animation: tsIdent 2.1s ease forwards .35s;
}

.ts-title {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 10vw, 150px);
  line-height: .92;
  letter-spacing: .02em;
  color: #fff;
  text-align: center;
  max-width: 94vw;
  padding-inline: 3vw;
  opacity: 0;
  text-shadow: 0 0 60px rgba(255, 115, 56, .25);
  animation: tsTitle 2.4s cubic-bezier(.16, 1, .3, 1) forwards 1.9s;
}
.ts-title small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(10px, 1.5vw, 15px);
  letter-spacing: .42em;
  color: var(--v2-accent);
  margin-top: 1.1em;
  opacity: 0;
  animation: tsFade 1s ease forwards 3.1s;
}

/* the anamorphic flare that wipes across as the title resolves */
.ts-flare {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 62vh;
  transform: translateY(-50%) scaleX(.12);
  background: url("../images/home-v2/hero-flare.jpg") center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: tsFlare 1.6s ease-out forwards 1.75s;
}

.title-sequence.is-done { animation: tsExit .85s ease forwards; }

/* Skip button — always give users an out. */
.ts-skip {
  position: absolute;
  right: clamp(16px, 4vw, 44px);
  bottom: clamp(16px, 4vw, 40px);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(247, 239, 225, .55);
  background: transparent;
  border: 1px solid rgba(247, 239, 225, .22);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  opacity: 0;
  animation: tsFade .6s ease forwards 1.2s;
  transition: color .2s, border-color .2s;
}
.ts-skip:hover { color: #fff; border-color: var(--v2-accent); }

@keyframes tsIdent { 0% { opacity: 0; letter-spacing: .8em; } 22% { opacity: 1; letter-spacing: .55em; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tsTitle { 0% { opacity: 0; letter-spacing: .45em; filter: blur(16px); transform: scale(1.06); } 45% { opacity: 1; } 100% { opacity: 1; letter-spacing: .02em; filter: blur(0); transform: scale(1); } }
@keyframes tsFlare { 0% { opacity: 0; transform: translateY(-50%) scaleX(.08); } 35% { opacity: .95; } 100% { opacity: 0; transform: translateY(-50%) scaleX(1.35); } }
@keyframes tsFade { to { opacity: 1; } }
@keyframes tsExit { to { opacity: 0; visibility: hidden; } }
@keyframes tsFlicker { 0%,100% { opacity: .05; } 50% { opacity: .085; } }

/* ============================================================================
   2. DIRECTOR'S MONITOR HERO
   Applied to <section class="edit-bay edit-bay--v2">. Adds a cinematic photo
   plate behind the carousel, a monitor bezel, corner brackets, HUD, safe-area
   guides and a scanline. All chrome is pointer-events:none so the playable
   cards underneath stay clickable.
   ========================================================================== */

/* cinematic photo plate behind everything in the hero */
.edit-bay--v2 .monitor-plate {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../images/home-v2/hero-plate.jpg") center / cover no-repeat;
  opacity: .38;
  filter: saturate(1.05) contrast(1.02);
  animation: heroPlateDrift 32s ease-in-out infinite alternate;
}
.edit-bay--v2 .monitor-plate-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.edit-bay--v2 .monitor-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2,3,6,.55), rgba(2,3,6,.35) 45%, rgba(1,2,4,.85));
}
@keyframes heroPlateDrift { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.12) translateY(-1.5%); } }

/* the bezel: a dark frame ring + luminous inner edge */
.monitor-chrome {
  position: absolute;
  inset: clamp(10px, 1.4vw, 20px);
  z-index: 19;
  pointer-events: none;
  border-radius: 18px;
  border: 1px solid rgba(255, 115, 56, .20);
  box-shadow:
    0 0 0 clamp(9px, 1.2vw, 16px) var(--v2-bezel),   /* the physical bezel */
    0 0 0 calc(clamp(9px,1.2vw,16px) + 1px) rgba(255,115,56,.10),
    inset 0 0 70px rgba(255, 115, 56, .05),
    inset 0 0 2px rgba(255, 255, 255, .10);
}

/* corner focus brackets */
.monitor-chrome::before,
.monitor-chrome::after {
  content: "";
  position: absolute;
  width: 34px; height: 34px;
  border: 2px solid rgba(255, 115, 56, .55);
}
.monitor-chrome::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.monitor-chrome::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* HUD layer — real DOM, above the bezel */
.monitor-hud {
  position: absolute;
  inset: clamp(10px, 1.4vw, 20px);
  z-index: 21;
  pointer-events: none;
  font-family: var(--font-mono);
  color: rgba(247, 239, 225, .78);
}
.monitor-hud > * { position: absolute; }

.hud-rec {
  top: 20px; left: 24px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}
.hud-rec .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff2d78; box-shadow: 0 0 10px #ff2d78;
  animation: recBlink 1.4s steps(1) infinite;
}
@keyframes recBlink { 0%,60% { opacity: 1; } 61%,100% { opacity: .25; } }

.hud-tc {
  top: 20px; right: 24px;
  font-size: 12px; letter-spacing: .12em;
  color: var(--v2-accent);
}
.hud-tc b { color: #fff; font-weight: 600; }

.hud-meta {
  bottom: 18px; left: 24px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(247, 239, 225, .5);
}

/* corner waveform readout */
.hud-scope {
  bottom: 16px; right: 22px;
  width: 116px; height: 46px;
  border: 1px solid rgba(255, 115, 56, .28);
  border-radius: 6px;
  background: url("../images/home-v2/accent-waveform.jpg") center / cover;
  opacity: .9;
  box-shadow: inset 0 0 18px rgba(0,0,0,.6);
}
.hud-scope::after {
  content: "WFM";
  position: absolute; top: 3px; left: 6px;
  font-size: 8px; letter-spacing: .2em; color: rgba(247,239,225,.6);
}

/* safe-area guide */
.monitor-safe {
  position: absolute;
  inset: clamp(48px, 7vw, 90px);
  z-index: 20;
  pointer-events: none;
  border: 1px dashed rgba(247, 239, 225, .10);
  border-radius: 4px;
}

/* scanline sweep */
.monitor-scan {
  position: absolute;
  inset: clamp(10px, 1.4vw, 20px);
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  border-radius: 18px;
}
.monitor-scan::before {
  content: "";
  position: absolute;
  left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg, transparent, rgba(71, 239, 255, .05) 50%, transparent);
  animation: scanSweep 7s linear infinite;
}
@keyframes scanSweep { from { top: -34%; } to { top: 100%; } }

@media (max-width: 720px) {
  .hud-scope, .monitor-safe { display: none; }
  .monitor-chrome { border-radius: 12px; }
}

/* ============================================================================
   3. CINEMATIC IMAGE WASHES for content sections
   Subtle photographic depth behind text-heavy bands. Kept low-opacity and
   masked so copy stays readable.
   ========================================================================== */
.bay-lanes, .treatment-map, .about-bay { position: relative; isolation: isolate; }

.bay-lanes::after,
.treatment-map::after,
.about-bay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  opacity: .06;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000, transparent 78%);
  pointer-events: none;
}
/* Washes bumped from "invisible" to "felt" — still readable over them. */
.bay-lanes::after { background-image: url("../images/home-v2/tex-edit-bay.jpg"); opacity: .14; }
.treatment-map::after { background-image: url("../images/home-v2/tex-tools-bg.jpg"); opacity: .16; }
.about-bay::after { background-image: url("../images/home-v2/tex-about.jpg"); opacity: .16; }

/* Atmospheric wash behind the AI-reel / featured-spot bands too. */
.feature-reel { position: relative; isolation: isolate; }
.feature-reel::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: url("../images/home-v2/hero-atmos.jpg") center / cover;
  opacity: .12;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 95% 80% at 70% 50%, #000, transparent 82%);
  mask-image: radial-gradient(ellipse 95% 80% at 70% 50%, #000, transparent 82%);
  pointer-events: none;
}

/* vectorscope accent dropped next to a heading */
.v2-scope-accent {
  display: inline-block;
  width: clamp(38px, 5vw, 58px); height: clamp(38px, 5vw, 58px);
  border-radius: 50%;
  background: url("../images/home-v2/accent-vectorscope.jpg") center / cover;
  box-shadow: 0 0 24px rgba(255, 45, 120, .3);
  vertical-align: middle;
  margin-left: 16px;
  animation: scopeSpin 26s linear infinite;
}
@keyframes scopeSpin { to { transform: rotate(360deg); } }

/* ============================================================================
   5. FILM-STRIP SECTION DIVIDERS
   Thin sprocket strip that carries the cinema motif down the page.
   Insert <div class="film-divider"></div> between sections.
   ========================================================================== */
.film-divider {
  height: 38px;
  position: relative;
  background: #04070d;
  overflow: hidden;
  border-top: 1px solid rgba(255, 115, 56, .10);
  border-bottom: 1px solid rgba(255, 115, 56, .10);
}
.film-divider::before,
.film-divider::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 9px;
  background-image: radial-gradient(rgba(247, 239, 225, .16) 0 42%, transparent 46%);
  background-size: 28px 9px;
  background-repeat: repeat-x;
}
.film-divider::before { top: 7px; }
.film-divider::after { bottom: 7px; }

/* ============================================================================
   6. STAT COUNTERS — number pops + glows as it counts up (JS drives the value)
   ========================================================================== */
.stat-tile strong {
  font-variant-numeric: tabular-nums;
  transition: text-shadow .4s ease;
}
.stat-tile.counting strong { text-shadow: 0 0 22px rgba(255, 115, 56, .5); }

/* ============================================================================
   7. ABOUT — cinematic glow on the portrait
   ========================================================================== */
.about-bay .portrait-frame .cell img {
  filter: saturate(1.04) contrast(1.02) drop-shadow(0 22px 50px rgba(255, 115, 56, .18));
}

/* ============================================================================
   4. SCROLL REVEAL
   Sections fade + rise as they enter. JS adds .rv-in.
   ========================================================================== */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }
.rv.rv-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .title-sequence,
  .ts-ident, .ts-title, .ts-title small, .ts-flare, .ts-skip,
  .monitor-plate, .monitor-scan::before, .hud-rec .dot,
  .rv { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .title-sequence { display: none !important; }
}
