/*
 * Gestaltung der LaunchPage, Richtung "Karmesin-Glut".
 *
 * Farbfuehrung: main.js setzt --bg und --flame-base aus config.js, alles
 * Weitere leitet sich hier per color-mix daraus ab. Die statischen
 * Startwerte verhindern nur einen hellen Blitz vor dem ersten Skriptlauf.
 * Token-Werte und Kontrastentscheidungen folgen dem Schwesterprojekt
 * (tokens.css der neuen Hauptseite).
 */

@font-face {
  font-family: 'Bricolage Grotesque Variable';
  src: url('../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans Variable';
  src: url('../assets/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #12100f;
  --flame-base: #d80030;
  --ink: #f4f1ed;
  --ink-muted: #8a8580;
  --line: #2b2624;
  --flame-hell: color-mix(in oklab, var(--flame-base), white 42%);
  --flame-glow: color-mix(in oklab, var(--flame-base) 55%, transparent);
  --flame-glow-weich: color-mix(in oklab, var(--flame-base) 30%, transparent);
  --font-display: 'Bricolage Grotesque Variable', 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Instrument Sans Variable', 'Instrument Sans', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
}

/* Bei reduzierter Bewegung stehen alle Zeilen statisch im Fluss. Die Seite
   darf dann scrollen, statt Inhalte abzuschneiden. */
html.bewegung-reduziert body { overflow: auto; }

/* Glutbett: das warme Fundament am unteren Rand. Liegt als Compositor-Ebene
   unter dem Partikel-Canvas und kostet kein WebGL-Budget. In den
   Fallback-Faellen (kein WebGL, reduzierte Bewegung) ist es zugleich das
   statische Gluehband. */
.glut-bett {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(34% 18% at 50% 100%, color-mix(in oklab, var(--flame-base) 34%, transparent), transparent 78%),
    radial-gradient(70% 30% at 50% 100%, color-mix(in oklab, var(--flame-base) 22%, transparent), transparent 76%);
  animation: glut-atmen 4.5s ease-in-out infinite alternate;
}
@keyframes glut-atmen {
  from { opacity: 0.72; }
  to { opacity: 1; }
}
html.bewegung-reduziert .glut-bett { animation: none; }

#feuer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Waehrend der Burn-Transition wandert der Canvas vor den Inhalt, damit der
   Dissolve die Seite verschlingen kann. Sonst liegt er immer dahinter. */
html.brennt #feuer { z-index: 5; }

/* Ohne WebGL2 oder mit reduzierter Bewegung ersetzt ein statisches Gluehband
   am unteren Rand die Partikel. Die Seite bleibt voll bedienbar. */
html.kein-webgl #feuer { display: none; }

.buehne {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 20px calc(64px + env(safe-area-inset-bottom));
}
html.bewegung-reduziert .buehne { min-height: 100dvh; height: auto; }

.drittel-oben,
.drittel-unten {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-halter { position: relative; }
.logo-halter::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 165%;
  height: 165%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--flame-glow-weich), transparent 72%);
  filter: blur(6px);
}
#logo {
  position: relative;
  display: block;
  width: auto;
  height: clamp(120px, 26dvh, 250px);
  filter: drop-shadow(0 0 16px var(--flame-glow)) drop-shadow(0 0 3px color-mix(in oklab, var(--flame-hell) 60%, transparent));
}

.drittel-mitte {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 6.4vw, 60px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 32px var(--flame-glow), 0 2px 16px rgba(0, 0, 0, 0.6);
}

/* Das Laufband ist ein Fenster mit begrenzter Hoehe: die Zeilen ziehen
   hindurch, deshalb passt die Mitte bei jeder Viewport-Hoehe, auch mit
   10 Zeilen im Landscape-Handy. */
.zeilen-band {
  position: relative;
  margin-top: clamp(18px, 3.4dvh, 34px);
  width: min(84vw, 640px);
  height: clamp(76px, 21dvh, 190px);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 84%, transparent);
}
html.bewegung-reduziert .zeilen-band {
  height: auto;
  mask-image: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.zeile {
  position: absolute;
  left: 50%;
  top: 0;
  white-space: nowrap;
  font-size: clamp(15px, 2.1dvh, 19px);
  font-weight: 500;
  color: #a8a29b;
  opacity: 0;
  will-change: transform, opacity, filter;
}
html.bewegung-reduziert .zeile {
  position: static;
  transform: none;
  opacity: 0.85;
  will-change: auto;
}

/* Unsichtbare, aber vorlesbare Kopie der Zeilen: das animierte Band selbst
   ist fuer Screenreader ausgeblendet, sonst waere es Dauer-Gemurmel. */
.zeilen-vorleser {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  list-style: none;
}

.hoellen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px 42px;
  border-radius: 999px;
  background: var(--flame-base);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid color-mix(in oklab, var(--flame-hell) 75%, transparent);
  box-shadow: 0 0 28px var(--flame-glow), 0 0 64px var(--flame-glow-weich), inset 0 -8px 16px rgba(0, 0, 0, 0.35);
  transition: transform 180ms var(--ease-out);
  animation: glut-puls 3.6s ease-in-out infinite;
}
.hoellen-button:hover { transform: translateY(-1px); }
.hoellen-button:focus-visible {
  outline: 2px solid var(--flame-hell);
  outline-offset: 3px;
}
@keyframes glut-puls {
  0%, 100% { box-shadow: 0 0 28px var(--flame-glow), 0 0 64px var(--flame-glow-weich), inset 0 -8px 16px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 38px var(--flame-glow), 0 0 88px var(--flame-glow-weich), inset 0 -8px 16px rgba(0, 0, 0, 0.35); }
}
html.bewegung-reduziert .hoellen-button { animation: none; }

.fusszeile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.fusszeile-links { display: flex; gap: 6px; }
.fusszeile-links a {
  color: var(--ink-muted);
  font-size: 13px;
  text-decoration: none;
  padding: 12px 8px;
}
.fusszeile-links a:hover { color: var(--ink); }
.fusszeile-links a:focus-visible {
  outline: 2px solid var(--flame-hell);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Das eigene display wuerde das hidden-Attribut sonst ueberstimmen. */
.ton-schalter[hidden] { display: none; }

.ton-schalter {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}
.ton-schalter:hover { color: var(--ink); }
.ton-schalter:focus-visible {
  outline: 2px solid var(--flame-hell);
  outline-offset: 3px;
}
.ton-schalter .ton-aus { display: none; }
.ton-schalter[aria-pressed='true'] .ton-an { display: none; }
.ton-schalter[aria-pressed='true'] .ton-aus { display: block; }

/* Feine Koernung wie auf der neuen Hauptseite: liegt ueber dem Inhalt,
   aber unter dem Burn-Overlay. */
.koernung {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23k)'/%3E%3C/svg%3E");
}

.kein-js {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 10px 16px;
  background: color-mix(in oklab, var(--bg), white 6%);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.kein-js a { color: var(--flame-hell); }

@media (max-width: 480px) {
  .hoellen-button {
    padding: 15px 34px;
    font-size: 16px;
  }
}
