/* 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: var(--header-radius-mobile, 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(2.45rem, 10.8vw, 3.35rem) !important;
    line-height: .96;
    letter-spacing: -.052em;
    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.18rem, 10.5vw, 2.78rem) !important;
  }

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


  /* Leichter Hintergrund unter dem aufgeklappten Mobilmenü für bessere Lesbarkeit. */
  html body .site-header.menu-open .main-nav {
    width: 100% !important;
    padding-top: 8px !important;
  }

  html body .site-header.menu-open .main-nav ul {
    padding: 8px 14px !important;
    border-radius: 16px !important;
  }

  html body .site-header.menu-open .main-nav a {
    font-size: .96rem !important;
  }
}

/* 4K Studio CMS 0.5.8 – echtes aufklappendes Mobile-Menü */
@media screen and (max-width: 640px) {
  html body .site-header.menu-open,
  html body .site-header.menu-open.is-scrolled {
    height: auto !important;
    min-height: 80px !important;
    overflow: visible !important;
  }

  html body .site-header.menu-open .header-inner,
  html body .site-header.menu-open.is-scrolled .header-inner {
    height: auto !important;
    min-height: 72px !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
    padding-bottom: 12px !important;
    overflow: visible !important;
  }

  html body .site-header.menu-open .main-nav {
    display: block !important;
    order: 10 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
  }

  html body .site-header.menu-open .main-nav ul {
    display: grid !important;
    width: 100% !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 7px 14px !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    border-radius: 14px !important;
    background: rgba(4,10,14,.76) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.06) !important;
    -webkit-backdrop-filter: blur(16px) saturate(130%) !important;
    backdrop-filter: blur(16px) saturate(130%) !important;
  }

  html body .site-header.menu-open .main-nav li + li {
    border-top: 1px solid rgba(255,255,255,.10) !important;
  }

  html body .site-header.menu-open .main-nav a {
    display: block !important;
    padding: 12px 2px !important;
    color: rgba(255,255,255,.94) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.22) !important;
  }

  html[data-theme="light"] body .site-header.menu-open .main-nav ul {
    border-color: rgba(12,20,25,.12) !important;
    background: rgba(255,255,255,.90) !important;
    box-shadow: 0 12px 30px rgba(12,20,25,.14), inset 0 1px 0 rgba(255,255,255,.88) !important;
  }

  html[data-theme="light"] body .site-header.menu-open .main-nav li + li {
    border-top-color: rgba(12,20,25,.09) !important;
  }

  html[data-theme="light"] body .site-header.menu-open .main-nav a {
    color: #11161a !important;
    text-shadow: none !important;
  }
}

/* 4K Studio CMS 0.5.9 – hellerer Glas-Look für den mobilen Header */
@media screen and (max-width: 640px) {
  html body .site-header .header-inner,
  html body .site-header.is-scrolled .header-inner {
    background: rgba(10, 24, 32, .56) !important;
    border-color: rgba(255,255,255,.23) !important;
    box-shadow:
      0 14px 36px rgba(0,0,0,.18),
      inset 0 1px 0 rgba(255,255,255,.14),
      inset 0 -1px 0 rgba(255,255,255,.03) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.08) !important;
    backdrop-filter: blur(24px) saturate(160%) brightness(1.08) !important;
  }

  html body .site-header.is-scrolled .header-inner {
    background: rgba(10, 24, 32, .64) !important;
  }

  html body .site-header.menu-open .header-inner,
  html body .site-header.menu-open.is-scrolled .header-inner {
    background: rgba(10, 24, 32, .62) !important;
    border-color: rgba(255,255,255,.24) !important;
    box-shadow:
      0 18px 44px rgba(0,0,0,.20),
      inset 0 1px 0 rgba(255,255,255,.15) !important;
    -webkit-backdrop-filter: blur(26px) saturate(165%) brightness(1.08) !important;
    backdrop-filter: blur(26px) saturate(165%) brightness(1.08) !important;
  }

  html body .site-header.menu-open .main-nav ul {
    background: rgba(4, 14, 20, .43) !important;
    border-color: rgba(255,255,255,.17) !important;
    box-shadow:
      0 10px 28px rgba(0,0,0,.16),
      inset 0 1px 0 rgba(255,255,255,.08) !important;
    -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
    backdrop-filter: blur(20px) saturate(145%) !important;
  }

  html body .theme-toggle {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
  }

  html[data-theme="light"] body .site-header .header-inner,
  html[data-theme="light"] body .site-header.is-scrolled .header-inner,
  html[data-theme="light"] body .site-header.menu-open .header-inner,
  html[data-theme="light"] body .site-header.menu-open.is-scrolled .header-inner {
    background: rgba(255,255,255,.66) !important;
    border-color: rgba(255,255,255,.72) !important;
    box-shadow:
      0 14px 36px rgba(25,37,44,.12),
      inset 0 1px 0 rgba(255,255,255,.92) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
  }

  html[data-theme="light"] body .site-header.menu-open .main-nav ul {
    background: rgba(255,255,255,.54) !important;
    border-color: rgba(15,25,30,.10) !important;
    box-shadow:
      0 10px 28px rgba(20,34,42,.10),
      inset 0 1px 0 rgba(255,255,255,.88) !important;
  }

  html[data-theme="light"] body .site-header .menu-toggle,
  html[data-theme="light"] body .site-header .theme-toggle {
    color: #11161a !important;
  }

  html[data-theme="light"] body .site-header .theme-toggle {
    background: rgba(20,30,36,.05) !important;
    border-color: rgba(20,30,36,.12) !important;
  }
}

