:root {
  /* Farben von St. Laurentius */
  --paper: #fafaf7;    /* Kirchenheft-Papier */
  --ink: #2c343d;      /* Schiefer vom Turmhelm */
  --muted: #5b646e;
  --rubric: #9d3b2b;   /* Backstein, Rubriken */
  --green: #2f6049;    /* Portaltür */
  --gold: #b8913f;     /* Ringe */
  --rule: #dcdfe2;
  --serif: "Alegreya", Georgia, serif;
  --sans: "Alegreya Sans", system-ui, -apple-system, sans-serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}

a { color: var(--green); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: fixed;
  z-index: 50;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(43, 38, 34, 0.12);
  max-width: 760px;
  margin: 0 auto;
}
.topbar__brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__brand span { font-family: var(--script); color: var(--gold); font-weight: 400; }
.topbar__brand { font-weight: 500; }
.topbar__nav { display: flex; gap: 2px; }
.topbar__nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
}
.topbar__nav a:hover, .topbar__nav a:focus-visible { background: rgba(47, 90, 69, 0.1); }

/* ---------- Intro-Animation ---------- */
.intro { position: relative; height: 520vh; background: #2b1d16; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.stage { background: #5d8cdf; }   /* Himmelfarbe des Fotos, falls über dem Bild noch Platz ist */
.shot { position: absolute; inset: 0; overflow: hidden; }
.shot + .shot { opacity: 0; background: #3a332c; }
/* Querformat: links neben dem Foto ein ruhiger Verlauf aus den Randfarben des Fotos */
@media (min-aspect-ratio: 1/1) {
  .shot--outside { background: linear-gradient(#5888dc 0%, #5e98ea 60%, #7cabe6 100%); }
}
.frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.frame__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Fotorand weich in die Fläche daneben auslaufen lassen (Hochformat: oben in den Himmel, Querformat: nach links) */
.shot--outside .frame__img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 6%);
}
@media (min-aspect-ratio: 1/1) {
  .shot--outside .frame__img {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%);
    mask-image: linear-gradient(to right, transparent 0, #000 22%);
  }
}
.portal { position: absolute; perspective: 900px; perspective-origin: 50% 60%; }
.portal > img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Türöffnung und Flügel in Portal-Pixeln (Ausschnitt ab x=1250, y=2850) */
.portal__light, .portal__leaf { position: absolute; top: 377px; height: 313px; }
.portal__light {
  left: 211px;
  width: 240px;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 70%, #fffaf0 0%, #ffe3a8 45%, #e9b060 100%);
}
.portal__leaf {
  background-image: url("img/portal.jpg");
  background-size: 700px 690px;
  backface-visibility: hidden;
}
.portal__leaf--l { left: 211px; width: 138px; background-position: -211px -377px; transform-origin: 0 50%; }
.portal__leaf--r { left: 349px; width: 102px; background-position: -349px -377px; transform-origin: 100% 50%; }
.couple { position: absolute; transform: translateX(-50%); width: auto; filter: drop-shadow(0 30px 40px rgba(40, 25, 10, 0.35)); }
.rings { display: block; margin: 0 auto 6px; filter: drop-shadow(0 0 10px rgba(255, 220, 150, 0.8)); }
.glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 55%, #fff8e6 0%, #f7d38e 55%, #d9a45e 100%);
}

.overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  text-align: center;
  pointer-events: none;
  color: #fff;
}
.overlay--title {
  top: calc(84px + env(safe-area-inset-top));
  text-shadow: 0 2px 18px rgba(30, 40, 60, 0.45);
}
.overlay__kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
}
.overlay__names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 6.5rem);
  line-height: 1.1;
  margin: 4px 0 2px;
}
.overlay__names span { font-size: 0.7em; color: #f6dfa7; }
@media (min-aspect-ratio: 1/1) {
  .overlay--title { top: 50%; transform: translateY(-50%); left: 4vw; right: 54vw; }
}
.overlay__date { font-family: var(--serif); font-size: clamp(1.2rem, 4.4vw, 1.6rem); font-style: italic; }

.overlay--final {
  bottom: 0;
  left: 0;
  right: 0;
  padding: 90px 16px calc(84px + env(safe-area-inset-bottom));
  opacity: 0;
  background: linear-gradient(to bottom, rgba(43, 29, 22, 0), rgba(43, 29, 22, 0.72));
  color: #fbf3e2;
}
.overlay__names--small { font-size: clamp(2.8rem, 11vw, 4.6rem); }

.scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-size: 0.875rem;
  font-family: var(--sans);
  font-size: 1rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.scroll-hint svg { animation: nudge 1.8s ease-in-out infinite; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4)); }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.skip {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.9);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.skip:hover, .skip:focus-visible { background: #fff; }

/* Handy: kürzere Fahrt, weniger Details */
@media (max-width: 700px) {
  .intro { height: 380vh; }
}

/* Weniger Bewegung: statisches Bild statt Scroll-Fahrt */
.intro.is-static { height: 100vh; height: 100svh; }
.intro.is-static .scroll-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .scroll-hint svg { animation: none; }
}

