/* ==========================================================================
   SC Salzburg City – Cinematic Intro + HUD-Cookie-Banner
   intro.css · keine Abhängigkeiten

   Aufbau
     1. Schrift (Poppins, selbst gehostet – kein Google-Fonts-Request = DSGVO)
     2. Tokens
     3. Seiten-Zustände (Scroll-Sperre, Reveal der Startseite)
     4. Intro-Layer (Videos, Flash/Whip, HUD, Steuerung, Fortschritt)
     5. HUD-Bausteine (Panel, Buttons, Pill)
     6. Cookie-Banner
     7. Reduzierte Bewegung
   ========================================================================== */

/* 1. Schrift ---------------------------------------------------------------
   Falls eure Seite Poppins schon lädt: diesen Block löschen.
   Tipp: TTF → WOFF2 konvertieren (ca. 60 % kleiner), siehe Checkliste. */
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Poppins-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/Poppins-ExtraBold.ttf') format('truetype'); }

/* 2. Tokens ----------------------------------------------------------------- */
:root {
  --scsc-violet: #3F2B91;
  --scsc-violet-deep: #221E6A;
  --scsc-ink: #0A0620;          /* dunkelster Wert – nie reines Schwarz */
  --scsc-sky: #54B2F5;
  --scsc-sky-light: #83CDFA;
  --scsc-white: #FFFFFF;

  --scsc-sky-rgb: 84 178 245;
  --scsc-ink-rgb: 10 6 32;

  --scsc-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Position der Linsenmitte im Zoom-Clip (Blender-Skript zentriert sie) */
  --lens-x: 50%;
  --lens-y: 50%;

  /* Abstand zum Rand inkl. Notch/Home-Indicator */
  --safe-t: max(16px, env(safe-area-inset-top));
  --safe-r: max(16px, env(safe-area-inset-right));
  --safe-b: max(16px, env(safe-area-inset-bottom));
  --safe-l: max(16px, env(safe-area-inset-left));
}

/* 3. Seiten-Zustände ---------------------------------------------------------- */

/* Während das Intro läuft: kein Scrollen, Seite liegt fertig gerendert darunter */
html.intro-pending,
html.intro-running,
html.intro-pending body,
html.intro-running body {
  overflow: hidden;
}

/* Reveal: Startseite wird über das Intro gehoben und kreisförmig aus der
   Linsenmitte aufgezogen. Ablauf (Werte in px setzt intro.js):
     1. .is-lens     – Seite verkleinert (--site-scale) im Glas, noch unsichtbar
     2. .is-lens-in  – Seite blendet im Glas auf („Website in der Linse“)
     3. .is-open     – Kreis wächst auf Vollbild, Seite auf Originalgröße
   Ohne Zoom-Clip startet Schritt 3 direkt mit Radius 0. */
.scsc-site.is-revealing {
  --reveal-ease: cubic-bezier(.7, 0, .2, 1);
  position: relative;
  z-index: 1001;
  min-height: 100vh;
  background-color: var(--scsc-site-bg, #FFFFFF);
  transform-origin: var(--reveal-x, 50%) var(--reveal-y, 50vh);
  transform: scale(var(--site-scale, 1));
  clip-path: circle(var(--clip-r, 0px) at var(--reveal-x, 50%) var(--reveal-y, 50vh));
  transition:
    clip-path var(--reveal-ms, 1100ms) var(--reveal-ease),
    transform var(--reveal-ms, 1100ms) var(--reveal-ease),
    filter var(--reveal-ms, 1100ms) ease,
    opacity 320ms ease;
  will-change: clip-path, transform;
}
/* Im Glas: leicht abgedunkelt und satter, wie durch eine Linse gesehen */
.scsc-site.is-revealing.is-lens { opacity: 0; filter: brightness(.8) saturate(1.2) contrast(1.05); }
.scsc-site.is-revealing.is-lens.is-lens-in { opacity: 1; }
.scsc-site.is-revealing.is-open { opacity: 1; filter: none; }
.scsc-site.is-revealing.is-instant { transition: none !important; }

/* Glas über der Mini-Seite: Vignette zum Rand, Glanzlicht, violetter Reflex */
.intro-glass {
  position: fixed;
  z-index: 1002;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  background:
    radial-gradient(ellipse 34% 22% at 34% 24%, rgb(255 255 255 / .30), rgb(131 205 250 / .10) 60%, transparent 100%),
    radial-gradient(circle at 74% 78%, rgb(63 43 145 / .40), transparent 32%),
    radial-gradient(circle, transparent 50%, rgb(var(--scsc-ink-rgb) / .45) 80%, rgb(var(--scsc-ink-rgb) / .95) 100%);
  box-shadow:
    inset 0 0 0 2px rgb(131 205 250 / .55),
    inset 0 0 48px 10px rgb(var(--scsc-sky-rgb) / .30);
  transition:
    opacity 320ms ease,
    transform var(--reveal-ms, 1100ms) cubic-bezier(.7, 0, .2, 1);
}
.intro-glass.is-in { opacity: 1; }
.intro-glass.is-open {
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--glass-grow, 4));
  transition:
    opacity calc(var(--reveal-ms, 1100ms) * .6) ease,
    transform var(--reveal-ms, 1100ms) cubic-bezier(.7, 0, .2, 1);
}

