/* =====================================================================
   Darven & Chearisse — wedding invitation
   Mobile-first (390px), scales up to tablet / desktop.
   ===================================================================== */
:root {
  --paper: #FBF8F3;
  --paper-2: #EFE7DA;
  --linen: #E4DBCF;
  --dusty: #5B7A99;          /* main accent */
  --dusty-ink: #4A6785;      /* dusty blue dark enough for small text */
  --dusty-soft: #A9BED3;
  --navy: #2F4A6B;           /* deeper blue, for text that must stay readable */
  --ink: #2F4A6B;
  --gold: #B8975A;
  --line: rgba(91, 122, 153, .32);
  --err: #9C3A3A;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --display: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --script: "Pinyon Script", "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive;

  --vh: 1vh;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@supports (height: 100svh) { :root { --vh: 1svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper) url("../img/paper.webp");
  color: var(--ink);
  font: 500 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--dusty); outline-offset: 3px; }
[hidden] { display: none !important; }

/* placeholder values from config.js — easy to spot until filled in */
.is-ph { text-decoration: underline dotted rgba(184, 151, 90, .95); text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* =====================================================================
   OPENING ENVELOPE
   ===================================================================== */
html.is-intro, html.is-intro body { overflow: hidden; height: 100%; }
html.is-intro #site, html.is-intro .nav, html.is-intro .music, html.is-intro .petals { visibility: hidden; }

.intro {
  --ew: min(92vw, 640px, calc((var(--vh) * 100 - 90px) * .87));
  --eh: calc(var(--ew) / 1.6598);
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255, 251, 244, .55) 0%, rgba(255, 251, 244, 0) 55%),
    radial-gradient(140% 120% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(90, 70, 50, .16) 100%),
    var(--linen) url("../img/linen.webp");
  overflow: hidden;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.intro__stage {
  display: flex; flex-direction: column; align-items: center;
  margin-top: calc(var(--eh) * .38);
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity .9s ease, transform 1.1s var(--ease);
}
.intro.is-ready .intro__stage { opacity: 1; transform: none; }

.env { position: relative; width: var(--ew); height: var(--eh); perspective: 1600px; cursor: pointer; }
.env > * { position: absolute; inset: 0; }
.env__shadow {
  inset: 3% 1.5% 0; border-radius: 6px;
  box-shadow: 0 22px 44px -6px rgba(74, 56, 38, .34), 0 6px 14px rgba(74, 56, 38, .16);
  z-index: 0;
}
/* inner back panel + liner, seen through the open V */
.env__inside {
  z-index: 1; border-radius: 3px;
  background:
    linear-gradient(to bottom, rgba(47, 74, 107, .0) 40%, rgba(47, 74, 107, .22) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%235B7A99' stroke-width='1' opacity='.55'%3E%3Cpath d='M22 6c4 5 4 10 0 15-4-5-4-10 0-15zM6 30c5-1 9 1 11 6-5 1-9-1-11-6zM38 30c-5-1-9 1-11 6 5 1 9-1 11-6z'/%3E%3C/g%3E%3Ccircle cx='22' cy='38' r='1.6' fill='%23B8975A' opacity='.7'/%3E%3C/svg%3E") 0 0 / 22px 22px,
    #DCE5EE;
}
.env__letter { z-index: 3; inset: 5% 5.5% auto; height: 88%; will-change: transform; }
.env__letter.is-front { z-index: 8; }
.env__pocket {
  z-index: 4;
  clip-path: polygon(0 14.7%, 29.15% 50.25%, 49.5% 75.1%, 70.6% 49.6%, 100% 14.2%, 100% 100%, 0 100%);
  -webkit-clip-path: polygon(0 14.7%, 29.15% 50.25%, 49.5% 75.1%, 70.6% 49.6%, 100% 14.2%, 100% 100%, 0 100%);
}
.env__pocket img, .env__flap img { width: 100%; height: 100%; border-radius: 3px; }
.env__flap { z-index: 5; transform-origin: 50% 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; will-change: transform; }
.env.is-open .env__flap { z-index: 2; }
.env__flap-front, .env__flap-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.env__flap-front {
  clip-path: polygon(0 0, 100% 0, 100% 14.2%, 70.6% 49.6%, 49.5% 75.1%, 29.15% 50.25%, 0 14.7%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 14.2%, 70.6% 49.6%, 49.5% 75.1%, 29.15% 50.25%, 0 14.7%);
}
/* back of the flap = envelope liner (mirrored polygon, pre-flipped) */
.env__flap-back {
  transform: rotateX(180deg);
  clip-path: polygon(0 100%, 100% 100%, 100% 85.8%, 70.6% 50.4%, 49.5% 24.9%, 29.15% 49.75%, 0 85.3%);
  -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 85.8%, 70.6% 50.4%, 49.5% 24.9%, 29.15% 49.75%, 0 85.3%);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%235B7A99' stroke-width='1' opacity='.6'%3E%3Cpath d='M22 6c4 5 4 10 0 15-4-5-4-10 0-15zM6 30c5-1 9 1 11 6-5 1-9-1-11-6zM38 30c-5-1-9 1-11 6 5 1 9-1 11-6z'/%3E%3C/g%3E%3Ccircle cx='22' cy='38' r='1.6' fill='%23B8975A' opacity='.8'/%3E%3C/svg%3E") 0 0 / 22px 22px,
    linear-gradient(to top, #F7F3EC, #E7EDF3);
}
.env__shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(47, 60, 80, .15), rgba(47, 60, 80, .55)); opacity: 0; pointer-events: none; }
.env__flap-back .env__shade { opacity: .5; background: linear-gradient(to top, rgba(47, 60, 80, .1), rgba(47, 60, 80, .5)); }