/* ---------- Inhalt im Stil des Kirchenhefts ---------- */
.page { padding: 72px 0 8px; }
.wrap { max-width: 42rem; margin: 0 auto; padding: 0 20px; }
section[id] { scroll-margin-top: 72px; }

.page__title {
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 28px;
}
.rubric { color: var(--rubric); font-style: italic; }

/* Titelseite */
.welcome { padding-top: 88px; text-align: center; }
.welcome__title { font-size: clamp(2.25rem, 8vw, 3rem); font-weight: 500; line-height: 1.15; margin-bottom: 28px; }
.welcome__text { max-width: 30em; margin: 0 auto; text-align: left; text-wrap: pretty; }
.welcome__text::first-letter {
  float: left;
  font-size: 3.55em;
  line-height: 0.85;
  margin: 0.08em 0.1em 0 0;
  color: var(--rubric);
  font-weight: 500;
}
.countdown { margin-top: 28px; font-style: italic; color: var(--muted); }

/* Tabs */
.tabs { display: none; }
.js .tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.tab {
  font: 500 1.0625rem/1.2 var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 12px 10px 10px;
  min-height: 48px;
  cursor: pointer;
}
.tab span { font-weight: 400; }
.tab[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }
.tab:hover { color: var(--ink); }
.tab:focus-visible, .maplink:focus-visible, .topbar a:focus-visible, .skip:focus-visible, .aside a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.day + .day { margin-top: 48px; }
.js .day + .day { margin-top: 0; }
.js .day[hidden] { display: none; }
.day__title { font-size: 1.5rem; font-weight: 500; line-height: 1.25; margin-bottom: 6px; }
.day__title + .rubric { margin-bottom: 4px; }

/* Ablauf */
.order { list-style: none; margin: 16px 0 0; padding: 0; }
.order li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  column-gap: 16px;
  padding: 10px 0;
}
.order time {
  color: var(--rubric);
  font-variant-numeric: lining-nums tabular-nums;
  text-align: right;
  line-height: 1.5;
}
.order h4 { font-size: 1.1875rem; font-weight: 500; line-height: 1.5; }
.order .is-main h4 { font-size: 1.375rem; font-weight: 700; line-height: 1.35; }
.order p { color: var(--muted); }
.order p.rubric { color: var(--rubric); }
.aside { margin-top: 24px; color: var(--muted); }
.aside a { color: var(--green); text-underline-offset: 3px; }

/* Orte */
.places { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px 40px; }
@media (min-width: 720px) { .places { grid-template-columns: 1fr 1fr; } }
.places h3 { font-size: 1.375rem; font-weight: 500; line-height: 1.25; margin-bottom: 2px; }
.places address { font-style: normal; color: var(--muted); margin: 6px 0 4px; }
.maplink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.maplink:hover { text-decoration-thickness: 2px; }

/* Hinweise */
.hints { display: grid; gap: 28px 40px; }
@media (min-width: 720px) { .hints { grid-template-columns: 1fr 1fr; } }
.hint h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.hint p { color: var(--muted); }
.hint p.rubric { color: var(--rubric); }
.hint strong { color: var(--ink); font-weight: 700; }
#hinweise .aside { margin: 40px 0 0; }

/* Schluss */
.footer {
  margin-top: 88px;
  background: var(--ink);
  color: #d9dde1;
  text-align: center;
  padding: 56px 20px calc(56px + env(safe-area-inset-bottom));
}
.footer__sign { font-family: var(--script); font-size: 3rem; line-height: 1.2; color: #e2c47f; }

@media (max-width: 420px) {
  .topbar { padding-left: 14px; }
  .topbar__nav a { padding: 8px 8px; font-size: 0.9375rem; }
  .tab { padding-left: 6px; padding-right: 6px; font-size: 1rem; }
  .tab span { display: block; font-size: 0.875rem; }
  .order li { grid-template-columns: 3.4rem 1fr; column-gap: 12px; }
}
.footer__credit { max-width: 40rem; margin: 20px auto 0; font-size: 0.8125rem; line-height: 1.5; color: #9aa3ad; }
.footer__credit a { color: #c9d0d6; }
