/* =========================================================
   Alriss & Ezeil — Guest invitation styles
   Palette taken from the printed invitation.
   ========================================================= */

:root {
  /* Brand palette */
  --bg: #320407;
  --bg-raise: #3d0710;
  --burgundy: #5a0c16;
  --burgundy-deep: #4a0612;
  --wine: #74131f;
  --terracotta: #a0442a;
  --champagne: #c4a693;
  --dusty-rose: #a1595f;
  --gold: #c9a35b;
  --gold-light: #e7cd92;
  --gold-deep: #9c7536;
  --cream: #f6e8d6;
  --paper: #f8eedf;
  --ink: #3a060c;

  /* Semantic tokens */
  --text: #f3e4d2;
  --text-muted: rgba(243, 228, 210, 0.78);
  --line: rgba(201, 163, 91, 0.55);
  --line-soft: rgba(201, 163, 91, 0.28);
  --surface: rgba(255, 240, 225, 0.035);
  --danger: #ffb4a8;
  --success: #cfe8b9;
  --gold-gradient: linear-gradient(135deg, #f3dca4 0%, #c9a35b 48%, #a47b3a 100%);

  /* Type */
  --f-display: 'Playfair Display', 'Times New Roman', serif;
  --f-caps: 'Cinzel', 'Times New Roman', serif;
  --f-body: 'Cormorant Garamond', Georgia, serif;
  --f-script: 'Pinyon Script', 'Brush Script MT', cursive;

  /* Spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --radius: 12px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.65);
  --topbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + var(--s-4)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(116, 19, 31, 0.45), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(116, 19, 31, 0.3), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1.2rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-light); }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--ink); }

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 100;
  padding: var(--s-2) var(--s-4); background: var(--gold); color: var(--ink);
  border-radius: var(--radius-pill); font-family: var(--f-caps); font-size: 0.8rem; text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

.eyebrow, .caps {
  font-family: var(--f-caps);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.script { font-family: var(--f-script); font-weight: 400; color: var(--gold-light); line-height: 1.2; }
.amp { font-style: normal; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--f-caps);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn--gold { background: var(--gold-gradient); color: var(--ink); box-shadow: 0 10px 24px -10px rgba(201, 163, 91, 0.75); }
.btn--gold:hover { box-shadow: 0 16px 30px -12px rgba(231, 205, 146, 0.85); }
.btn--ghost { background: transparent; color: var(--gold-light); border-color: var(--line); }
.btn--ghost:hover { background: rgba(201, 163, 91, 0.12); border-color: var(--gold); }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: 0.72rem; }
.btn--lg { min-height: 56px; padding: 0 var(--s-6); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn__spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(58, 6, 12, 0.25); border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading { pointer-events: none; }
.link-btn {
  background: none; border: 0; padding: var(--s-2); color: var(--text-muted);
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 1rem;
}
.link-btn:hover { color: var(--gold-light); }

/* ---------- Petals ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.petal {
  position: absolute; top: -40px;
  width: var(--size, 12px); height: calc(var(--size, 12px) * 0.8);
  background: linear-gradient(135deg, rgba(231, 205, 146, 0.9), rgba(161, 89, 95, 0.75));
  border-radius: 150% 0 150% 0;
  opacity: 0;
  animation: petal-fall var(--dur, 12s) linear var(--delay, 0s) infinite;
}
.petal--rose { background: linear-gradient(135deg, rgba(196, 120, 126, 0.85), rgba(116, 19, 31, 0.8)); }

/* =========================================================
   ENVELOPE GATE
   ========================================================= */
.gate {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--s-7) var(--s-4) var(--s-8);
  overflow: hidden;
  transition: opacity 0.9s var(--ease), transform 1.2s var(--ease);
}
.gate.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.gate__floral { position: absolute; pointer-events: none; opacity: 0.95; }
.gate__floral--tr { top: 0; right: 0; width: clamp(150px, 30vw, 360px); }
.gate__floral--bl { bottom: 0; left: 0; width: clamp(150px, 28vw, 340px); }
.gate__inner { position: relative; z-index: 2; width: 100%; max-width: 560px; text-align: center; }
.gate__title {
  margin: var(--s-3) 0 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  line-height: 1.1;
  color: var(--cream);
}

.envelope {
  --env-w: min(88vw, 480px);
  position: relative;
  width: var(--env-w);
  aspect-ratio: 3 / 2;
  margin: calc(var(--env-w) * 0.36) auto 0;
  perspective: 1400px;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.55));
  animation: envelope-float 5s ease-in-out infinite;
}
.envelope.is-open { animation: none; }
.envelope__back {
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(180deg, #4f0a14, #3b0710);
}
.envelope__letter {
  position: absolute; left: 5%; right: 5%; top: 5%; height: 90%;
  z-index: 2;
  border-radius: 4px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(180deg, #fbf3e7, #f1e0c9);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.25);
  padding: 7% 6%;
  color: var(--ink);
  transition: transform 1.2s var(--ease) 0.75s;
}
.letter__frame {
  height: 100%;
  border: 1px solid rgba(156, 117, 54, 0.6);
  outline: 1px solid rgba(156, 117, 54, 0.35);
  outline-offset: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 6%;
  gap: 2px;
}
.letter__eyebrow { font-family: var(--f-caps); font-size: clamp(0.5rem, 1.6vw, 0.66rem); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.letter__names { font-family: var(--f-display); font-size: clamp(1.2rem, 4.6vw, 1.9rem); line-height: 1.2; color: var(--burgundy); }
.letter__text { font-size: clamp(0.72rem, 2.3vw, 0.95rem); font-style: italic; color: #5b2a2e; }
.letter__guest { font-family: var(--f-script); font-size: clamp(1.1rem, 4.4vw, 1.75rem); color: var(--wine); line-height: 1.3; margin-top: 2%; }
.letter__date { font-family: var(--f-caps); font-size: clamp(0.5rem, 1.6vw, 0.66rem); letter-spacing: 0.3em; color: var(--gold-deep); }

.envelope__pocket {
  position: absolute; inset: 0; z-index: 3;
  filter: drop-shadow(0 -1px 0 rgba(231, 205, 146, 0.65));
  pointer-events: none;
}
.envelope__pocket::before,
.envelope__pocket::after { content: ''; position: absolute; inset: 0; border-radius: 6px; }
.envelope__pocket::before {
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg, #6b111d, #4d0a13 70%);
}
.envelope__pocket::after {
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  background: linear-gradient(0deg, #5e0e19, #6f1420);
}
.envelope__stamp {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 9%;
  font-family: var(--f-caps); font-size: clamp(0.6rem, 2vw, 0.78rem); letter-spacing: 0.4em;
  color: var(--gold-light); opacity: 0.85;
}
.envelope__flap {
  position: absolute; left: 0; right: 0; top: 0; height: 60%;
  z-index: 4;
  transform-origin: 50% 0;
  transition: transform 0.9s var(--ease) 0.2s, z-index 0s linear 0.65s;
  filter: drop-shadow(0 2px 0 rgba(231, 205, 146, 0.6)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}
.envelope__flap::before {
  content: ''; position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #7b1723, #5a0c16);
  border-radius: 6px 6px 0 0;
}
.envelope.is-open .envelope__flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-open .envelope__letter { transform: translateY(-58%); }

.seal {
  position: absolute; left: 50%; top: 60%; z-index: 5;
  width: clamp(68px, 18vw, 92px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; cursor: pointer;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 35% 30%, #f6e2ad, #d1ab62 40%, #9b7434 75%, #6f5121);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 -4px 8px rgba(0, 0, 0, 0.25), inset 0 3px 6px rgba(255, 255, 255, 0.35);
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.seal:hover { transform: translate(-50%, -50%) scale(1.05) rotate(-4deg); }
.seal__ring {
  position: absolute; inset: 12%;
  border-radius: 50%;
  border: 1.5px solid rgba(90, 58, 20, 0.55);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.35);
  display: grid; place-items: center;
}
.seal__mono {
  font-family: var(--f-display); font-size: clamp(1rem, 4vw, 1.35rem); letter-spacing: 0.02em;
  color: #5a3a14; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
}
.seal__mono i { font-family: var(--f-script); font-style: normal; font-size: 0.9em; margin: 0 1px; }
.envelope.is-open .seal { transform: translate(-50%, -50%) scale(1.5) rotate(25deg); opacity: 0; pointer-events: none; }
.envelope.is-shaking { animation: shake 0.5s var(--ease); }

.key-form { margin-top: var(--s-7); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.key-form.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
.key-form__label { display: block; font-family: var(--f-caps); font-size: 0.82rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-light); margin-bottom: var(--s-3); }
.key-form__row { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.key-form__input {
  flex: 1 1 220px; max-width: 300px; min-height: 52px;
  padding: 0 var(--s-4);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--cream);
  font-family: var(--f-caps); font-size: 1.05rem; letter-spacing: 0.22em; text-align: center; text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.key-form__input::placeholder { color: rgba(243, 228, 210, 0.45); letter-spacing: 0.14em; }
.key-form__input:focus { outline: none; border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(201, 163, 91, 0.22); }
.key-form__input[aria-invalid='true'] { border-color: var(--danger); }
.key-form__hint { margin-top: var(--s-3); font-size: 1rem; font-style: italic; color: var(--text-muted); }
.key-form__error { min-height: 1.6em; margin-top: var(--s-2); color: var(--danger); font-size: 1.05rem; }

/* =========================================================
   INVITATION
   ========================================================= */
.invitation { position: relative; z-index: 2; }
.invitation.is-entering > main,
.invitation.is-entering > .footer { animation: invite-in 1.2s var(--ease) both; }

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 0 max(var(--s-4), env(safe-area-inset-left));
  background: rgba(36, 2, 5, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
}
.topbar.is-visible { transform: none; }
.topbar__mono { font-family: var(--f-display); font-size: 1.35rem; color: var(--cream); text-decoration: none; }
.topbar__mono i { font-family: var(--f-script); font-style: normal; color: var(--gold-light); margin: 0 2px; }
.topbar__nav { display: none; gap: var(--s-5); }
.topbar__nav a {
  font-family: var(--f-caps); font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text); text-decoration: none; padding: var(--s-2) 0; position: relative;
}
.topbar__nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--gold); transform: scaleX(0); transition: transform 0.3s var(--ease);
}
.topbar__nav a:hover::after, .topbar__nav a.is-active::after { transform: scaleX(1); }

/* Frame (double gold rule like the printed card) */
.frame {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 2px;
}
.frame::before {
  content: ''; position: absolute; inset: 9px; pointer-events: none;
  border: 1px solid var(--line-soft);
}
.frame--soft { border-color: var(--line-soft); }

.floral { position: absolute; pointer-events: none; z-index: 0; }
.floral--tr { top: 0; right: 0; width: clamp(140px, 36%, 310px); }
.floral--bl { bottom: 0; left: 0; width: clamp(140px, 34%, 300px); }
.floral--sm.floral--tr { width: clamp(110px, 24%, 220px); }
.floral--sm.floral--bl { width: clamp(110px, 22%, 220px); }

.ornament { display: block; width: min(240px, 62%); height: auto; margin: 0 auto var(--s-4); }

.divider { display: flex; align-items: center; justify-content: center; gap: var(--s-3); margin: var(--s-5) auto; max-width: 360px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider::after { background: linear-gradient(90deg, var(--gold), transparent); }
.divider span { width: 16px; height: 16px; background: var(--gold-gradient); flex: none; }
.divider--heart span {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 6-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 6-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.divider--leaf span {
  width: 20px; height: 20px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c2.5 4 3.5 8 0 14-3.5-6-2.5-10 0-14zM12 16c-4-.5-8-2.5-9-7 4 0 7.5 2.5 9 7zM12 16c4-.5 8-2.5 9-7-4 0-7.5 2.5-9 7zM12 17.5a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c2.5 4 3.5 8 0 14-3.5-6-2.5-10 0-14zM12 16c-4-.5-8-2.5-9-7 4 0 7.5 2.5 9 7zM12 16c4-.5 8-2.5 9-7-4 0-7.5 2.5-9 7zM12 17.5a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 780px;
  margin: calc(var(--topbar-h) + var(--s-5)) auto 0;
  margin-left: max(var(--s-4), calc((100% - 780px) / 2));
  margin-right: max(var(--s-4), calc((100% - 780px) / 2));
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(90, 12, 22, 0.55), transparent 70%), var(--bg);
}
.hero__content { position: relative; z-index: 1; text-align: center; padding: var(--s-8) var(--s-5) 0; }
.hero__baybayin { width: min(84%, 520px); margin: 0 auto var(--s-5); }
.hero__greeting { text-wrap: balance; font-family: var(--f-script); font-size: clamp(1.7rem, 6vw, 2.5rem); color: var(--gold-light); margin-bottom: var(--s-2); }
.hero__names {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.2rem, 10vw, 5.2rem); line-height: 1.05;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(231, 205, 146, 0.15);
}
.hero__invite { margin-top: var(--s-4); font-family: var(--f-caps); font-size: clamp(0.82rem, 2.8vw, 1.05rem); letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.7; }

.datebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: 560px; margin: var(--s-5) auto 0;
}
.datebar__side {
  font-family: var(--f-caps); font-size: clamp(0.78rem, 2.6vw, 1.05rem); letter-spacing: 0.14em; text-transform: uppercase;
  border-top: 1px solid rgba(243, 228, 210, 0.6); border-bottom: 1px solid rgba(243, 228, 210, 0.6);
  padding: var(--s-3) var(--s-1);
}
.datebar__center {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 clamp(14px, 4vw, 32px);
  border-left: 1px solid rgba(243, 228, 210, 0.6); border-right: 1px solid rgba(243, 228, 210, 0.6);
  margin: 0 clamp(8px, 2.5vw, 20px);
}
.datebar__month { font-family: var(--f-caps); font-size: clamp(0.78rem, 2.6vw, 1.05rem); letter-spacing: 0.16em; text-transform: uppercase; }
.datebar__day { font-family: var(--f-display); font-size: clamp(3rem, 12vw, 4.8rem); line-height: 1; margin: 2px 0; }
.datebar__year { font-family: var(--f-caps); font-size: clamp(0.85rem, 2.8vw, 1.15rem); letter-spacing: 0.4em; padding-left: 0.4em; }

.hero__venue { font-size: clamp(1.15rem, 3.6vw, 1.45rem); letter-spacing: 0.06em; line-height: 1.5; }
.hero__reception { font-family: var(--f-caps); font-size: clamp(0.82rem, 2.8vw, 1.05rem); letter-spacing: 0.14em; text-transform: uppercase; }
.hero__couple { width: min(80%, 430px); margin: var(--s-4) auto 0; }
.scroll-cue {
  position: absolute; left: 50%; bottom: var(--s-5); transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid var(--line); border-radius: 14px; display: none;
}
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--gold-light); animation: cue 1.8s ease-in-out infinite; }

/* ---------- Sections ---------- */
.section { position: relative; max-width: 980px; margin: 0 auto; padding: var(--s-9) var(--s-4) 0; text-align: center; }
.section__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.1rem, 7vw, 3.2rem); line-height: 1.15; color: var(--cream);
}
.section__title--lower { text-transform: lowercase; font-size: clamp(2.6rem, 9vw, 4rem); }
.section__lead { margin-top: var(--s-3); color: var(--text-muted); font-style: italic; }

