/* ───────────────────────────────────────────────────────────────────────────
   geburtstag.niklaslustig.de

   Bewusst schlicht gehalten und bewusst NICHT in der Bildsprache von
   niklaslustig.de — die soll er zum ersten Mal sehen, wenn er draufklickt,
   nicht hier vorweggenommen kriegen. Warmes Papier, freundlich, lesbar.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --paper:      #FBF8F3;
  --paper-alt:  #F3EEE4;
  --ink:        #1E1B17;
  --ink-soft:   #5C554B;
  --ink-faint:  #8C8478;
  --accent:     #C4542A;
  --accent-dim: #A9461F;
  --line:       #E2DACB;
  --shadow:     0 1px 2px rgba(30, 27, 23, .05), 0 8px 24px rgba(30, 27, 23, .07);

  --measure: 34rem;
  --gap: clamp(1rem, 4vw, 2rem);
}

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

/* ─────────────────────────────────── Tor ────────────────────────────────── */

/* Ein Scherz-Schloss, keine Sicherheitsmaßnahme: Antwort und Inhalt stehen
   beide im Quelltext. Es soll den Moment vor der Seite gestalten, nicht
   irgendwas schützen. */

html.gated { overflow: hidden; }
html.gated body > *:not(#gate) { display: none; }
html.gated #gate { display: grid; }

#gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: grid;
  place-items: center;
  padding: var(--gap);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  transition: opacity .5s ease;
}
#gate[hidden] { display: none; }
#gate.dismissed { opacity: 0; pointer-events: none; }

/* Das GIF ist nur 500×400 groß und müsste gekachelt werden — eine einzelne
   Kachelung sieht man sofort, weil alle Kopien im Gleichtakt fallen. Deshalb
   zwei Lagen desselben Bildes in unterschiedlicher Größe, versetzt und
   gespiegelt: die Raster passen nicht aufeinander, das Muster löst sich auf.
   Geladen wird die Datei trotzdem nur einmal. */
.gate-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000 url("assets/digital-rain.gif") repeat 0 0 / 520px 416px;
  opacity: .7;
}
.gate-rain::before,
.gate-rain::after {
  content: "";
  position: absolute;
  inset: -10%;
}
.gate-rain::before {
  background: url("assets/digital-rain.gif") repeat 270px 150px / 790px 632px;
  transform: scaleX(-1);
  opacity: .6;
}
/* Vignette: zieht den Blick in die Mitte und schluckt den Rest der Regelmäßigkeit. */
.gate-rain::after {
  background: radial-gradient(ellipse at center,
              rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.85) 100%);
}

.gate-box {
  position: relative;
  width: min(34rem, 100%);
  text-align: center;
}

.gate-prompt {
  max-width: none;
  color: #4AE07A;
  font-size: clamp(.95rem, 3.2vw, 1.25rem);
  line-height: 1.5;
  text-shadow: 0 0 12px rgba(74, 224, 122, .55), 0 2px 18px #000;
  margin-bottom: .6rem;
}

.gate-hint {
  max-width: none;
  margin-bottom: 1.5rem;
  color: rgba(122, 200, 150, .72);
  font-size: .8rem;
  text-shadow: 0 2px 14px #000;
}

.gate-row {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gate-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#gate-input {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: .8rem 1rem;
  color: #C9FFD8;
  background: rgba(0, 0, 0, .78);
  border: 1px solid rgba(74, 224, 122, .5);
  border-radius: 6px;
  caret-color: #4AE07A;
}
#gate-input::placeholder { color: rgba(201, 255, 216, .35); }
#gate-input:focus {
  outline: none;
  border-color: #4AE07A;
  box-shadow: 0 0 0 3px rgba(74, 224, 122, .22);
}

#gate-form button {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: .8rem 1.75rem;
  border-radius: 6px;
  border: 1px solid #4AE07A;
  background: rgba(74, 224, 122, .14);
  color: #4AE07A;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
#gate-form button:hover { background: #4AE07A; color: #000; }

