/* ==========================================================================
   Schafmoor · Landingpage
   ========================================================================== */

/* Solange das Tor zu ist: kein Scrollen */
html.js.tor-zu, html.js.tor-zu body { overflow: hidden; }

/* ==========================================================================
   4.1 Intro: Die Tore von Schafmoor
   ========================================================================== */
.tor { display: none; }
html.js .tor {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  color: var(--text);
}
html.js.tor-weg .tor { display: none; }

/* Die zwei Torflügel mit Sternenhimmel */
.tor-fluegel {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 34%, #ffe9c4 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 46%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 62%, #f5d6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 76%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 88%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 90%, #ffe9c4 50%, transparent 51%),
    radial-gradient(120% 90% at 50% 0%, var(--nacht-violett) 0%, var(--nacht-1) 45%, var(--nacht-0) 100%);
  background-size: 260px 260px, 310px 310px, 370px 370px, 290px 290px, 330px 330px, 410px 410px, 350px 350px, 270px 270px, 100% 100%;
  transition: transform 1.5s var(--ease-tor);
  will-change: transform;
}
.tor-fluegel.links { left: 0; border-right: 1px solid rgba(235, 192, 99, .35); background-position: 0 0, 40px 20px, 10px 80px, 0 0, 30px 10px, 0 0, 20px 40px, 0 0, 0 0; }
.tor-fluegel.rechts { right: 0; border-left: 1px solid rgba(235, 192, 99, .35); }
/* feine Goldkante an der Tormitte */
.tor-fluegel::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 18px;
  background: linear-gradient(90deg, transparent, rgba(235, 192, 99, .12), transparent);
}
.tor-fluegel.links::after { right: 0; }
.tor-fluegel.rechts::after { left: 0; }

/* Lichtspalt, der sich beim Öffnen weitet */
.tor-licht {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: radial-gradient(50% 70% at 50% 50%, rgba(255, 246, 225, .95) 0%, rgba(255, 214, 150, .55) 30%, rgba(240, 150, 220, .25) 60%, transparent 100%);
  box-shadow: 0 0 30px 6px rgba(255, 214, 150, .35);
  mix-blend-mode: screen;
  opacity: 0;
  z-index: 1;
}

.tor-mitte {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  padding: 2rem var(--rand);
  text-align: center;
  transition: opacity .45s, transform .6s var(--ease-weich), filter .45s;
}
.tor-ueber {
  font-family: var(--font-caps); font-weight: 400;
  font-size: .8rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold);
  opacity: .9;
}
.tor-emblem {
  position: relative;
  width: clamp(8.5rem, 34vw, 11rem); aspect-ratio: 1;
  margin: .5rem 0 1rem;
  /* eigener Stapelkontext: die Lichtlinie (mix-blend-mode: screen) soll dahinter
     bleiben, statt durch die transparenten Stellen von Logo und Button zu scheinen */
  isolation: isolate;
}
.tor-emblem img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 22px rgba(240, 90, 180, .55)); }
.tor-emblem::before {
  content: ''; position: absolute; inset: -14%;
  border-radius: 50%;
  border: 1px solid rgba(235, 192, 99, .45);
  box-shadow: 0 0 40px rgba(192, 80, 186, .45), inset 0 0 30px rgba(235, 192, 99, .15);
  animation: emblem-puls 3.6s ease-in-out infinite;
}
.tor-emblem::after {
  content: ''; position: absolute; inset: -26%;
  border-radius: 50%;
  border: 1px dashed rgba(235, 192, 99, .22);
  animation: drehen 60s linear infinite;
}
@keyframes emblem-puls { 0%, 100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes drehen { to { transform: rotate(360deg); } }

.tor-btn {
  position: relative;
  isolation: isolate;
  min-height: 3.5rem; padding: .9em 2.2em;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(180deg, rgba(235, 192, 99, .18), rgba(235, 192, 99, .04));
  color: var(--gold-hell);
  font-family: var(--font-caps); font-weight: 700; font-size: 1.2rem; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: var(--schatten-glow-gold);
  transition: transform .25s var(--ease-weich), box-shadow .25s, color .25s;
}
.tor-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 0 26px rgba(235, 192, 99, .7), 0 0 70px rgba(192, 80, 186, .35); }
.tor-hinweis { margin-top: -.6rem; font-size: .9rem; font-style: italic; color: var(--text-leise); }
.tor-ohne {
  padding: .5rem .75rem; border: 0; background: none;
  font-size: .9rem; color: var(--text-leise);
  text-decoration: underline; text-decoration-color: rgba(205, 191, 216, .45); text-underline-offset: .25em;
}
.tor-ohne:hover { color: var(--text); }

