/* Kuverta – Einladungsseite */
:root {
  --bg: #ece3d6; --paper: #fbf7f0; --paper2: #f3ebdf; --ink: #3a2e28; --muted: #8a7a6c;
  --accent: #b08a55; --accent2: #d9bf8f; --seal: #a07a45; --seal-hi: #d8b57a; --seal-lo: #6d4f28;
  --liner: #e9dcc6; --line: rgba(58, 46, 40, .14);
  --f-script: "Pinyon Script", "Noto Naskh Arabic", cursive;
  --f-serif: "Cormorant Garamond", "Noto Naskh Arabic", Georgia, serif;
  --f-caps: "Cinzel", "Cormorant Garamond", "Noto Naskh Arabic", serif;
  --col: min(100vw, 520px);
}
[data-theme="noir"] {
  --bg: #0b0a09; --paper: #141210; --paper2: #1c1916; --ink: #efe6d6; --muted: #a39887;
  --accent: #c9a45c; --accent2: #8f7340; --seal: #1b1a19; --seal-hi: #3a3734; --seal-lo: #050505;
  --liner: #2a2520; --line: rgba(239, 230, 214, .14);
  --f-script: "Italiana", "Noto Naskh Arabic", serif; --f-serif: "Bodoni Moda", "Noto Naskh Arabic", Georgia, serif; --f-caps: "Italiana", "Bodoni Moda", serif;
}
[data-theme="salbei"] {
  --bg: #dfe3d4; --paper: #f7f5ec; --paper2: #eceee2; --ink: #2f3a2e; --muted: #6f7a69;
  --accent: #6f8460; --accent2: #b7c2a3; --seal: #6e7f5d; --seal-hi: #a3b38e; --seal-lo: #3f4c33;
  --liner: #dfe5d2; --line: rgba(47, 58, 46, .14);
  --f-script: "Pinyon Script", "Noto Naskh Arabic", cursive; --f-serif: "Fraunces", "Noto Naskh Arabic", Georgia, serif; --f-caps: "Fraunces", serif;
}
[data-theme="rose"] {
  --bg: #efe0dc; --paper: #fcf6f3; --paper2: #f5e9e4; --ink: #4a2c2a; --muted: #93726c;
  --accent: #b06f66; --accent2: #e2b9ae; --seal: #8c2f35; --seal-hi: #c0575c; --seal-lo: #561a1f;
  --liner: #f0d9d2; --line: rgba(74, 44, 42, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-serif); font-size: 19px; line-height: 1.55;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* Papierkorn über allem */
.grain { position: fixed; inset: -50%; pointer-events: none; z-index: 90; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
[data-theme="noir"] .grain { mix-blend-mode: screen; opacity: .08; }

/* ---------- Bühne mit Kuvert ---------- */
#stage { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; perspective: 1400px;
  background: radial-gradient(120% 80% at 50% 40%, var(--paper2), var(--bg) 70%); }
#stage.gone { pointer-events: none; }
.stage-top { position: absolute; top: max(28px, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; }
.greet-for { font-family: var(--f-caps); letter-spacing: .3em; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.greet-name { font-family: var(--f-script); font-size: clamp(38px, 11vw, 56px); line-height: 1.15; color: var(--ink); margin-top: 4px; padding: 0 16px; }
.hint { position: absolute; bottom: max(44px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  font-family: var(--f-caps); letter-spacing: .32em; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.hint span { display: inline-block; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; transform: translateY(-3px); } }

.env-wrap { position: relative; width: min(84vw, 380px); aspect-ratio: 1.45; transform-style: preserve-3d; cursor: pointer;
  filter: drop-shadow(0 30px 40px rgba(40, 25, 10, .22)) drop-shadow(0 6px 10px rgba(40, 25, 10, .12)); }
[data-theme="noir"] .env-wrap { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .7)); }
.env-back, .env-pocket, .env-flap, .env-card { position: absolute; left: 0; width: 100%; }
.env-back { inset: 0; height: 100%; border-radius: 6px; background: linear-gradient(160deg, var(--paper2), var(--liner)); }
.env-back::after { content: ""; position: absolute; inset: 0; border-radius: 6px; background: repeating-linear-gradient(45deg, transparent 0 9px, rgba(0,0,0,.025) 9px 10px); }
.env-card { left: 5%; width: 90%; top: 6%; height: 88%; border-radius: 4px; background: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 14px rgba(0,0,0,.08); display: grid; place-items: center; text-align: center; z-index: 2; overflow: hidden; }
.env-card .mini-names { font-family: var(--f-script); font-size: clamp(30px, 9vw, 44px); line-height: 1.1; }
.env-card .mini-date { font-family: var(--f-caps); font-size: 11px; letter-spacing: .3em; color: var(--muted); margin-top: 6px; }
.env-card .mini-frame { position: absolute; inset: 7px; border: 1px solid var(--accent); opacity: .5; border-radius: 2px; }
.env-pocket { inset: 0; height: 100%; z-index: 3; pointer-events: none; }
.env-pocket svg { width: 100%; height: 100%; display: block; }
.env-flap { top: 0; height: 62%; z-index: 4; transform-origin: 50% 0; transform-style: preserve-3d; }
.flap-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.flap-front { background: linear-gradient(180deg, var(--paper2) 0%, var(--paper) 70%, var(--paper2) 100%); }
.flap-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.08)); }
.flap-back { transform: rotateX(180deg); background-color: var(--liner);
  background-image: radial-gradient(circle at 25% 25%, var(--accent) 0 1.2px, transparent 1.6px), radial-gradient(circle at 75% 75%, var(--accent) 0 1.2px, transparent 1.6px);
  background-size: 14px 14px; }
