/* ==========================================================
   In Erinnerung an Valent Majerić – Gestaltung
   ========================================================== */

:root {
  --cream: #f6f0e4;
  --ivory: #fbf8f1;
  --paper: #fffdf8;
  --sand: #ece3d1;
  --line: #ddd0b8;
  --ink: #3b3129;
  --ink-soft: #6e6052;
  --gold: #a5824c;
  --gold-soft: #cbb184;
  --gold-light: #ecdcb6;
  --shadow: 0 18px 40px -22px rgba(74, 56, 34, .45);
  --ease-out: cubic-bezier(.2, .7, .2, 1);

  --serif-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --serif-text: 'EB Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--cream) url(../img/grain.png);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: clamp(1.08rem, 1rem + .3vw, 1.22rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-underline-offset: .18em; }
a:hover { color: var(--ink); }

h1, h2, h3 { font-family: var(--serif-display); font-weight: 500; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem); letter-spacing: .02em; }

::selection { background: rgba(203, 177, 132, .45); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Mehrsprachigkeit ---------- */
html:not([data-lang="de"]) body [lang="de"],
html:not([data-lang="hr"]) body [lang="hr"],
html:not([data-lang="en"]) body [lang="en"] { display: none !important; }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 1.6rem;
  padding: max(.7rem, env(safe-area-inset-top)) max(clamp(1rem, 3vw, 2.2rem), env(safe-area-inset-right)) .7rem max(clamp(1rem, 3vw, 2.2rem), env(safe-area-inset-left));
  font-family: var(--serif-display);
  font-size: 1.08rem;
  letter-spacing: .04em;
  transition: background-color .5s ease, box-shadow .5s ease;
}
.topbar.is-scrolled {
  background: rgba(246, 240, 228, .9);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -24px rgba(74, 56, 34, .5);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  font-size: 1.2rem; letter-spacing: .06em;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .6s ease, transform .6s var(--ease-out);
}
.topbar.is-scrolled .brand { opacity: 1; transform: none; pointer-events: auto; }
.brand-flame {
  width: .55rem; height: .9rem; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse 50% 70% at 50% 80%, #fff8dc, #ffcf5e 45%, #ff9a2e 75%, transparent 78%);
  filter: drop-shadow(0 0 4px rgba(255, 170, 70, .8));
  animation: flame-flicker 3s ease-in-out infinite;
}
/* Navigation: kleine Karten, die von der Oberkante herabhängen;
   die Karte des aktuellen Abschnitts hängt etwas tiefer */
.topnav {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: .45rem;
}
.topnav a {
  position: relative; display: block;
  margin-top: -1rem;
  padding: 1.55rem 1.05rem .6rem;
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  font-size: 1.02rem; letter-spacing: .05em;
  background: linear-gradient(180deg, #f4ecdc 0%, #fffdf8 45%, #faf4e8 100%);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 .75rem .75rem;
  box-shadow: 0 10px 20px -14px rgba(74, 56, 34, .5), inset 0 -1px 0 rgba(255, 255, 255, .8);
  transform: translateY(-.7rem);
  transition: transform .6s var(--ease-out), box-shadow .6s ease, color .3s ease, border-color .4s ease;
}
.topnav a::after {
  /* goldene Linie, die sich bei der aktiven Karte aufzieht */
  content: ""; position: absolute; left: 1rem; right: 1rem; bottom: .38rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transition: transform .6s var(--ease-out);
}
.topnav a:hover { transform: translateY(-.35rem); color: var(--ink); }
.topnav a.is-active {
  transform: translateY(.2rem);
  color: var(--ink);
  border-color: var(--gold-soft);
  box-shadow: 0 16px 26px -14px rgba(74, 56, 34, .55), inset 0 -1px 0 rgba(255, 255, 255, .8);
}
.topnav a.is-active::after { transform: scaleX(1); }

.langswitch { display: flex; align-items: center; gap: .1rem; margin-left: auto; }
.langswitch button {
  font: inherit; letter-spacing: inherit; color: var(--ink-soft);
  background: none; border: 0; padding: .2rem .45rem; cursor: pointer;
  border-radius: 1rem;
  transition: color .3s ease, background-color .3s ease;
}
.langswitch button:hover { color: var(--ink); }
.langswitch button[aria-pressed="true"] { color: var(--ink); background: rgba(203, 177, 132, .25); }
.l-short { display: none; }

.nav-toggle, .topnav .nav-home { display: none; }

@media (max-width: 1280px) { .topnav ~ .langswitch .l-long { display: none; } .topnav ~ .langswitch .l-short { display: inline; } }
@media (max-width: 1180px) { .topbar:has(.topnav) .brand { display: none; } }

/* Handy & Tablet: hängende Karte „Menü“, die eine Kartenliste aufklappt */
@media (max-width: 960px) {
  .topbar:has(.topnav) .brand { display: flex; }
  .nav-toggle {
    position: absolute; left: 50%; top: 0; transform: translateX(-50%) translateY(-.5rem);
    display: flex; align-items: center; gap: .5rem;
    margin-top: -1rem; padding: calc(1.55rem + env(safe-area-inset-top)) 1.1rem .65rem;
    font: inherit; letter-spacing: .06em; color: var(--ink);
    background: linear-gradient(180deg, #f4ecdc 0%, #fffdf8 45%, #faf4e8 100%);
    border: 1px solid var(--line); border-top: 0; border-radius: 0 0 .75rem .75rem;
    box-shadow: 0 10px 20px -14px rgba(74, 56, 34, .5);
    cursor: pointer;
    transition: transform .5s var(--ease-out), border-color .3s ease;
  }
  .nav-toggle[aria-expanded="true"] { transform: translateX(-50%) translateY(.15rem); border-color: var(--gold-soft); }
  .nav-toggle-icon { position: relative; width: 1rem; height: .7rem; border-top: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); }
  .nav-toggle-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; margin-top: -.75px; height: 1.5px; background: var(--gold); }

  .topnav {
    position: fixed; left: 50%; top: calc(4.2rem + env(safe-area-inset-top)); transform: translate(-50%, -.8rem);
    flex-direction: column; align-items: stretch; gap: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: .5rem; border-radius: .9rem;
    background: rgba(255, 253, 248, .97);
    border: 1px solid var(--line);
    box-shadow: 0 24px 50px -20px rgba(74, 56, 34, .55);
    opacity: 0; visibility: hidden;
    transition: opacity .35s ease, transform .45s var(--ease-out), visibility 0s linear .45s;
  }
  .topbar.nav-open .topnav { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .35s ease, transform .45s var(--ease-out); }
  .topnav a, .topnav .nav-home {
    display: block; margin: 0; padding: .8rem 1rem; text-align: center;
    background: none; border: 0; border-radius: .6rem; box-shadow: none; transform: none;
    font-size: 1.15rem;
  }
  .topnav a + a { border-top: 1px solid rgba(221, 208, 184, .6); border-radius: 0; }
  .topnav a:hover, .topnav a.is-active { transform: none; background: rgba(203, 177, 132, .14); box-shadow: none; }
  .topnav a::after { left: 35%; right: 35%; bottom: .45rem; }
}
@media (max-width: 600px) {
  .topbar:has(.nav-toggle) .brand { display: none; }
  /* auf dem Handy links, damit die Sprachwahl rechts frei bleibt */
  .nav-toggle { left: max(.9rem, env(safe-area-inset-left)); transform: translateY(-.5rem); }
  .nav-toggle[aria-expanded="true"] { transform: translateY(.15rem); }
}