/* Leuchtring, der exakt auf der Kreiskante mitläuft */
.intro-ring {
  position: fixed;
  z-index: 1002;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--ring-from, 0));
  box-shadow:
    0 0 0 2px var(--scsc-sky-light),
    0 0 28px 6px rgb(var(--scsc-sky-rgb) / .55),
    inset 0 0 36px 4px rgb(var(--scsc-sky-rgb) / .45);
  transition:
    transform var(--reveal-ms, 1100ms) cubic-bezier(.7, 0, .2, 1),
    opacity 300ms ease calc(var(--reveal-ms, 1100ms) - 250ms);
}
.intro-ring.is-open { transform: translate(-50%, -50%) scale(1); opacity: 0; }

/* 4. Intro-Layer ------------------------------------------------------------ */
.intro { display: none; }

html.intro-pending .intro,
html.intro-running .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  color: var(--scsc-white);
  font-family: var(--scsc-font);
  /* Poster als Hintergrund: sofort sichtbar, auch bevor das Video läuft */
  background: var(--scsc-ink) url('media/poster-16x9.jpg') center / cover no-repeat;
  opacity: 1;
  transition: opacity var(--leave-ms, 400ms) ease;
}
@media (orientation: portrait) {
  html.intro-pending .intro,
  html.intro-running .intro { background-image: url('media/poster-9x16.jpg'); }
}
.intro.is-leaving { opacity: 0 !important; pointer-events: none; }

.intro__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

/* Hauptvideo: beim Whip zoomt und verwischt es Richtung Linsenmitte */
.intro__video--main {
  transform-origin: var(--lens-x) var(--lens-y);
  transition:
    transform 260ms cubic-bezier(.55, 0, 1, .45),
    filter 260ms cubic-bezier(.55, 0, 1, .45);
}
.intro.is-whip .intro__video--main {
  transform: scale(1.22);
  filter: blur(14px) brightness(1.9) saturate(1.3);
}

/* Zoom-Clip: liegt unsichtbar bereit und wird beim Flash-Peak getauscht */
.intro__video--zoom { opacity: 0; }
.intro.is-zooming .intro__video--zoom { opacity: 1; }
.intro.is-zooming .intro__video--main { opacity: 0; }

/* Licht-Flash: am Höhepunkt deckend → der Schnitt ist unsichtbar */
.intro__flash {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--lens-x) var(--lens-y),
    #FFFFFF 0%,
    var(--scsc-sky-light) 22%,
    var(--scsc-sky) 42%,
    var(--scsc-violet) 72%,
    var(--scsc-violet-deep) 100%);
  transition: opacity 340ms cubic-bezier(.2, .7, .3, 1);   /* Ausklingen */
}
.intro.is-whip .intro__flash {
  opacity: 1;
  transition: opacity 240ms cubic-bezier(.7, 0, 1, .6);   /* Aufblitzen */
}

/* Warp-Streifen (Speed-Lines) aus der Bildmitte */
.intro__streaks {
  position: absolute;
  inset: -25%;
  pointer-events: none;
  opacity: 0;
  background: repeating-conic-gradient(from 0deg at var(--lens-x) var(--lens-y),
    transparent 0deg 3.2deg,
    rgb(255 255 255 / .55) 3.4deg 3.7deg,
    transparent 3.9deg 7deg);
  -webkit-mask-image: radial-gradient(circle at var(--lens-x) var(--lens-y), transparent 8%, #000 45%);
          mask-image: radial-gradient(circle at var(--lens-x) var(--lens-y), transparent 8%, #000 45%);
  transform: scale(.6);
  transition: opacity 300ms ease, transform 300ms ease;
}
.intro.is-whip .intro__streaks {
  opacity: .9;
  transform: scale(1.15);
  transition: opacity 180ms ease-in, transform 300ms cubic-bezier(.5, 0, 1, .5);
}

/* HUD-Rahmenecken */
.intro__hud { position: absolute; inset: 0; pointer-events: none; }
.hud-corner {
  position: absolute;
  width: clamp(28px, 4vw, 56px);
  height: clamp(28px, 4vw, 56px);
  border: 0 solid rgb(var(--scsc-sky-rgb) / .8);
}
.hud-corner--tl { top: var(--safe-t); left: var(--safe-l); border-top-width: 2px; border-left-width: 2px; }
.hud-corner--tr { top: var(--safe-t); right: var(--safe-r); border-top-width: 2px; border-right-width: 2px; }
.hud-corner--bl { bottom: var(--safe-b); left: var(--safe-l); border-bottom-width: 2px; border-left-width: 2px; }
.hud-corner--br { bottom: var(--safe-b); right: var(--safe-r); border-bottom-width: 2px; border-right-width: 2px; }

/* Steuerleiste oben: Ton links, Label Mitte, Überspringen rechts */
.intro__bar {
  position: absolute;
  top: calc(var(--safe-t) + 20px);
  left: calc(var(--safe-l) + 20px);
  right: calc(var(--safe-r) + 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.intro__bar .intro__label { margin: 0; }
@media (max-width: 560px) {
  .intro__bar .intro__label { display: none; }
  .intro__bar { top: calc(var(--safe-t) + 12px); left: calc(var(--safe-l) + 8px); right: calc(var(--safe-r) + 8px); }
}

/* Fortschritt des Intros (Game-Menü-Ladebalken) */
.intro__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgb(255 255 255 / .12);
}
.intro__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--scsc-violet), var(--scsc-sky) 60%, var(--scsc-sky-light));
  transform-origin: left center;
  transform: scaleX(0);
}