/* Sanftes Erscheinen beim ersten Besuch */
html.js:not(.kurz) .tor-mitte > * { animation: tor-rein 1s var(--ease-weich) both; }
html.js:not(.kurz) .tor-mitte > :nth-child(2) { animation-delay: .15s; }
html.js:not(.kurz) .tor-mitte > :nth-child(3) { animation-delay: .45s; }
html.js:not(.kurz) .tor-mitte > :nth-child(n+4) { animation-delay: .7s; }
@keyframes tor-rein { from { opacity: 0; transform: translateY(10px); } }

/* Öffnen */
html.tor-oeffnet .tor-mitte { opacity: 0; transform: scale(1.08); filter: blur(4px); }
html.tor-oeffnet .tor-licht { animation: licht-auf 1.9s var(--ease-tor) forwards; }
html.tor-oeffnet .tor-fluegel.links { transform: translateX(-102%); transition-delay: .35s; }
html.tor-oeffnet .tor-fluegel.rechts { transform: translateX(102%); transition-delay: .35s; }
html.tor-oeffnet .tor { pointer-events: none; }
@keyframes licht-auf {
  0% { opacity: 0; width: 2px; }
  20% { opacity: 1; width: 6px; }
  55% { opacity: .85; width: 45vw; }
  100% { opacity: 0; width: 140vw; }
}
/* Wiederkehrer: kürzer */
html.kurz.tor-oeffnet .tor-mitte { transition-duration: .25s; }
html.kurz.tor-oeffnet .tor-fluegel { transition-duration: .8s; transition-delay: .1s; }
html.kurz.tor-oeffnet .tor-licht { animation-duration: .95s; }

/* ==========================================================================
   4.3 Hero
   ========================================================================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'kopf' 'bild' 'aktionen';
  background:
    radial-gradient(90% 60% at 20% 0%, var(--nacht-violett) 0%, transparent 70%),
    linear-gradient(180deg, var(--nacht-1) 0%, var(--nacht-0) 100%);
  overflow: hidden;
  isolation: isolate;
}

/* Bild */
.hero-bild {
  grid-area: bild;
  position: relative;
  height: 62vh; height: min(62svh, 34rem);
  margin-top: -2rem;
  z-index: 0;
}
.hero-bild picture { width: 100%; height: 100%; }
.hero-bild img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 62%;
  will-change: transform;
}
.hero-bild::after {
  /* Kanten weich in die Nacht auslaufen lassen */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, var(--nacht-1) 0%, rgba(13, 11, 41, 0) 22%, rgba(6, 5, 26, 0) 72%, var(--nacht-0) 100%);
}
/* pinkfarbener Lichtring aus dem Bild, dezent pulsierend */
.hero-ring {
  position: absolute; left: 34%; top: -6%; width: 76%; height: 62%;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 72%, rgba(245, 150, 230, .55) 86%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: ring-puls 5.5s ease-in-out infinite;
}
@keyframes ring-puls { 0%, 100% { opacity: .08; } 50% { opacity: .42; } }

/* Himmel-Canvas (Sterne + Schnee) */
.hero-himmel { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* Text */
.hero-kopf, .hero-aktionen { position: relative; z-index: 2; padding-inline: var(--rand); }
.hero-kopf { grid-area: kopf; padding-top: 5.25rem; }
.hero-aktionen { grid-area: aktionen; padding-bottom: 3.5rem; margin-top: -3rem; }

.hero-schule {
  font-family: var(--font-caps); font-weight: 700;
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold);
  line-height: 1.7;
}
.hero-schule span { display: block; font-weight: 400; letter-spacing: .16em; text-transform: none; font-size: 1.05em; color: rgba(255, 231, 168, .85); }