.gate-error {
  max-width: none;
  min-height: 1.4em;
  margin-top: 1rem;
  font-size: .85rem;
  color: #E0794A;
  text-shadow: 0 2px 12px #000;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}
.gate-box.wrong { animation: gate-shake .42s ease; }

@media (prefers-reduced-motion: reduce) {
  .gate-box.wrong { animation: none; }
  #gate { transition: none; }
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body { margin: 0; overflow-x: hidden; }

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; max-width: var(--measure); }

a { color: var(--accent); }
a:hover { color: var(--accent-dim); }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--accent); color: #fff;
  padding: .7rem 1.2rem; border-radius: 999px;
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* ───────────────────────────────── Hero ─────────────────────────────────── */

.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 6rem);
  text-align: center;
}

.hero .wrap > * { margin-inline: auto; }

.hero-photo {
  margin: 0 auto clamp(1.75rem, 5vw, 2.75rem);
  max-width: 40rem;
}
.hero-photo img {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.kicker {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .75rem;
}

h1 {
  font-size: clamp(2.6rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
}

.lede {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--ink-soft);
  margin-top: 1.25rem;
  max-width: 28rem;
}

.hero-anleitung {
  margin-top: 2rem;
  font-size: .95rem;
  color: var(--ink-faint);
  max-width: 24rem;
}

/* Kein Link, nur ein Wegweiser — der Button soll erst weiter unten kommen. */
.hero-pfeil {
  margin-top: .5rem;
  max-width: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  animation: pfeil-tippt 2.6s ease-in-out infinite;
}
@keyframes pfeil-tippt {
  0%, 70%, 100% { transform: translateY(0); }
  82%           { transform: translateY(5px); }
}

.cta-row { margin-top: 2.25rem; max-width: none; }
.cta-note {
  margin-top: .85rem;
  font-size: .9rem;
  color: var(--ink-faint);
  max-width: none;
}

/* ──────────────────────────────── Finale ───────────────────────────────── */

/* Der einzige Ausgang der Seite. Sitzt zwischen den Fotos und der Timeline,
   deshalb oben und unten eine Kante — er soll als eigener Moment stehen und
   nicht mit dem Nachbarband verschwimmen. */
.finale {
  text-align: center;
  background: linear-gradient(180deg, #EFE6D6 0%, var(--paper-alt) 100%);
  border-block: 1px solid var(--line);
}
.finale .wrap > * { margin-inline: auto; }
.finale h2 { margin-top: .2rem; }
.finale-lede {
  margin-top: .9rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 28rem;
}

/* ───────────────────────────────── Buttons ──────────────────────────────── */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: .85rem 1.9rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(196, 84, 42, .25);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--accent-dim);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(196, 84, 42, .3);
}
.btn:active { transform: translateY(0); }

.btn-primary { font-size: 1.1rem; padding: 1rem 2.4rem; }
.btn-big     { font-size: 1.05rem; padding: 1rem 2.1rem; }

/* ───────────────────────────────── Bänder ──────────────────────────────── */

.band { padding-block: clamp(3rem, 8vw, 5.5rem); }
.band-alt { background: var(--paper-alt); }

.band h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.022em;
}

