/* ==========================================================================
   styles.css — Dark & Cinematic Design-System
   Palette: Mitternachtsblau + Tiefteal + Champagner-Gold (kein Purple)
   ========================================================================== */

/* ----- Design-Tokens ----- */
:root {
  --bg:         #05070d;
  --bg-raise:   #0a1224;
  --ink:        #f2f5f9;
  --ink-soft:   #97a3b6;
  --ink-faint:  #7e8a9d;
  --accent:     #e3c188;   /* wird zur Laufzeit aus config.js gesetzt */
  --accent-contrast: #171006;
  --aurora-1:   #16324f;
  --aurora-2:   #123c3f;
  --error:      #f2a6a6;
  --success:    #a8d8b9;

  /* Fallbacks für Browser ohne color-mix (fixe Gold-Töne) */
  --accent-glow: rgba(227, 193, 136, 0.14);
  --accent-soft: rgba(227, 193, 136, 0.55);
  --hairline:    rgba(151, 163, 182, 0.18);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  :root {
    --accent-glow: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 55%, transparent);
  }
}

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

html {
  height: 100%;
  overflow-x: clip; /* dekorative Ebenen (Halo/Aurora) nie horizontal scrollbar */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

/* ==========================================================================
   Hintergrund-Ebenen
   z-Skala: Aurora -2 · Canvas -1 · Inhalt 1 · Vignette 2 · Filmkorn 3
   ========================================================================== */

.aurora {
  position: fixed;
  width: 120vmax;
  height: 120vmax;
  border-radius: 50%;
  z-index: -2;
  pointer-events: none;
  will-change: transform;
}

.aurora-1 {
  top: -62vmax;
  left: -42vmax;
  background: radial-gradient(circle at 42% 44%,
              rgba(22, 50, 79, 0.55), transparent 62%);
}

.aurora-2 {
  bottom: -66vmax;
  right: -46vmax;
  background: radial-gradient(circle at 56% 58%,
              rgba(18, 60, 63, 0.5), transparent 62%);
}

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

/* Vignette — dunkelt die Ränder filmisch ab */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
              transparent 52%, rgba(0, 0, 0, 0.38) 100%);
}

/* Filmkorn — statisches SVG-Rauschen, sehr dezent */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  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'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

/* ==========================================================================
   Szene & Hero
   ========================================================================== */

.scene {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.25rem, 3vh, 2.25rem);
  max-width: 52rem;
  width: 100%;
}

/* Atmender Licht-Halo hinter dem Hero */
.halo {
  position: absolute;
  inset: -28% -18%;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  opacity: 0.55;
}

/* ----- Eyebrow ----- */
.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 1.125rem;
  color: var(--accent);
  font-size: clamp(0.6875rem, 0.625rem + 0.3vw, 0.8125rem);
  font-weight: 500;
  letter-spacing: 0.35em;
  text-indent: 0.35em; /* gleicht das letzte letter-spacing optisch aus */
  text-transform: uppercase;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: clamp(1.75rem, 4vw, 2.75rem);
  height: 1px;
  flex: none;
}

.eyebrow::before { background: linear-gradient(to left,  var(--accent-soft), transparent); }
.eyebrow::after  { background: linear-gradient(to right, var(--accent-soft), transparent); }

