/* ================================================================
   LAYOUT — structural positioning and section structure
   ================================================================ */

/* ── Geometric lattice background (full-page fixed) ──────────── */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at center, rgba(139, 92, 58, .10) 0 1.2px, transparent 1.6px),
    repeating-linear-gradient(45deg,  rgba(139, 92, 58, .045) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(-45deg, rgba(139, 92, 58, .045) 0 1px, transparent 1px 28px),
    radial-gradient(circle at center, var(--cream) 0%, var(--cream-deep) 140%);
  background-size: 28px 28px, 28px 28px, 28px 28px, 100% 100%;
}

/* ── Petals layer ─────────────────────────────────────────────── */
.petals {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

/* ── Gate opener scene ───────────────────────────────────────── */
.gate-scene {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gate-bg);
  overflow: hidden;
  perspective: 1200px;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.gate-scene.opened {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Main invitation page ─────────────────────────────────────── */
/* ponytail: vignette pseudo creates "light from edges" during zoom reveal */
.invitation {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 3.4vh, 30px);
  padding: clamp(36px, 7vh, 64px) clamp(16px, 4vw, 48px) clamp(56px, 10vh, 96px);
  opacity: 0;
  transform: scale(0.25);
  filter: brightness(0.55);
  transition: opacity 0.4s ease,
              transform 1.6s var(--ease-out-expo),
              filter 1.6s ease;
}
.invitation.show { opacity: 1; transform: scale(1); filter: brightness(1); }

.invitation::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(139, 92, 58, 0.55) 0%,
    rgba(139, 92, 58, 0.32) 35%,
    rgba(139, 92, 58, 0.08) 72%,
    transparent 100%);
  opacity: 0;
  will-change: opacity;
}
.invitation.show::before {
  animation: edge-light 1.8s ease-out forwards;
}

/* ── Card entrance — ink-in stagger ───────────────────────────── */
#invitation-card,
#invitation-card .inner > * { opacity: 0; }
#invitation-card.unfolded { opacity: 1; }
#invitation-card.unfolded .inner > * {
  animation: ink-in 700ms ease both;
  animation-delay: calc(250ms + var(--i, 0) * 130ms);
}
#invitation-card.unfolded .orn svg {
  transform-origin: center;
  animation: rule-draw 1000ms var(--ease-out-expo) both;
  animation-delay: calc(350ms + var(--i, 0) * 130ms);
}

/* ── Music button (fixed) ─────────────────────────────────────── */
.music-btn {
  position: fixed;
  z-index: 60;
  right: max(16px, 3vw);
  bottom: max(16px, 3vw);
}

/* ── Hidden utility ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Developer footer ─────────────────────────────────────────── */
.dev-footer {
  width: 100%;
  margin-top: clamp(28px, 5vw, 44px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--kufi);
  font-size: clamp(12px, 2.6vw, 14px);
  letter-spacing: 0.12em;
  color: var(--text-footer);
  text-align: center;
  opacity: 0.72;
}
.dev-footer a {
  color: var(--text-footer);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s ease;
}
.dev-footer a:hover { opacity: 0.85; }