/* 5. HUD-Bausteine -------------------------------------------------------------
   Abgeschrägte Ecken via clip-path. Weil clip-path auch Outlines abschneidet,
   liegt die Form in .hud-btn__bg – der Button selbst bleibt rechteckig und
   kann einen sichtbaren Fokusrahmen zeigen. */
.hud-btn {
  --cut: 10px;
  --edge: 1.5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  background: none;
  color: var(--scsc-white);
  font: 700 .8125rem/1 var(--scsc-font);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: color 160ms ease, transform 160ms ease;
}
.hud-btn__bg,
.hud-btn__bg::after {
  position: absolute;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.hud-btn__bg {
  inset: 0;
  z-index: -1;
  /* äußere Fläche = Leuchtkante */
  background: linear-gradient(135deg, var(--scsc-sky-light), rgb(var(--scsc-sky-rgb) / .45) 45%, var(--scsc-sky));
  filter: drop-shadow(0 0 8px rgb(var(--scsc-sky-rgb) / .35));
}
.hud-btn__bg::after {
  content: '';
  inset: var(--edge);
  background: linear-gradient(180deg, var(--scsc-violet) 0%, var(--scsc-violet-deep) 100%);
  transition: background 160ms ease;
}
.hud-btn:hover .hud-btn__bg::after,
.hud-btn:focus-visible .hud-btn__bg::after {
  background: linear-gradient(180deg, var(--scsc-sky) 0%, #3E9FE6 100%);
}
.hud-btn:hover,
.hud-btn:focus-visible { color: var(--scsc-ink); }
.hud-btn:active { transform: translateY(1px); }
.hud-btn:focus-visible {
  outline: 2px solid var(--scsc-white);
  outline-offset: 3px;
}
.hud-btn .icon { width: 20px; height: 20px; flex: none; }

.hud-btn--icon { width: 48px; padding: 0; --cut: 8px; }
.hud-btn--icon .icon--on { display: none; }
.hud-btn--icon[aria-pressed="true"] .icon--on { display: block; }
.hud-btn--icon[aria-pressed="true"] .icon--muted { display: none; }
.hud-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.hud-btn--skip { padding: 0 16px 0 20px; }
@media (max-width: 400px) { .hud-btn--skip { font-size: .75rem; letter-spacing: .06em; padding: 0 12px 0 14px; } }

/* Pill-Label (Vereins-Baustein): Kapsel mit Punkt */
.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  border: 1px solid rgb(255 255 255 / .18);
  color: var(--scsc-white);
  font: 600 .75rem/1.2 var(--scsc-font);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hud-pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--scsc-sky);
  box-shadow: 0 0 8px var(--scsc-sky);
}

/* 6. Cookie-Banner ------------------------------------------------------------ */
.consent {
  position: fixed;
  z-index: 1100;                 /* über Intro (1000) und Reveal (1001/1002) */
  left: 50%;
  /* 20px Innenabstand = Platz für den Glow (sonst schneidet overflow ihn ab) */
  bottom: calc(var(--safe-b) - 12px);
  width: min(720px, 100vw + 8px);
  padding: 20px;
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-50%);
  font-family: var(--scsc-font);
  color: var(--scsc-white);
}
.consent[hidden] { display: none; }

/* Wrapper trägt den Glow (drop-shadow folgt der abgeschrägten Form) */
.consent__glow {
  filter: drop-shadow(0 0 18px rgb(var(--scsc-sky-rgb) / .35)) drop-shadow(0 12px 32px rgb(var(--scsc-ink-rgb) / .6));
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.2, .8, .2, 1);
}
.consent.is-open .consent__glow { opacity: 1; transform: none; }
.consent.is-closing .consent__glow { opacity: 0; transform: translateY(16px); transition-duration: 200ms; }

