/* ============================================================
   Véspera Verde — Pre-Wedding Party
   Mobile-first, plain CSS
   ============================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: "Caroni";
  src: url("font/Caroni-Regular.woff2") format("woff2"),
       url("font/Caroni-Regular.woff")  format("woff"),
       url("font/Caroni-Regular.otf")   format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --cream:       #faf6ef;
  --green:       #435c37;
  --green-soft:  rgba(67, 92, 55, 0.72);
  --green-line:  rgba(67, 92, 55, 0.22);

  --gap:   1.25rem;
  --maxw:  36rem;

  --ease:        cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fade:    0.8s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--cream);
  color: var(--green);
  font-family: "Caroni", Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

::selection { background: var(--green); color: var(--cream); }

[hidden] { display: none !important; }

/* ---------- Sprache (i18n) ---------- */
.tr-en { display: none; }
body.lang-en .tr-de { display: none; }
body.lang-en .tr-en { display: revert; }

#lang-toggle {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 200;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  background: transparent;
  color: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
#lang-toggle:hover, #lang-toggle:focus-visible {
  color: var(--green);
  border-color: var(--green);
}

.btn-loading { display: none; }
#rsvp-submit.is-loading .btn-default { display: none; }
#rsvp-submit.is-loading .btn-loading { display: inline; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

.prose a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: opacity 0.2s var(--ease);
}
.prose a:hover { opacity: 0.7; }

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

/* ---------- Layout ---------- */
.section {
  padding: 4rem 1.25rem;
  max-width: var(--maxw);
  margin-inline: auto;
}

/* ---------- Reveal ---------- */
.reveal > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-fade) var(--ease),
              transform var(--dur-fade) var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible > * {
  opacity: 1;
  transform: none;
}

/* Staffel-Delays: jedes weitere Direkt-Kind kommt 90ms später */
.reveal.is-visible > *:nth-child(1) { transition-delay: 0.00s; }
.reveal.is-visible > *:nth-child(2) { transition-delay: 0.09s; }
.reveal.is-visible > *:nth-child(3) { transition-delay: 0.18s; }
.reveal.is-visible > *:nth-child(4) { transition-delay: 0.27s; }
.reveal.is-visible > *:nth-child(5) { transition-delay: 0.36s; }
.reveal.is-visible > *:nth-child(6) { transition-delay: 0.45s; }
.reveal.is-visible > *:nth-child(7) { transition-delay: 0.54s; }
.reveal.is-visible > *:nth-child(n+8) { transition-delay: 0.63s; }