/* Countdown */
.countdown__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); max-width: 560px; margin: var(--s-5) auto 0; }
.countdown__cell {
  padding: var(--s-4) var(--s-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}
.countdown__num { display: block; font-family: var(--f-display); font-size: clamp(1.8rem, 7vw, 2.8rem); line-height: 1.1; color: var(--cream); font-variant-numeric: tabular-nums; }
.countdown__label { font-family: var(--f-caps); font-size: clamp(0.6rem, 2vw, 0.72rem); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-light); }
#countdownTitle { font-size: clamp(2.2rem, 7vw, 3rem); }
.countdown__done { margin-top: var(--s-4); font-style: italic; }

/* Events */
.events { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
.event-card {
  padding: var(--s-6) var(--s-5);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.4s;
}
.event-card:hover { transform: translateY(-4px); border-color: var(--line); }
.event-card__icon { width: 48px; height: 48px; margin: 0 auto var(--s-3); color: var(--gold); }
.event-card__title { font-family: var(--f-caps); font-size: 0.9rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-light); font-weight: 500; }
.event-card__time { font-family: var(--f-display); font-size: 2.2rem; color: var(--cream); margin: var(--s-2) 0; }
.event-card__venue { font-size: 1.3rem; line-height: 1.4; }
.event-card__sub { color: var(--text-muted); font-style: italic; margin: var(--s-1) 0 var(--s-5); }
.event-card__qr {
  display: inline-block; padding: var(--s-2);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px rgba(201, 163, 91, 0.18), 0 14px 26px -14px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.event-card__qr:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 0 0 1px var(--gold-light), 0 0 0 6px rgba(231, 205, 146, 0.25), 0 18px 30px -14px rgba(0, 0, 0, 0.75); }