/* the letter card inside */
.letter {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4% 10%; text-align: center; overflow: hidden;
  background: #FFFDF8 url("../img/paper.webp");
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(60, 45, 30, .18), 0 10px 26px -10px rgba(60, 45, 30, .35);
  color: var(--navy);
}
.letter::before, .letter::after { content: ""; position: absolute; pointer-events: none; }
.letter::before { inset: 4.5%; border: 1px solid rgba(91, 122, 153, .55); }
.letter::after { inset: 6%; border: .5px solid rgba(184, 151, 90, .55); }
.letter__floral { position: absolute; width: 30%; height: 47.6%; }
.letter__floral--l { left: -3%; top: -4%; }
.letter__floral--r { right: -3%; bottom: -4%; transform: scale(-1, -1); }
.letter__kicker { font-weight: 600; font-size: calc(var(--ew) * .022); letter-spacing: .22em; text-transform: uppercase; color: var(--dusty-ink); }
.letter__names { font-family: var(--script); font-size: calc(var(--ew) * .085); line-height: 1.15; margin: 1.5% 0 2%; white-space: nowrap; }
.letter__names em { font-style: normal; font-size: .62em; color: var(--dusty); padding: 0 .1em; }
.letter__divider { width: 34%; height: calc(var(--ew) * .03); margin: 3% auto 2%; }
.letter__date { font-family: var(--display); font-size: calc(var(--ew) * .026); letter-spacing: .3em; }