/* größere Tippflächen auf Touch-Geräten */
@media (pointer: coarse) {
  .langswitch button { min-width: 2.75rem; min-height: 2.75rem; }
  .consent input { width: 1.35rem; height: 1.35rem; margin-top: .25rem; }
  .scroll-cue::before { content: ""; position: absolute; inset: -.8rem -1.2rem; }
  .footer-links a, .consent a { padding: .3rem 0; }
}
@media (max-width: 720px) {
  .brand { font-size: 1.05rem; }
  .l-long { display: none; }
  .l-short { display: inline; }
}

/* ---------- Eingang ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 5.5rem 1.25rem 5rem;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-bg .slide { position: absolute; inset: 0; display: flex; opacity: 0; transition: opacity 3s ease; }
.hero-bg .slide.is-active { opacity: .4; }
.hero-bg img {
  flex: 1 1 50%; width: 50%; min-width: 0; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 20%;
  filter: blur(1.5px) sepia(.2);
}
@media (max-width: 900px) { .hero-bg img + img { display: none; } .hero-bg img { flex-basis: 100%; width: 100%; } }

/* fallende Blütenblätter */
.petals { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; perspective: 700px; }
.petal { position: absolute; top: -8%; left: var(--x); animation: petal-fall var(--dur) linear var(--delay) infinite; will-change: transform; }
.petal-sway { display: block; animation: petal-sway var(--sway) ease-in-out var(--delay) infinite alternate; }
.petal svg {
  display: block; width: var(--size); height: calc(var(--size) * 1.2); opacity: var(--alpha);
  animation: petal-spin var(--spin) linear infinite;
  filter: drop-shadow(0 1px 1px rgba(120, 90, 50, .2));
}
@keyframes petal-fall { from { transform: translateY(0); } to { transform: translateY(118vh); } }
@keyframes petal-sway { from { transform: translateX(calc(var(--sw) * -1)) rotate(-14deg); } to { transform: translateX(var(--sw)) rotate(16deg); } }
@keyframes petal-spin { from { transform: rotate3d(1, .35, .2, 0deg); } to { transform: rotate3d(1, .35, .2, 360deg); } }

/* Blütenzweig links unten am Porträt */
.blossoms {
  position: absolute; left: -6rem; bottom: -2.9rem; width: 17rem; z-index: 4; pointer-events: none;
  transform-origin: 92% 96%;
  filter: drop-shadow(0 3px 4px rgba(90, 64, 30, .22));
  animation: fade-in 1.8s ease 1.3s both, branch-sway 9s ease-in-out 3s infinite alternate;
}
.blossoms img { display: block; width: 100%; height: auto; }
@keyframes branch-sway { from { rotate: -.8deg; } to { rotate: 1.2deg; } }
@media (max-width: 480px) { .blossoms { left: -3rem; bottom: -1.9rem; width: 11.5rem; } }
.hero::before {
  /* weicher Cremeschleier über den Hintergrundbildern */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 46% 56% at 50% 47%, rgba(251, 248, 241, .95) 0%, rgba(251, 248, 241, .78) 48%, rgba(246, 240, 228, .1) 100%),
    linear-gradient(to bottom, rgba(246, 240, 228, .35), rgba(246, 240, 228, 0) 18%, rgba(246, 240, 228, 0) 70%, rgba(246, 240, 228, .96) 100%);
}

/* schwebende Lichtpunkte */
.motes { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.mote {
  position: absolute; bottom: -2rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 160, .95), rgba(255, 200, 120, .35) 45%, rgba(255, 200, 120, 0) 70%);
  opacity: 0;
  animation: mote-rise var(--dur, 22s) linear var(--delay, 0s) infinite;
}
@keyframes mote-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  12% { opacity: var(--alpha, .55); }
  50% { transform: translate(var(--drift, 20px), -48vh) scale(1); }
  85% { opacity: var(--alpha, .55); }
  100% { opacity: 0; transform: translate(calc(var(--drift, 20px) * -.6), -96vh) scale(.7); }
}

.hero-inner { width: min(44rem, 100%); }

/* Auftritt beim Laden */
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes name-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { animation: rise-in 1.2s var(--ease-out) .2s both; }
.portrait-wrap { animation: fade-in 1.8s ease .35s both; }
.candle--pillar { animation: fade-in 1.4s ease 1s both; }
.name { animation: name-in 2s var(--ease-out) .8s both; }
.dates { animation: rise-in 1.2s var(--ease-out) 1.25s both; }
.tagline { animation: rise-in 1.2s var(--ease-out) 1.5s both; }
.scroll-cue { animation: rise-in 1s ease 2.4s both; }

.eyebrow {
  font-family: var(--serif-display); font-style: italic;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  color: var(--ink-soft); letter-spacing: .06em;
  margin: 0 0 3.4rem;
}

.memorial { position: relative; width: min(19rem, 66vw); margin: 0 auto; }

/* goldenes Kreuz über dem Rahmen */
.cross {
  position: absolute; left: 50%; top: -3.05rem; z-index: 4;
  width: 1.75rem; height: 2.5rem; margin-left: -.875rem;
  filter: drop-shadow(0 2px 3px rgba(90, 64, 30, .35));
  animation: fade-in 1.6s ease 1.1s both;
}
.cross::before {
  content: ""; position: absolute; inset: -60% -110%; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse, rgba(255, 236, 190, .7), rgba(255, 236, 190, 0) 65%);
}
.cross svg { display: block; width: 100%; height: 100%; overflow: visible; }
.portrait-wrap { position: relative; }

.portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: 50%;
  padding: .6rem;
  /* Goldrahmen mit metallischem Verlauf */
  background: conic-gradient(from 210deg, #b48f57, #f4e3b8, #a8804a, #ecd6a5, #9a7744, #f2dfb1, #b48f57);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(122, 92, 48, .35),
    0 0 0 7px rgba(255, 253, 248, .55),
    0 0 0 8px rgba(203, 177, 132, .55);
}
.portrait::before {
  /* feine Innenkante */
  content: ""; position: absolute; inset: .45rem; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(90, 64, 30, .45), inset 0 2px 6px rgba(60, 40, 20, .35);
  z-index: 2; pointer-events: none;
}
.portrait-photo {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  border: 3px solid var(--paper);
  isolation: isolate;
}
.portrait-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  animation: photo-settle 4s var(--ease-out) .35s backwards;
  transition: transform 2.4s var(--ease-out);
}
.portrait-wrap:hover .portrait-photo img { transform: scale(1.04); }
@keyframes photo-settle { from { transform: scale(1.08); } to { transform: scale(1); } }

/* Glanz, der über Glas und Rahmen wandert */
.portrait-photo::after, .gloss::after, .btn::after {
  content: ""; position: absolute; inset: -30%;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .42) 48%, rgba(255, 255, 255, .1) 54%, transparent 62%);
  transform: translateX(-80%);
  pointer-events: none;
}
.portrait-photo::after { transition: transform 1.6s var(--ease-out); }
.portrait-wrap:hover .portrait-photo::after { transform: translateX(80%); }
.portrait-photo.is-glint::after { animation: glint 2.2s var(--ease-out) both; }
@keyframes glint { from { transform: translateX(-80%); } to { transform: translateX(80%); } }

/* Trauerflor über der oberen rechten Ecke des Rahmens */
.ribbon {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; z-index: 3;
  animation: fade-in 1.4s ease 1.6s both;
}
.ribbon span {
  position: absolute; width: 70%; height: 7%; top: 13%; right: -10%;
  transform: rotate(45deg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .14) 48%, rgba(255, 255, 255, 0) 62%, rgba(0, 0, 0, .3) 100%),
    linear-gradient(180deg, #2b2623, #121010 50%, #1c1917);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.ribbon span::before, .ribbon span::after {
  /* feine Ziernaht des Bandes */
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: rgba(255, 255, 255, .1);
}
.ribbon span::before { top: 16%; }
.ribbon span::after { bottom: 16%; }

.name {
  margin-top: 2.7rem;
  font-size: clamp(2.7rem, 1.8rem + 4.5vw, 4.8rem);
  letter-spacing: .05em;
  font-weight: 500;
  background: linear-gradient(180deg, #3b3129 30%, #5c4a37);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.dates {
  margin: .5rem 0 0;
  font-family: var(--serif-display);
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem);
  letter-spacing: .08em;
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: .9rem; flex-wrap: wrap;
}
.dates .sep { width: 2.6rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.tagline { margin: 1.1rem 0 0; font-style: italic; color: var(--ink-soft); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.4rem;
  width: 1.4rem; height: 2.3rem; margin-left: -.7rem;
  border: 1px solid var(--gold-soft); border-radius: 1rem;
}
.scroll-cue::after {
  content: ""; position: absolute; left: 50%; top: .45rem;
  width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px;
  background: var(--gold);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(.7rem); opacity: 0; } }

/* Startmodus: nur der Eingang */
.is-teaser .hero { min-height: calc(100svh - 9rem); }

/* ==========================================================
   Kerzen – Flamme (gemeinsam für Stumpenkerze und Teelicht)
   ========================================================== */