.event-card__qr img { width: 148px; height: 148px; }
.event-card__qr-label {
  margin: var(--s-3) 0 var(--s-5);
  font-family: var(--f-caps); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-light);
}

.map { margin: var(--s-7) auto 0; max-width: 900px; }
.map__btn {
  display: block; width: 100%; padding: 6px; border: 0; cursor: zoom-in;
  background: #f4eedf; border-radius: 4px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(201, 163, 91, 0.5);
  transition: transform 0.4s var(--ease);
}
.map__btn:hover { transform: scale(1.01); }
.map figcaption { margin-top: var(--s-3); font-style: italic; color: var(--text-muted); font-size: 1rem; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; margin-top: var(--s-6); }

/* Quote */
.quote__time { font-family: var(--f-script); font-size: clamp(3rem, 12vw, 4.6rem); color: var(--champagne); line-height: 1.2; }
.quote__text { margin: 0; font-size: clamp(1.25rem, 4vw, 1.6rem); letter-spacing: 0.05em; line-height: 1.7; color: var(--cream); }

/* Attire */
.attire { max-width: 900px; margin: var(--s-9) var(--s-4) 0; padding: var(--s-8) var(--s-4) var(--s-7); overflow: hidden; }
@media (min-width: 932px) { .attire { margin-left: auto; margin-right: auto; } }
.attire > *:not(.floral) { position: relative; z-index: 1; }
.attire__theme { font-family: var(--f-body); font-style: italic; font-size: clamp(1.8rem, 6vw, 2.4rem); color: var(--cream); margin-top: var(--s-1); }
.attire__grid { display: grid; gap: var(--s-5); align-items: center; margin-top: var(--s-5); }
.attire__text p { font-size: 1.25rem; line-height: 1.6; margin-bottom: var(--s-4); }
.attire__text strong { font-weight: 600; color: var(--gold-light); }
.attire__img { width: min(100%, 460px); margin: 0 auto; }
.attire__invite { font-size: 1.3rem; letter-spacing: 0.06em; margin-bottom: var(--s-4); }
.palette { list-style: none; padding: 0; margin: var(--s-5) auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); max-width: 620px; }
.palette__item { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); font-size: clamp(0.95rem, 3vw, 1.15rem); line-height: 1.25; }
.palette__swatch {
  width: 100%; max-width: 110px; aspect-ratio: 1;
  background: var(--swatch);
  border: 2px solid var(--gold);
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.35s var(--ease);
}
.palette__item:hover .palette__swatch { transform: translateY(-4px) rotate(-2deg); }

