/*
 * MODUL: landing.css
 * ZWECK:    Aussehen der Landing Page — Asche-Schwarz, Glut-Bernstein, Blut-Rot.
 *           Palette + Layout + die Inszenierung (Tod -> Wiederkehr -> Sog).
 * EINGABE:  index.html (Klassen/IDs), Body-States via stage.js.
 * AUSGABE:  Gestaltete, animierte Oberflaeche.
 * BRAUCHT:  Fonts Cinzel + Spectral (mit System-Fallback).
 * BENUTZT VON: index.html.
 *
 * ZUM ANPASSEN (ein Fakt, eine Stelle): Farben + Titel-Text unten in :root
 * bzw. in index.html (#title). Alles andere richtet sich danach.
 */

:root {
  --bg:        #0a0807;
  --bg-deep:   #050409;
  --ash:       #ece5d6;   /* Pergament-Text */
  --ash-dim:   #8d8676;
  --ember:     #e6a24c;   /* Bernstein */
  --ember-hot: #ff7a18;
  --blood:     #b11217;   /* "YOU DIED" */
  --blood-glow:#ff2b30;
  --gold:      #d8b46a;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Spectral", Georgia, serif;

  --ease: cubic-bezier(.2,.7,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: radial-gradient(120% 120% at 50% 30%, var(--bg) 0%, var(--bg-deep) 70%, #000 100%);
  color: var(--ash);
  font-family: var(--serif);
  overflow: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

/* ---- Hintergrund-Ebenen ---- */
#life, #embers {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
#life   { opacity: 0; transition: opacity 1.4s var(--ease); z-index: 0; }
#embers { z-index: 1; opacity: .9; }

.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 0%, transparent 35%, rgba(0,0,0,.55) 100%),
    radial-gradient(60% 50% at 50% 52%, rgba(0,0,0,.55) 0%, transparent 70%);
}

.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 3;
  width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(230,162,76,.10) 0%, transparent 60%);
  mix-blend-mode: screen;
  transition: opacity .6s var(--ease);
}

/* ---- Bühne ---- */
.stage {
  position: relative; z-index: 4;
  height: 100%;
  display: grid; place-items: center;
  text-align: center;
  padding: 6vh 7vw;
}

/* ---- 1) YOU DIED ---- */
.death {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: .8rem;
  opacity: 0; pointer-events: none;
}
body.state-dying .death { animation: deathIn 2.6s var(--ease) forwards; }

.death__word {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 8.5rem);
  letter-spacing: .12em;
  color: var(--blood);
  text-shadow: 0 0 36px rgba(255,43,48,.45), 0 0 90px rgba(177,18,23,.35);
  filter: blur(8px);
  transform: scale(1.06);
  animation: sharpen 2.6s var(--ease) forwards;
}
.death__sub {
  font-style: italic; letter-spacing: .35em; text-transform: lowercase;
  color: var(--ash-dim); font-size: clamp(.7rem, 2.2vw, 1rem);
}

@keyframes deathIn {
  0%   { opacity: 0; }
  14%  { opacity: 1; }
  72%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes sharpen {
  0%   { filter: blur(14px); transform: scale(1.12); }
  30%  { filter: blur(0);    transform: scale(1); }
  100% { filter: blur(0);    transform: scale(1); }
}

/* ---- 2) Pitch / Landing ---- */
.landing {
  display: grid; gap: clamp(1rem, 2.4vh, 1.6rem);
  max-width: 46rem;
  opacity: 0; transform: translateY(18px);
  pointer-events: none;
}
body.state-reborn .landing { pointer-events: auto; }
body.state-reborn .landing > * {
  animation: rise .9s var(--ease) both;
}
body.state-reborn .landing { opacity: 1; transform: none; transition: none; }
body.state-reborn .landing > *:nth-child(1) { animation-delay: .05s; }
body.state-reborn .landing > *:nth-child(2) { animation-delay: .18s; }
body.state-reborn .landing > *:nth-child(3) { animation-delay: .32s; }
body.state-reborn .landing > *:nth-child(4) { animation-delay: .48s; }
body.state-reborn .landing > *:nth-child(5) { animation-delay: .66s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.eyebrow {
  font-size: clamp(.62rem, 1.6vw, .78rem);
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--ash-dim);
  display: inline-flex; align-items: center; gap: .7em;
  justify-self: center;
}
.eyebrow .sep { opacity: .5; }
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 10px var(--ember-hot);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

.title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 5.4rem);
  line-height: .98;
  letter-spacing: .04em;
  color: var(--ash);
  text-shadow: 0 0 50px rgba(216,180,106,.18);
}

