/* gather-your-party.de – Startseite
   Eine Idee: verstreute Punkte finden sich zum Wort zusammen.
   Alles lokal, kein Inline-CSS, läuft unter CSP default-src 'self'. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("nunito-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --grund: #0c0d11;
  --tinte: #f7f5f1;
  --leise: #a9acb6;
  --leiser: #80848f;
  --glut: #ff5a3c;
  --orange: #ff7a2e;
  --hell: #ff9836;
  --bernstein: #ffb547;
  --creme: #ffe7cb;

  /* Laufweiten bei Nunito, gemessen: „Großartiges“ (900) und „Hier entsteht was“ (300).
     Daraus ergibt sich ein Schriftbild, in dem beide Zeilen gleich breit laufen. */
  --wort-em: 5.93;
  --auftakt-zu-wort: 0.76;

  --rand: clamp(1.125rem, 5.5vw, 5.5rem);
  --breite: min(100vw - 2 * var(--rand), 105rem);
  --wort: min(var(--breite) / var(--wort-em), 25vh);

  --sanft: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  background: var(--grund);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--tinte);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(95% 70% at 22% 58%, rgba(255, 122, 46, 0.085), transparent 62%),
    radial-gradient(70% 55% at 92% 6%, rgba(255, 181, 71, 0.04), transparent 60%),
    var(--grund);
}

::selection {
  background: rgba(255, 122, 46, 0.4);
  color: #fff;
}

/* ---------- Punktefeld ---------- */

.feld {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.js .feld {
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease-out;
}

.js.ist-live .feld {
  opacity: 1;
}

/* ---------- Gerüst ---------- */

.kopf,
.buehne,
.fuss {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--breite) + 2 * var(--rand));
  margin-inline: auto;
  padding-inline: max(var(--rand), env(safe-area-inset-left)) max(var(--rand), env(safe-area-inset-right));
}

.kopf {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-top: max(clamp(1.25rem, 4vh, 2.75rem), env(safe-area-inset-top));
  animation: auftauchen 0.9s var(--sanft) 0.05s both;
}

.domain {
  font-size: clamp(0.95rem, 0.88rem + 0.25vw, 1.125rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--tinte);
}

/* Vier Punkte, eine Gruppe. */
.marke {
  position: relative;
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
}

.marke span {
  position: absolute;
  border-radius: 50%;
  animation: sammeln 1.1s var(--sanft) 0.25s both;
}

.marke span:nth-child(1) {
  top: 0.06rem;
  left: 0;
  width: 0.72rem;
  height: 0.72rem;
  background: var(--orange);
  --dx: -0.55rem;
  --dy: -0.4rem;
}

.marke span:nth-child(2) {
  top: 0;
  right: 0.02rem;
  width: 0.52rem;
  height: 0.52rem;
  background: var(--bernstein);
  --dx: 0.6rem;
  --dy: -0.5rem;
  animation-delay: 0.33s;
}

.marke span:nth-child(3) {
  bottom: 0;
  left: 0.16rem;
  width: 0.46rem;
  height: 0.46rem;
  background: var(--glut);
  --dx: -0.45rem;
  --dy: 0.6rem;
  animation-delay: 0.41s;
}

.marke span:nth-child(4) {
  right: 0;
  bottom: 0.04rem;
  width: 0.6rem;
  height: 0.6rem;
  background: var(--creme);
  --dx: 0.6rem;
  --dy: 0.45rem;
  animation-delay: 0.49s;
}

.buehne {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(1.5rem, 5vh, 4rem) clamp(2rem, 9vh, 7rem);
}

/* ---------- Motto ---------- */

.motto {
  margin: 0;
  font-size: var(--wort);
  font-weight: 900;
  line-height: 1;
}

.motto__auftakt,
.motto__wort {
  display: block;
  white-space: nowrap;
}

.motto__auftakt {
  font-size: calc(var(--auftakt-zu-wort) * 1em);
  font-weight: 300;
  color: var(--tinte);
  animation: auftauchen 1s var(--sanft) 0.15s both;
}

.motto__wort {
  /* Platz für die Unterlänge des g, ohne die Zeile darunter wegzuschieben */
  margin: -0.05em 0 -0.24em;
  padding-bottom: 0.24em;
  color: var(--orange);
  animation: auftauchen 1s var(--sanft) 0.5s both;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .motto__wort {
    width: fit-content;
    background: linear-gradient(100deg, var(--orange) 5%, var(--hell) 55%, var(--bernstein) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Sobald das Punktefeld läuft, übernimmt es das Wort.
   Der Text bleibt im Dokument: für Screenreader, Suche und Kopieren. */
.js.ist-live .motto__wort {
  width: auto;
  background: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: none;
}

/* Die Widmung: klar unter dem Motto, aber kein Kleingedrucktes. */
.widmung {
  margin: max(1.35rem, calc(var(--wort) * 0.31)) 0 0;
  font-size: clamp(1.125rem, 0.95rem + 0.95vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--creme);
  animation: auftauchen 1s var(--sanft) 0.9s both;
}

.widmung__zwinkern {
  color: var(--hell);
  font-weight: 800;
  white-space: nowrap;
}

.js .widmung {
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 1.1s var(--sanft), transform 1.1s var(--sanft);
  animation: none;
}

.js.ist-versammelt .widmung {
  opacity: 1;
  transform: none;
}

/* ---------- Fuß ---------- */

.fuss {
  padding-bottom: max(clamp(1.25rem, 4vh, 2.75rem), env(safe-area-inset-bottom));
}

.hinweis {
  display: none;
  margin: 0;
  font-size: clamp(0.875rem, 0.84rem + 0.15vw, 1rem);
  font-weight: 500;
  color: var(--leiser);
}

.js .hinweis {
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease-out 0.9s;
}

.js.ist-versammelt .hinweis {
  opacity: 1;
}

.js.hat-gewirbelt .hinweis {
  opacity: 0;
  transition-delay: 0.6s;
}

/* ---------- Bewegung ---------- */

@keyframes auftauchen {
  from {
    opacity: 0;
    transform: translateY(0.28em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sammeln {
  from {
    opacity: 0;
    transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.4);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Ruhige Fassung: alles steht sofort an seinem Platz. */
@media (prefers-reduced-motion: reduce) {
  .kopf,
  .marke span,
  .motto__auftakt,
  .motto__wort,
  .widmung {
    animation: none;
  }

  .js .feld,
  .js .widmung {
    transform: none;
    transition: none;
  }

  .js .hinweis {
    display: none;
  }
}

/* Sehr flache Fenster (Handy quer): Luft sparen. */
@media (max-height: 30rem) {
  .buehne {
    padding-block: 1rem 1.5rem;
  }
}