.seal { position: absolute; left: 50%; top: 62%; width: 84px; height: 84px; margin: -42px 0 0 -42px; z-index: 6; pointer-events: none; }
.seal .half { position: absolute; inset: 0; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal .mono { font-family: var(--f-script); font-size: 30px; fill: var(--seal-lo); }
.seal .mono-hi { font-family: var(--f-script); font-size: 30px; fill: var(--seal-hi); opacity: .55; }

/* Fotorealer Kuvert-Film */
.film { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--col); margin-left: calc(var(--col) / -2); overflow: hidden; will-change: transform; }
.film-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(.9); opacity: .9; }
.film-poster, .film-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-poster { z-index: 2; }
.film-ink { position: absolute; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  opacity: 0; filter: blur(4px); mix-blend-mode: multiply; pointer-events: none; }
.film-ink .mini-names { font-family: var(--f-script); font-size: 1em; line-height: 1.15; }
.film-ink .mini-date { font-family: var(--f-caps); font-size: .26em; letter-spacing: .3em; margin-top: .5em; opacity: .8; }
.film-shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(180deg, rgba(255,250,242,.55) 0%, rgba(255,250,242,0) 26%, rgba(255,250,242,0) 80%, rgba(255,250,242,.5) 100%); }
#stage .stage-top, #stage .hint { z-index: 5; }
.film-hit { position: absolute; inset: 0; z-index: 6; cursor: pointer; }

/* Übergangs-Papier */
.reveal-sheet { position: fixed; z-index: 60; background: var(--paper); border-radius: 4px; pointer-events: none; }

/* Partikel */
#fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }

/* ---------- Oberleiste ---------- */
.topbar { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: var(--col); padding: 0 14px;
  display: flex; justify-content: space-between; align-items: center; z-index: 80; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.langs { display: flex; gap: 2px; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.langs button { font-family: var(--f-caps); font-size: 11px; letter-spacing: .14em; padding: 7px 11px; border-radius: 99px; color: var(--muted); min-height: 32px; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.music-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.music-btn svg { width: 18px; height: 18px; stroke: var(--ink); }
.music-btn.on .bars rect { animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.music-btn .bars rect:nth-child(2) { animation-delay: -.3s; } .music-btn .bars rect:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 50% { transform: scaleY(.35); } }

/* ---------- Inhalt ---------- */
#app { width: var(--col); margin: 0 auto; background: var(--paper); position: relative; min-height: 100svh; overflow: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,.08); }
@media (min-width: 560px) { body { background: radial-gradient(90% 70% at 50% 30%, var(--paper2), var(--bg)); } }
.sec { position: relative; padding: 96px 28px; text-align: center; }
.sec + .sec { border-top: 1px solid transparent; }
.kicker { font-family: var(--f-caps); font-size: 12px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); }
.h-script { font-family: var(--f-script); font-weight: 400; font-size: clamp(40px, 12vw, 58px); line-height: 1.15; margin-top: 10px; }
[data-theme="noir"] .h-script { font-size: clamp(34px, 10vw, 48px); letter-spacing: .04em; }
.lead { font-size: 21px; line-height: 1.6; max-width: 26em; margin: 0 auto; }
.muted { color: var(--muted); }
.divider { width: 120px; height: 28px; margin: 28px auto; display: block; }
.divider path { stroke: var(--accent); fill: none; stroke-width: 1; }

/* Hero */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding-top: 110px; padding-bottom: 90px; }
.hero .flora { position: absolute; width: 62%; pointer-events: none; opacity: .9; }
.hero .flora path, .closing .flora path { fill: none; stroke: var(--accent); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.hero .flora .berry, .closing .flora .berry { fill: var(--accent); stroke: none; }
.hero .flora.tl { top: -2%; left: -8%; } .hero .flora.br { bottom: -2%; right: -8%; transform: rotate(180deg); }
.hero .eyebrow { font-family: var(--f-serif); font-style: italic; font-size: 20px; color: var(--muted); }
.names { font-family: var(--f-script); font-weight: 400; font-size: clamp(64px, 20vw, 104px); line-height: 1.02; margin: 14px 0 6px; }
[data-theme="noir"] .names { font-size: clamp(52px, 16vw, 84px); letter-spacing: .03em; text-transform: none; }
.names .amp { display: block; font-size: .62em; line-height: .9; color: var(--accent); margin: 0; }
.names .ch { display: inline-block; will-change: transform, opacity, filter; }
.names .word { display: inline-block; white-space: nowrap; }
.hero .invite { font-family: var(--f-serif); font-size: 21px; margin-top: 8px; }
.hero .rule { width: 72px; height: 1px; background: var(--accent); margin: 26px auto; transform-origin: center; }
.hero .date { font-family: var(--f-caps); letter-spacing: .28em; font-size: 15px; }
.hero .datesub { font-family: var(--f-caps); letter-spacing: .22em; font-size: 12px; color: var(--muted); margin-top: 8px; text-transform: uppercase; }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-family: var(--f-caps); font-size: 10px; letter-spacing: .34em; color: var(--muted); text-transform: uppercase; }
.scroll-cue i { display: block; width: 1px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--accent), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Intro-Text Wort für Wort */
.intro .lead .w { opacity: .12; transition: none; }

/* Countdown */
.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.cd { width: 74px; padding: 14px 0 10px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--paper2) 60%, var(--paper)); }
.cd .n { font-family: var(--f-serif); font-size: 36px; line-height: 1; display: block; height: 36px; overflow: hidden; font-variant-numeric: tabular-nums; }
.cd .n span { display: block; }
.cd .l { font-family: var(--f-caps); font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; margin-top: 8px; display: block; }

/* Geschichte */
.story-track { display: flex; gap: 16px; padding: 0 28px; width: max-content; }
.story-item { width: 72vw; max-width: 340px; text-align: left; }
.story-item img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 20px; }
.story-item .yr { font-family: var(--f-caps); letter-spacing: .3em; font-size: 12px; color: var(--accent); margin-top: 14px; }
.story-item h3 { font-family: var(--f-serif); font-weight: 500; font-size: 24px; margin-top: 4px; }
.story-item p { color: var(--muted); font-size: 17px; }
.story-pin { overflow: hidden; padding: 0; }
.story-pin .head { padding: 96px 28px 34px; }

