/* ============================================================
   Sandy · Birthday Reveal
   Dunkler Gerichtssaal trifft Geburtstag: Tinte, Messing, Samt.
   ============================================================ */

:root {
  --ink:        #0B0E14;
  --ink-2:      #12161F;
  --ink-3:      #1A2030;
  --velvet:     #4A1420;

  --gold:       #C9A227;
  --gold-lite:  #EBD48A;
  --gold-deep:  #8A6B14;

  --text:       #F4F1E9;
  --text-mute:  #A2A9B8;
  --text-faint: #6B7382;

  --line:       rgba(235, 212, 138, .16);
  --line-soft:  rgba(255, 255, 255, .07);

  --font-display: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --font-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shell:  min(34rem, 100%);
  --pad-x:  clamp(1.25rem, 6vw, 2.25rem);

  --ease:   cubic-bezier(.22, 1, .36, 1);
}

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

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Atmosphäre: Vignette + Filmkorn ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #1E2436 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, var(--velvet) 0%, transparent 65%),
    var(--ink);
}

.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.vignette {
  background: radial-gradient(75% 60% at 50% 45%, transparent 40%, rgba(0, 0, 0, .55) 100%);
}

.grain {
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Konfetti-Canvas ---------- */

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

/* ---------- Bühne / Layout ---------- */

#app {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding:
    calc(env(safe-area-inset-top) + clamp(3rem, 12vh, 6rem))
    var(--pad-x)
    calc(env(safe-area-inset-bottom) + 3.5rem);
}

.stage {
  width: var(--shell);
  margin: auto 0;
  text-align: center;
}

.stage[hidden] { display: none; }

/* Gestaffeltes Einblenden der Kinder einer aktiven Bühne */
.stage.is-active > * {
  animation: rise .72s var(--ease) both;
}
.stage.is-active > *:nth-child(1) { animation-delay: .04s; }
.stage.is-active > *:nth-child(2) { animation-delay: .12s; }
.stage.is-active > *:nth-child(3) { animation-delay: .20s; }
.stage.is-active > *:nth-child(4) { animation-delay: .28s; }
.stage.is-active > *:nth-child(5) { animation-delay: .36s; }
.stage.is-active > *:nth-child(6) { animation-delay: .44s; }
.stage.is-active > *:nth-child(7) { animation-delay: .52s; }
.stage.is-active > *:nth-child(8) { animation-delay: .60s; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 1.25rem, 0); filter: blur(6px); }
  to   { opacity: 1; transform: none;                       filter: blur(0); }
}

/* ---------- Typografie ---------- */

.kicker {
  margin: 0 0 1.5rem;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
}

.display {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 17vw, 5.25rem);
  line-height: .95;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.display--md { font-size: clamp(2.5rem, 13vw, 4.25rem); }
.display--sm { font-size: clamp(2rem, 10vw, 3.25rem); line-height: 1.04; }

.display__line { display: block; }