/* Entourage */
.entourage { overflow: hidden; padding-bottom: var(--s-4); }
.lily {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: min(130%, 820px); height: auto; color: rgba(161, 89, 95, 0.16); pointer-events: none; z-index: 0;
}
.entourage > *:not(.lily) { position: relative; z-index: 1; }
.roles { display: grid; gap: var(--s-6) var(--s-5); margin-top: var(--s-6); }
.roles--tight { margin-top: var(--s-4); }
.role h3, .role__heading { font-family: var(--f-body); font-weight: 500; font-size: clamp(1.55rem, 5vw, 2rem); color: var(--cream); margin-bottom: var(--s-2); }
.role__heading { margin-top: var(--s-2); }
.role p { font-size: 1.2rem; color: var(--text); line-height: 1.55; }

/* ---------- RSVP ---------- */
.rsvp__card {
  max-width: 680px; margin: 0 auto;
  padding: var(--s-8) var(--s-5) var(--s-7);
  background: linear-gradient(180deg, rgba(90, 12, 22, 0.55), rgba(50, 4, 7, 0.4));
  box-shadow: var(--shadow-lg);
}
.rsvp__card > * { position: relative; }
.rsvp__lead { margin-top: var(--s-2); font-style: italic; font-size: 1.35rem; color: var(--text-muted); }
.rsvp__deadline { margin-top: var(--s-2); font-family: var(--f-caps); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-light); }
.rsvp-form { margin-top: var(--s-6); text-align: left; display: grid; gap: var(--s-5); }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field__label {
  display: block; margin-bottom: var(--s-2);
  font-family: var(--f-caps); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-light);
}
.field__label .optional { text-transform: none; letter-spacing: 0.04em; font-family: var(--f-body); font-style: italic; font-size: 1rem; color: var(--text-muted); }
.field__help { color: var(--text-muted); font-size: 1.05rem; margin-bottom: var(--s-3); }
.field__error { min-height: 0; color: var(--danger); font-size: 1rem; margin-top: var(--s-2); }
.field__error:empty { display: none; }
.field__count { text-align: right; font-size: 0.95rem; color: var(--text-muted); margin-top: var(--s-1); }
.rsvp-form__guest { font-family: var(--f-display); font-size: 1.6rem; color: var(--cream); line-height: 1.3; }
.rsvp-form__seats { margin-top: var(--s-1); font-style: italic; color: var(--text-muted); }

