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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-anthracite);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 245, 241, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-line);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.nav-mark {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--color-anthracite);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  row-gap: 4px;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-anthracite-soft);
  white-space: nowrap;
  transition: color 0.2s ease;
}

@media (min-width: 480px) {
  .nav-links a {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
  }

  .nav-links {
    gap: var(--space-3);
  }
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* ---------- Namens-Merge-Intro ---------- */

.name-merge {
  position: relative;
  background: var(--color-bg);
}

.name-merge-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-3);
}

.name-merge--active {
  height: 140vh;
}

.name-merge--active .name-merge-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0 var(--space-3);
}

.name-merge-fallback {
  font-family: var(--font-serif);
  text-align: center;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  color: var(--color-anthracite);
  margin: 0;
}

.name-merge--active .name-merge-fallback {
  display: none;
}

.name-merge-stage {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  width: min(92vw, 760px);
  margin: 0 auto;
}

.name-merge-stage[hidden] {
  display: none;
}

.nm-first {
  grid-row: 1;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 6.5vw, 2.5rem);
  color: var(--color-anthracite);
  white-space: nowrap;
  justify-self: center;
}

.nm-amp {
  grid-row: 1;
  grid-column: 2;
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--color-accent);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
}

.nm-last {
  grid-row: 2;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 6.5vw, 2.5rem);
  color: var(--color-anthracite);
  white-space: nowrap;
  justify-self: center;
  will-change: transform, opacity;
}

.nm-first[data-nm-col="andre"],
.nm-last[data-nm-col="andre"] {
  grid-column: 1;
}

.nm-first[data-nm-col="jenny"],
.nm-last[data-nm-col="jenny"] {
  grid-column: 3;
}

/* Wo der Browser scroll-getriebene Animationen kann (Safari 26+, Chrome),
   laeuft die Namens-Animation direkt im Compositor statt per JS im
   Scroll-Event. Fortschritt 0..1 entspricht exakt dem JS-Fallback:
   von "Section-Oberkante am Viewport oben" bis "Section-Unterkante am
   Viewport unten". --nm-shift wird von name-merge.js gemessen. */
.name-merge--timeline {
  view-timeline: --name-merge block;
  /* Sonst zaehlt scroll-padding-top (Sticky-Header) mit und verschiebt den
     Ablauf gegenueber dem JS-Fallback. */
  view-timeline-inset: 0;
}

.name-merge--timeline [data-nm="holt"] {
  animation: nm-holt-shift linear both;
  animation-timeline: --name-merge;
  animation-range: contain 0% contain 100%;
}

.name-merge--timeline [data-nm="theis"] {
  animation: nm-theis-fade linear both;
  animation-timeline: --name-merge;
  animation-range: contain 0% contain 100%;
}

@keyframes nm-holt-shift {
  from { transform: translateX(0); }
  to { transform: translateX(var(--nm-shift, 0px)); }
}

/* JS-Fallback: opacity = 1 - progress * 1.6 -> 0 bei progress 0.625 */
@keyframes nm-theis-fade {
  0% { opacity: 1; }
  62.5% { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .name-merge--active {
    height: auto;
  }

  .name-merge--active .name-merge-inner {
    position: static;
    height: auto;
  }
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: var(--space-6) var(--space-3) var(--space-5);
}

.arch-frame {
  --w: min(88vw, 440px);
  width: var(--w);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: calc(var(--w) / 2) calc(var(--w) / 2) 0 0;
  overflow: hidden;
  background: var(--color-line);
  box-shadow: var(--shadow-soft);
  border: 3px solid var(--color-gold);
}

.arch-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-headline {
  margin: var(--space-4) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-headline-caps {
  font-family: var(--font-serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--color-anthracite);
}

.hero-headline-script {
  font-family: var(--font-script);
  font-size: clamp(3rem, 14vw, 5rem);
  color: var(--color-accent);
  line-height: 1;
  margin-top: -0.1em;
}

.hero-date {
  margin: var(--space-3) 0 0;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--color-anthracite-soft);
}

.hero-countdown {
  display: inline-block;
  margin: var(--space-3) 0 0;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--color-gold-pale);
  color: var(--color-gold-deep);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.hero-countdown:empty {
  display: none;
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3);
}