.titel {
  margin: 1.1rem 0 1rem;
  font-family: var(--font-titel); font-weight: 700; line-height: .95;
  /* Versalien: In Cinzel Decorative überlappen sonst die kleinen „oo“ */
  text-transform: uppercase;
}
.titel-oben {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'sieben die' 'sieben ligen';
  align-items: end;
  column-gap: .12em;
  font-size: clamp(1.7rem, 7.6vw, 3.5rem);
  letter-spacing: .02em;
}
.titel-die { grid-area: die; align-self: end; }
.titel-ligen { grid-area: ligen; align-self: start; padding-top: .08em; }

/* Schmale Screens: "Die" / "7" / "Ligen von" in natürlicher Lesereihenfolge
   untereinander statt "7 Die" nebeneinander (sonst liest es sich holprig). */
@media (max-width: 480px) {
  .titel-oben {
    grid-template-columns: 1fr;
    grid-template-areas: 'die' 'sieben' 'ligen';
    justify-items: center;
    text-align: center;
  }
  .titel-die, .titel-ligen { align-self: auto; }
}

.titel-sieben {
  grid-area: sieben;
  position: relative;
  font-family: var(--font-titel); font-weight: 900;
  font-size: 2.7em; line-height: .8;
  padding-right: .02em;
}
.gold-text {
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%) no-repeat, var(--gold-verlauf);
  background-size: 250% 100%, 100% 100%;
  background-position: 180% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(90, 50, 5, .55)) drop-shadow(0 0 14px rgba(235, 192, 99, .35));
}
.titel-schafmoor {
  display: block;
  margin-top: .12em;
  font-size: clamp(2.35rem, 11.4vw, 6rem);
  letter-spacing: .01em;
  background: var(--pink-verlauf);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(80, 10, 60, .6)) drop-shadow(0 0 14px rgba(224, 110, 200, .65)) drop-shadow(0 0 36px rgba(192, 80, 186, .45));
}

/* Glitzer über der 7 */
.funkeln { position: absolute; width: .16em; aspect-ratio: 1; opacity: 0; pointer-events: none; }
.funkeln::before {
  content: ''; position: absolute; inset: 0;
  background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px var(--gold));
}
.funkeln.f1 { top: 2%; left: 62%; }
.funkeln.f2 { top: 38%; left: -4%; width: .1em; }
.funkeln.f3 { top: 72%; left: 44%; width: .12em; }