.flame {
  position: absolute; left: 50%;
  transform-origin: 50% 92%;
}
.flame-body {
  width: 100%; height: 100%;
  transform-origin: 50% 92%;
  animation: flame-flicker var(--flicker, 3.4s) ease-in-out var(--delay, 0s) infinite,
             flame-sway var(--sway, 5.6s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 0 .25em rgba(255, 170, 60, .7));
}
.flame svg { display: block; width: 100%; height: 100%; overflow: visible; }
.halo {
  position: absolute; left: 50%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 196, 96, .6), rgba(255, 170, 70, 0) 70%);
  filter: blur(.25em);
  animation: halo var(--flicker, 3.4s) ease-in-out var(--delay, 0s) infinite;
  pointer-events: none;
}
.glow {
  position: absolute; left: 50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 204, 120, .4) 0%, rgba(255, 196, 110, .15) 36%, rgba(255, 190, 100, 0) 68%);
  animation: halo var(--flicker, 3.4s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes flame-flicker {
  0%, 100% { scale: 1 1; }
  9% { scale: .97 1.04; }
  19% { scale: 1.03 .96; }
  31% { scale: .96 1.07; }
  44% { scale: 1.02 .97; }
  57% { scale: .98 1.05; }
  69% { scale: 1.04 .95; }
  83% { scale: .99 1.06; }
}
@keyframes flame-sway {
  0%, 100% { rotate: 0deg; }
  24% { rotate: -2.6deg; }
  51% { rotate: 1.9deg; }
  77% { rotate: -1.1deg; }
}
@keyframes halo {
  0%, 100% { opacity: 1; scale: 1; }
  27% { opacity: .82; scale: .96; }
  55% { opacity: .96; scale: 1.04; }
  78% { opacity: .85; scale: .98; }
}
@keyframes ignite {
  0% { transform: scale(0, 0); opacity: 0; }
  35% { transform: scale(1.3, 1.45); opacity: 1; }
  65% { transform: scale(.9, .94); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes light-up { from { opacity: 0; } to { opacity: 1; } }

/* seichter Rauch (Canvas-Partikel) */
.smoke-canvas { position: absolute; pointer-events: none; z-index: 2; }

/* ---------- Stumpenkerze neben dem Porträt ---------- */
.candle--pillar {
  position: absolute; right: -3.2em; bottom: -.6em;
  font-size: clamp(14px, 1.45vw, 18px);
  width: 2.6em; height: 10em;
}
.candle--pillar .glow { bottom: 7.6em; width: 17em; height: 17em; margin: 0 0 -8.5em -8.5em; }
.candle--pillar .halo { bottom: 7.3em; width: 3em; height: 4.4em; margin-left: -1.5em; }
.candle--pillar .flame { bottom: 7.1em; width: 1.3em; height: 3.1em; margin-left: -.65em; }
.candle--pillar .smoke-canvas { left: 50%; bottom: 9.95em; width: 10em; height: 16em; margin-left: -5em; }
/* Flamme aus dem Shader (WebGL); die SVG-Flamme bleibt als Ersatz */
.candle--pillar .flame-gl { position: absolute; left: 50%; bottom: 6.7em; width: 3.4em; height: 5.2em; margin-left: -1.7em; pointer-events: none; z-index: 1; display: none; }
.candle--pillar.has-gl .flame-gl { display: block; }
.candle--pillar.has-gl .flame { display: none; }
.candle--pillar .wick {
  position: absolute; left: 50%; bottom: 6.85em; width: .14em; height: .78em; margin-left: -.07em;
  border-radius: .1em .1em 0 0;
  background: linear-gradient(#120c09, #4b3524);
  transform: rotate(7deg); transform-origin: bottom;
  z-index: 1;
}
.candle--pillar .wick::after {
  content: ""; position: absolute; top: -.06em; left: -.04em; width: .22em; height: .22em; border-radius: 50%;
  background: #ff9a3c; box-shadow: 0 0 .3em #ff8a1e;
}
.candle--pillar .wax {
  position: absolute; left: 0; right: 0; bottom: .55em; height: 6.4em; z-index: 1;
  border-radius: .32em .32em .26em .26em / .26em .26em .2em .2em;
  background:
    radial-gradient(ellipse 75% 34% at 50% 0%, rgba(255, 196, 110, .6), rgba(255, 196, 110, 0) 72%),
    linear-gradient(90deg, #cbb389 0%, #efe2c5 15%, #fffaf0 37%, #f8eed9 58%, #e3d0ab 82%, #c2aa80 100%);
  box-shadow: inset 0 -1.3em 1.2em -1em rgba(110, 80, 40, .35);
}
.candle--pillar .wax::before {
  /* geschmolzener Rand oben, vom Licht durchschienen */
  content: ""; position: absolute; left: 0; right: 0; top: -.33em; height: .66em; border-radius: 50%;
  background: radial-gradient(ellipse 44% 48% at 50% 50%, #f9cf86 0%, #f4dcae 38%, #fcf2dd 62%, #e9d6b0 100%);
  box-shadow: inset 0 .08em .12em rgba(255, 255, 255, .75), inset 0 -.06em .1em rgba(140, 100, 50, .25);
}
.candle--pillar .drip {
  position: absolute; top: .02em; width: .34em; border-radius: 0 0 .3em .3em;
  background: linear-gradient(90deg, #efe1c4, #fffaf0 55%, #ecdcbc);
  box-shadow: 0 .05em .08em rgba(120, 90, 50, .15);
}
.candle--pillar .drip::after {
  content: ""; position: absolute; left: -.04em; right: -.04em; bottom: -.12em; height: .3em; border-radius: 50%;
  background: inherit;
}
.candle--pillar .drip--1 { left: .38em; height: 1.7em; }
.candle--pillar .drip--2 { right: .5em; height: .95em; width: .28em; }
.candle--pillar .holder {
  position: absolute; left: -1em; right: -1em; bottom: 0; height: 1.15em; border-radius: 50%;
  background: radial-gradient(ellipse 52% 44% at 50% 36%, #f8e6b5 0%, #d8b274 38%, #a47b40 72%, #7a5a2b 100%);
  box-shadow: 0 .5em .8em -.35em rgba(60, 40, 20, .6);
}
.candle--pillar .holder::before {
  content: ""; position: absolute; inset: .14em .3em .4em; border-radius: 50%;
  border-top: 1px solid rgba(255, 245, 210, .75);
}
/* entzündet sich nach dem Laden */
.candle--pillar .flame, .candle--pillar .halo, .candle--pillar .glow, .candle--pillar .wick::after { opacity: 0; }
.candle--pillar.is-lit .flame { animation: ignite 1.4s var(--ease-out) both; }
.candle--pillar.is-lit .halo, .candle--pillar.is-lit .glow { opacity: 1; animation: light-up 1.6s ease both, halo var(--flicker, 3.4s) ease-in-out 1.6s infinite; }
.candle--pillar.is-lit .wick::after { opacity: 1; transition: opacity .4s ease; }
@media (max-width: 480px) { .candle--pillar { right: -2.2em; font-size: 13px; } }

/* ---------- Teelichter im Windlicht (Kerzenfeld) ---------- */
.tealight { position: relative; font-size: 12px; width: 5em; height: 7.5em; flex: none; margin-bottom: var(--lift, 0); isolation: isolate; }
@media (max-width: 600px) { .tealight { font-size: 10px; } .tealight .halo { filter: none; } }
.tealight svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tealight .tea-back { z-index: 0; }
.tealight .flame { z-index: 1; bottom: 1.98em; width: .95em; height: 2.25em; margin-left: -.475em; }
.tealight .halo { z-index: 1; bottom: 2.3em; width: 2.4em; height: 3.2em; margin-left: -1.2em; }
.tealight .tea-front { z-index: 2; }
.candle-stage { position: relative; }
.candle-stage .smoke-canvas { left: 0; top: -8rem; width: 100%; height: calc(100% + 8rem); z-index: 3; }
.tealight .glow { z-index: -1; bottom: 2.8em; width: 11em; height: 11em; margin: 0 0 -5.5em -5.5em; }
.tealight::before {
  /* warmer Lichtschein auf dem Untergrund */
  content: ""; position: absolute; left: -25%; right: -25%; bottom: -.5em; height: 1.6em; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse, rgba(255, 186, 96, .38), rgba(255, 186, 96, 0) 70%);
  animation: flicker-o var(--flicker, 3.4s) ease-in-out var(--delay, 0s) infinite;
}
.tealight .tea-light { animation: flicker-o var(--flicker, 3.4s) ease-in-out var(--delay, 0s) infinite; }
.tealight .tea-tint { fill: none; }
.tealight.glass--amber .tea-tint { fill: rgba(214, 158, 74, .2); }
.tealight.glass--rose .tea-tint { fill: rgba(212, 146, 126, .14); }
@keyframes flicker-o { 0%, 100% { opacity: 1; } 27% { opacity: .76; } 55% { opacity: .95; } 78% { opacity: .82; } }
.tealight.is-new { animation: candle-in 1s var(--ease-out) both; }
.tealight.is-new .flame { animation: ignite 1.4s var(--ease-out) .5s both; }
.tealight.is-new .halo, .tealight.is-new .glow { animation: light-up 1.4s ease .6s both, halo var(--flicker, 3.4s) ease-in-out 2s infinite; }
.tealight.is-new::after {
  /* kleine Funken beim Anzünden */
  content: ""; position: absolute; left: 50%; bottom: 4.4em; width: .4em; height: .4em; margin-left: -.2em; border-radius: 50%; z-index: 3;
  box-shadow: 0 -1.5em 0 -.08em #ffd27a, 1.2em -.9em 0 -.1em #ffe2a0, -1.2em -.9em 0 -.1em #ffe2a0, .8em -1.9em 0 -.12em #ffc65c, -.8em -1.9em 0 -.12em #ffc65c;
  animation: sparks 1s ease-out .45s both; opacity: 0;
}
@keyframes candle-in { from { opacity: 0; transform: translateY(1em) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes sparks { 0% { opacity: 0; transform: scale(.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6) translateY(-1em); } }

/* ---------- Abschnitte ---------- */
.section { position: relative; padding: clamp(4.5rem, 9vw, 7.5rem) 1.25rem; }
.section:nth-of-type(even) { background-color: var(--ivory); background-image: url(../img/grain.png); }
section[id] { scroll-margin-top: 3.5rem; }
.wrap { max-width: 68rem; margin: 0 auto; }
.wrap.narrow { max-width: 44rem; }
.section-head { text-align: center; margin-bottom: 2.8rem; }
.lead { color: var(--ink-soft); font-style: italic; margin: 1rem auto 0; max-width: 36rem; }

/* Zierlinie mit Olivenzweig – Linien ziehen sich beim Einblenden auf */
.ornament {
  position: relative; height: 1.5rem; margin: 1rem auto 0; width: min(19rem, 80%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 24'%3E%3Cg fill='%23a5824c' fill-opacity='.72'%3E%3Cellipse cx='59.6' cy='9.4' rx='4.2' ry='1.55' transform='rotate(-28 59.6 9.4)'/%3E%3Cellipse cx='65.5' cy='13.4' rx='4.2' ry='1.55' transform='rotate(26 65.5 13.4)'/%3E%3Cellipse cx='71.4' cy='7.2' rx='4.2' ry='1.55' transform='rotate(-28 71.4 7.2)'/%3E%3Cellipse cx='77.3' cy='13.2' rx='4.2' ry='1.55' transform='rotate(26 77.3 13.2)'/%3E%3Cellipse cx='83.3' cy='9.0' rx='4.2' ry='1.55' transform='rotate(-28 83.3 9.0)'/%3E%3Cellipse cx='36.4' cy='9.4' rx='4.2' ry='1.55' transform='rotate(28 36.4 9.4)'/%3E%3Cellipse cx='30.5' cy='13.4' rx='4.2' ry='1.55' transform='rotate(-26 30.5 13.4)'/%3E%3Cellipse cx='24.6' cy='7.2' rx='4.2' ry='1.55' transform='rotate(28 24.6 7.2)'/%3E%3Cellipse cx='18.7' cy='13.2' rx='4.2' ry='1.55' transform='rotate(-26 18.7 13.2)'/%3E%3Cellipse cx='12.7' cy='9.0' rx='4.2' ry='1.55' transform='rotate(28 12.7 9.0)'/%3E%3C/g%3E%3Cpath d='M56 14 Q72.0 10 88 14' fill='none' stroke='%23a5824c' stroke-width='1'/%3E%3Cpath d='M40 14 Q24.0 10 8 14' fill='none' stroke='%23a5824c' stroke-width='1'/%3E%3Cpath d='M48 2L49 3.2V7.3H53.1L54.3 8.3L53.1 9.3H49V20.4L50.1 22H45.9L47 20.4V9.3H42.9L41.7 8.3L42.9 7.3H47V3.2Z' fill='%23a5824c'/%3E%3C/svg%3E") center / 6.2rem auto no-repeat;
}
.ornament::before, .ornament::after {
  content: ""; position: absolute; top: 58%; height: 1px; width: calc(50% - 3.5rem);
  background: linear-gradient(90deg, rgba(203, 177, 132, 0), var(--gold-soft));
  transition: transform 1.4s var(--ease-out) .3s;
}
.ornament::before { left: 0; transform-origin: right center; }
.ornament::after { right: 0; transform-origin: left center; background: linear-gradient(90deg, var(--gold-soft), rgba(203, 177, 132, 0)); }
html.js [data-reveal]:not(.is-in) .ornament::before,
html.js [data-reveal]:not(.is-in) .ornament::after { transform: scaleX(0); }

/* ---------- Einblenden beim Scrollen ---------- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1.1s ease, transform 1.2s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms);
}
html.js [data-reveal="left"] { transform: translateX(-34px) rotate(-6deg); }
html.js [data-reveal="zoom"] { transform: scale(.94); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js .about-photo[data-reveal].is-in { transform: rotate(-2.5deg); }

/* ---------- Über Valent ---------- */
.about-grid {
  display: grid; gap: clamp(2.4rem, 5vw, 4.8rem);
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  align-items: center;
}
.about-photo {
  position: relative;
  margin: 0; padding: .75rem .75rem 2.8rem;
  background: var(--paper);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  transform: rotate(-2.5deg);
  transition: transform .8s var(--ease-out), box-shadow .8s ease, opacity 1.1s ease !important;
}
html.js .about-photo[data-reveal].is-in:hover, .about-photo:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 26px 50px -24px rgba(74, 56, 34, .55), 0 0 0 1px var(--line); }
.about-photo::before {
  /* Klebestreifen */
  content: ""; position: absolute; top: -.85rem; left: 50%; z-index: 2;
  width: 6.8rem; height: 1.7rem; margin-left: -3.4rem;
  transform: rotate(-4deg);
  background: linear-gradient(90deg, rgba(236, 222, 190, .82), rgba(244, 233, 208, .9) 50%, rgba(236, 222, 190, .82));
  box-shadow: 0 2px 4px rgba(74, 56, 34, .15);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 4% 96%, 0 50%);
}
.gloss { position: relative; overflow: hidden; }
.gloss img { transition: transform 1.6s var(--ease-out); }
.gloss::after { transition: transform 1.4s var(--ease-out); }
.about-photo:hover .gloss::after, .gallery button:hover .gloss::after, .gallery button:focus-visible .gloss::after { transform: translateX(80%); }
.about-photo:hover .gloss img { transform: scale(1.03); }

.about-text h2 { text-align: left; }
.about-text .ornament { margin-left: 0; }
.about-text p { margin: 1.1rem 0 0; }
.about-text > div > p:first-child { margin-top: 1.6rem; }
.about-text > div > p:first-child::first-letter {
  font-family: var(--serif-display); font-size: 3.4em; float: left;
  line-height: .8; padding: .08em .1em 0 0; color: var(--gold);
}
.about-text .closing { font-style: italic; color: var(--ink-soft); }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 15rem; margin: 0 auto; }
  .about-text h2 { text-align: center; }
  .about-text .ornament { margin-left: auto; }
}

/* Tischtennis (Line Art): zwei Schläger, der Ball fliegt langsam hin und her
   und trifft jeweils die Mitte der Schlagfläche (Werte aus tools-Rechnung, siehe Kommentar) */
.about-photo { padding-bottom: 3.55rem; }
.tt { position: absolute; left: 1.05rem; right: 1.05rem; bottom: .45rem; height: 2.75rem; z-index: 2; pointer-events: none; --tt: 2.8s; }
.tt::before { content: ""; position: absolute; left: 1.6rem; right: 1.6rem; bottom: .18rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.tt-net { position: absolute; left: 50%; bottom: .18rem; width: 1px; height: .7rem; background: var(--gold-soft); }
.tt-net::before { content: ""; position: absolute; left: -.12rem; top: 0; width: .25rem; height: 1px; background: var(--gold-soft); }
.tt-paddle { position: absolute; bottom: 0; width: 1.6rem; height: 2.453rem; transform-origin: 50% 95%; overflow: visible; }
.tt-left { left: 0; rotate: -12deg; animation: tt-swing-left calc(var(--tt) * 2) ease-in-out infinite; }
.tt-right { right: 0; rotate: 12deg; animation: tt-swing-right calc(var(--tt) * 2) ease-in-out infinite; }
/* Flugbahn: von Flächenmitte zu Flächenmitte (Schlagwinkel ±10°) */
.tt-track { position: absolute; left: 1.075rem; right: 1.075rem; bottom: 1.683rem; height: 0; z-index: 3; }
.tt-mover { position: absolute; left: 0; bottom: -.21rem; animation: tt-x calc(var(--tt) * 2) linear infinite; }
.tt-ball {
  display: block; width: .42rem; height: .42rem; margin-left: -.21rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f5ede0 70%);
  box-shadow: 0 0 0 1px rgba(165, 130, 76, .7);
  animation: tt-y calc(var(--tt) * 2) infinite;
}
/* waagerecht gleichmäßig hin (0–50 %) und zurück (50–100 %) */
@keyframes tt-x { 0% { left: 0; } 50% { left: 100%; } 100% { left: 0; } }
/* senkrecht wie beim echten Tischtennis: Schlag – Bogen über das Netz – Aufsprung auf der Gegenseite
   (bei 68 % bzw. 32 % der Strecke) – Gegner trifft. 1.29rem = Schlaghöhe bis Tischlinie (minus Ballradius) */
@keyframes tt-y {
  0%   { transform: translateY(0);        animation-timing-function: ease-out; }
  14%  { transform: translateY(-.8rem);   animation-timing-function: ease-in; }
  34%  { transform: translateY(1.293rem);  animation-timing-function: ease-out; }
  43%  { transform: translateY(-.22rem);  animation-timing-function: ease-in; }
  50%  { transform: translateY(0);        animation-timing-function: ease-out; }
  64%  { transform: translateY(-.8rem);   animation-timing-function: ease-in; }
  84%  { transform: translateY(1.293rem);  animation-timing-function: ease-out; }
  93%  { transform: translateY(-.22rem);  animation-timing-function: ease-in; }
  100% { transform: translateY(0); }
}
/* ausholen – treffen (10°) – durchschwingen – zurück in Bereitschaft */
@keyframes tt-swing-left {
  0% { rotate: 10deg; } 6% { rotate: 22deg; } 20%, 88% { rotate: -12deg; } 96% { rotate: -22deg; } 100% { rotate: 10deg; }
}
@keyframes tt-swing-right {
  0%, 38% { rotate: 12deg; } 46% { rotate: 22deg; } 50% { rotate: -10deg; } 56% { rotate: -22deg; } 70%, 100% { rotate: 12deg; }
}

/* ---------- Galerie ---------- */
.gallery { display: flex; gap: 1.1rem; align-items: flex-start; }
.gallery-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
@media (max-width: 600px) { .gallery, .gallery-col { gap: .65rem; } .section { padding-left: 1rem; padding-right: 1rem; } }
.gallery figure { margin: 0; }
.gallery button {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--paper);
  box-shadow: 0 10px 26px -18px rgba(74, 56, 34, .55), 0 0 0 1px var(--line);
  overflow: hidden;
  transition: transform .7s var(--ease-out), box-shadow .7s ease;
}
.gallery button:hover, .gallery button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -22px rgba(74, 56, 34, .6), 0 0 0 1px var(--gold-soft);
}
.gallery img { width: 100%; transition: transform 1.2s var(--ease-out), filter 1.2s ease; filter: saturate(.9) brightness(.98); }
.gallery button:hover img, .gallery button:focus-visible img { transform: scale(1.04); filter: brightness(1.04); }
html.js .gallery .fade-in { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
html.js .gallery .fade-in.is-visible { opacity: 1; transform: none; }

/* ---------- Gemeinsames Album ---------- */
.album-gallery { justify-content: center; }
.album-gallery .gallery-col { max-width: 22rem; }
.album-gallery figcaption { padding: .55rem .2rem 0; font-size: .95rem; line-height: 1.45; color: var(--ink-soft); }
.album-gallery figcaption .who { font-style: italic; color: var(--ink); white-space: nowrap; }
.album-empty { text-align: center; font-style: italic; color: var(--ink-soft); margin: 0; }
.album-cta { text-align: center; margin-top: 2.4rem; }
.album-cta[hidden] { display: none; }
.upload-form { margin: 2.4rem auto 0; max-width: 44rem; position: relative; animation: rise-in .8s var(--ease-out) both; }
.upload-form[hidden] { display: none; }
.hint { color: var(--ink-soft); font-size: .88rem; font-style: italic; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 9.5rem; padding: 1.4rem;
  border: 1.5px dashed var(--gold-soft); border-radius: .5rem;
  background: var(--ivory);
  text-align: center; cursor: pointer;
  transition: border-color .3s ease, background-color .3s ease, transform .3s var(--ease-out);
}
.dropzone:hover, .dropzone.is-over, #u-files:focus-visible + .dropzone { border-color: var(--gold); background: #fbf5e8; }
.dropzone.is-over { transform: scale(1.01); }
.dropzone-text { font-family: var(--serif-display); font-size: 1.3rem; color: var(--ink); }
.dropzone small { color: var(--ink-soft); font-size: .88rem; }
.dropzone-icon { width: 2.6rem; height: 2.1rem; border: 1.5px solid var(--gold); border-radius: .3rem; position: relative; transition: transform .4s var(--ease-out); }
.dropzone:hover .dropzone-icon { transform: translateY(-3px); }
.dropzone-icon::before {
  content: ""; position: absolute; left: .35rem; right: .35rem; bottom: .3rem; height: .8rem;
  background: linear-gradient(135deg, transparent 49%, var(--gold-soft) 50%) left / 55% 100% no-repeat,
              linear-gradient(225deg, transparent 49%, var(--gold-soft) 50%) right / 55% 100% no-repeat;
}
.dropzone-icon::after { content: ""; position: absolute; right: .45rem; top: .35rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--gold); }

.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: .7rem; margin-top: .9rem; }
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: .35rem; overflow: hidden; background: var(--sand); box-shadow: 0 0 0 1px var(--line); animation: rise-in .5s var(--ease-out) both; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview.is-done::after, .preview.is-error::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2rem; color: var(--paper); background: rgba(93, 107, 62, .55);
}
.preview.is-error::after { content: "!"; background: rgba(154, 82, 54, .6); }
.preview.is-busy::after { content: ""; position: absolute; inset: 0; background: rgba(255, 253, 248, .55); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.preview-remove {
  position: absolute; top: .25rem; right: .25rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 0; background: rgba(59, 49, 41, .7); color: var(--paper); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.progress { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--sand); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-soft), var(--gold)); transition: width .4s ease; }

/* ---------- Kerzen-Abschnitt ---------- */
.candles-section {
  text-align: center;
  background:
    radial-gradient(ellipse 60% 55% at 50% 52%, rgba(255, 244, 222, .95) 0%, rgba(239, 227, 204, .6) 55%, rgba(226, 212, 186, .55) 100%),
    url(../img/grain.png) var(--sand) !important;
}
.candle-field {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: 1.1rem 1.1rem; min-height: 8rem; margin: 0 auto 1.2rem; max-width: 40rem;
  padding: 2rem 0 1.4rem;
  isolation: isolate;
}
.candle-field::after {
  /* sanfter Schatten unter den Kerzen */
  content: ""; position: absolute; left: 10%; right: 10%; bottom: .6rem; height: 1.2rem; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(120, 90, 50, .16), rgba(120, 90, 50, 0) 70%);
  z-index: -1;
}
.candle-count {
  font-family: var(--serif-display); font-size: 1.5rem; color: var(--ink-soft);
  margin: 0 0 1.6rem; min-height: 1.6em;
}