.display--gold,
.display__line--gold {
  background: linear-gradient(168deg, var(--gold-lite) 8%, var(--gold) 48%, var(--gold-deep) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: .08em;   /* Unterlängen nicht abschneiden */
}

.display em {
  font-style: italic;
  color: var(--gold-lite);
}

.lede {
  margin: 0 auto 1.25rem;
  max-width: 30ch;
  color: var(--text-mute);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

.lede--tight { margin-bottom: 2rem; }

.hint-meta {
  margin: 1.125rem 0 0;
  font-size: .8125rem;
  color: var(--text-faint);
  letter-spacing: .02em;
}

.signed-by {
  margin: 3.25rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--text-faint);
}

.signed-by--final {
  margin-top: 1rem;
  font-style: normal;
  font-size: .8125rem;
  font-family: var(--font-ui);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .8;
}

.closing {
  margin: 2.75rem 0 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3.25rem;
  padding: .875rem 2rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn--primary {
  color: #17120A;
  background: linear-gradient(160deg, var(--gold-lite), var(--gold) 58%, #A8801B);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .4) inset,
    0 10px 30px -10px rgba(201, 162, 39, .55);
}

.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 16px 38px -12px rgba(201,162,39,.7); }
.btn--primary:active { transform: translateY(0) scale(.985); }

.btn--ghost {
  margin-top: 1.75rem;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid var(--line-soft);
}

.btn--ghost:hover { color: var(--text); border-color: var(--line); }

.btn--sm {
  min-height: 2.75rem;
  padding: .625rem 1.375rem;
  font-size: .875rem;
  font-weight: 500;
}

.btn--link {
  margin-top: 1.75rem;
  width: 100%;
  padding-inline: 1.25rem;
  white-space: nowrap;   /* Pfeil bleibt am Text, kein Umbruch */
}

/* Neustart schliesst direkt an den Erlebnis-Link an */
.btn--link + .btn--ghost { margin-top: .75rem; }

.btn__arrow { transition: transform .25s var(--ease); }
.btn--link:hover .btn__arrow { transform: translateX(4px); }

.btn:focus-visible {
  outline: 2px solid var(--gold-lite);
  outline-offset: 3px;
}

/* ---------- Fortschritt ---------- */

.progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.progress__label {
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.progress__track {
  position: relative;
  width: min(11rem, 60%);
  height: 2px;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 25%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-lite));
  transition: width .6s var(--ease);
}

/* ---------- Hinweis-Karten ---------- */

.clue-deck { position: relative; }

.clue[hidden] { display: none; }

.clue {
  position: relative;
  padding: clamp(1.75rem, 7vw, 2.75rem) clamp(1.25rem, 5vw, 2.25rem) clamp(2rem, 7vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
    var(--ink-2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .05) inset,
    0 30px 60px -30px rgba(0, 0, 0, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.clue.is-entering { animation: clueIn .6s var(--ease) both; }

@keyframes clueIn {
  from { opacity: 0; transform: translate3d(0, 1.5rem, 0) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.clue__glyph {
  display: block;
  margin-bottom: 1.125rem;
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(201, 162, 39, .35));
}

.clue__eyebrow {
  margin: 0 0 .875rem;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
}

.clue__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.clue__body {
  margin: 0 auto .875rem;
  max-width: 32ch;
  color: var(--text-mute);
  text-wrap: pretty;
}

.clue__body--aside {
  margin-bottom: 0;
  padding-top: .875rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--gold-lite);
  opacity: .9;
}

/* ---------- Tipp / Formular ---------- */

.guess {
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

.guess__input {
  width: 100%;
  min-height: 3.25rem;
  padding: .875rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 1rem;                 /* >=16px verhindert iOS-Zoom */
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  text-align: center;
  transition: border-color .2s, background .2s;
}

.guess__input::placeholder { color: var(--text-faint); }

.guess__input:focus {
  outline: none;
  border-color: var(--line);
  background: rgba(255, 255, 255, .07);
}

.guess__verdict {
  margin: 1.5rem auto 0;
  max-width: 32ch;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--gold-lite);
  animation: rise .5s var(--ease) both;
}

.guess__verdict[hidden] { display: none; }

/* ---------- Auflösung ---------- */

.seal {
  display: grid;
  place-items: center;
  width: 6.25rem;
  height: 6.25rem;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 32% 28%, rgba(235, 212, 138, .28), rgba(74, 20, 32, .55));
  box-shadow:
    0 0 0 6px rgba(201, 162, 39, .1),
    0 18px 40px -18px rgba(201, 162, 39, .6);
  transform: rotate(-8deg);
}

.stage.is-active .seal { animation: stamp .7s var(--ease) both; }

.seal__inner {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-lite);
}

@keyframes stamp {
  0%   { opacity: 0; transform: rotate(-8deg) scale(2.4); }
  60%  { opacity: 1; transform: rotate(-8deg) scale(.94); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}

.reveal__tagline {
  margin: 0 auto 2.25rem;
  max-width: 28ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1875rem;
  color: var(--text-mute);
}

/* ---------- Karten ---------- */

.card {
  padding: clamp(1.5rem, 6vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
    var(--ink-2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
  text-align: left;
}

.card--invite { text-align: left; }

.card__body {
  margin: 0 0 1rem;
  color: var(--text-mute);
  text-wrap: pretty;
}

.card__body:last-of-type { margin-bottom: 0; }

.card__body--sm {
  margin-top: .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  font-size: .875rem;
  color: var(--text-faint);
}

/* ---------- Fakten-Liste ---------- */

.facts {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
}

.facts__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.facts__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .8125rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.facts__k {
  font-size: .8125rem;
  color: var(--text-faint);
  letter-spacing: .02em;
}

.facts__v {
  font-weight: 500;
  text-align: right;
}

/* ---------- Datums-Badge ---------- */

.date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .125rem;
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}

.date-badge__day {
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.date-badge__date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.875rem, 9vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--text);
}

/* ---------- Ablauf-Zeitstrahl ---------- */

.timeline {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.timeline__step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.timeline__step:last-child { padding-bottom: 0; }

/* Verbindungslinie zwischen den Punkten */
.timeline__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 4.25rem;
  top: 1.45rem;
  bottom: -.6rem;
  width: 1px;
  margin-left: -.5px;
  background: linear-gradient(180deg, var(--gold-deep), rgba(201, 162, 39, .28));
}

.timeline__time {
  flex: 0 0 3.25rem;
  padding-top: .1rem;
  font-family: var(--font-ui);
  font-size: .8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--gold);
}

.timeline__body {
  position: relative;
  display: block;
  padding-left: 1rem;
  border-left: 1px solid transparent;   /* haelt die Punkte ausgerichtet */
}

/* Punkt auf der Linie */
.timeline__body::before {
  content: "";
  position: absolute;
  left: -.3125rem;
  top: .45rem;
  width: .625rem;
  height: .625rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

.timeline__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.25;
  color: var(--text);
}

.timeline__note {
  display: block;
  margin-top: .1875rem;
  font-size: .9375rem;
  color: var(--text-mute);
}

/* ---------- Einladung ---------- */

.invite__eyebrow {
  margin: 0 0 1.25rem;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

.invite { margin: 0; }

.invite__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 0;
  border-top: 1px solid var(--line-soft);
}

.invite__row:first-child { border-top: 0; padding-top: 0; }

.timeline + .invite { border-top: 1px solid var(--line-soft); padding-top: .25rem; }
.timeline + .invite .invite__row:first-child { padding-top: .875rem; }

.invite__k {
  flex: none;
  font-size: .8125rem;
  color: var(--text-faint);
}

.invite__v {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.35;
  text-align: right;
  color: var(--text);
}

/* ---------- Motion-Präferenz respektieren ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .stage.is-active > *,
  .clue.is-entering,
  .stage.is-active .seal,
  .guess__verdict {
    animation: none !important;
  }

  .btn { transition: none; }
  .btn--primary:hover { transform: none; }
  .progress__fill { transition: none; }
}

/* ---------- Größere Viewports ---------- */

@media (min-width: 48rem) {
  .stage { text-align: center; }
  .lede { font-size: 1.125rem; }
  .btn--link { width: auto; }
}