/* ----- Domain-Headline ----- */
.domain {
  margin: 0;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 380;
  font-size: clamp(2.25rem, 1rem + 6.5vw, 6.75rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  max-width: 100%;
}

.domain-name { color: var(--ink); }

/* Der Gradient-Sheen wird erst NACH der Buchstaben-Entrance aktiviert
   (app.js ersetzt die Buchstaben-Spans durch reinen Text und setzt .sheen-on),
   weil background-clip: text nicht in inline-block-Kinder hineinwirkt. */
@supports (-webkit-background-clip: text) {
  .domain-name.sheen-on {
    background-image: linear-gradient(110deg,
      var(--ink) 0%, var(--ink) 44%,
      var(--accent) 50%,
      var(--ink) 56%, var(--ink) 100%);
    background-size: 250% 100%;
    background-position: 0% 0;
    background-repeat: repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.domain-tld {
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.char { display: inline-block; }

/* ----- Tagline ----- */
.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.375rem);
  font-weight: 300;
  line-height: 1.6;
  max-width: 44ch;
}

/* ==========================================================================
   E-Mail-Formular
   ========================================================================== */

.notify {
  width: 100%;
  max-width: 26.5rem;
  margin-top: 0.25rem;
}

.notify-label {
  display: block;
  margin-bottom: 0.625rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.field-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.375rem;
  background: rgba(10, 18, 36, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease;
}

.field-row:focus-within { border-color: var(--accent-soft); }

#email {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}

#email::placeholder { color: var(--ink-faint); }
#email:focus { outline: none; } /* Fokus zeigt der Rahmen via :focus-within */

#notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s ease, transform 0.15s ease;
}

#notify-btn:hover  { filter: brightness(1.08); }
#notify-btn:active { transform: scale(0.97); }

.icon { width: 1.125rem; height: 1.125rem; flex: none; }

/* Honeypot — für Menschen unsichtbar, für naive Bots ausfüllbar */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status {
  margin: 0.625rem 0 0;
  min-height: 1.5rem;
  font-size: 0.875rem;
  font-weight: 400;
}

.notify.loading #notify-btn { opacity: 0.65; cursor: progress; }

.notify.error #email { caret-color: var(--error); }
.notify.error .form-status { color: var(--error); }

.notify.success .notify-label,
.notify.success .field-row { display: none; }

.notify.success .form-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  color: var(--success);
  font-size: 1rem;
}

@media (max-width: 26rem) {
  .field-row { flex-direction: column; }
  #notify-btn { justify-content: center; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem) 1.75rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
  font-weight: 400;
}

.footer-note { margin: 0; }

.lang-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.875rem;
  background: transparent;
  border: 1px solid rgba(151, 163, 182, 0.25);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-toggle:hover {
  color: var(--ink);
  border-color: rgba(151, 163, 182, 0.5);
}

/* ==========================================================================
   Fokus
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

#notify-btn:focus-visible,
.lang-toggle:focus-visible { border-radius: inherit; }

/* ==========================================================================
   Bewegung — komplett hinter prefers-reduced-motion: no-preference
   (bei Reduced Motion bleibt alles statisch sichtbar)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  .aurora-1 { animation: drift-1 40s ease-in-out infinite alternate; }
  .aurora-2 { animation: drift-2 55s ease-in-out infinite alternate; }

  @keyframes drift-1 {
    from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    to   { transform: translate3d(8vmax, 6vmax, 0) rotate(40deg) scale(1.15); }
  }

  @keyframes drift-2 {
    from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1.1); }
    to   { transform: translate3d(-7vmax, -5vmax, 0) rotate(-30deg) scale(0.95); }
  }

  /* Atmender Halo — gleiche Periode wie der Lichtstreifen */
  .halo { animation: breathe 9s ease-in-out infinite; }

  @keyframes breathe {
    0%, 100% { opacity: 0.4;  transform: scale(1); }
    50%      { opacity: 0.75; transform: scale(1.06); }
  }

  /* Cinematic Light Sweep über die Headline (läuft von links nach rechts) */
  .domain-name.sheen-on { animation: sheen 9s ease-in-out 1.2s infinite; }

  @keyframes sheen {
    0%   { background-position: 100% 0; }
    26%  { background-position: 0% 0; }
    100% { background-position: 0% 0; }
  }

  /* Buchstaben-Entrance (Spans erzeugt app.js nur ohne Reduced Motion) */
  .char {
    opacity: 0;
    transform: translateY(12px);
    animation: char-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  @keyframes char-rise {
    to { opacity: 1; transform: none; }
  }

  /* Sanftes Aufblenden der übrigen Elemente */
  .eyebrow, .tagline, .notify, .footer {
    animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .eyebrow { animation-delay: 0.15s; }
  .tagline { animation-delay: 0.55s; }
  .notify  { animation-delay: 0.7s; }
  .footer  { animation-delay: 0.9s; }

  @keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}
