/* 4K Film Studio – mobile composition (max-width: 640px) */
@media screen and (max-width: 640px) {
  :root {
    --header-h-mobile: 72px;
    --logo-size-mobile: 56px;
  }

  /* Header: intentionally more specific than legacy Customizer CSS. */
  html body .site-header,
  html body .site-header.is-scrolled {
    top: 8px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    height: 80px !important;
    min-height: 80px !important;
    padding: 0 !important;
    background: transparent !important;
  }

  html body.admin-bar .site-header,
  html body.admin-bar .site-header.is-scrolled {
    top: 54px !important;
  }

  html body .site-header .header-inner,
  html body .site-header.is-scrolled .header-inner {
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    padding: 0 14px !important;
    gap: 10px !important;
    border-radius: 22px !important;
  }

  html body .site-header .brand,
  html body .site-header .brand .custom-logo-link {
    height: 100% !important;
  }

  html body .site-header .brand img,
  html body .site-header .brand img.custom-logo,
  html body .site-header .brand .custom-logo-link img,
  html body .site-header.is-scrolled .brand img,
  html body .site-header.is-scrolled .brand img.custom-logo,
  html body .site-header.is-scrolled .brand .custom-logo-link img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: contain !important;
  }

  html body .theme-toggle,
  html body .menu-toggle {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
  }

  html body .menu-toggle {
    font-size: 1.55rem !important;
  }

  /* Hero becomes a separate mobile composition rather than a scaled desktop. */
  html body.home .hero {
    min-height: 100svh;
    place-items: initial;
  }

  html body.home .hero-media::after {
    background:
      linear-gradient(180deg, rgba(2,8,12,.22) 0%, rgba(2,8,12,.12) 26%, rgba(2,8,12,.42) 67%, rgba(2,8,12,.67) 100%),
      linear-gradient(90deg, rgba(2,8,12,.20), rgba(2,8,12,.04), rgba(2,8,12,.18));
    opacity: max(var(--hero-overlay), .68);
  }

  html body.home .hero-media video,
  html body.home .hero-media img {
    object-position: 50% 50%;
  }

  html body.home .hero-content {
    position: absolute;
    z-index: 2;
    top: clamp(210px, 29svh, 300px);
    left: 22px;
    right: 22px;
    width: auto !important;
    padding: 0 !important;
    text-align: center !important;
  }

  html body.home .hero-copy,
  html body.home .hero.hero-left .hero-copy {
    width: 100%;
    max-width: 420px;
    margin: 0 auto !important;
    text-shadow: 0 3px 22px rgba(0,0,0,.68);
  }

  html body.home .hero-kicker {
    display: block;
    max-width: 340px;
    margin: 0 auto 18px;
    font-size: clamp(.66rem, 2.9vw, .78rem);
    line-height: 1.55;
    letter-spacing: .20em;
  }

  html body.home .hero h1 {
    max-width: 390px;
    margin: 0 auto 22px;
    font-size: clamp(3.15rem, 14.2vw, 4.15rem) !important;
    line-height: .91;
    letter-spacing: -.065em;
    text-wrap: balance;
  }

  html body.home .hero p,
  html body.home .hero-left p {
    max-width: 355px;
    margin: 0 auto !important;
    font-size: clamp(.98rem, 4.35vw, 1.08rem) !important;
    line-height: 1.45;
    color: rgba(255,255,255,.88);
  }

  /* Compact cinema invitation, respecting the iPhone safe area. */
  html body.home .sound-toggle.sound-toggle-cinematic {
    position: absolute;
    right: 50% !important;
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    width: calc(100% - 40px) !important;
    min-height: 58px !important;
    padding: 10px 14px !important;
    gap: 12px !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    border-radius: 16px !important;
    background: rgba(7,12,16,.48) !important;
    box-shadow: 0 14px 42px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08) !important;
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    transform: translate(50%,8px) !important;
    font-size: .73rem !important;
    letter-spacing: .13em !important;
  }

  html body.home .sound-toggle.sound-toggle-cinematic.is-visible {
    transform: translate(50%,0) !important;
  }

  html body.home .sound-toggle-line {
    opacity: .78;
  }

  html body.home .sound-toggle-label {
    white-space: nowrap;
  }

  html body.home .scroll-cue {
    display: none !important;
  }

  /* Keep text readable during its timed fade instead of becoming muddy. */
  html body.home .hero-copy.fade-cycle {
    will-change: opacity, transform;
  }
}

@media screen and (max-width: 380px) {
  html body.home .hero-content {
    top: clamp(195px, 27svh, 250px);
    left: 18px;
    right: 18px;
  }

  html body.home .hero h1 {
    font-size: clamp(2.85rem, 14vw, 3.55rem) !important;
  }

  html body.home .sound-toggle.sound-toggle-cinematic {
    width: calc(100% - 28px) !important;
  }
}
