/* ════════════════════════════════════════════════════════════
   LA FENICE — Polish-Layer
   View Transitions · Film-Grain · Ambient-Glut · Clip-Reveals ·
   Hero-Typo-Settle · Live-Uhr. Additiv, alles rm-gegated.
   ════════════════════════════════════════════════════════════ */

/* Safari darf Text beim Wechsel von Browser-Chrome/Dialog nicht neu skalieren.
   Echte Schnitte statt synthetischer Zwischenstufen halten die Metrik stabil. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-synthesis: none;
}

/* ── Seitenwechsel: Cross-Document View Transitions ── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: 380ms cubic-bezier(0.32, 0.72, 0, 1) both vtFadeOut;
}
::view-transition-new(root) {
  animation: 520ms cubic-bezier(0.16, 1, 0.3, 1) both vtFadeIn;
}
@keyframes vtFadeOut {
  to { opacity: 0; transform: translateY(-8px); }
}
@keyframes vtFadeIn {
  from { opacity: 0; transform: translateY(10px); }
}
@media (max-width: 900px) {
  html { view-transition-name: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ── Film-Grain: analoge Textur über allem ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ── Ambient-Glut: warme Lichtinseln in den dunklen Sektionen ── */
.sec--maroon,
.sec--night,
.family,
.gallery,
.finale {
  background-image:
    radial-gradient(720px 480px at 18% 22%, rgba(212, 160, 61, 0.055), transparent 62%),
    radial-gradient(640px 460px at 84% 78%, rgba(201, 62, 69, 0.05), transparent 60%);
  background-size: 200% 200%, 200% 200%;
  background-position: 0% 0%, 100% 100%;
  animation: glutDrift 46s ease-in-out infinite alternate;
}
@keyframes glutDrift {
  to { background-position: 30% 40%, 70% 60%; }
}

/* ── Clip-Reveals: Bilder werden aufgedeckt, nicht eingeblendet ── */
.gal figure[data-r] img,
.gallery-grid figure[data-r] img,
figure.polaroid[data-r] img,
[data-r] .polaroid img,
[data-r] .filmstrip img {
  clip-path: inset(100% 0 0 0);
  transition:
    clip-path 1.1s cubic-bezier(0.18, 1, 0.22, 1),
    filter 900ms cubic-bezier(0.18, 1, 0.22, 1);
}
.gal figure[data-r].in img,
.gallery-grid figure[data-r].in img,
figure.polaroid[data-r].in img,
[data-r].in .polaroid img,
[data-r].in .filmstrip img {
  clip-path: inset(0 0 0 0);
}
[data-r] .filmstrip img:nth-child(2) { transition-delay: 120ms; }
[data-r] .filmstrip img:nth-child(3) { transition-delay: 240ms; }

/* ── Hero-Typo-Settle: Blur + Letter-Spacing landen ── */
.hero-h {
  animation-name: heroType;
}
@keyframes heroType {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(10px);
  }
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ── Live-Uhr im Footer ── */
.fx-clock {
  font-variant-numeric: tabular-nums;
  color: rgba(245, 240, 232, 0.5);
}

@media print {
  body::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .sec--maroon, .sec--night, .family, .gallery, .finale { animation: none; }
  .gal figure[data-r] img,
  .gallery-grid figure[data-r] img,
  figure.polaroid[data-r] img,
  [data-r] .polaroid img,
  [data-r] .filmstrip img { clip-path: none; transition: none; }
  .hero-h { animation: none; opacity: 1; }
}