/* Ablauf */
.timeline { position: relative; margin: 40px auto 0; max-width: 360px; text-align: left; }
.timeline .track { position: absolute; left: 27px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline .fill { position: absolute; left: 27px; top: 8px; bottom: 8px; width: 1px; background: var(--accent); transform-origin: top; transform: scaleY(0); }
[dir="rtl"] .timeline { text-align: right; } [dir="rtl"] .timeline .track, [dir="rtl"] .timeline .fill { left: auto; right: 27px; }
.ti { display: flex; gap: 20px; align-items: center; padding: 14px 0; position: relative; }
.ti .ic { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 1px solid var(--accent); background: var(--paper); display: grid; place-items: center; z-index: 1; }
.ti .ic svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ti .t { font-family: var(--f-caps); font-size: 13px; letter-spacing: .22em; color: var(--accent); }
.ti .what { font-size: 21px; line-height: 1.3; }

/* Location */
.venue-card { margin: 32px auto 0; max-width: 380px; border: 1px solid var(--line); border-radius: 22px; padding: 30px 22px; background: color-mix(in srgb, var(--paper2) 55%, var(--paper)); }
.venue-card .pin { width: 46px; height: 46px; margin: 0 auto 14px; }
.venue-card .pin path, .venue-card .pin circle { stroke: var(--accent); fill: none; stroke-width: 1.2; }
.venue-name { font-family: var(--f-serif); font-size: 25px; font-weight: 500; }
.venue-addr { color: var(--muted); margin-top: 4px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 99px; border: 1px solid var(--ink);
  font-family: var(--f-caps); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.gold { background: linear-gradient(135deg, var(--accent2), var(--accent)); border-color: transparent; color: #fff; }
[data-theme="noir"] .btn.gold { color: #120f0b; }

/* Dresscode */
.swatches { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.swatches span { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); box-shadow: inset 0 -6px 10px rgba(0,0,0,.08); }

/* RSVP */
.rsvp-form { max-width: 400px; margin: 30px auto 0; text-align: left; display: grid; gap: 18px; }
[dir="rtl"] .rsvp-form { text-align: right; }
.field label { display: block; font-family: var(--f-caps); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea, .field select { width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 16px; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field .hint2 { font-size: 13px; color: var(--muted); margin-top: 6px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-size: 17px; line-height: 1.2; padding: 8px 10px; }
.choice button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); font-size: 22px; }
.stepper output { font-size: 24px; min-width: 2ch; text-align: center; }
.menu-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.menu-row span { font-size: 15px; color: var(--muted); min-width: 72px; }
.menu-row select { flex: 1; }
.rsvp-done { text-align: center; padding: 26px 0; }
.rsvp-done .big { font-family: var(--f-script); font-size: 44px; line-height: 1.2; }
.yes-only[hidden] { display: none; }
.send { width: 100%; justify-content: center; min-height: 54px; }
.note { font-size: 15px; color: var(--muted); text-align: center; }

/* Abschluss */
.closing { padding-bottom: 130px; overflow: hidden; }
.closing .flora { position: absolute; width: 70%; left: 15%; bottom: -10px; opacity: .8; }
.mono-big { width: 120px; height: 120px; margin: 28px auto 0; }
.mono-big text { font-family: var(--f-script); font-size: 46px; fill: var(--accent); }
.mono-big circle { fill: none; stroke: var(--accent); stroke-width: .8; }
.foot { font-family: var(--f-caps); font-size: 10px; letter-spacing: .24em; color: var(--muted); text-transform: uppercase; padding: 0 0 34px; text-align: center; }
.foot a { color: inherit; }

/* Vorschau-Wasserzeichen */
.wm { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.wm div { position: absolute; inset: -50%; transform: rotate(-28deg); display: flex; flex-wrap: wrap; gap: 70px 50px; align-content: center; justify-content: center;
  font-family: var(--f-caps); font-size: 15px; letter-spacing: .4em; color: var(--ink); opacity: .07; }

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) { .hint span, .scroll-cue i { animation: none; } }
.rv { opacity: 0; transform: translateY(26px); }
html.no-js .rv { opacity: 1; transform: none; }