.input {
  width: 100%; min-height: 52px;
  padding: var(--s-3) var(--s-4);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--f-body); font-size: 1.2rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder { color: rgba(243, 228, 210, 0.45); }
.input:focus { outline: none; border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(201, 163, 91, 0.2); background: rgba(0, 0, 0, 0.3); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.input--area { resize: vertical; min-height: 120px; line-height: 1.5; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.choice legend { grid-column: 1 / -1; float: left; width: 100%; }
.choice .field__error { grid-column: 1 / -1; }
.choice__tile { position: relative; cursor: pointer; display: block; }
.choice__tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__body {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1); text-align: center;
  height: 100%;
  padding: var(--s-5) var(--s-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s, background-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.choice__body svg { width: 30px; height: 30px; color: var(--gold); margin-bottom: var(--s-1); transition: transform 0.3s var(--ease); }
.choice__title { font-family: var(--f-caps); font-size: clamp(0.72rem, 2.4vw, 0.85rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream); }
.choice__sub { font-style: italic; color: var(--text-muted); font-size: 1rem; }
.choice__tile:hover .choice__body { border-color: var(--line); transform: translateY(-2px); }
.choice__tile input:focus-visible + .choice__body { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.choice__tile input:checked + .choice__body {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(201, 163, 91, 0.22), rgba(201, 163, 91, 0.06));
  box-shadow: 0 0 0 1px var(--gold) inset, 0 12px 24px -14px rgba(231, 205, 146, 0.6);
}
.choice__tile input:checked + .choice__body svg { transform: scale(1.15); }
.choice__tile input:checked + .choice__body svg path { fill: rgba(201, 163, 91, 0.35); }

.companions__list { list-style: none; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: var(--s-3); }
.companion { display: flex; gap: var(--s-2); align-items: center; animation: rise 0.35s var(--ease) both; }
.companion__num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--gold-light);
  font-family: var(--f-caps); font-size: 0.8rem;
}
.companion .input { flex: 1; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft); background: transparent; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 180, 168, 0.08); }
.icon-btn svg { width: 18px; height: 18px; }

