/*
 * AI Videos v6.7 overrides
 *
 * This stylesheet builds on top of v5.8 and v6.5.  It preserves the thin
 * header and hero rails while improving the mobile drawer behaviour,
 * adjusting section spacing and transitions, tuning film‑strip animations,
 * refining card interactions, scaling the prompt generator heading, and
 * styling internal pages.  These rules load after the v6.5 layer and
 * override only specific pieces of the layout.
 */

/* ===================== Mobile Drawer Overlay ===================== */
/* Ensure the entire drawer system sits above all content when open. */
.mobile-drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 90000;
}
.mobile-drawer.open {
  display: block;
}
/* Dim and blur the page behind the drawer */
.mobile-drawer .overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 90000;
}
.mobile-drawer.open .overlay {
  opacity: 1;
}
/* The actual navigation panel */
.mobile-drawer .panel {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-height: calc(100svh - var(--header-h));
  overflow-y: auto;
  background: var(--aiv-yellow);
  color: #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 90001;
}
.mobile-drawer .panel .drawer-head img {
  height: 60px;
}
.mobile-drawer .panel .close {
  background: #000;
  color: var(--aiv-yellow);
  border: none;
}
.mobile-drawer .menu-items a {
  display: block;
  color: #000;
  font-weight: 900;
  font-size: 22px;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  text-decoration: none;
}
.mobile-drawer .menu-items a:hover {
  background: rgba(0, 0, 0, 0.06);
}
/* Lock page scrolling when nav is open */
html.nav-open, body.nav-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* ===================== Section Layout & Transitions ===================== */
/* Slightly tighter vertical spacing compared to the base 88px */
.section {
  padding: 72px 0;
}
@media (max-width: 900px) {
  .section {
    padding: 60px 0;
  }
}
/* Fade from hero into intro to soften the seam */
#intro {
  position: relative;
}
#intro::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.75));
  pointer-events: none;
  z-index: 1;
}
/* Centre tagline under the intro heading */
#intro .intro-tagline {
  margin-top: 12px;
  color: #cfcfcf;
  font-size: clamp(14px, 2vw, 20px);
}

/* ===================== Film‑Strip Tweaks ===================== */
/* Adjust rail speed and offset per breakpoint to give breathing room */
:root {
  --film-speed: 16s;
  --rail-bottom-y: calc(92svh + (2 * var(--film-rail)));
}
@media (max-width: 1024px) {
  :root {
    --film-speed: 14s;
    --rail-bottom-y: calc(92svh + (2 * var(--film-rail)));
  }
}
@media (max-width: 640px) {
  :root {
    --film-speed: 11s;
    --rail-bottom-y: calc(95svh + (2 * var(--film-rail)));
  }
}
/* Apply the computed duration to features rails */
#features::before,
#features::after {
  animation-duration: var(--film-speed);
}

/* ===================== Card Hover (desktop only) ===================== */
@media (hover: hover) {
  .card {
    transition: transform 0.18s, box-shadow 0.18s;
  }
  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

/* ===================== Generator Title Scaling ===================== */
#generator .section-title {
  font-size: clamp(28px, 4vw, 64px);
  line-height: 1.1;
}

/* ===================== Dark Header on Internal Pages ===================== */
body:not(.home) .site-header {
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
body:not(.home) .site-header .menu-items li a {
  color: #fff;
}
body:not(.home) .site-header .menu-items li a:hover {
  color: var(--aiv-yellow);
}
body:not(.home) .site-header .hamburger {
  border-color: var(--aiv-yellow);
  background: var(--aiv-yellow);
}

/* ===================== Lazy Loading ===================== */
img,
iframe {
  /* Let browsers lazy-load above-the-fold images/iframes where supported */
  loading: lazy;
}