.tagline {
  font-size: clamp(1rem, 2.6vw, 1.4rem);
  font-weight: 300; line-height: 1.5;
  color: #cfc7b6;
}
.tagline em { color: var(--ember); font-style: italic; }

.cta-row {
  display: flex; gap: 1rem; justify-content: center; align-items: center;
  flex-wrap: wrap; margin-top: .4rem;
}

.cta {
  position: relative;
  font-family: var(--display);
  font-size: clamp(.95rem, 2.4vw, 1.15rem);
  letter-spacing: .14em; text-transform: uppercase;
  color: #1a1207;
  padding: 1.05em 2.4em;
  border: none; border-radius: 999px; cursor: pointer;
  display: inline-grid; gap: .15em;
  background: linear-gradient(180deg, #f6c66f 0%, var(--ember) 55%, #c87e25 100%);
  box-shadow: 0 0 0 1px rgba(255,210,140,.4), 0 14px 40px -10px rgba(230,162,76,.6),
              inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .25s var(--ease), box-shadow .35s var(--ease), filter .35s var(--ease);
  will-change: transform;
}
.cta__hint {
  font-family: var(--serif); font-size: .58em; letter-spacing: .3em;
  opacity: .65; text-transform: lowercase;
}
.cta::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  background: radial-gradient(60% 120% at 50% 0%, rgba(255,255,255,.5), transparent 60%);
  opacity: 0; transition: opacity .35s var(--ease); pointer-events: none;
}
.cta:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(255,225,170,.7), 0 22px 60px -12px rgba(255,140,40,.8),
              inset 0 1px 0 rgba(255,255,255,.6);
}
.cta:hover::after { opacity: 1; }
.cta:active { transform: scale(.97); }

.ghost {
  background: none; border: 1px solid rgba(236,229,214,.2);
  color: var(--ash-dim); font-family: var(--serif);
  font-size: clamp(.8rem, 2vw, .95rem); letter-spacing: .08em;
  padding: .9em 1.5em; border-radius: 999px; cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
}
.ghost:hover { color: var(--ash); border-color: rgba(236,229,214,.5); background: rgba(236,229,214,.04); }

.hint {
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ash-dim); opacity: .55;
}
body.state-reborn .hint { display: none; }

/* ---- Ton-Schalter ---- */
.sound {
  position: fixed; z-index: 6; right: 1.4rem; bottom: 1.4rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,16,12,.6); color: var(--ash-dim);
  border: 1px solid rgba(236,229,214,.16); cursor: pointer;
  font-size: 1.1rem; backdrop-filter: blur(6px);
  transition: color .3s, border-color .3s, transform .3s;
}
.sound:hover { color: var(--ember); border-color: rgba(230,162,76,.5); transform: scale(1.08); }
.sound[aria-pressed="true"] { color: var(--ember); border-color: rgba(230,162,76,.6); }

/* ---- 3) Sog / Übergang ---- */
.dive {
  position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, #000 70%);
  transform: scale(2.4);
}
body.state-diving .dive { animation: dive 1s var(--ease) forwards; }
@keyframes dive {
  0%   { opacity: 0; transform: scale(2.4); }
  100% { opacity: 1; transform: scale(1); }
}

.portal {
  position: fixed; inset: 0; z-index: 9;
  display: grid; place-content: center; gap: .6rem; text-align: center;
  opacity: 0; pointer-events: none; background: #000;
}
body.state-portal .portal { opacity: 1; pointer-events: auto; transition: opacity .8s var(--ease) .6s; }
.portal__line { font-family: var(--display); font-size: clamp(1.2rem,4vw,2rem); letter-spacing: .12em; color: var(--ember); }
.portal__sub  { color: var(--ash-dim); letter-spacing: .3em; text-transform: uppercase; font-size: .75rem; }
.portal__back { margin-top: 1.4rem; justify-self: center; }

/* ---- Sanfter als Voreinstellung; reduzierte Bewegung respektieren ---- */
@media (prefers-reduced-motion: reduce) {
  .death, .dive { display: none !important; }
  .landing { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
  .landing > * { animation: none !important; }
  .eyebrow .dot { animation: none; }
}

@media (max-width: 540px) {
  .cta-row { flex-direction: column; }
  .stage { padding: 8vh 6vw; }
}