.section-alt {
  max-width: none;
  background: var(--color-bg-alt);
}

/* Hoehere Spezifitaet als .section-eyebrow/.section-title/.section-intro
   noetig, da deren margin-Kurzschreibweise sonst margin-left/right: 0
   setzt und die Zentrierung hier zufaellig wieder aufhebt. */
.section.section-alt > * {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-1);
}

.section-title {
  font-family: var(--font-serif);
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-4);
  color: var(--color-anthracite);
}

.section-intro {
  text-align: center;
  color: var(--color-anthracite-soft);
  margin: 0 0 var(--space-4);
}

.wedding-day-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* Sanftes Einblenden beim Scrollen (siehe js/reveal.js). Ohne JS bleiben
   .reveal-Elemente einfach normal sichtbar -- die Klasse js-reveal wird
   nur gesetzt, wenn JS laeuft und keine reduzierte Bewegung gewuenscht ist. */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.registry-text {
  text-align: center;
  color: var(--color-anthracite-soft);
  white-space: pre-line;
}

/* ---------- Details ---------- */

.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: var(--space-4);
  text-align: center;
}

.detail-card h3 {
  font-family: var(--font-serif);
  color: var(--color-accent);
  margin: 0 0 var(--space-1);
  font-size: 1.1rem;
}

.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 var(--space-2);
}

.ornament-line {
  width: 16px;
  height: 1px;
  background: var(--color-gold);
}

.ornament-dot {
  width: 5px;
  height: 5px;
  background: var(--color-gold);
  transform: rotate(45deg);
}

.detail-card p {
  margin: 0 0 var(--space-1);
  color: var(--color-anthracite-soft);
}

.detail-link {
  display: inline-block;
  margin-top: var(--space-1);
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.detail-link:hover {
  border-color: var(--color-accent);
}

.timeline {
  list-style: none;
  margin: 0 auto var(--space-5);
  padding: 0;
  max-width: 460px;
}

.timeline-item {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-line);
}

.timeline-time {
  min-width: 76px;
  font-weight: 500;
  color: var(--color-accent);
}

.timeline-label {
  color: var(--color-anthracite);
}

.calendar-cta {
  text-align: center;
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}

.gallery-item {
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: var(--color-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  transition: transform 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(51, 54, 58, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 100;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
}

.lightbox-figure img {
  max-width: 90vw;
  max-height: 75vh;
  border-radius: var(--radius-sm);
  display: block;
}

.lightbox-caption {
  margin: var(--space-2) 0 0;
  max-width: 90vw;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
}

.lightbox-caption[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Forms ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 460px;
  margin: 0 auto;
}

.form[hidden] {
  display: none;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-row[hidden] {
  display: none;
}

.form-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.form-fieldset legend {
  padding: 0;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

label {
  font-weight: 500;
  font-size: 0.9rem;
}

input,
textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-anthracite);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-pale);
}

textarea {
  resize: vertical;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--color-anthracite-soft);
  cursor: pointer;
}