.section-lede {
  margin-top: .85rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ──────────────────────────────── Übersicht ────────────────────────────── */

.gifts {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.gifts li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem 1.6rem;
}
.gift-num {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .6rem;
}
.gifts h3 { font-size: 1.1rem; font-weight: 700; }
.gifts p  { margin-top: .5rem; color: var(--ink-soft); font-size: .95rem; }

/* ──────────────────────────────── Konzerte ─────────────────────────────── */

.konzert { margin-top: clamp(2.5rem, 6vw, 4rem); }

.konzert-head { margin-bottom: 1.5rem; }
.konzert-date {
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.konzert-head h3 {
  font-size: clamp(1.25rem, 3.4vw, 1.6rem);
  font-weight: 700;
  margin-top: .4rem;
}
.konzert-meta {
  margin-top: .4rem;
  color: var(--ink-faint);
  font-size: .9rem;
  max-width: none;
}

/* Der Stapel: Karten überlappen sich und stehen leicht schief.
   Die Ausweich-Mechanik in main.js setzt --tx/--ty; die Basis-Rotation
   bleibt dabei erhalten, weil sie im selben transform steckt. */
/* Das Polster ist kein Zierrat: main.js sperrt die Fotos in genau diese Box
   ein, damit sie beim Ausweichen nicht über den Button darunter wandern. */
.stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 2.25rem 1rem;
  min-height: 8rem;
}

.stack .karte {
  --tx: 0px;
  --ty: 0px;
  --rot: 0deg;
  display: block;
  margin: -12px;
  border-radius: 8px;
  background: #fff;
  padding: 6px 6px 22px;
  box-shadow: var(--shadow);
  transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
  position: relative;
  z-index: 1;
}
.stack .karte img {
  width: clamp(88px, 13vw, 148px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
}

.stack .karte.fleeing { z-index: 5; }

/* Liegt über den Fotos — falls doch mal eins zu nah kommt, bleibt der
   Button trotzdem anklickbar. */
.stack-foot {
  position: relative;
  z-index: 6;
  margin-top: 1.25rem;
  max-width: none;
}

/* ──────────────────────────────── Timeline ─────────────────────────────── */

.timeline {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0 0 0 1.75rem;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: .55rem; bottom: .55rem;
  width: 2px;
  background: var(--line);
}

.timeline > li {
  position: relative;
  padding-bottom: 2.2rem;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -1.75rem; top: .5rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
}
.band-alt .timeline > li::before { background: var(--paper-alt); }

.timeline > li.t-mark::before {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline > li.t-last::before {
  width: 16px; height: 16px;
  left: -1.87rem; top: .4rem;
  box-shadow: 0 0 0 4px rgba(196, 84, 42, .18);
}

.t-date {
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.timeline h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-top: .25rem;
}
.timeline > li > p:last-child,
.timeline > li h3 + p {
  margin-top: .35rem;
  color: var(--ink-soft);
}

.timeline > li.t-last h3 { font-size: 1.4rem; }

/* Querformat-Foto neben Hochformat-Video: die feste Breite der zweiten Spalte
   bringt beide auf ungefähr dieselbe Höhe, ohne irgendwo zu beschneiden. */
.media {
  margin-top: 1.1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 12rem;
  align-items: start;
  max-width: 44rem;
}
.media figure { margin: 0; }
.media-single { grid-template-columns: minmax(0, 1fr); max-width: 34rem; }
.media img,
.media video {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: #000;
}
.media figcaption {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--ink-faint);
}

@media (max-width: 40rem) {
  .media { grid-template-columns: 1fr; }
  .media video { max-width: 13rem; }
}

/* ───────────────────────────── Nächste Schritte ────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: .6rem;
  max-width: 48rem;
}

.steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s ease, opacity .2s ease;
}
.steps li:has(input:checked) {
  opacity: .55;
  border-color: var(--accent);
}

.steps label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .9rem;
  align-items: start;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
}

.steps input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 1.25rem; height: 1.25rem;
  flex: none;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  top: .18rem;
  transition: background .15s ease, border-color .15s ease;
}
.steps input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.steps input:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.steps span { color: var(--ink-soft); font-size: .97rem; }
.steps strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.steps li:has(input:checked) strong { text-decoration: line-through; }

.steps-foot {
  margin-top: 1.75rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* ───────────────────────────────── Footer ──────────────────────────────── */

.foot {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  border-top: 1px solid var(--line);
}
.foot p { max-width: none; }
.foot p:first-child {
  font-size: 1.25rem;
  font-weight: 700;
}
.foot-small {
  margin-top: .7rem;
  font-size: .82rem;
  color: var(--ink-faint);
}

/* ─────────────────────────────── Reduced motion ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .hero-pfeil { animation: none; }
}