.hero-slogan {
  max-width: 26em;
  font-size: clamp(1.1rem, 4.6vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

.claim {
  font-family: var(--font-caps); font-weight: 700;
  font-size: clamp(1rem, 4.2vw, 1.3rem); letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(235, 192, 99, .45), 0 2px 8px rgba(0, 0, 0, .7);
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: .85rem; margin: 1.4rem 0 1.25rem; }
.hero-buttons .btn { flex: 1 1 16rem; }
.anmeldung-zu { display: none !important; }
.hero-frist { margin-top: .35rem; font-size: .95rem; color: var(--gold-hell); letter-spacing: .02em; }
.hero-info { font-size: .95rem; color: var(--text-leise); letter-spacing: .02em; }
.hero-info span[aria-hidden] { color: var(--gold); padding: 0 .35em; }

/* Live-Zähler */
.live {
  display: inline-flex; align-items: baseline; gap: .6rem;
  margin-top: 1.1rem; padding: .55rem 1rem;
  border-radius: 999px;
  background: rgba(6, 5, 26, .55);
  border: 1px solid rgba(240, 184, 224, .25);
  font-size: .95rem; line-height: 1.45;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.live-punkt {
  flex: none; width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--rosa); box-shadow: 0 0 10px var(--magenta);
  transform: translateY(-.05rem);
  animation: live-puls 2.2s ease-in-out infinite;
}
@keyframes live-puls { 0%, 100% { opacity: .5; transform: translateY(-.05rem) scale(.85); } 50% { opacity: 1; transform: translateY(-.05rem) scale(1.1); } }
.live strong { color: var(--classic-pink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Aufbau der Titel-Ebenen nach dem Öffnen des Tores */
html.js .hero .aufbau { opacity: 0; }
html.js.tor-oeffnet .hero .aufbau,
html.js.tor-weg .hero .aufbau { animation: aufbau 1.1s var(--ease-weich) forwards; }
html.js .hero .aufbau.e1 { animation-delay: .55s; }
html.js .hero .aufbau.e2 { animation-delay: .95s; }
html.js .hero .aufbau.e3 { animation-delay: 1.35s; }
html.js .hero .aufbau.e4 { animation-delay: 1.75s; }
html.js.kurz .hero .aufbau.e1 { animation-delay: .2s; }
html.js.kurz .hero .aufbau.e2 { animation-delay: .6s; }
html.js.kurz .hero .aufbau.e3 { animation-delay: 1s; }
html.js.kurz .hero .aufbau.e4 { animation-delay: 1.3s; }
@keyframes aufbau {
  from { opacity: 0; transform: translateY(14px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
html.js.tor-oeffnet .gold-text, html.js.tor-weg .gold-text { animation: glanz 1.6s ease-in-out 1.9s both; }
html.js.kurz .gold-text { animation-delay: 1.4s !important; }
@keyframes glanz { from { background-position: 180% 0, 0 0; } to { background-position: -80% 0, 0 0; } }
html.js.tor-oeffnet .funkeln, html.js.tor-weg .funkeln { animation: funkeln 2.8s ease-in-out infinite; }
html.js .funkeln.f1 { animation-delay: 1.9s; }
html.js .funkeln.f2 { animation-delay: 2.6s; }
html.js .funkeln.f3 { animation-delay: 3.3s; }
@keyframes funkeln {
  0%, 100% { opacity: 0; transform: scale(.2) rotate(0); }
  12% { opacity: 1; transform: scale(1) rotate(45deg); }
  30% { opacity: 0; transform: scale(.3) rotate(90deg); }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .hero {
    min-height: 100vh; min-height: 100svh;
    grid-template-columns: minmax(0, 52%) 1fr;
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: '. .' 'kopf .' 'aktionen .' '. .';
  }
  .hero-bild { grid-area: 1 / 1 / -1 / -1; height: auto; margin: 0; }
  .hero-bild img { object-position: 72% 50%; }
  .hero-bild::after {
    background:
      linear-gradient(90deg, rgba(6, 5, 26, .82) 0%, rgba(6, 5, 26, .55) 28%, rgba(6, 5, 26, .1) 52%, rgba(6, 5, 26, 0) 62%),
      linear-gradient(180deg, rgba(6, 5, 26, 0) 70%, var(--nacht-0) 100%);
  }
  .hero-ring { left: 30%; top: -14%; width: 84%; height: 74%; }
  .hero-kopf { padding-top: 5rem; padding-left: clamp(2rem, 5vw, 5rem); }
  .hero-aktionen { margin-top: 1.4rem; padding-left: clamp(2rem, 5vw, 5rem); padding-bottom: 5rem; }
  .titel-oben { font-size: clamp(2rem, 3.3vw, 3.6rem); }
  .titel-schafmoor { font-size: clamp(3rem, 5.2vw, 6.2rem); }
  .hero-schule { font-size: .8rem; }
  .hero-slogan { font-size: clamp(1.2rem, 1.6vw, 1.5rem); }
  .claim { font-size: clamp(1.05rem, 1.35vw, 1.35rem); }
  .hero-buttons .btn { flex: 0 1 auto; }
}


/* Musik-Button erst zeigen, wenn das Tor offen ist */
html.js.tor-zu .musik-btn { opacity: 0; pointer-events: none; }
.titel:focus { outline: none; }