.btn {
  display: inline-block;
  align-self: center;
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: var(--space-2) var(--space-5);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover:not(:disabled) {
  background: var(--color-anthracite);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  margin: 0;
}

.form-status--success {
  color: var(--color-success);
}

.form-status--error {
  color: var(--color-error);
}

/* ---------- Contact / FAQ ---------- */

.contact-card {
  text-align: center;
  margin-bottom: var(--space-4);
}

.contact-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 var(--space-1);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-group {
  margin-bottom: var(--space-4);
}

.faq-group:last-child {
  margin-bottom: 0;
}

.faq-category {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 0 var(--space-4);
}

@media (min-width: 700px) {
  .faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.faq-item {
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-2) 0;
}

/* Bewusst ein normaler <button> statt <details>/<summary>: neuere
   Chrome-Versionen verstecken geschlossene details-Inhalte intern per
   content-visibility, was sich nicht zuverlaessig ueberschreiben laesst und
   die Schliess-Animation einfrieren liess. Mit einem selbst gesteuerten
   Button + Klasse bleibt die Animation in beide Richtungen zuverlaessig. */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  background: none;
  border: none;
  padding: 0 var(--space-4) 0 0;
  margin: 0;
  font: inherit;
  font-weight: 500;
  color: var(--color-anthracite);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.faq-icon {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--color-accent);
  transition: transform 0.2s ease;
}

.faq-icon::before {
  content: "+";
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
}

.faq-item.is-open .faq-answer-wrap {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-item p {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-2);
  border-left: 2px solid var(--color-gold);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-anthracite-soft);
  line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer-wrap {
    transition: none;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  background: var(--color-anthracite);
  color: var(--color-bg);
}

.footer-script {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--color-accent-light);
  margin: 0 0 var(--space-1);
}

.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--color-gold);
  margin: 0 0 var(--space-4);
}

.back-to-top {
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-bg-alt);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ---------- Admin ---------- */

.admin-subtitle {
  font-family: var(--font-serif);
  margin: var(--space-5) 0 var(--space-2);
}

.admin-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--color-surface);
}

.admin-table th,
.admin-table td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

.admin-table thead {
  background: var(--color-bg-alt);
}

.rsvp-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
}

.rsvp-badge--yes {
  background: var(--color-success);
}

.rsvp-badge--no {
  background: var(--color-error);
}

/* ---------- Zugangssperre ---------- */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.gate-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: var(--space-6) var(--space-4);
}

.gate-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}

.gate-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  color: var(--color-anthracite);
  margin: 0 0 var(--space-3);
}

.gate-amp {
  font-family: var(--font-script);
  color: var(--color-accent);
  font-size: 1.3em;
  padding: 0 0.1em;
}

.gate-intro {
  color: var(--color-anthracite-soft);
  margin: 0 0 var(--space-4);
}

.gate-error {
  color: var(--color-error);
  font-size: 0.9rem;
  margin: 0 0 var(--space-3);
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.gate-form input[type="password"] {
  text-align: center;
}

.gate-form .btn {
  align-self: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (min-width: 768px) {
  .hero {
    padding: var(--space-7) var(--space-4) var(--space-6);
  }

  .section {
    padding: var(--space-7) var(--space-4);
  }

  .btn {
    align-self: flex-start;
  }

  .arch-frame {
    --w: 500px;
  }
}

@media (min-width: 1100px) {
  .arch-frame {
    --w: 580px;
  }
}

/* ---------- Hero: Foto kommt sanft naeher ---------- */

/* Nur aktiv, wenn hero-open.js die Klasse setzt (scroll-getriebene
   Animationen verfuegbar, keine reduzierte Bewegung). Beim Hereinscrollen
   waechst der Bogen leicht auf seine normale Groesse, und das Foto darin
   zoomt sanft zurueck. Layout, Rahmen und Text bleiben wie gehabt; keine
   zusaetzliche Scrollstrecke. */
.hero--opening {
  view-timeline: --hero-open block;
  view-timeline-inset: 0;
}

.hero--opening .hero-frame {
  animation: hero-frame-grow ease-out both;
  animation-timeline: --hero-open;
  animation-range: entry 0% cover 45%;
}

.hero--opening .hero-photo {
  animation: hero-photo-settle ease-out both;
  animation-timeline: --hero-open;
  animation-range: entry 0% cover 45%;
}

@keyframes hero-frame-grow {
  from { transform: scale(0.9); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes hero-photo-settle {
  from { transform: scale(1.18); }
  to { transform: scale(1); }
}