.form-error { color: var(--danger); text-align: center; font-size: 1.05rem; }
.form-error:empty { display: none; }
.rsvp-form__actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

.rsvp__summary, .rsvp__success, .rsvp__closed { margin-top: var(--s-6); animation: rise 0.6s var(--ease) both; }
.rsvp__summary-icon { width: 40px; height: 40px; margin: 0 auto var(--s-3); color: var(--dusty-rose); }
.rsvp__summary-title, .rsvp__success-title { font-family: var(--f-script); font-weight: 400; font-size: clamp(2.2rem, 7vw, 2.8rem); color: var(--gold-light); line-height: 1.2; }
.rsvp__summary-list { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); text-align: left; max-width: 440px; margin: var(--s-5) auto; }
.rsvp__summary-list dt { font-family: var(--f-caps); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-light); padding-top: 4px; }
.rsvp__summary-list dd { margin: 0; overflow-wrap: anywhere; }
.rsvp__success { outline: none; }
.rsvp__success-icon { width: 72px; height: 72px; margin: 0 auto var(--s-3); color: var(--gold); }
.rsvp__success-icon path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.8s var(--ease) 0.3s forwards; }
.rsvp__success-text { max-width: 460px; margin: var(--s-3) auto var(--s-5); font-size: 1.25rem; }

/* Keepsake */
.keepsake__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-6); }
.keepsake__card {
  padding: 0; border: 1px solid var(--line-soft); background: none; cursor: zoom-in;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 18px 30px -16px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
}
.keepsake__card:hover { transform: translateY(-6px) rotate(-0.6deg); border-color: var(--gold); box-shadow: 0 26px 40px -18px rgba(0, 0, 0, 0.8); }