/* the wax seal */
.seal {
  position: absolute; z-index: 7;
  inset: auto; left: 39.238%; top: 48.263%; width: 21.3%; height: 36.104%;
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.seal:focus-visible { outline-offset: -8%; }
.seal__half { position: absolute; inset: 0; }
.seal__half img { width: 100%; height: 100%; }
.seal__half--l { clip-path: polygon(0 0, 53% 0, 48% 22%, 55% 41%, 47% 60%, 53% 79%, 49% 100%, 0 100%); -webkit-clip-path: polygon(0 0, 53% 0, 48% 22%, 55% 41%, 47% 60%, 53% 79%, 49% 100%, 0 100%); }
.seal__half--r { clip-path: polygon(52.4% 0, 100% 0, 100% 100%, 48.4% 100%, 52.4% 79%, 46.4% 60%, 54.4% 41%, 47.4% 22%); -webkit-clip-path: polygon(52.4% 0, 100% 0, 100% 100%, 48.4% 100%, 52.4% 79%, 46.4% 60%, 54.4% 41%, 47.4% 22%); }
.seal__glow {
  position: absolute; inset: 2%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 228, .95) 0%, rgba(214, 228, 242, .65) 38%, rgba(214, 228, 242, 0) 70%);
  animation: sealGlow 2.4s ease-in-out infinite;
}
.seal__shine {
  position: absolute; left: 17%; top: 16%; width: 66%; height: 66%;
  border-radius: 50%; overflow: hidden; pointer-events: none;
}
.seal__shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 250, 235, .55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-140%) skewX(-18deg);
  animation: sealShine 3.4s ease-in-out 1s infinite;
}
.seal__stars { position: absolute; inset: 0; pointer-events: none; }
.seal__stars svg {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--ew) * .062 * var(--s)); height: calc(var(--ew) * .062 * var(--s));
  margin: calc(var(--ew) * -.031 * var(--s));
  fill: #FFF6DA;
  filter: drop-shadow(0 0 3px rgba(255, 244, 210, .95));
  opacity: 0; transform: scale(0);
  animation: twinkle 2.3s ease-in-out var(--d) infinite;
}
.seal__stars svg:nth-child(odd) { fill: #fff; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.burst i { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle, #fff 0 35%, rgba(255, 240, 200, .85) 36%, rgba(255, 240, 200, 0) 70%); }
.burst i.is-star { width: 12px; height: 12px; border-radius: 0; background: #FFF4D4; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); -webkit-clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }

@keyframes sealGlow { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.32); opacity: .95; } }
@keyframes sealShine { 0% { transform: translateX(-140%) skewX(-18deg); } 45%, 100% { transform: translateX(330%) skewX(-18deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: .2; transform: scale(.4) rotate(80deg); } }

.intro__hint {
  margin-top: max(22px, calc(var(--eh) * .1));
  font-size: 13px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--navy);
  display: flex; align-items: center; gap: 12px;
}
.intro__hint span { animation: breathe 2.4s ease-in-out infinite; }
.intro__hint::before, .intro__hint::after { content: ""; width: 26px; height: 1px; background: var(--dusty); opacity: .7; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.intro__skip {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .55);
  font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--navy);
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .6s;
}
.intro__skip svg { width: 14px; height: 14px; }
.intro__skip.is-visible { opacity: .8; pointer-events: auto; }

.flash {
  position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 48%, #fff 0%, #fffdf8 45%, #f9f3e8 100%);
}

/* =====================================================================
   SHARED
   ===================================================================== */
.wrap { width: min(100% - 40px, 1040px); margin: 0 auto; position: relative; z-index: 3; }
.wrap--narrow { width: min(100% - 40px, 560px); }
.section {
  --bg: var(--paper);
  position: relative; padding: 76px 0 84px; text-align: center;
  background: var(--bg) url("../img/paper.webp");
  scroll-margin-top: 40px;
}
.section--alt { --bg: var(--paper-2); }

/* torn-paper top edge, coloured like its own section */
.torn::before, .torn::after {
  content: ""; position: absolute; left: 0; right: 0; pointer-events: none;
  -webkit-mask: url("../img/torn-a.svg") repeat-x 0 100% / 640px 100%;
  mask: url("../img/torn-a.svg") repeat-x 0 100% / 640px 100%;
}
.torn::before { top: -21px; height: 22px; background: var(--bg); z-index: 4; }
.torn::after {
  top: -23.5px; height: 24.5px; z-index: 3; background: rgba(255, 255, 255, .9);
  -webkit-mask-image: url("../img/torn-b.svg"); mask-image: url("../img/torn-b.svg");
  -webkit-mask-position: 37px 100%; mask-position: 37px 100%;
}
.footer.torn::after { background: rgba(214, 226, 238, .55); }

