/* assets/css/style.css */
/* Minimalistic Redesign - Top Nav - Fade Background */

:root {
  --font-body: 'Inter', system-ui, sans-serif;
  --font-title: 'Cinzel', serif;

  --bg: #000000;
  --text: #ffffff;
  --text-muted: #999999;

  --header-h: 80px;
  --pad: 40px;
  --max-w: 1200px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Prevent 100vw scrollbar */
}

/* Ensure content pushes footer down */
.page,
.main-wrapper,
.hero,
.home-split {
  /* No special flex needed here if body handles direction, 
     but we need ONE element to grow. 
     Since structure varies (index vs imprint), let's use margin-top: auto on footer provided body is flex.
  */
}

/* Background Image Container - Fixed & Faded via JS */
.bg-fixed {
  position: fixed;
  inset: 0;
  background-image: url('../img/background_marmor.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  /* Parallax feel */
  z-index: -2;
  transition: opacity 0.1s linear;
}

/* Overlay for text readability */
.overlay-fixed {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  /* Slightly darker */
  backdrop-filter: blur(20px);
  /* Strong blur */
  -webkit-backdrop-filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

/* ... */
.logo {
  justify-self: center;
  grid-column: 2;
  display: block;
  transition: all 0.3s ease;
  line-height: 0;
  width: fit-content;
  margin: 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

/* Utility: Colorize on Hover */
.colorize-on-hover {
  filter: grayscale(100%);
  transition: filter 0.5s ease, transform 0.5s ease;
}

.colorize-on-hover:hover {
  filter: grayscale(0%);
}

/* Homepage Parallax */
.parallax-section {
  min-height: 80vh;
  /* width: 100%; Reverted to full width */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  margin-bottom: 40px;
  position: relative;
}

.parallax-section.left {
  background-position: left center;
}

.parallax-section.right {
  background-position: right center;
}

.parallax-section.center {
  background-position: center center;
}

.parallax-section.center {
  background-position: center center;
}

/* Mobile: Disable fixed background for performance/support */
@media (max-width: 768px) {
  .parallax-section {
    background-attachment: scroll;
    min-height: 50vh;
  }
}

/* Homepage Split Layout */
.home-split {
  display: flex;
  margin-bottom: 120px;
  /* Space between sections */
  align-items: stretch;
  /* Reduced height (80% of original 90vh) -> now 60vh */
  min-height: 60vh;
  width: 100%;
}

.home-split.reversed {
  flex-direction: row-reverse;
}

.split-img {
  flex: 1.5;
  /* Wider / Original Ratio */
  min-height: 60vh;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.split-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
}

.big-btn {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 32px;
  color: var(--text);
  border: 1px solid var(--text);
  padding: 24px 48px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
  background: transparent;
  cursor: pointer;
}

.big-btn:hover {
  background: var(--text);
  color: var(--bg);
}

@media (max-width: 900px) {

  .home-split,
  .home-split.reversed {
    flex-direction: column;
  }

  .split-img,
  .split-content {
    flex: auto;
    width: 100%;
    min-height: 50vh;
    background-attachment: scroll; /* Fix for mobile zoom/blur issue */
  }

  .split-content {
    padding: 40px 20px;
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}



/* Top Navigation */
/* Header: Logo Center, Hamburger Left */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  /* Taller initially for big logo */
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  /* Left (Burger) | Center (Logo) | Right (Spacer) */
  align-items: center;
  padding: 0 var(--pad);
  z-index: 100;
  transition: all 0.3s ease;
  background: transparent;
}

.site-header.scrolled {
  height: 60px;
  /* Shrinks on scroll */
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.logo {
  justify-self: center;
  grid-column: 2;
  display: block;
  transition: all 0.3s ease;
  line-height: 0;
  width: min-content;
  /* Strict width */
  margin: 0 auto;
  pointer-events: auto;
  /* Allow clicks */
}

.header-controls {
  justify-self: end;
  display: flex;
  gap: 15px;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  color: white;
  /* Always white in header initial state? or dynamic? */
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.site-header.scrolled .icon-btn,
body.light-mode .site-header.scrolled .icon-btn {
  color: var(--text);
  /* Black/White depending on mode when scrolled */
}

/* Header Text/Icons are white by default on dark bg */
.icon-btn {
  color: #fff;
}

body.light-mode .icon-btn {
  color: #000;
}

/* In light mode light bg? No, header is transparent */

/* Wait. Header is transparent. 
   Dark Mode: White text.
   Light Mode: Black text? 
*/

/* Force consistent colors based on header state */
.site-header .icon-btn,
.site-header .menu-toggle {
  color: #fff;
}

body.light-mode .site-header .icon-btn,
body.light-mode .site-header .menu-toggle {
  color: #000;
}

.site-header.scrolled .icon-btn,
.site-header.scrolled .menu-toggle {
  color: #fff;
}

/* Scrolled is dark bg */
body.light-mode .site-header.scrolled .icon-btn,
body.light-mode .site-header.scrolled .menu-toggle {
  color: #000;
}

/* Scrolled light is white bg? No wait. */

/* Let's simplify. 
   Default (Transparent): White (Dark Mode), Black (Light Mode).
   Scrolled (Solid): White (Dark Mode), Black (Light Mode).
*/
.site-header .icon-btn,
.site-header .menu-toggle {
  color: #fff;
}

body.light-mode .site-header .icon-btn,
body.light-mode .site-header .menu-toggle {
  color: #000;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

.site-header.scrolled .icon-btn,
.site-header.scrolled .menu-toggle {
  color: #fff;
}

body.light-mode .site-header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

body.light-mode .site-header.scrolled .icon-btn,
body.light-mode .site-header.scrolled .menu-toggle {
  color: #000;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.logo img {
  height: 80px !important;
  /* Start big */
  width: auto;
  display: block;
  transition: height 0.3s ease;
}

.site-header.scrolled .logo img {
  height: 50px !important;
  /* Shrink on scroll */
}

/* Hamburger - Left Side */
.menu-toggle {
  grid-column: 1;
  /* Left column */
  justify-self: start;
  display: flex;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 10px 0;
  pointer-events: auto;
  /* Enable clicks */
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: all 0.2s;
}

/* Sidebar Drawer - Opens from LEFT */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  /* Left side now */
  bottom: 0;
  width: 320px;
  max-width: 80vw;
  background: #080808;
  z-index: 201;
  /* Higher than header z-index (100) */
  transform: translateX(-100%);
  /* Start off-screen left */
  /* transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); */
  /* Removed default transition to force visibility first? No, keep transition */
  transition: transform 0.4s ease;
  border-right: 1px solid var(--border);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-drawer.is-open {
  transform: translateX(0);
}

/* Sidebar Header inside Drawer (Close btn logic) */
.sidebar-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 40px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.drawer-close:hover {
  color: var(--text);
}

.drawer-link {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s, padding-left 0.2s;
  display: block;
}

.drawer-link:hover {
  color: var(--text);
  padding-left: 10px;
  border-left: 2px solid var(--text);
}

/* Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  /* Behind drawer (201) but above header (100) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================
   GALLERY / GRID FIX
   ========================================= */

/* Gallery Chips */
.gallery__bar {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover,
.chip.is-active {
  color: var(--text);
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Hard Grid for Images - Aspect Ratio */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  /* Force square */
  overflow: hidden;
  background: #111;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Crop to fit square */
  transition: transform 0.5s ease;
  display: block;
}

.tile:hover img {
  transform: scale(1.05);
}

/* Duplicate header CSS removed */

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* Main Content */
.main-wrapper {
  padding-top: calc(var(--header-h) + 60px);
  padding-bottom: 100px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
  position: relative;
  z-index: 1;
}

/* Page Headers (Gallery, Team) */
.page__header {
  margin-bottom: 60px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.h1 {
  font-family: var(--font-title);
  font-size: 48px;
  margin: 0 0 20px 0;
  line-height: 1.1;
}

.subtitle {
  font-size: 16px;
  color: #ccc;
  font-weight: 300;
}

/* Hero Section */
.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 80px;
}

.hero h1,
.hero-title {
  font-family: var(--font-title);
  font-size: 10vw;
  /* Responsive Desktop */
  max-font-size: 150px;
  margin: 0 0 24px 0;
  line-height: 0.95;
}

@media (min-width: 1200px) {

  .hero h1,
  .hero-title {
    font-size: 150px;
  }
}

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 500px;
  font-weight: 300;
}

/* Cards / Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  background: rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
}

.card h3 {
  font-family: var(--font-title);
  font-size: 20px;
  margin-bottom: 10px;
}

.card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.btn {
  display: inline-block;
  border: 1px solid var(--text);
  padding: 14px 28px;
  font-size: 13px;
  text-transform: uppercase;
  font-family: var(--font-body);
  /* Ensure readable font */
  letter-spacing: 0.2em;
  margin-top: 30px;
  transition: all 0.3s;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
  background: transparent;
}

/* Light Mode Override */
body.light-mode {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
}

body.light-mode .site-header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #000;
}

body.light-mode .card,
body.light-mode .tile {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .menu-toggle,
body.light-mode .drawer-close {
  color: #000;
}

body.light-mode .sidebar-drawer {
  background: #fff;
  border-right: 1px solid #eee;
}

/* Light Mode Logo Toggle */
body.light-mode .logo .logo-light {
  display: none;
}

body.light-mode .logo .logo-dark {
  display: block !important;
}

/* Footer Overhaul */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg);
  padding: 60px var(--pad);
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  z-index: 10;
  margin-top: auto;
  /* Sticky footer */
}

body.light-mode .site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-col h4 {
  font-family: var(--font-title);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-link {
  display: block;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--text);
}

.social-bar {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.social-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 0.2s;
}

.social-icon:hover {
  transform: scale(1.1);
  color: var(--text);
}

/* Toggles in Footer */
.footer-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  justify-content: space-between;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

body.light-mode .footer-controls {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.toggle-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: var(--text);
}

.toggle-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 900px) {
  .hero h1 {
    font-size: 42px;
  }

  .footer-controls {
    flex-direction: column;
    gap: 20px;
  }
}
/* ============================================================================
   REDESIGN 2026-09-12 — Hero mit Video-Loop
   Bewusst ans Dateiende gehaengt: gleiche Spezifitaet gewinnt spaeter im
   Cascade, so bleiben die Originalregeln oben unveraendert und rueckbaubar.
   ========================================================================= */

/* Marmor raus. Platzhalter bis das Studio-Bild da ist — bewusst eine Farbe
   und kein Bild, damit nichts laedt, was gleich wieder ersetzt wird. */
.bg-fixed {
  background-image: none;
  background-color: #0d0d0d;
}

body.light-mode .bg-fixed {
  background-color: #f2f0ed;
}

/* --- Hero ------------------------------------------------------------------
   Hoehe < 100vh ist der ganze Trick: der naechste Abschnitt schneidet unten an
   und macht sichtbar, dass gescrollt werden kann.
   svh statt vh, weil iOS Safari bei vh die eingeblendete URL-Leiste ignoriert
   und der Hero beim ersten Scrollen springt. vh bleibt als Fallback davor. */
.hero--video {
  position: relative;
  width: 100%;
  height: 88vh;
  height: 88svh;
  min-height: 420px;
  margin: 0 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

@media (max-width: 768px) {
  .hero--video {
    /* Mobil sind 12% zu wenig, um als Anschnitt gelesen zu werden. */
    height: 85vh;
    height: 85svh;
  }
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
  /* Wird per JS gefadet; transition nur als Sicherheitsnetz, falls JS ausfaellt. */
  will-change: opacity, transform;
}

/* Scrim: bewusst minimal. Frueher lag hier ein Verlauf ueber die ganze Hoehe,
   der das Video sichtbar abgedunkelt hat. Jetzt nur noch ein schmaler Hauch
   oben, damit die Header-Icons auf hellen Frames nicht verschwinden - das
   Video selbst bleibt unangetastet. Lesbarkeit der Schrift macht text-shadow. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.30) 0%,
      rgba(0, 0, 0, 0.10) 18%,
      rgba(0, 0, 0, 0) 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--pad);
}

.hero--video .hero-title {
  font-family: 'Mukadimah', var(--font-title), serif;
  font-weight: normal;
  line-height: 0.8;
  font-size: clamp(64px, 14vw, 180px);
  margin: 0 0 28px 0;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75), 0 0 60px rgba(0, 0, 0, 0.45);
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Scroll-Hinweis --------------------------------------------------------
   Kleiner Strich, der langsam nach unten wandert. Zusammen mit dem Anschnitt
   des naechsten Abschnitts reicht das; ein Pfeil waere zu laut. */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 1px;
  height: 48px;
  overflow: hidden;
  z-index: 1;
  opacity: 0.6;
}

.hero-cue span {
  display: block;
  width: 1px;
  height: 48px;
  background: #fff;
  animation: hero-cue-run 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes hero-cue-run {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* Erster Abschnitt unter der Hero: oben abgesetzt, damit der Anschnitt als
   eigene Flaeche gelesen wird und nicht als Fortsetzung des Videos. */
.hero--video + .home-split {
  margin-top: 0;
  background: var(--bg);
}

/* --- Barrierefreiheit ------------------------------------------------------
   Wer Bewegung reduziert haben will, bekommt das Posterframe und keinen Loop.
   Das JS pausiert das Video zusaetzlich; hier greift es auch ohne JS. */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero-cue { display: none; }
  .hero--video {
    background-image: url('../video/hero-poster.jpg');
    background-size: cover;
    background-position: center;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
  .hero--video { background-image: url('../video/hero-poster-mobile.jpg'); }
}


/* Auf der Startseite wird der main-wrapper sofort wieder geschlossen, damit die
   Hero full-bleed laufen kann. Sein padding-top (header-h + 60px) und
   padding-bottom (100px) standen dann als schwarzer Block ueber dem Video.
   :empty greift hier nicht - zwischen den Tags steht ein Zeilenumbruch. */
.main-wrapper--bare {
  padding: 0;
  margin: 0;
  min-height: 0;
  max-width: none;
}

/* Die Hero sitzt direkt unter dem fixierten Header und laeuft bewusst
   darunter durch - der Header ist transparent, bis er 'scrolled' bekommt. */
.hero--video {
  margin-top: 0;
}


/* ---------------------------------------------------------------------------
   FIX 2026-09-12: Hero-Video und Scrim blieben auf dem iPhone schwarz.
   Ursache: beide lagen auf z-index:-1, und in menu.php liegt ein
   .overlay-fixed mit backdrop-filter:blur(20px) ebenfalls auf z-index:-1.
   Ein Element mit backdrop-filter erzeugt einen Stacking Context und filtert
   alles, was hinter ihm gezeichnet wird - negative z-index-Geschwister
   verschwinden dabei in WebKit. Sichtbar blieb genau das, was positive
   z-index hatte: Schrift, Buttons, Cue.
   Loesung: keine negativen z-index mehr in der Hero. Alles positiv gestapelt.
   ------------------------------------------------------------------------ */
.hero--video {
  z-index: 1;
  isolation: auto;
}

.hero-video  { z-index: 0; }
.hero-scrim  { z-index: 1; }
.hero-content { z-index: 2; }
.hero-cue    { z-index: 2; }

/* Der Blur lag ueber einem Bild - jetzt liegt er ueber einer einzelnen Farbe
   und hat damit keinerlei sichtbare Wirkung mehr, kostet aber auf jedem Frame
   GPU-Zeit. Auf Mobilgeraeten ist ein vollflaechiger backdrop-filter der
   haeufigste Ruckelgrund ueberhaupt. */
.overlay-fixed {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ============================================================================
   INTRO-ANIMATION (nur Startseite)
   Ablauf: Logo gross einblenden -> Stern blitzt einmal -> alles wandert ins
   gepinnte Header-Logo und blendet aus.
   Das Overlay ist per Default display:none. Erst ein Inline-Script im <head>
   setzt html.js-intro - ohne JavaScript passiert also nichts und der Inhalt
   bleibt erreichbar. Genau umgekehrt waere es ein Totalausfall.
   ========================================================================= */
.intro { display: none; }

html.js-intro .intro {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: background-color 700ms ease, opacity 300ms ease;
  will-change: background-color, opacity;
}

/* Scrollen sperren, solange das Intro laeuft. */
html.js-intro,
html.js-intro body { overflow: hidden; }

/* Das echte Header-Logo bleibt unsichtbar, bis das Intro darauf landet -
   sonst sieht man es waehrend des Flugs doppelt. */
html.js-intro .site-header .logo { visibility: hidden; }

.intro-logo {
  position: relative;
  width: min(62vw, 420px);
  aspect-ratio: 512 / 543;
  opacity: 0;
  transform: scale(0.92);
  transform-origin: center center;
  transition: opacity 450ms ease, transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.intro.is-in .intro-logo {
  opacity: 1;
  transform: scale(1);
}

/* Flugphase: laengere, weichere Kurve als beim Einblenden. */
.intro.is-flying .intro-logo {
  /* Die Deckkraft muss VOR der Bewegung bei 0 sein (810ms < 850ms), sonst
     ist das fliegende Logo im Moment der Uebergabe noch sichtbar und poppt,
     wenn das echte Header-Logo freigegeben wird. */
  transition: transform 850ms cubic-bezier(0.65, 0, 0.35, 1),
              opacity 250ms ease 560ms;
}

.intro-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Der Stern liegt deckungsgleich als eigene Ebene ueber dem Logo: gleiche
   Leinwandgroesse wie das Vollbild-Logo, alles ausser dem Stern transparent.
   Dadurch braucht die Positionierung keinerlei Koordinaten im CSS. */
.intro-star {
  opacity: 0;
  transform-origin: 49.8% 17%;
  /* Mittelpunkt des Sterns im Logo */
}

.intro.is-flash .intro-star {
  animation: intro-star-flash 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes intro-star-flash {
  0%   { opacity: 0;    transform: scale(1); filter: none; }
  30%  { opacity: 1;    transform: scale(1.45);
         filter: drop-shadow(0 0 14px rgba(255,255,255,0.95))
                 drop-shadow(0 0 46px rgba(255,255,255,0.7)); }
  60%  { opacity: 0.85; transform: scale(1.1);
         filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)); }
  100% { opacity: 0;    transform: scale(1); filter: none; }
}

/* Zusaetzlicher Lichtstoss hinter dem Stern - gibt dem Blitz Volumen,
   ohne die Kanten der Grafik aufzuweichen. */
.intro-glow {
  position: absolute;
  left: 49.8%;
  top: 17%;
  width: 42%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle closest-side,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.25) 45%,
      rgba(255, 255, 255, 0) 75%);
}

.intro.is-flash .intro-glow {
  animation: intro-glow-burst 620ms ease-out;
}

@keyframes intro-glow-burst {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
  30%  { opacity: 1;   transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.6); }
}

/* Ende: Hintergrund transparent, damit das Video darunter sichtbar wird. */
.intro.is-clearing { background-color: transparent; }
.intro.is-done { opacity: 0; }

/* Light Mode: schwarzes Logo, schwarzer Stern, dunkler Lichtstoss waere
   unsichtbar - daher hier ein abgedunkelter statt aufgehellter Stoss. */
body.light-mode .intro-logo .logo-light { display: none; }
body.light-mode .intro-logo .logo-dark { display: block; }
.intro-logo .logo-dark { display: none; }

body.light-mode .intro-glow {
  background: radial-gradient(circle closest-side,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.12) 45%,
      rgba(0, 0, 0, 0) 75%);
}

body.light-mode .intro.is-flash .intro-star {
  animation: intro-star-flash-dark 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes intro-star-flash-dark {
  0%   { opacity: 0;   transform: scale(1); }
  30%  { opacity: 1;   transform: scale(1.45);
         filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); }
  100% { opacity: 0;   transform: scale(1); }
}

/* Wer Bewegung reduziert haben will, sieht gar kein Intro. Das Script
   ueberspringt dann direkt in den Endzustand. */
@media (prefers-reduced-motion: reduce) {
  html.js-intro .intro { display: none; }
  html.js-intro, html.js-intro body { overflow: auto; }
  html.js-intro .site-header .logo { visibility: visible; }
}