/* Footer */
.footer { position: relative; overflow: hidden; text-align: center; padding: var(--s-9) var(--s-4) var(--s-8); margin-top: var(--s-8); border-top: 1px solid var(--line-soft); }
.footer > *:not(.floral) { position: relative; z-index: 1; }
.footer__script { font-size: clamp(1.9rem, 7vw, 2.8rem); color: var(--champagne); }
.footer__mono { font-family: var(--f-display); font-size: 2rem; margin-top: var(--s-4); color: var(--cream); }
.footer__mono i { font-family: var(--f-script); font-style: normal; color: var(--gold-light); }
.footer__date { margin: var(--s-2) 0 var(--s-5); }

.footer__credit { margin-top: var(--s-4); font-size: 0.9rem; color: var(--text-muted); }

/* Music toggle */
.music-toggle {
  position: fixed; z-index: 60;
  right: max(var(--s-4), env(safe-area-inset-right)); bottom: max(var(--s-4), env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid rgba(255, 240, 200, 0.5);
  background: var(--gold-gradient); color: var(--ink);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.65), 0 0 0 4px rgba(201, 163, 91, 0.18);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.music-toggle:hover { transform: translateY(-2px) scale(1.05); }
.music-toggle:active { transform: scale(0.95); }
.music-toggle svg { width: 22px; height: 22px; }
.music-toggle__bars { display: none; align-items: flex-end; gap: 3px; height: 18px; }
.music-toggle__bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--ink); transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.music-toggle__bars i:nth-child(2) { animation-delay: -0.3s; }
.music-toggle__bars i:nth-child(3) { animation-delay: -0.6s; }
.music-toggle__bars i:nth-child(4) { animation-delay: -0.15s; }
.music-toggle.is-playing .music-toggle__note { display: none; }
.music-toggle.is-playing .music-toggle__bars { display: flex; }
.music-toggle.is-hinting::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--gold-light); animation: ping 1.8s var(--ease) infinite;
}

/* Lightbox */
.lightbox {
  width: min(96vw, 1100px); max-height: 94vh; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
.lightbox::backdrop { background: rgba(14, 1, 3, 0.88); backdrop-filter: blur(4px); }
.lightbox[open] { animation: rise 0.35s var(--ease) both; }
.lightbox__figure { margin: 0; text-align: center; }
.lightbox__figure img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 4px; box-shadow: var(--shadow-lg); }
.lightbox__figure figcaption { margin-top: var(--s-3); font-style: italic; color: var(--text-muted); }
.lightbox__close {
  position: absolute; top: -8px; right: -8px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--cream);
}
.lightbox__close svg { width: 20px; height: 20px; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (min-width: 560px) {
  .roles--2 { grid-template-columns: 1fr 1fr; }
  .keepsake__grid { gap: var(--s-5); }
}
@media (min-width: 768px) {
  .events { grid-template-columns: 1fr 1fr; }
  .attire__grid { grid-template-columns: 1fr 1.1fr; text-align: left; }
  .topbar__nav { display: flex; }
  .topbar { padding: 0 var(--s-6); }
  .hero { margin-top: calc(var(--topbar-h) + var(--s-6)); }
  .hero__content { padding-top: var(--s-9); }
  .rsvp__card { padding: var(--s-8) var(--s-8) var(--s-7); }
  .attire { padding: var(--s-8) var(--s-7) var(--s-7); }
}
@media (min-width: 1024px) {
  .keepsake__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .choice { grid-template-columns: 1fr; }
  .hero__content { padding-left: var(--s-4); padding-right: var(--s-4); }
  .datebar__side { font-size: 0.7rem; letter-spacing: 0.06em; white-space: nowrap; }
  .datebar__center { padding: 0 var(--s-3); margin: 0 var(--s-2); }
  .rsvp__card { padding-left: var(--s-4); padding-right: var(--s-4); }
  #addCompanionBtn { letter-spacing: 0.1em; }
}

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes envelope-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(9px) rotate(1deg); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
@keyframes petal-fall {
  0% { opacity: 0; transform: translate3d(0, -5vh, 0) rotate(0deg); }
  10% { opacity: var(--alpha, 0.7); }
  50% { transform: translate3d(var(--sway, 40px), 50vh, 0) rotate(200deg); }
  90% { opacity: var(--alpha, 0.7); }
  100% { opacity: 0; transform: translate3d(calc(var(--sway, 40px) * -0.5), 105vh, 0) rotate(380deg); }
}
@keyframes invite-in { from { opacity: 0; transform: translateY(30px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .petals { display: none; }
  .reveal { opacity: 1; transform: none; }
}