.consent__panel {
  --cut: 22px;
  --edge: 1.5px;
  position: relative;
  isolation: isolate;
  padding: clamp(20px, 4vw, 32px);
  padding-top: clamp(18px, 3vw, 24px);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  /* äußere Fläche = Leuchtkante (Verlauf Himmelblau) */
  background: linear-gradient(135deg, var(--scsc-sky-light) 0%, rgb(var(--scsc-sky-rgb) / .35) 30%, rgb(var(--scsc-sky-rgb) / .2) 70%, var(--scsc-sky) 100%);
}
.consent__panel:focus { outline: none; }
.consent__panel:focus-visible { outline: none; }
/* innere Fläche: Violett, nach unten in Fast-Schwarz, feine Scanlines */
.consent__panel::before {
  content: '';
  position: absolute;
  inset: var(--edge);
  z-index: -2;
  clip-path: inherit;
  background:
    repeating-linear-gradient(180deg, rgb(255 255 255 / .025) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, rgb(63 43 145 / .97) 0%, rgb(34 30 106 / .97) 55%, rgb(var(--scsc-ink-rgb) / .97) 100%);
}
/* Punktraster (Vereins-Baustein), nur in der Ecke oben rechts */
.consent__panel::after {
  content: '';
  position: absolute;
  top: var(--edge);
  right: var(--edge);
  width: 160px;
  height: 120px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(rgb(255 255 255 / .18) 1.2px, transparent 1.7px) 0 0 / 12px 12px;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, transparent 70%);
          mask-image: linear-gradient(225deg, #000 0%, transparent 70%);
}

.consent__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 56px 14px 0;          /* Platz für das X */
}
.consent__logo { width: 40px; height: 40px; flex: none; }

.consent__title {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: .94;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.consent__title span { color: var(--scsc-sky); }

.consent__text {
  margin: 0 0 16px;
  font-size: .9375rem;
  line-height: 1.55;
  color: rgb(255 255 255 / .88);
}
.consent__text a,
.consent__legal a { color: var(--scsc-sky-light); text-underline-offset: 3px; }
.consent__text a:focus-visible,
.consent__legal a:focus-visible { outline: 2px solid var(--scsc-white); outline-offset: 2px; border-radius: 2px; }

/* Kategorie-Zeile im HUD-Stil (einzige Kategorie: Statistik) */
.consent__category {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--scsc-sky);
  background: rgb(var(--scsc-ink-rgb) / .45);
  font-size: .8125rem;
  line-height: 1.4;
}
.consent__tag {
  grid-row: span 2;
  padding: 6px 10px;
  background: var(--scsc-sky);
  color: var(--scsc-ink);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .6875rem;
}
.consent__provider { font-weight: 600; }
.consent__state { color: rgb(255 255 255 / .7); }

/* Annehmen & Ablehnen: identische Größe, identische Optik (DSGVO) */
.consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.consent__actions .hud-btn { width: 100%; min-height: 54px; font-size: .9375rem; }
@media (max-width: 360px) { .consent__actions .hud-btn { padding: 0 8px; letter-spacing: .06em; } }

.consent__legal {
  margin: 14px 0 0;
  font-size: .75rem;
  color: rgb(255 255 255 / .65);
}

/* Schließen-X (= Ablehnen) */
.consent__close {
  position: absolute;
  top: clamp(14px, 2.5vw, 20px);
  right: clamp(14px, 2.5vw, 20px);
  width: 44px;
  min-height: 44px;
  padding: 0;
  --cut: 7px;
}
.consent__close .icon { width: 18px; height: 18px; }
.consent__head .hud-pill { min-width: 0; white-space: normal; }

/* Kleine Handys: kompakter, damit beide Buttons ohne Scrollen sichtbar sind */
@media (max-width: 420px), (max-height: 640px) {
  .consent__panel { padding: 18px 18px 16px; --cut: 16px; }
  .consent__head { margin-bottom: 10px; }
  .consent__logo { width: 32px; height: 32px; }
  .consent__title { font-size: 1.5rem; margin-bottom: 8px; }
  .consent__text { font-size: .8125rem; line-height: 1.5; margin-bottom: 12px; }
  .consent__category { margin-bottom: 14px; padding: 10px 12px; font-size: .75rem; }
  .consent__actions .hud-btn { min-height: 50px; }
  .consent__close { top: 12px; right: 12px; }
}

/* 7. Reduzierte Bewegung ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .consent__glow,
  .consent.is-open .consent__glow,
  .consent.is-closing .consent__glow { transition: none; transform: none; }
  .hud-btn { transition: none; }
}
