/* =========================================================
   WELTRAUM — gemeinsame Basis für alle Seiten
   Wird von jeder Seite geladen. Seitenspezifisches CSS steht
   in der jeweiligen index.html im <style>-Block darunter und
   darf hier definierte Werte überschreiben.
   ========================================================= */

:root {
  --bg-color: #000000;
  --text-color: #ffffff;
  --accent-cyan: #00f2ff;
  --accent-magenta: #bf00ff;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  font-family: 'Courier New', Courier, monospace;
  color: var(--text-color);
  overflow-x: hidden;
}

/* =========================================================
   Sternenszene
   Standard: Hintergrundebene hinter dem Inhalt.
   Die Startseite überschreibt .space-scene, weil sie ihren
   Inhalt darin vertikal zentriert.
   ========================================================= */
.space-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-color);
}

.parallax-container {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  opacity: 0.8;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

.twinkle { animation: twinkle 4s infinite ease-in-out; }
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Ruhigerer Hintergrund auf den Rechtstexten — dort zählt Lesbarkeit */
body.legal .star {
  opacity: 0.6;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6);
}
body.legal .twinkle { animation-name: twinkleQuiet; }
@keyframes twinkleQuiet { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }

/* =========================================================
   Tilt-Button (nur iOS, erscheint per JS)
   ========================================================= */
#tiltBtn {
  display: none;
  position: fixed;
  top: max(18px, env(safe-area-inset-top, 18px));
  right: max(18px, env(safe-area-inset-right, 18px));
  z-index: 999999;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 255, 0.45);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 30px;
  opacity: 0.85;
  transition: opacity 0.4s, transform 0.4s, box-shadow 0.4s;
  animation: gentlePulse 4s ease-in-out infinite;
}
#tiltBtn.show { display: inline-block; }
#tiltBtn:hover, #tiltBtn:active {
  opacity: 1;
  box-shadow: 0 0 18px rgba(0, 242, 255, 0.45);
}
#tiltBtn::before { content: '◉ '; font-size: 0.9em; }
#tiltBtn.returning::before { content: '↻ '; }
#tiltBtn.fading { opacity: 0; transform: translateY(-10px); }
@keyframes gentlePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 242, 255, 0.15); }
  50%      { box-shadow: 0 0 14px rgba(0, 242, 255, 0.4); }
}

/* =========================================================
   Grundgerüst der Unterseiten
   ========================================================= */
.container {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  padding-left: max(20px, env(safe-area-inset-left, 20px));
  padding-right: max(20px, env(safe-area-inset-right, 20px));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.nav-top { padding: 20px 0; margin-bottom: 40px; }

.back-link {
  text-decoration: none;
  color: var(--accent-cyan);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 1px solid transparent;
  padding: 10px 15px;
  transition: all 0.3s;
  display: inline-block;
}
.back-link:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
  text-shadow: 0 0 8px var(--accent-cyan);
}

.footer-legal {
  text-align: center;
  padding: 40px 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
  font-size: 0.7rem;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-top: auto;
}
.footer-legal a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.3s;
}
.footer-legal a:hover { color: var(--accent-cyan); }

/* =========================================================
   Barrierefreiheit
   ========================================================= */

/* Sprunglink — nur sichtbar, wenn er den Fokus hat */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000000;
  padding: 12px 18px;
  background: #000;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Sichtbarer Fokus für Tastaturbedienung — vorher gab es keinen */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .twinkle,
  #tiltBtn { animation: none !important; }
  .layer,
  .ui-wrapper { transform: none !important; }
  * { scroll-behavior: auto !important; }
}
