/* ==========================================================================
   Kevin & Sona wedding invitation: bright and elegant
   Palette: ivory, blush, sage, champagne gold, forest green, warm plum ink
   ========================================================================== */

:root {
  --ivory:  #FFFCF7;
  --white:  #FFFFFF;
  --blush:  #FBEEEC;
  --blush-d:#F2D4D3;
  --sage:   #EEF3EC;
  --leaf:   #7C9A78;
  --forest: #2E4A3D;
  --gold:   #C9A24D;
  --gold-d: #7D5F1D;
  --ink:    #3A2E33;
  --ink-soft:#6B5C63;

  --script:  "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --display: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  --body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --foil: linear-gradient(100deg, #9C7A2B 0%, #E7CC84 22%, #B88F3A 42%, #F5E6B0 60%, #B18732 80%, #8F6D22 100%);
  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0; font-family: var(--body); font-weight: 300;
  font-size: clamp(1rem, .96rem + .22vw, 1.1rem); line-height: 1.75;
  color: var(--ink); background: var(--ivory);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.is-loading { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; line-height: 1.12; color: var(--forest); }
p { margin: 0 0 1em; }
.script { font-family: var(--script); font-weight: 400; }

.foil {
  background: var(--foil); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { from { background-position: 0% 0; } to { background-position: -220% 0; } }

:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 3px; border-radius: 2px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 400; background: var(--forest); color: var(--ivory); padding: 10px 16px; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* All painted flower sprays */
.flora { position: absolute; pointer-events: none; user-select: none; max-width: none; height: auto; }

/* ---------- Buttons ---------- */
.btn {
  --c: var(--forest); --t: var(--forest); --h: var(--ivory);
  appearance: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px; font: 400 .98rem/1 var(--body); letter-spacing: .04em;
  color: var(--t); background: transparent; border: 1px solid var(--c); border-radius: 999px;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c); transform: translateY(101%); transition: transform .4s var(--ease); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn:hover, .btn:focus-visible { color: var(--h); }
.btn-solid { background: var(--forest); color: var(--ivory); --c: var(--gold-d); --h: var(--ivory); }
.btn-solid:hover, .btn-solid:focus-visible { border-color: var(--gold-d); }
.btn-line { --c: var(--forest); --t: var(--forest); border-color: rgba(46,74,61,.45); }
.btn-gold-line { --c: var(--gold); --t: var(--gold); --h: var(--forest); }

/* ==========================================================================
   Loader: wax-sealed envelope
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 300; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(70% 60% at 50% 42%, #FFFFFF 0%, var(--blush) 68%, #F6DEDB 100%);
  transition: opacity 1s ease .35s;
}
.loader.go { opacity: 0; pointer-events: none; }

.loader .flora { opacity: 0; animation: bloomIn 2.4s var(--ease) .2s forwards; }
.lf-tl { top: -4%; left: -6%; width: min(78vw, 560px); }
.lf-br { bottom: -4%; right: -6%; width: min(78vw, 560px); rotate: 180deg; }
@keyframes bloomIn { from { opacity: 0; scale: .55; } to { opacity: 1; scale: 1; } }

.loader-stage { position: relative; z-index: 2; text-align: center; padding: 0 20px; transition: transform 1.3s cubic-bezier(.6, 0, .2, 1), opacity .9s ease .3s; }
.loader.go .loader-stage { transform: scale(2.6); opacity: 0; }

.loader-script {
  font: 400 clamp(2.6rem, 9vw, 3.8rem)/1.1 var(--script); margin: 0 0 26px; padding: 0 .1em .12em;
  background: var(--foil); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite, wipe 1.8s var(--ease) .6s both;
}
@keyframes wipe { from { clip-path: inset(-20% 100% -20% -10%); } to { clip-path: inset(-20% -10% -20% -10%); } }

.env { position: relative; width: min(80vw, 360px); aspect-ratio: 3 / 2; margin: 0 auto; perspective: 1200px; filter: drop-shadow(0 24px 30px rgba(140,90,90,.22)); opacity: 0; animation: envIn 1.4s var(--ease) .5s forwards; }
@keyframes envIn { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }

.env-back { position: absolute; inset: 0; background: #F2D2CF; border-radius: 6px; }
.env-card {
  position: absolute; left: 7%; right: 7%; top: 7%; bottom: 7%; z-index: 1;
  background: #fff; border: 1px solid var(--gold); border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  outline: 1px solid rgba(201,162,77,.5); outline-offset: -7px;
  transition: transform 1.2s cubic-bezier(.3, .8, .2, 1) .75s;
}
.env-card-names { font: 400 clamp(1.7rem, 7vw, 2.4rem)/1.1 var(--script); color: var(--gold-d); }
.env-card-names i { font-style: normal; padding: 0 .1em; }
.env-card-line { font: italic 500 clamp(.85rem, 3vw, 1rem)/1.2 var(--display); color: var(--ink-soft); }
.env.open .env-card { transform: translateY(-62%); }

.env-front { position: absolute; inset: 0; z-index: 2; }
.env-l { background: #FBE3E0; clip-path: polygon(0 0, 54% 54%, 0 100%); }
.env-r { background: #F8D9D5; clip-path: polygon(100% 0, 46% 54%, 100% 100%); }
.env-b { background: #FDEDEB; clip-path: polygon(0 100%, 50% 46%, 100% 100%); }

.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 54%; z-index: 3; transform-origin: 50% 0; background: var(--gold); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-flap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #FFFFFF, #FBE4E1); clip-path: polygon(1.6% 0, 98.4% 0, 50% 95%); }
.env.open .env-flap { animation: flapOpen 1s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes flapOpen {
  0%   { transform: rotateX(0);     z-index: 3; }
  49%  { transform: rotateX(86deg); z-index: 3; }
  50%  { z-index: 0; }
  100% { transform: rotateX(180deg); z-index: 0; }
}

.seal {
  position: absolute; z-index: 5; left: 50%; top: 54%; width: clamp(60px, 17vw, 76px); aspect-ratio: 1; padding: 0; border: 0; cursor: pointer;
  translate: -50% -50%; border-radius: 49% 51% 50% 50% / 51% 49% 51% 49%;
  background: radial-gradient(circle at 34% 28%, #F7E8B8 0%, #D9B664 42%, #B48B35 78%, #94702A 100%);
  box-shadow: 0 4px 10px rgba(90,60,10,.4), inset 0 2px 4px rgba(255,255,255,.55), inset 0 -4px 6px rgba(100,70,15,.35);
  display: grid; place-items: center; transition: transform .35s var(--ease), opacity .6s ease;
}
.seal svg { width: 74%; height: 74%; }
.seal:disabled { cursor: progress; }
.seal.ready { animation: sealBeat 2.2s ease-in-out infinite; }
.seal.ready::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--gold); animation: ripple 2.2s ease-out infinite; }
.seal.ready:hover { transform: scale(1.08); }
@keyframes sealBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
.env.open .seal { opacity: 0; transform: scale(1.5) rotate(14deg); animation: none; pointer-events: none; }
.env.open .seal::after { display: none; }

.loader-bar { width: min(240px, 60vw); height: 1px; margin: 30px auto 12px; background: rgba(125,95,29,.25); overflow: hidden; transition: opacity .5s; }
.loader-bar span { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.loader-status { font: italic 500 1.1rem/1.4 var(--display); color: var(--gold-d); margin: 0; min-height: 1.6em; transition: opacity .5s; }
.env.open ~ .loader-bar, .env.open ~ .loader-status { opacity: 0; }

/* ==========================================================================
   Top bar and music button
   ========================================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; gap: 24px;
  padding: 8px var(--gutter); padding-top: max(8px, env(safe-area-inset-top));
  color: var(--ink); background: rgba(255,252,247,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(201,162,77,.4);
  transform: translateY(-110%); opacity: 0;
  transition: transform .7s var(--ease), opacity .7s ease, background .4s ease, box-shadow .4s ease;
}
body:not(.is-loading) .topbar { transform: none; opacity: 1; transition-delay: 2.4s, 2.4s, 0s, 0s; }
.topbar.solid { background: rgba(255,252,247,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(201,162,77,.4); transition-delay: 0s; }

.brand { font: 400 1.9rem/1 var(--script); color: var(--gold-d); text-decoration: none; padding: 4px 0; }
.navlinks { display: none; list-style: none; margin: 0 0 0 auto; padding: 0; gap: 30px; }
.navlinks a { text-decoration: none; font-size: .95rem; letter-spacing: .03em; padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color .3s, color .3s; }
.navlinks a:hover { border-color: var(--gold); color: var(--gold-d); }

.music-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; cursor: pointer;
  font: 400 .92rem/1 var(--body); letter-spacing: .03em; color: var(--ink);
  background: rgba(255,255,255,.7); border: 1px solid var(--gold); border-radius: 999px;
}
.music-btn:hover { background: #fff; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq b { width: 2px; height: 3px; background: var(--gold-d); border-radius: 1px; }
.music-btn.playing .eq b { animation: eq 1s ease-in-out infinite; }
.music-btn.playing .eq b:nth-child(2) { animation-delay: -.3s; }
.music-btn.playing .eq b:nth-child(3) { animation-delay: -.6s; }
.music-btn.playing .eq b:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }
@media (min-width: 900px) { .navlinks { display: flex; } .music-btn { margin-left: 0; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(60% 46% at 50% 36%, #FFFFFF 0%, rgba(255,255,255,0) 72%),
    linear-gradient(180deg, var(--ivory) 0%, var(--blush) 62%, #F5DCD9 100%);
}
.petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

.hf { z-index: 1; --par: 0; --fx: 1; --fy: 1; scale: var(--fx) var(--fy); translate: 0 calc(var(--sy, 0) * var(--par) * 1px); }
.hf-tl { top: 40px; left: -5%;  width: min(66vw, 500px); --par: -.05; }
.hf-tr { top: 40px; right: -5%; width: min(66vw, 500px); --fx: -1; --par: -.07; }
.hf-bl { bottom: -3%; left: -6%;  width: min(70vw, 520px); --fy: -1; --par: .05; }
.hf-br { bottom: -3%; right: -6%; width: min(70vw, 520px); --fx: -1; --fy: -1; --par: .07; }

.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 860px; padding: 84px var(--gutter) 56px; text-align: center; display: flex; flex-direction: column; align-items: center; }

.greeting { font: italic 500 clamp(1.2rem, 3.2vw, 1.6rem)/1.3 var(--display); color: var(--gold-d); min-height: 2em; margin-bottom: 14px; transition: opacity .8s ease, transform .8s var(--ease); }
.greeting.swap { opacity: 0; transform: translateY(6px); }

.arch-wrap { position: relative; width: min(60vw, 270px, 38svh); margin: 0 auto -2.4rem; z-index: 1; }
.arch {
  position: relative; aspect-ratio: 3 / 4.1; overflow: hidden; border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBE8E5 60%, #F2CFCB 100%);
  box-shadow: 0 0 0 6px var(--ivory), 0 0 0 7.5px var(--gold), 0 0 0 14px rgba(255,255,255,.55), 0 26px 60px rgba(150,90,90,.22);
}
.arch-art, .arch-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch-photo { object-fit: cover; z-index: 1; }
.bq { z-index: 2; width: clamp(150px, 46vw, 230px); }
.bq-l { right: 82%; bottom: 2.2rem; rotate: 180deg; }
.bq-r { left: 82%;  bottom: 2.2rem; scale: 1 -1; }

.names {
  position: relative; z-index: 3; width: min(100%, 6.6em); margin: 0 auto;
  font: 400 clamp(4.2rem, 21vw, 5.8rem)/1 var(--script); display: grid; grid-template-columns: 1fr;
  filter: drop-shadow(0 8px 18px rgba(255,255,255,.85));
}
.names .n, .names .amp { padding: 0 .14em .14em; }
.names .n1 { justify-self: start; }
.names .n2 { justify-self: end; margin-top: -.2em; }
.names .amp { justify-self: center; font-size: .5em; line-height: .8; margin-top: -.14em; }
@media (min-width: 720px) {
  .names { width: auto; display: flex; align-items: baseline; justify-content: center; gap: .08em; font-size: clamp(5rem, 9.2vw, 8.2rem); }
  .names .n2 { margin-top: 0; }
  .names .amp { margin-top: 0; font-size: .55em; }
}

.hero-full { margin: 1.8rem 0 .2rem; font: 500 clamp(1.25rem, 3.4vw, 1.65rem)/1.35 var(--display); color: var(--forest); letter-spacing: .02em; }
.hero-invite { font: italic 400 clamp(1.05rem, 2.6vw, 1.25rem)/1.5 var(--display); color: var(--ink-soft); max-width: 24em; margin-bottom: 1.2rem; }
.hero-date { font: 600 clamp(1.5rem, 4.4vw, 2.1rem)/1.2 var(--display); font-variant-numeric: lining-nums; color: var(--gold-d); margin-bottom: 1.8rem; }

.countdown { display: flex; justify-content: center; gap: clamp(10px, 3.4vw, 26px); margin-bottom: 2.8rem; }
.cd { position: relative; width: clamp(64px, 17vw, 92px); aspect-ratio: 1; text-align: center; }
.cd svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; overflow: visible; }
.cd circle { fill: none; stroke-width: 2.2; }
.cd-bg { stroke: rgba(201,162,77,.28); }
.cd-fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 219.9; stroke-dashoffset: 219.9; transition: stroke-dashoffset .9s ease; }
.cd b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 clamp(1.4rem, 5vw, 2rem)/1 var(--display); color: var(--forest); font-variant-numeric: lining-nums tabular-nums; }
.cd span { position: absolute; left: 0; right: 0; top: calc(100% + 8px); font: italic 500 .95rem/1 var(--display); color: var(--ink-soft); }

.scroll-cue { display: block; width: 26px; height: 42px; border: 1px solid var(--gold); border-radius: 14px; position: relative; margin-top: .6rem; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--gold-d); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

@media (max-width: 719px) {
  .hf-tl, .hf-tr { top: 58px; width: 44vw; }
  .hf-bl, .hf-br { bottom: -5%; width: 42vw; }
  .hero-inner { padding-top: 92px; }
}

/* The hero plays once, after the envelope opens: flowers bloom, the arch rises, the names are written */
.hf, .arch-wrap, .greeting, .names .n, .names .amp, .hero-full, .hero-invite, .hero-date, .countdown, .scroll-cue { opacity: 0; }
body:not(.is-loading) .hf        { animation: hfBloom 2.6s var(--ease) .1s both; }
body:not(.is-loading) .greeting  { animation: fadeUp 1.2s var(--ease) .5s both; }
body:not(.is-loading) .arch-wrap { animation: fade 1s ease .5s both; }
body:not(.is-loading) .arch      { animation: rise 2s var(--ease) .6s both; }
body:not(.is-loading) .bq        { animation: fade 1.6s ease 2s both; }
body:not(.is-loading) .names .n1 { animation: write 1.7s var(--ease) 1.7s both; }
body:not(.is-loading) .names .amp { animation: fadeUp 1s var(--ease) 2.5s both; }
body:not(.is-loading) .names .n2 { animation: write 1.7s var(--ease) 2.8s both; }
body:not(.is-loading) .hero-full   { animation: fadeUp 1.2s var(--ease) 3.7s both; }
body:not(.is-loading) .hero-invite { animation: fadeUp 1.2s var(--ease) 3.9s both; }
body:not(.is-loading) .hero-date   { animation: fadeUp 1.2s var(--ease) 4.1s both; }
body:not(.is-loading) .countdown   { animation: fadeUp 1.2s var(--ease) 4.3s both; }
body:not(.is-loading) .scroll-cue  { animation: fadeUp 1.2s var(--ease) 4.6s both; }
.names .n, .names .amp { animation-fill-mode: both; }
@keyframes rise   { from { clip-path: inset(100% -60px -60px -60px); } to { clip-path: inset(-60px -60px -60px -60px); } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes hfBloom { from { opacity: 0; scale: calc(var(--fx) * .6) calc(var(--fy) * .6); } to { opacity: 1; scale: var(--fx) var(--fy); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes write  { from { opacity: 1; clip-path: inset(-20% 100% -20% -10%); } to { opacity: 1; clip-path: inset(-20% -10% -20% -10%); } }

/* Hero text keeps its shimmer after being written (animations are combined) */
body:not(.is-loading) .names .n1 { animation: write 1.7s var(--ease) 1.7s both, shimmer 7s linear infinite; }
body:not(.is-loading) .names .n2 { animation: write 1.7s var(--ease) 2.8s both, shimmer 7s linear infinite; }
body:not(.is-loading) .names .amp { animation: fadeUp 1s var(--ease) 2.5s both, shimmer 7s linear infinite; }

/* ==========================================================================
   Sections
   ========================================================================== */
.sec { position: relative; padding: clamp(72px, 11vw, 140px) 0; }
.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin: 0 auto; }
.wrap.wide { width: min(1240px, 100% - 2 * var(--gutter)); }
.wrap.narrow { width: min(640px, 100% - 2 * var(--gutter)); }
.center { text-align: center; }
.soft { color: var(--ink-soft); }

.ivory { background: var(--ivory); }
.white { background: var(--white); }
.blush { background: var(--blush); }
.sage  { background: var(--sage); }

.sec h2 { font-size: clamp(2.2rem, 5.6vw, 3.8rem); margin-bottom: 14px; letter-spacing: -.005em; }
.orn { display: block; width: 210px; height: 22px; margin: 0 auto clamp(40px, 6vw, 64px); color: var(--gold); }

/* ---------- Welcome ---------- */
.welcome { display: grid; gap: clamp(36px, 6vw, 84px); align-items: center; }
.verse { margin: 0; }
.verse p { font: italic 500 clamp(2.2rem, 5.8vw, 3.9rem)/1.12 var(--display); color: var(--forest); margin: 0 0 22px; }
.verse p::before { content: "\201C"; display: block; font: 400 5rem/.7 var(--script); color: var(--gold); margin-bottom: 8px; }
.verse footer { color: var(--gold-d); font: italic 500 1.15rem/1 var(--display); padding-left: 56px; position: relative; }
.verse footer::before { content: ""; position: absolute; left: 0; top: 50%; width: 40px; height: 1px; background: var(--gold); }
.letter { max-width: 34em; }
.letter h2 { font: 400 clamp(2.1rem, 4.4vw, 3rem)/1.1 var(--script); color: var(--gold-d); margin-bottom: 18px; }
.letter .sign { margin-top: 1.6em; color: var(--ink-soft); }
.letter .sign .script { font-size: 2rem; color: var(--gold-d); line-height: 1.3; }
@media (min-width: 900px) { .welcome { grid-template-columns: 1.05fr 1fr; } }

/* ---------- Families ---------- */
.families { display: grid; gap: 34px; max-width: 780px; margin: 0 auto 28px; text-align: center; }
.family h3 { font-size: 2.3rem; color: var(--gold-d); margin-bottom: 6px; }
.family p { margin: 0; color: var(--ink-soft); }
.families-note { font: italic 500 1.2rem/1.5 var(--display); margin: 0; }
@media (min-width: 720px) {
  .families { grid-template-columns: 1fr 1fr; gap: 0; }
  .family { padding: 8px 40px; }
  .family + .family { border-left: 1px solid rgba(201,162,77,.7); }
}

/* ---------- Couple ---------- */
.couple { display: grid; gap: 52px; justify-items: center; align-items: start; }
.person { text-align: center; max-width: 380px; }
.portrait-wrap { position: relative; width: min(64vw, 260px); margin: 0 auto 30px; }
.portrait {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #FFFFFF, #FBE6E3 62%, #EFC9C4);
  box-shadow: 0 0 0 6px var(--white), 0 0 0 7.5px var(--gold), 0 22px 44px rgba(150,90,90,.2);
}
.portrait .mono { position: absolute; inset: 0; display: grid; place-items: center; font: italic 500 7rem/1 var(--display); color: var(--gold); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf { width: 200px; z-index: 2; top: -30px; }
.pf-l { right: 56%; rotate: 0deg; }
.pf-r { left: 56%; scale: -1 1; }
.person h3 { font-size: clamp(1.7rem, 3.2vw, 2.1rem); margin-bottom: 12px; }
.person p { color: var(--ink-soft); margin: 0; }
.rings { width: 76px; fill: none; stroke: var(--gold); stroke-width: 1.4; }
@media (min-width: 860px) {
  .couple { grid-template-columns: 1fr auto 1fr; gap: 24px; }
  .rings { margin-top: 110px; width: 92px; }
}

/* ---------- Timeline ---------- */
.timeline { --p: 0; list-style: none; margin: 0 auto; padding: 0; max-width: 860px; position: relative; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; }
.timeline::before { background: rgba(201,162,77,.35); }
.timeline::after { background: var(--gold); transform-origin: top; transform: scaleY(var(--p)); }
.tl-item { position: relative; padding: 0 0 44px 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 8px; width: 15px; height: 15px; border-radius: 50%; background: var(--sage); border: 1px solid var(--gold); transition: background .5s, box-shadow .5s; }
.tl-item.in::before { background: var(--gold); box-shadow: 0 0 0 6px rgba(201,162,77,.25); }
.tl-item h3 { font-size: clamp(1.5rem, 3vw, 1.95rem); margin-bottom: 6px; }
.tl-item p { color: var(--ink-soft); margin: 0; max-width: 32em; }
@media (min-width: 820px) {
  .timeline::before, .timeline::after { left: 50%; }
  .tl-item { width: 50%; padding: 0 56px 56px 0; text-align: right; }
  .tl-item::before { left: auto; right: -8px; }
  .tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 56px 56px; text-align: left; }
  .tl-item:nth-child(even)::before { right: auto; left: -8px; }
  .tl-item p { margin-left: auto; }
  .tl-item:nth-child(even) p { margin-left: 0; }
}

/* ---------- Illustrated card ---------- */
.illus { margin: 0 auto; width: min(80vw, 360px); text-align: center; }
.illus img { width: 100%; height: auto; padding: 10px; background: var(--white); border: 1px solid rgba(201,162,77,.7); box-shadow: 0 0 0 7px rgba(255,255,255,.55), 0 30px 60px rgba(150,90,90,.2); }
.illus figcaption { margin-top: 26px; font: italic 500 1.3rem/1.4 var(--display); color: var(--gold-d); }

/* ---------- Events: they are invitation cards ---------- */
.events { display: grid; gap: 44px; max-width: 520px; margin: 0 auto; }
.event {
  position: relative; text-align: center; background: var(--white); padding: 48px 28px 40px;
  border: 1px solid var(--gold); outline: 1px solid rgba(201,162,77,.55); outline-offset: -10px;
  box-shadow: 0 0 0 7px var(--ivory), 0 0 0 8px rgba(201,162,77,.55), 0 30px 60px rgba(150,90,90,.14);
}
.event-icon { width: 46px; height: 46px; color: var(--gold); margin: 0 auto 16px; }
.event h3 { font-size: clamp(1.8rem, 3.8vw, 2.4rem); margin-bottom: 14px; }
.event-time { font: 600 clamp(1.5rem, 4vw, 1.9rem)/1.1 var(--display); font-variant-numeric: lining-nums; color: var(--gold-d); }
.event-day { font: italic 500 1.15rem/1.4 var(--display); font-variant-numeric: lining-nums; color: var(--ink-soft); margin: 4px 0 18px; }
.event-note { color: var(--ink-soft); max-width: 28em; margin: 0 auto; }
.event-venue { margin: 20px 0 24px; }
.event-venue strong { display: block; font: 500 1.35rem/1.3 var(--display); color: var(--forest); }
.event-venue span { color: var(--ink-soft); }
.event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (min-width: 900px) { .events { grid-template-columns: 1fr 1fr; max-width: none; gap: 64px; } }

/* ---------- Venue ---------- */
.venue-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -24px 0 30px; }
.venue-tab { cursor: pointer; min-height: 44px; padding: 0 24px; font: 400 .95rem/1 var(--body); letter-spacing: .03em; color: var(--ink); background: rgba(255,255,255,.6); border: 1px solid rgba(201,162,77,.8); border-radius: 999px; transition: background .3s, color .3s; }
.venue-tab[aria-selected="true"] { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.map-frame {
  position: relative; height: clamp(320px, 52vw, 480px); overflow: hidden; background: var(--sage);
  border-radius: clamp(80px, 18vw, 220px) clamp(80px, 18vw, 220px) 8px 8px;
  box-shadow: 0 0 0 6px var(--ivory), 0 0 0 7.5px var(--gold), 0 30px 60px rgba(150,90,90,.18);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.venue-info { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 38px; text-align: center; }
.venue-info p { margin: 0; max-width: 34em; }
.venue-info strong { font: 500 1.4rem/1.3 var(--display); color: var(--forest); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile { position: relative; aspect-ratio: 4 / 5; padding: 6px; border: 0; cursor: zoom-in; background: var(--white); box-shadow: 0 0 0 1px rgba(201,162,77,.45), 0 14px 30px rgba(150,90,90,.14); overflow: hidden; }
.tile:nth-child(2n) { margin-top: 28px; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tile[data-ok="false"] { cursor: default; }
.tile[data-ok="false"] img { object-fit: contain; }
.tile[data-ok="false"]:hover img { transform: none; }
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 28px; }
  .tile:nth-child(2n) { margin-top: 0; }
  .tile:nth-child(3n+2) { margin-top: 36px; }
}

/* ---------- Forms ---------- */
.form { margin-top: 36px; display: grid; gap: 22px; }
.form label, .form legend { display: block; font-size: .95rem; font-weight: 400; letter-spacing: .02em; color: var(--forest); }
.form input[type="text"], .form select, .form textarea {
  display: block; width: 100%; margin-top: 8px; padding: 12px 16px; min-height: 50px;
  font: 300 1.05rem/1.4 var(--body); color: var(--ink);
  background: var(--white); border: 1px solid rgba(58,46,51,.22); border-radius: 6px;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.form fieldset { border: 0; padding: 0; margin: 0; }
.checks { display: grid; gap: 4px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 300; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--forest); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form-error { color: #9A2F3C; margin: 0; font-weight: 400; }

/* ---------- Verses ---------- */
.verses { display: grid; gap: 40px; max-width: 980px; margin: 0 auto 84px; }
.verses figure { margin: 0; text-align: center; padding: 0 8px; }
.verses blockquote { margin: 0 0 12px; font: italic 500 clamp(1.4rem, 2.6vw, 1.7rem)/1.4 var(--display); color: var(--forest); }
.verses figcaption { color: var(--gold-d); font: italic 500 1.1rem/1 var(--display); }
@media (min-width: 860px) {
  .verses { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .verses figure { padding: 6px 32px; }
  .verses figure + figure { border-left: 1px solid rgba(201,162,77,.6); }
}
.blessing-form { max-width: 600px; margin: 0 auto; }
.blessing-form h3 { font-size: clamp(2.2rem, 4.6vw, 3rem); color: var(--gold-d); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.footer { position: relative; overflow: hidden; background: var(--forest); color: var(--ivory); text-align: center; padding: clamp(150px, 18vw, 210px) 0 56px; }
.ff { top: -2%; width: min(44vw, 400px); opacity: .95; }
.ff-l { left: -6%; }
.ff-r { right: -6%; scale: -1 1; }
.footer .wrap { position: relative; z-index: 2; }
.benediction { font: italic 500 clamp(1.3rem, 2.8vw, 1.75rem)/1.5 var(--display); max-width: 30em; margin: 0 auto 8px; }
.benediction-ref { color: var(--gold); font: italic 500 1.1rem/1 var(--display); margin-bottom: 56px; }
.footer-names { white-space: nowrap; font: 400 clamp(3rem, 13.5vw, 7rem)/1.1 var(--script); padding: 0 .14em .14em; margin: 0 auto 10px; width: fit-content; }
.footer-date { font: 600 1.5rem/1.2 var(--display); font-variant-numeric: lining-nums; color: var(--gold); margin-bottom: 4px; }
.footer-tag { color: rgba(255,252,247,.72); margin-bottom: 36px; }
.footer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 56px; }
.thanks { font: italic 500 1.15rem/1.4 var(--display); color: rgba(255,252,247,.7); margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 350; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 16px; background: rgba(34,24,28,.94); }
.lightbox figure { margin: 0; text-align: center; min-width: 0; }
.lightbox img { max-height: 80vh; max-height: 80dvh; width: auto; margin: 0 auto; object-fit: contain; border: 6px solid #fff; }
.lightbox figcaption { margin-top: 12px; color: rgba(255,252,247,.85); font: italic 500 1.1rem/1.4 var(--display); }
.lb-close, .lb-nav { cursor: pointer; color: var(--ivory); background: transparent; border: 1px solid rgba(255,252,247,.4); border-radius: 50%; width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; }
.lb-close:hover, .lb-nav:hover { border-color: var(--gold); color: var(--gold); }
.lb-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2; }

/* ---------- Scroll reveal ---------- */
.js .tl-item { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s var(--ease); }
.js .tl-item.in { opacity: 1; transform: none; }
.js .tile { opacity: 0; transition: opacity .9s ease; }
.js .tile.in { opacity: 1; }
.js .event { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s var(--ease); }
.js .event.in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .loader .flora, .env, .loader-script { opacity: 1; }
  .hf, .arch-wrap, .greeting, .names .n, .names .amp, .hero-full, .hero-invite, .hero-date, .countdown, .scroll-cue { opacity: 1; }
  .petals { display: none; }
}

/* ==========================================================================
   Dove that carries the message
   ========================================================================== */
.dove-layer { position: fixed; inset: 0; z-index: 9998; pointer-events: none; overflow: hidden; }
.dove { --dove-w: 150px; position: absolute; left: 0; top: 0; width: var(--dove-w); aspect-ratio: 190 / 120; will-change: transform; filter: drop-shadow(0 7px 7px rgba(70, 50, 60, .26)); }
.dove svg { display: block; width: 100%; height: 100%; overflow: visible; }
@media (max-width: 600px) { .dove { --dove-w: 118px; } }

.dv-wing { transform-origin: 0 0; animation: dvFlap var(--flap, .3s) ease-in-out infinite alternate; }
.dv-back { animation-delay: -.05s; }
@keyframes dvFlap { from { transform: rotate(20deg); } to { transform: rotate(-82deg); } }

.dove:not(.carrying) .dv-carry { display: none; }
.dv-note { transform-origin: 0 0; transform: rotate(calc(var(--ca, 0) * 1deg)); }
.dv-note-in { transform-origin: 0 0; animation: dvSwing .9s ease-in-out infinite alternate; }
@keyframes dvSwing { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }

.dove-note { position: absolute; transform-origin: 50% 0; animation: noteIn .45s var(--ease) both; filter: drop-shadow(0 5px 5px rgba(70, 50, 60, .28)); }
.dove-note svg { display: block; width: 100%; height: auto; }
@keyframes noteIn { from { opacity: 0; transform: translateY(10px) scale(.3) rotate(-14deg); } to { opacity: 1; transform: none; } }

.dove-spark { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px 2px rgba(231, 204, 132, .9); animation: spark .8s ease-out forwards; }
@keyframes spark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); } }

/* Status shown once the dove has gone */
.send-status { margin: 0; padding: 14px 18px; border: 1px solid rgba(201, 162, 77, .55); border-radius: 6px; background: rgba(255, 252, 247, .8); color: var(--forest); font-weight: 400; animation: fadeUp .7s var(--ease) both; }
.send-status a { color: var(--gold-d); font-weight: 500; }
.form button[disabled] { opacity: .6; cursor: progress; }

@media (prefers-reduced-motion: reduce) { .dove-layer { display: none; } }

/* ---------- Phones: nothing may push the page wider than the screen ---------- */
html, body { overflow-x: clip; max-width: 100%; }
main, .sec { overflow-x: clip; }
@media (max-width: 380px) {
  .topbar { gap: 10px; }
  .brand { font-size: 1.6rem; }
  .music-btn { padding: 0 12px; gap: 8px; }
}

/* ---------- With regards ---------- */
.regards { margin: 26px 0 0; display: grid; justify-items: center; gap: 2px; }
.regards span { font: italic 500 1.15rem/1.3 var(--display); color: var(--ink-soft); }
.regards b { font-weight: 400; font-size: clamp(2.2rem, 6vw, 2.8rem); line-height: 1.2; color: var(--gold-d); }

/* ---------- Will you attend? ---------- */
.attend-details { display: grid; gap: 22px; }
.choices { display: grid; gap: 12px; margin-top: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: block; padding: 16px 18px 16px 52px; background: var(--white); border: 1px solid rgba(58,46,51,.22); border-radius: 8px; transition: border-color .3s, background .3s, box-shadow .3s; position: relative; }
.choice span::before { content: ""; position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border: 1.5px solid var(--gold-d); border-radius: 50%; background: var(--white); transition: background .3s, box-shadow .3s; }
.choice b { display: block; font: 600 1.2rem/1.3 var(--display); color: var(--forest); }
.choice i { display: block; font: italic 500 1.05rem/1.4 var(--display); color: var(--ink-soft); }
.choice input:checked + span { border-color: var(--gold); background: #FFFBF0; box-shadow: 0 6px 18px rgba(201,162,77,.18); }
.choice input:checked + span::before { background: var(--gold-d); box-shadow: inset 0 0 0 4px var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--gold-d); outline-offset: 2px; }

/* ---------- In the presence of ---------- */
.presence-sec { padding-block: clamp(56px, 9vw, 96px); }
.presence { position: relative; max-width: 640px; margin: 0 auto; padding: clamp(34px, 6vw, 52px) clamp(20px, 5vw, 48px) clamp(22px, 4vw, 30px); text-align: center; border: 1px solid rgba(201,162,77,.65); border-radius: 4px; background: linear-gradient(180deg, #FFFDF8, #FFF8EC); box-shadow: 0 0 0 6px var(--white), 0 0 0 7px rgba(201,162,77,.35), 0 18px 44px rgba(150,90,90,.10); }
.presence-cross { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--gold); display: block; }
.presence p { margin: 0; }
.presence-lead { font: italic 500 clamp(1.15rem, 3vw, 1.35rem)/1.4 var(--display); color: var(--ink-soft); }
.presence-title { margin-top: 6px !important; font: 500 clamp(.9rem, 2.4vw, 1.05rem)/1.4 var(--body); letter-spacing: .28em; text-transform: uppercase; color: var(--gold-d); }
.presence-name { margin-top: 6px !important; font-size: clamp(2.3rem, 8vw, 3.4rem); line-height: 1.2; color: var(--forest); padding-bottom: .1em; }
.presence .orn { display: block; width: min(240px, 70%); height: 24px; margin: 14px auto 0; color: var(--gold); }
.js .presence { opacity: 0; transform: translateY(16px); transition: opacity 1s ease, transform 1s var(--ease); }
.js .presence.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .presence { opacity: 1; transform: none; } }