/* Hero-Bild bekommt einen sanften Scale-In zusätzlich */
.reveal .hero-art {
  transform: translateY(28px) scale(0.96);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible .hero-art { transform: none; }

/* Fullbleed-Bilder: nur Opacity faden, Position-Transform beibehalten */
.reveal > .bleed-art,
.reveal > .fingers-wrap {
  transform: translateX(-50%);
  transition: opacity 1s var(--ease);
}
.reveal.is-visible > .bleed-art,
.reveal.is-visible > .fingers-wrap {
  transform: translateX(-50%);
}

/* Form-Felder einzeln staffeln */
.reveal.is-visible .form > * { animation: rise 0.7s var(--ease) both; }
.reveal.is-visible .form > *:nth-child(1) { animation-delay: 0.50s; }
.reveal.is-visible .form > *:nth-child(2) { animation-delay: 0.58s; }
.reveal.is-visible .form > *:nth-child(3) { animation-delay: 0.66s; }
.reveal.is-visible .form > *:nth-child(4) { animation-delay: 0.74s; }
.reveal.is-visible .form > *:nth-child(5) { animation-delay: 0.82s; }
.reveal.is-visible .form > *:nth-child(6) { animation-delay: 0.90s; }
.reveal.is-visible .form > *:nth-child(n+7) { animation-delay: 0.98s; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: var(--cream);
  letter-spacing: 0.04em;
  font-size: 1.15rem;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover, .btn:focus-visible { opacity: 0.92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ---------- Passwort-Gate ---------- */
#password-gate {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  z-index: 100;
  transition: opacity 0.6s var(--ease);
}
#password-gate.fade-out { opacity: 0; pointer-events: none; }

#gate-form {
  width: 100%;
  max-width: 24rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#gate-title {
  font-size: clamp(2.75rem, 11vw, 3.75rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.gate-sub {
  font-size: 1.45rem;
  line-height: 1.5;
  color: var(--green-soft);
  margin-bottom: 0.75rem;
}

#gate-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 999px;
  text-align: center;
  letter-spacing: 0.04em;
}
#gate-input::placeholder { color: var(--green-soft); }

/* Shake bei falschem Passwort */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.shake { animation: shake 0.4s var(--ease); }

/* ---------- Typografie ---------- */
.eyebrow {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--green-soft);
  margin-bottom: 1.25rem;
}

.display {
  font-size: clamp(2.75rem, 10vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 2rem;
}
.display em { font-style: normal; }

.heading {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 2rem;
  text-align: center;
}

.sub-heading {
  font-size: 1.65rem;
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.muted { color: var(--green-soft); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 5rem; padding-bottom: 5rem; }
.hero-art {
  width: 70%;
  max-width: 280px;
  margin: 0 auto 1.5rem;
}
.names { font-size: 1.85rem; margin-bottom: 0.35rem; }
.date  { font-size: 1.3rem; color: var(--green-soft); margin-bottom: 2.5rem; letter-spacing: 0.04em; }

/* ---------- Invitation ---------- */
.bleed-art {
  display: block;
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.fingers-wrap {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2.5rem;
}
.fingers-wrap .fingers-art {
  margin: 0;
  transform: none;
}
.fingers-names {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  font-size: clamp(1.2rem, 4.5vw, 1.65rem);
  text-align: center;
  white-space: nowrap;
  margin: 0;
  pointer-events: none;
}

/* ---------- Prose ---------- */
.prose {
  max-width: 34rem;
}
.prose p {
  margin-bottom: 1.35rem;
  font-size: 1.25rem;
  line-height: 1.75;
}
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }
.prose-close {
  margin-top: 1.75rem !important;
  font-size: 1.5rem !important;
  text-align: center;
}
.info-outro { margin-top: 3rem; text-align: center; }
.signature { font-size: 1.5rem; margin-top: 0.75rem !important; }

/* ---------- Countdown ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 2.5rem auto;
  max-width: 28rem;
  text-align: center;
}
.cd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.25rem;
  border: 1px solid var(--green-line);
  border-radius: 1.25rem;
  background: rgba(67, 92, 55, 0.04);
}
.cd-num {
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--green-soft);
  text-transform: uppercase;
}
.countdown.is-done {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2rem);
  padding: 2rem 1rem;
}

/* ---------- Locations ---------- */
.locations {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin: 2.5rem 0;
  text-align: center;
}
.loc-title {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-soft);
  margin-bottom: 0.5rem;
}
.loc-name { font-size: 1.55rem; margin-bottom: 0.25rem; }
.loc-meta { font-size: 1.15rem; color: var(--green-soft); }
.loc-map  { margin-top: 1rem; }

.btn-small {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
}

/* ---------- RSVP-Formular ---------- */
.rsvp-sub {
  text-align: center;
  color: var(--green-soft);
  margin-bottom: 2.5rem;
  font-size: 1.2rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 30rem;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 0;
  padding: 0;
}

.field-label {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-soft);
  padding-left: 0.25rem;
}

.field input[type="text"],
.field input[type="tel"],
.field select {
  width: 100%;
  padding: 0.95rem 1.35rem;
  font-size: 1.1rem;
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 999px;
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.field input:focus,
.field select:focus {
  background: rgba(67, 92, 55, 0.05);
}

.field select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--green) 50%),
    linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position:
    calc(100% - 1.25rem) 50%,
    calc(100% - 1rem) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field-radios {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field-radios .field-label { margin-bottom: 0.25rem; }
.field-radios > .radio:first-of-type { margin-top: 0; }

.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  font-size: 1.1rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.radio input { accent-color: var(--green); }
.radio:has(input:checked) {
  background: var(--green);
  color: var(--cream);
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.form-error {
  color: #8a2f2f;
  font-size: 0.95rem;
  text-align: center;
}

.rsvp-success {
  margin: 0 auto;
  text-align: center;
}

/* ---------- Closing ---------- */
.closing {
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 6rem;
}
.closing .countdown { margin-bottom: 3rem; }
.closing-line { line-height: 1.2; }
.closing-see   { font-size: clamp(1.5rem, 5vw, 2rem); color: var(--green-soft); margin-bottom: 0.5rem; letter-spacing: 0.04em; }
.closing-date  { font-size: clamp(3rem, 12vw, 5rem); margin-bottom: 1rem; letter-spacing: 0.02em; }
.closing-names { font-size: clamp(1.5rem, 5vw, 2rem); }

/* ---------- Audio-Player ---------- */
.player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: rgba(67, 92, 55, 0.04);
  max-width: 28rem;
  margin: 0 auto;
}

.player-toggle {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--green);
  color: var(--cream);
  display: grid;
  place-items: center;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.player-toggle:hover { opacity: 0.92; transform: scale(1.04); }
.player-toggle:active { transform: scale(0.98); }

.player-toggle .icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.player-toggle .icon-pause { display: none; }
.player.is-playing .icon-play  { display: none; }
.player.is-playing .icon-pause { display: block; }

.player-body {
  flex: 1 1 auto;
  min-width: 0;
}

.player-title {
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.55rem;
}

.player-bar {
  position: relative;
  height: 4px;
  background: var(--green-line);
  border-radius: 999px;
  cursor: pointer;
}
.player-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  body { font-size: 23px; }
  .section { padding: 7rem 2rem; }
  .prose { max-width: 36rem; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal > *,
  .reveal.is-visible > *,
  .reveal .hero-art,
  .reveal .bleed-art,
  .reveal.is-visible .form > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