/* ---------- Schaltflächen ---------- */
.btn {
  position: relative; overflow: hidden;
  font: inherit; font-family: var(--serif-display); font-size: 1.25rem; letter-spacing: .05em;
  color: var(--paper);
  background: linear-gradient(180deg, #b6935c, #93723f);
  border: 0; border-radius: 2rem;
  padding: .72rem 2.2rem .78rem;
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(110, 80, 35, .9), inset 0 1px 0 rgba(255, 240, 210, .35);
  transition: transform .3s var(--ease-out), box-shadow .3s ease, opacity .3s ease;
}
.btn::after { inset: -40%; transition: transform 1s var(--ease-out); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(110, 80, 35, .95), inset 0 1px 0 rgba(255, 240, 210, .35); }
.btn:hover::after { transform: translateX(80%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn--candle.is-lit, .btn--candle.is-lit:disabled { opacity: 1; background: linear-gradient(180deg, #c7a46a, #a3814b); box-shadow: 0 0 0 4px rgba(255, 210, 130, .25), 0 10px 30px -10px rgba(255, 170, 70, .7); }

/* ---------- Formulare ---------- */
.book-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem;
  background: var(--paper);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  border-radius: .4rem;
  position: relative;
}
.book-form::before {
  /* feine Doppellinie wie bei Briefpapier */
  content: ""; position: absolute; inset: .45rem; border: 1px solid rgba(203, 177, 132, .35); border-radius: .25rem; pointer-events: none;
}
.field { display: flex; flex-direction: column; gap: .3rem; position: relative; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--serif-display); font-size: 1.15rem; color: var(--ink-soft); }
.field small { font-size: .85em; }
.field input[type="text"], .field textarea {
  font: inherit; color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line); border-radius: .3rem;
  padding: .6rem .8rem;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: var(--paper); box-shadow: 0 0 0 4px rgba(203, 177, 132, .2); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #b2674b; animation: nudge .4s ease; }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.consent { flex-direction: row; align-items: flex-start; gap: .7rem; }
.consent input { margin-top: .45rem; width: 1.05rem; height: 1.05rem; accent-color: var(--gold); flex: none; }
.consent label { font-family: var(--serif-text); font-size: .98rem; line-height: 1.55; }
.consent.is-invalid label { color: #9a5236; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.4rem; }
.form-status { margin: 0; font-style: italic; color: var(--ink-soft); flex: 1 1 14rem; }
.form-status.is-error { color: #9a5236; }
.form-status.is-ok { color: #5d6b3e; animation: rise-in .6s var(--ease-out) both; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.protect-note { margin: 0; font-size: .85rem; font-style: italic; color: var(--ink-soft); opacity: .85; }
@media (max-width: 600px) { .book-form { grid-template-columns: 1fr; } }

/* ---------- Nachrichten ---------- */
.messages { margin-top: 3rem; display: grid; gap: 1.4rem; }
.message {
  position: relative;
  background: var(--paper);
  padding: 1.7rem 1.9rem 1.3rem;
  box-shadow: 0 10px 28px -22px rgba(74, 56, 34, .6), 0 0 0 1px var(--line);
  border-radius: .35rem;
  transition: transform .6s var(--ease-out), box-shadow .6s ease, opacity 1.1s ease;
}
html.js .message[data-reveal].is-in:hover, .message:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -24px rgba(74, 56, 34, .6), 0 0 0 1px var(--gold-soft); }
.message::before {
  content: "\201C"; position: absolute; top: .3rem; left: .9rem;
  font-family: var(--serif-display); font-size: 3.4rem; line-height: 1; color: var(--gold-soft);
}
.message::after {
  /* kleiner Olivenzweig unten links */
  content: ""; position: absolute; left: 1.4rem; bottom: 1.15rem; width: 2.4rem; height: 1rem; opacity: .45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 24'%3E%3Cpath d='M8 15 Q30 9 52 15' fill='none' stroke='%23a5824c' stroke-width='1.2'/%3E%3Cg fill='%23a5824c'%3E%3Cellipse cx='18' cy='10.8' rx='4.6' ry='1.7' transform='rotate(-28 18 10.8)'/%3E%3Cellipse cx='26' cy='16' rx='4.6' ry='1.7' transform='rotate(24 26 16)'/%3E%3Cellipse cx='34' cy='9.6' rx='4.6' ry='1.7' transform='rotate(-24 34 9.6)'/%3E%3Cellipse cx='42' cy='15.6' rx='4.4' ry='1.6' transform='rotate(26 42 15.6)'/%3E%3C/g%3E%3C/svg%3E") left center / contain no-repeat;
}
.message-text { margin: .4rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.message-meta { margin: 1rem 0 0; text-align: right; color: var(--ink-soft); font-family: var(--serif-display); font-size: 1.15rem; }
.message-meta .who { font-style: italic; color: var(--ink); }
.message-meta .when { display: block; font-size: .95rem; letter-spacing: .03em; }
.messages-empty { text-align: center; font-style: italic; color: var(--ink-soft); }

/* ---------- Fußzeile ---------- */
.footer {
  position: relative;
  text-align: center; padding: 3.8rem 1.25rem 3.2rem;
  background: url(../img/grain.png) var(--sand);
  color: var(--ink-soft);
}
.footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.footer .ornament { margin-top: 0; }
.footer-rip { font-family: var(--serif-display); font-style: italic; font-size: 1.6rem; margin: 1rem 0 0; color: var(--ink); }
.footer-name { margin: .2rem 0 0; letter-spacing: .14em; text-transform: uppercase; font-size: .9rem; }
.footer-years { margin: .1rem 0 0; font-family: var(--serif-display); letter-spacing: .2em; font-size: .95rem; color: var(--gold); }
.footer-links { margin: 1.4rem 0 0; font-size: .95rem; }

/* ---------- Pfeil nach oben ---------- */
.to-top {
  position: fixed; right: max(1.1rem, env(safe-area-inset-right)); bottom: max(1.1rem, env(safe-area-inset-bottom)); z-index: 25;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 10px 24px -12px rgba(74, 56, 34, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .5s ease, transform .5s var(--ease-out), box-shadow .3s ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { box-shadow: 0 14px 28px -12px rgba(74, 56, 34, .65); }
.to-top svg { position: absolute; }
.to-top-ring { inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top-ring circle { fill: none; stroke-width: 1.6; }
.to-top .ring-bg { stroke: rgba(203, 177, 132, .4); }
.to-top .ring-fg {
  stroke: var(--gold); stroke-linecap: round;
  stroke-dasharray: 138.23; stroke-dashoffset: calc(138.23 * (1 - var(--progress, 0)));
  transition: stroke-dashoffset .25s linear;
}
.to-top-arrow { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-out); }
.to-top:hover .to-top-arrow { transform: translateY(-3px); }
@media (max-width: 600px) { .to-top { width: 2.85rem; height: 2.85rem; } }

/* ---------- Vorschau-Hinweis ---------- */
.preview-badge {
  position: fixed; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .9rem; border-radius: 2rem;
  background: rgba(59, 49, 41, .88); color: var(--paper);
  font-family: var(--serif-text); font-size: .9rem; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5);
}
.preview-badge:hover { color: var(--gold-light); }
.preview-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #ffc65c; box-shadow: 0 0 6px #ffc65c; animation: pulse 1.6s ease-in-out infinite; }

/* ---------- Dialoge ---------- */
dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(32, 25, 19, .9); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: dialog-in .45s var(--ease-out) both; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: transparent; color: var(--paper);
  overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox-figure { margin: 0; display: grid; place-items: center; width: 100%; height: 100%; padding: 4rem 4.5rem; }
.lightbox img {
  max-width: calc(100vw - 9rem); max-height: calc(100vh - 8rem); width: auto; height: auto; object-fit: contain;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
  border: .45rem solid var(--paper);
  transition: opacity .35s ease, transform .5s var(--ease-out);
}
.lightbox img.is-loading { opacity: 0; transform: scale(.985); }
.lb-btn {
  position: absolute; z-index: 2;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif-display); font-size: 2.2rem; line-height: 1;
  color: var(--paper); background: rgba(255, 253, 248, .08);
  border: 1px solid rgba(255, 253, 248, .25);
  cursor: pointer;
  transition: background-color .25s ease, transform .25s var(--ease-out);
}
.lb-btn:hover { background: rgba(255, 253, 248, .2); transform: scale(1.06); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; margin-top: -1.5rem; }
.lb-next { right: 1rem; top: 50%; margin-top: -1.5rem; }
.lb-count {
  position: absolute; bottom: 1rem; left: 0; right: 0; margin: 0; text-align: center;
  font-family: var(--serif-display); letter-spacing: .1em; color: rgba(255, 253, 248, .75);
}
.lb-caption {
  position: absolute; left: 0; right: 0; bottom: 2.6rem; text-align: center; padding: 0 4.5rem;
  color: rgba(255, 253, 248, .9); font-style: italic; font-size: 1rem;
}
.lb-caption:empty { display: none; }
@media (max-width: 600px) {
  .lightbox-figure { padding: 3.8rem .6rem; }
  .lightbox img { max-width: calc(100vw - 1.2rem); max-height: calc(100vh - 8.5rem); }
  .lb-prev, .lb-next { top: auto; bottom: .6rem; margin: 0; }
  .lb-prev { left: 1rem; } .lb-next { right: 1rem; }
  .lb-caption { bottom: 4.4rem; padding: 0 1rem; }
}

.privacy {
  width: min(44rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem);
  background: var(--paper); color: var(--ink);
  border-radius: .5rem; box-shadow: var(--shadow);
}
.privacy-inner { position: relative; padding: 2.4rem clamp(1.3rem, 4vw, 2.6rem) 2rem; }
.privacy h2 { font-size: 2rem; padding-right: 3rem; }
.privacy h3 { font-size: 1.35rem; margin-top: 1.4rem; color: var(--gold); }
.privacy p { margin: .5rem 0 0; font-size: 1rem; }
.privacy-close { top: 1rem; right: 1rem; color: var(--ink); background: var(--cream); border-color: var(--line); font-size: 1.8rem; width: 2.6rem; height: 2.6rem; }
.privacy-close:hover { background: var(--sand); }

/* ---------- Weniger Bewegung, wenn gewünscht ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .hero-bg img { transition: none; }
  .motes { display: none; }
  .candle--pillar .flame, .candle--pillar .halo, .candle--pillar .glow, .candle--pillar .wick::after { opacity: 1; }
}