/* ── Skip-Link: erst bei Fokus sichtbar ── */
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 22px;
  background: var(--ink, #1A1614);
  color: var(--cream, #F5F0E8);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  border-radius: 999px;
  /* Unsichtbar UND untastbar — reines transform reicht nicht: iOS' einklappende
     Adressleiste verschiebt fixe Elemente beim Scrollen und legte den Link frei */
  transform: translateY(-64px);
  opacity: 0;
  pointer-events: none;
  transition: transform 250ms cubic-bezier(0.32, 0.72, 0, 1), opacity 250ms;
}
.skip-link:focus-visible { transform: none; opacity: 1; pointer-events: auto; }

/* ── Mobile-Nav: Wortmarken-Trigger + Drawer ── */
.nav-menu-btn {
  display: none;
  position: relative;
  background: none; border: 0; cursor: pointer;
  color: inherit;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  padding: 14px 4px;
  min-height: 44px;
}
.nav-menu-btn::after {
  content: "";
  position: absolute; left: 4px; right: 4px; bottom: 10px; height: 1px;
  background: var(--cream, #F5F0E8);
  transform: scaleX(0); transform-origin: right;
  transition: transform 450ms cubic-bezier(0.86, 0, 0.07, 1);
}
.nav-menu-btn:hover::after, .nav-menu-btn:focus-visible::after {
  transform: scaleX(1); transform-origin: left;
}
@media (max-width: 900px) {
  .nav-menu-btn { display: inline-block; }
}
.nav-drawer {
  position: fixed; inset: 0;
  border: 0; padding: 0; margin: 0;
  max-width: none; max-height: none; width: auto; height: auto;
  background: var(--night, #14100E);
  color: var(--cream, #F5F0E8);
  overflow: hidden;
  overscroll-behavior: contain;
}
.nav-drawer:focus { outline: none; }
.nav-drawer::backdrop { background: rgba(20, 16, 14, 0.6); }
.nav-drawer[open] { display: flex; flex-direction: column; }
.nav-drawer-inner {
  display: flex; flex-direction: column;
  width: 100%; height: 100%; min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: max(20px, env(safe-area-inset-top)) clamp(20px, 6vw, 40px) max(28px, env(safe-area-inset-bottom));
}
.nav-drawer {
  background:
    radial-gradient(560px 420px at 84% 16%, rgba(212, 160, 61, 0.07), transparent 60%),
    radial-gradient(520px 420px at 10% 88%, rgba(201, 62, 69, 0.06), transparent 58%),
    var(--night, #14100E);
}
.nav-drawer-wm {
  display: none;
}
.nav-drawer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: clamp(26px, 6svh, 52px); }
.nav-drawer-kicker { color: var(--gold, #D4A03D); }
.nav-drawer-close {
  position: relative;
  background: none; border: 0; cursor: pointer;
  color: var(--cream, #F5F0E8);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase;
  padding: 12px 4px; min-height: 44px;
}
.nav-drawer-close::after {
  content: "";
  position: absolute; left: 4px; right: 4px; bottom: 8px; height: 1px;
  background: var(--cream, #F5F0E8);
  transform: scaleX(0); transform-origin: right;
  transition: transform 450ms cubic-bezier(0.86, 0, 0.07, 1);
}
.nav-drawer-close:hover::after, .nav-drawer-close:focus-visible::after {
  transform: scaleX(1); transform-origin: left;
}
.nav-drawer-links { display: grid; gap: 0; }
.nav-drawer-links a {
  display: flex; align-items: baseline; gap: 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-synthesis: none;
  font-size: 38px;
  line-height: 1.15;
  padding: 13px 0;
  border-bottom: 1px solid rgba(245, 240, 232, 0.1);
  opacity: 1;
  transform: none;
  transition: color 250ms;
}

.nav-drawer-links .dn {
  font-size: 13px;
  font-style: italic;
  color: var(--gold, #D4A03D);
  min-width: 1.6em;
  flex: none;
}
.nav-drawer-links a:hover .dt { color: var(--cream, #F5F0E8); }
.nav-drawer-links a.is-active .dt { font-style: italic; }
.nav-drawer-cta { margin-top: auto; padding-top: 32px; position: relative; }
.nav-drawer-meta { margin-top: 24px; font-size: 11px; line-height: 2; color: rgba(245, 240, 232, 0.55); }

@media (max-width: 360px) {
  .nav-drawer-links a { font-size: 34px; padding-block: 11px; }
  .nav-drawer-links .dn { font-size: 11px; }
}
@media (max-height: 680px) {
  .nav-drawer-top { margin-bottom: 18px; }
  .nav-drawer-links a { font-size: 32px; padding-block: 9px; }
  .nav-drawer-cta { padding-top: 18px; }
  .nav-drawer-meta { margin-top: 12px; line-height: 1.75; }
}

/* ── Lightbox: ruhige Detailansicht ── */
.lightbox {
  border: 0; padding: 0;
  background: transparent;
  max-width: min(92vw, 1100px); max-height: 92vh;
}
.lightbox::backdrop { background: rgba(20, 16, 14, 0.92); }
.lightbox figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 80vh; object-fit: contain; border-radius: 4px; }
.lightbox figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold, #D4A03D);
}
.lightbox-close {
  position: fixed; top: 18px; right: 22px;
  background: none; border: 0; cursor: pointer;
  color: var(--cream, #F5F0E8);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  padding: 12px; min-height: 44px;
}
.gal figure[data-lb], .gallery-grid figure[data-lb] { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  .nav-drawer-links a { transition: none; opacity: 1; transform: none; }
  .skip-link { transition: none; }
}

/* ── Heute-Moment: Offen-Status aus echten Zeiten ── */
.open-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.open-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(245, 240, 232, 0.35);
  flex: none;
}
.open-status.is-open .open-dot {
  background: var(--gold, #D4A03D);
  box-shadow: 0 0 8px rgba(212, 160, 61, 0.5);
}