.corner { position: absolute; width: min(46vw, 300px); height: min(42.9vw, 280px); pointer-events: none; z-index: 1; }
.corner--sm { width: min(34vw, 210px); height: min(31.7vw, 196px); opacity: .9; }
.corner--tl { left: 0; top: 0; }
.corner--tr { right: 0; top: 0; transform: scaleX(-1); }
.corner--br { right: 0; bottom: 0; transform: scale(-1, -1); }
#site { overflow-x: hidden; overflow-x: clip; }
.corner--light { opacity: .2; }

.script { font-family: var(--script); font-weight: 400; font-size: clamp(2.9rem, 13vw, 4.4rem); line-height: 1.15; color: var(--navy); padding: 0 .1em; }
.title-caps { font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 11vw, 3.4rem); letter-spacing: .08em; color: var(--navy); line-height: 1.1; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--dusty-ink); }
.lead { font-size: 19px; color: var(--ink); margin-top: 6px; }
.note { font-size: 16px; font-style: italic; color: var(--dusty-ink); margin-top: 26px; }
.small { font-size: 15px; margin-top: 14px; }
.small a { color: var(--dusty-ink); text-underline-offset: 3px; }
.divider { width: 200px; height: 20px; margin: 0 auto 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 30px; border: 1px solid var(--navy); border-radius: 999px;
  background: var(--navy); color: #fff; text-decoration: none; cursor: pointer;
  font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  box-shadow: 0 8px 20px -10px rgba(47, 74, 107, .7);
  transition: transform .18s var(--ease), box-shadow .25s, background-color .25s;
}
.btn svg { width: 17px; height: 17px; transition: transform .25s var(--ease); }
.btn:hover { background: #3A5A80; }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.95); box-shadow: 0 4px 10px -6px rgba(47, 74, 107, .7); }
.btn--ghost { background: rgba(255, 255, 255, .6); color: var(--navy); box-shadow: none; }
.btn--ghost:hover { background: #fff; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease var(--d, 0s), transform 1s var(--ease) var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* photo placeholders */
.ph {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(140deg, #EDF2F7 0%, #F8F4ED 55%, #EAE2D4 100%);
  color: var(--dusty);
}
.ph::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(91, 122, 153, .35); pointer-events: none; }
.ph__icon { width: 34px; height: 34px; opacity: .8; }
.ph__label { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--dusty-ink); }

/* =====================================================================
   NAV
   ===================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 12px 0 18px;
  transition: background-color .35s, box-shadow .35s;
}
.nav.is-scrolled, .nav.is-menu { background: rgba(251, 248, 243, .96); box-shadow: 0 6px 20px -14px rgba(47, 74, 107, .45); }
.nav__mono { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 20px; color: var(--navy); text-decoration: none; }
.nav__mono i { width: 1px; height: 22px; background: var(--dusty); }
.nav__toggle { width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(251, 248, 243, .82); display: grid; place-content: center; gap: 6px; cursor: pointer; }
.nav__toggle span { width: 24px; height: 1.6px; background: var(--navy); transition: transform .3s var(--ease), opacity .2s; }
.nav.is-menu .nav__toggle span:nth-child(1) { transform: translateY(7.6px) rotate(45deg); }
.nav.is-menu .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-menu .nav__toggle span:nth-child(3) { transform: translateY(-7.6px) rotate(-45deg); }
.nav__menu {
  position: absolute; top: 58px; left: 0; right: 0;
  display: flex; flex-direction: column; padding: 8px 0 18px;
  background: rgba(251, 248, 243, .98); box-shadow: 0 16px 30px -18px rgba(47, 74, 107, .5);
  opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
  transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
}
.nav.is-menu .nav__menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .25s, transform .3s var(--ease); }
.nav__menu a { padding: 13px 26px; text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--navy); text-align: center; }
.nav__menu a.is-active { color: var(--dusty); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  position: relative; min-height: calc(var(--vh) * 100); padding: 104px 22px 86px;
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden;
  background:
    radial-gradient(60% 45% at 0% 0%, rgba(169, 190, 211, .38), rgba(169, 190, 211, 0) 70%),
    radial-gradient(60% 45% at 100% 100%, rgba(169, 190, 211, .34), rgba(169, 190, 211, 0) 70%),
    var(--paper) url("../img/paper.webp");
  outline: none;
}
.hero .corner--tl, .hero .corner--br { width: min(38vw, 320px); height: min(35.5vw, 299px); }
.hero .corner--tr { width: min(24vw, 190px); height: min(22.4vw, 177px); opacity: .7; }
@media (max-width: 899px) { .nav:not(.is-scrolled):not(.is-menu) .nav__mono { opacity: 0; pointer-events: none; } .nav__mono { transition: opacity .3s; } }
.hero__inner { position: relative; z-index: 2; max-width: 640px; }
.names { margin: 16px 0 14px; font-weight: 400; line-height: 1; color: var(--navy); }
.names__one, .names__two { display: block; font-family: var(--display); font-size: clamp(3.3rem, 16.5vw, 6.6rem); letter-spacing: -.005em; }
.names__and { display: block; font-family: var(--script); font-size: clamp(2.9rem, 14vw, 5rem); color: var(--dusty); line-height: .9; margin: -.05em 0 -.02em; }
.hero .divider { margin: 18px auto 14px; }
.hero__date { font-size: 15px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; line-height: 1.75; }
.hero__venue { font-family: var(--display); font-size: 23px; margin-top: 14px; }
.hero__addr { font-size: 17px; line-height: 1.45; margin: 4px auto 0; max-width: 320px; }
.countdown { display: flex; justify-content: center; gap: 9px; margin: 24px 0 26px; }
.countdown div { width: 68px; padding: 10px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .6); }
.countdown b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.countdown small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--dusty-ink); }
.hero__scroll { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); margin-left: -21px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--navy); background: rgba(255, 255, 255, .5); z-index: 2; animation: bob 2.2s ease-in-out infinite; }
.hero__scroll svg { width: 20px; height: 20px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* hero staggered entrance once the envelope opens */
.hero__step { opacity: 0; transform: translateY(18px); }
html.is-open .hero__step { animation: stepIn 1s var(--ease) forwards; animation-delay: calc(var(--i) * .13s + .2s); }
html.is-open .names__one { animation-name: nameIn; }
html.is-open .names__two { animation-name: nameIn2; }
html.is-open .names__and { animation-name: andIn; }
@keyframes stepIn { to { opacity: 1; transform: none; } }
@keyframes nameIn { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes nameIn2 { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes andIn { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }

/* =====================================================================
   OUR STORY
   ===================================================================== */
.story { display: grid; gap: 34px; align-items: center; }
.story__body { font-size: 19px; line-height: 1.7; margin-top: 8px; white-space: pre-line; }
.story__photo { margin: 0 auto; width: min(100%, 300px); aspect-ratio: 4 / 5; padding: 10px; background: #fff; box-shadow: 0 18px 36px -18px rgba(47, 74, 107, .45); transform: rotate(1.6deg); }
.story__photo.reveal.is-in { transform: rotate(1.6deg); }
.story__photo img { width: 100%; height: 100%; object-fit: cover; }
.story__photo.ph { padding: 0; border: 10px solid #fff; }

/* =====================================================================
   DETAILS
   ===================================================================== */
#details { padding-bottom: 0; }
.details { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; }
.details__col { padding: 0 8px; }
.details__col + .details__col { border-left: 1px solid var(--line); }
.details__icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--navy); }
.details__icon--sm { width: 34px; height: 34px; margin: 0; flex: none; }
.details h3, .reception h3, .attire h3 { font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--navy); margin-bottom: 6px; }
.details p { font-size: 16px; line-height: 1.45; word-break: break-word; }
.reception { display: flex; gap: 14px; align-items: center; justify-content: center; text-align: left; margin: 30px auto 0; padding: 16px 20px; max-width: 520px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reception p { font-size: 16px; }
.venue-photo { position: relative; margin: 44px 0 0; height: clamp(230px, 62vw, 520px); }
.venue-photo img { width: 100%; height: 100%; object-fit: cover; }
.venue-photo.ph { background: linear-gradient(160deg, #6F8CAA 0%, #49668A 55%, #2F4A6B 100%); color: #fff; }
.venue-photo.ph::before { inset: 26px 18px; border-color: rgba(255, 255, 255, .45); }
.venue-photo .ph__label { color: #fff; }
.venue-photo::after { /* torn bottom edge into the next section */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; z-index: 2;
  background: var(--paper-2);
  -webkit-mask: url("../img/torn-b.svg") repeat-x 0 100% / 640px 100%; mask: url("../img/torn-b.svg") repeat-x 0 100% / 640px 100%;
}
.venue-photo::before { z-index: 1; }
.venue-photo.reveal, .venue-photo.reveal.is-in { transform: none; }
#attire.torn::before, #attire.torn::after { display: none; }

/* =====================================================================
   ATTIRE
   ===================================================================== */
.attire { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.attire__col + .attire__col { border-left: 1px solid var(--line); }
.attire__fig { width: 92px; height: 156px; margin: 0 auto 14px; }
.swatches { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(47, 74, 107, .18), 0 0 0 3px #fff, 0 0 0 4px rgba(47, 74, 107, .12); }
.attire p { font-size: 16px; padding: 0 6px; }

/* =====================================================================
   ENTOURAGE
   ===================================================================== */
.group + .group { margin-top: 44px; }
.group .script { font-size: clamp(2.3rem, 10.2vw, 4.2rem); }
.names-cols { margin-top: 20px; display: grid; gap: 4px; }
.names-cols--two { grid-template-columns: 1fr auto 1fr; gap: 14px; }
.names-cols ul { list-style: none; margin: 0; padding: 0; }
.names-cols li { font-size: 17px; line-height: 1.85; }
.names-cols--two ul:first-child { text-align: right; }
.names-cols--two ul:last-child { text-align: left; }
.names-cols__mid { display: flex; align-items: center; justify-content: center; position: relative; width: 14px; }
.names-cols__mid::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 50%; width: 1px; background: var(--line); }
.names-cols__mid svg { position: relative; width: 14px; height: 14px; fill: var(--gold); background: var(--bg); }

/* =====================================================================
   GALLERY
   ===================================================================== */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 20px 0 22px; }
.tabs button { padding: 7px 10px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); transition: background-color .25s, color .25s, transform .15s; }
.tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.tabs button:active { transform: scale(.94); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 27vw; grid-auto-flow: dense; gap: 6px; }
.tile { position: relative; padding: 0; border: 0; overflow: hidden; cursor: pointer; background: #EEE; }
.tile--tall { grid-row: span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile.ph { cursor: default; gap: 6px; }
.tile.ph::before { inset: 6px; }
.tile .ph__icon { width: 26px; height: 26px; }
.tile .ph__label { font-size: 10px; letter-spacing: .18em; }
.tile.t2 { background: linear-gradient(150deg, #F6F2EB, #E4EBF2); }
.tile.t3 { background: linear-gradient(150deg, #E2E9F1, #F4EFE6); }
.tile.t4 { background: linear-gradient(150deg, #EFE8DC, #F9F6F0); }
.tile.pop { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
#galleryMore { margin-top: 26px; }

.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(20, 30, 45, .93); padding: 16px; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.lightbox__close { position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox__close svg { width: 22px; height: 22px; }

/* =====================================================================
   RSVP
   ===================================================================== */
.form { margin-top: 26px; padding: 26px 20px 24px; text-align: left; background: rgba(255, 255, 255, .78); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -26px rgba(47, 74, 107, .55); }
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; padding: 0; font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.field b { color: var(--err); font-weight: 600; }
.opt { font-weight: 500; color: var(--dusty-ink); }
.field input[type=text], .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 500 17px/1.3 var(--serif); color: var(--ink);
  background: #fff; border: 1px solid #C5D0DC; border-radius: 8px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: #8094A9; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--dusty); box-shadow: 0 0 0 3px rgba(91, 122, 153, .2); }
.field [aria-invalid="true"] { border-color: var(--err); }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 1.6px solid var(--navy); border-bottom: 1.6px solid var(--navy); transform: rotate(45deg); pointer-events: none; }
.field.is-disabled { opacity: .45; }
.radio { display: flex !important; align-items: center; gap: 12px; padding: 7px 0; font-weight: 500 !important; cursor: pointer; }
.radio input { -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 1.5px solid #9DB0C4; border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; transition: border-color .2s; }
.radio input::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--navy); transform: scale(0); transition: transform .2s var(--ease); }
.radio input:checked { border-color: var(--navy); }
.radio input:checked::after { transform: scale(1); }
.field__err { min-height: 0; font-size: 15px; color: var(--err); margin-top: 5px; }
.field__err:empty { display: none; }
.form__status { font-size: 16px; line-height: 1.45; margin-bottom: 14px; }
.form__status:empty { display: none; }
.form__status.is-error { padding: 12px 14px; border-radius: 8px; background: #FBEFEE; color: var(--err); border: 1px solid rgba(156, 58, 58, .25); }
.btn.is-busy { opacity: .75; pointer-events: none; }
.thanks { margin-top: 26px; padding: 30px 20px; background: rgba(255, 255, 255, .78); border: 1px solid var(--line); border-radius: 14px; outline: none; animation: pop .6s var(--ease); }
.thanks p { font-size: 18px; margin-top: 8px; }

/* =====================================================================
   VENUE MAP
   ===================================================================== */
.map { margin: 24px auto 0; max-width: 820px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 18px 40px -24px rgba(47, 74, 107, .55); }
.map iframe { display: block; width: 100%; height: 300px; border: 0; border-radius: 8px; background: #E8EDF2; }
.map__venue { margin-top: 18px; font-size: 17px; line-height: 1.5; }
.map__venue strong { font-family: var(--display); font-weight: 400; font-size: 21px; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer {
  --bg: #2F4A6B;
  position: relative; overflow: hidden; padding: 84px 0 calc(110px + var(--safe-b)); text-align: center; color: #EEF2F6;
  background: radial-gradient(80% 60% at 50% 0%, #3C5A7E 0%, rgba(60, 90, 126, 0) 70%), var(--bg);
}
.footer.torn { overflow: visible; }
.footer .script { color: #fff; }
.footer p { font-size: 18px; }
.footer__names { font-size: clamp(2.2rem, 10vw, 3.2rem) !important; margin: 18px 0 6px; color: #fff; }
.footer__date span { display: inline-block; }
.footer__date { font-size: 14px !important; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #C9D6E3; }
.footer__contact { margin-top: 18px; font-size: 16px !important; color: #DCE4EC; }
.footer__mono { margin-top: 28px; font-family: var(--display); font-size: 20px !important; letter-spacing: .1em; color: #A9BED3; }
.footer__mono i { font-style: normal; opacity: .6; }
.footer .is-ph { text-decoration-color: rgba(217, 190, 132, .9); }
.footer .corner { z-index: 0; }

/* =====================================================================
   MUSIC BUTTON + PETALS
   ===================================================================== */
.music {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 60;
  width: 50px; height: 50px; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--navy); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(47, 74, 107, .7), 0 0 0 4px rgba(255, 255, 255, .55);
  transition: transform .18s var(--ease);
  animation: pop .5s var(--ease);
}
.music:active { transform: scale(.9); }
.music svg { width: 20px; height: 20px; }
.music::after { content: ""; position: absolute; width: 28px; height: 2px; background: #fff; border-radius: 2px; transform: rotate(-45deg) scaleX(0); transition: transform .25s var(--ease); box-shadow: 0 0 0 1.5px var(--navy); }
.music.is-muted::after { transform: rotate(-45deg) scaleX(1); }
.music__bars { position: absolute; bottom: 9px; display: flex; gap: 2px; height: 7px; align-items: flex-end; opacity: 0; transition: opacity .3s; }
.music__bars i { width: 2px; height: 7px; background: #A9BED3; border-radius: 1px; transform-origin: bottom; transform: scaleY(.3); }
.music.is-playing .music__bars { opacity: 1; }
.music.is-playing .music__bars i { animation: eq 1s ease-in-out infinite; }
.music.is-playing .music__bars i:nth-child(2) { animation-delay: -.35s; }
.music.is-playing .music__bars i:nth-child(3) { animation-delay: -.7s; }
.music.is-playing svg { transform: translateY(-3px); }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.petals { position: fixed; inset: 0; z-index: 45; overflow: hidden; pointer-events: none; }
.petal { position: absolute; top: -30px; width: var(--w); height: calc(var(--w) * .8); opacity: var(--o); animation: fall var(--dur) linear var(--delay) infinite; will-change: transform; }
.petal span {
  display: block; width: 100%; height: 100%;
  background: radial-gradient(120% 120% at 30% 25%, #FFFFFF 0%, #F3EEE6 55%, #DCE5EE 100%);
  border-radius: 80% 0 80% 0;
  box-shadow: inset -1px -1px 2px rgba(91, 122, 153, .25);
  animation: sway var(--sway) ease-in-out infinite alternate;
}
.petal span[style*="--hue:1"] { background: radial-gradient(120% 120% at 30% 25%, #FFFFFF 0%, #E3EAF1 60%, #BFD0E0 100%); }
@keyframes fall { from { transform: translate3d(0, -40px, 0); } to { transform: translate3d(-60px, calc(var(--vh) * 100 + 60px), 0); } }
@keyframes sway { from { transform: translateX(-16px) rotate(-30deg); } to { transform: translateX(16px) rotate(50deg); } }

/* =====================================================================
   LARGER SCREENS
   ===================================================================== */
@media (max-width: 349px) {
  .details { grid-template-columns: 1fr; gap: 22px; }
  .details__col + .details__col { border-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .countdown div { width: 58px; }
}
@media (min-width: 600px) {
  .grid { grid-auto-rows: 150px; gap: 10px; }
  .form { padding: 34px 34px 30px; }
  .details p { font-size: 17px; }
}
@media (min-width: 900px) {
  body { font-size: 19px; }
  .section { padding: 110px 0 120px; }
  .nav { height: 64px; padding: 0 28px; background: var(--navy); box-shadow: 0 6px 24px -12px rgba(20, 35, 55, .6); }
  .nav.is-scrolled { background: var(--navy); }
  .nav__mono { color: #fff; }
  .nav__mono i { background: #A9BED3; }
  .nav__toggle { display: none; }
  .nav.is-scrolled .nav__toggle { background: none; }
  .nav__menu { position: static; flex-direction: row; gap: 4px; padding: 0; background: none; box-shadow: none; opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .nav__menu a { padding: 10px 14px; font-size: 13px; color: #fff; position: relative; }
  .nav__menu a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1px; background: #A9BED3; transform: scaleX(0); transition: transform .3s var(--ease); }
  .nav__menu a:hover::after, .nav__menu a.is-active::after { transform: scaleX(1); }
  .nav__menu a.is-active { color: #fff; }
  .hero { padding-top: 120px; }
  .story { grid-template-columns: 1.05fr .95fr; gap: 64px; text-align: left; }
  .story .divider { margin-left: 0; }
  .story .script { text-align: left; }
  .story__photo { width: 100%; max-width: 420px; }
  .details { max-width: 900px; margin-left: auto; margin-right: auto; }
  .details__col { padding: 0 26px; }
  .attire { max-width: 720px; margin-left: auto; margin-right: auto; }
  .attire__fig { width: 110px; height: 186px; }
  .names-cols { max-width: 760px; margin-left: auto; margin-right: auto; }
  .names-cols li { font-size: 19px; }
  .grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; }
  .map iframe { height: 420px; }
  .corner { width: 340px; height: 317px; }
  .corner--sm { width: 240px; height: 224px; }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal, .hero__step { opacity: 1 !important; transform: none !important; }
  .petals, .seal__stars, .seal__shine { display: none; }
  .seal__glow { opacity: .6; }
}
@media (max-width: 599px) {
  .footer__date .sep { display: none; }
  .footer__date span { display: block; }
}
