:root {
  --ink: #3a2a1f;
  --wine: #7c2f25;
  --paper: #f4ecdd;
  --paper-2: #ebe0c8;
  --paper-3: #efe5d0;
  --sand: #d9c9a8;
  --line: #cdb996;
  --field: #c4ad86;
  --muted: #6e5a48;
  --cream-soft: #e2d3b4;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .16 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --glow: radial-gradient(ellipse 75% 65% at 50% 45%, #f6efe0 0%, #eadcc0 60%, #c9b28a 100%);
  --serif: 'Cormorant Garamond', serif;
  --script: 'Great Vibes', cursive;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: 'EB Garamond', serif;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
* { box-sizing: border-box; }
a { color: var(--wine); text-decoration: none; }
input, textarea, button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #9a8570; }
img { display: block; }

@keyframes petalFall { 0% { transform: translate3d(0, -12vh, 0); } 100% { transform: translate3d(var(--dx), 112vh, 0); } }
@keyframes petalSpin { 0% { transform: rotate(0deg) rotateY(0deg); } 50% { transform: rotate(200deg) rotateY(170deg); } 100% { transform: rotate(380deg) rotateY(0deg); } }
@keyframes coverIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- shared type ---------- */
.eyebrow { font-family: var(--serif); font-size: 14px; letter-spacing: .32em; text-transform: uppercase; color: var(--wine); }
.script { font-family: var(--script); font-weight: 400; }
.title { margin: 0; font-family: var(--script); font-weight: 400; font-size: 52px; line-height: 1.1; }
.fleuron { font-size: 20px; color: var(--wine); }
.caps { font-family: var(--serif); letter-spacing: .2em; text-transform: uppercase; }
.amp { color: var(--wine); }
.diamond { width: 6px; height: 6px; background: var(--wine); transform: rotate(45deg); flex: none; }
.rule { height: 1px; background: var(--ink); }

/* ---------- cover ---------- */
.cover {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: safe center; justify-content: center;
  padding: 16px; overflow-x: hidden; overflow-y: auto;
  background: var(--noise), var(--glow);
  transition: transform 1.1s cubic-bezier(.7, 0, .2, 1), opacity 1.1s;
}
.cover.opened { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.petal-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.cover .petal-layer { z-index: 1; }
.cover-card {
  position: relative; z-index: 2; margin: auto 0; width: 100%; max-width: 440px;
  padding: clamp(70px, 13svh, 120px) 30px clamp(30px, 6svh, 56px);
  border: 2px solid var(--wine); border-radius: 220px 220px 6px 6px;
  text-align: center; display: flex; flex-direction: column; align-items: center;
  gap: clamp(6px, 1.5svh, 12px);
  background: rgba(244, 236, 221, .82);
  box-shadow: 0 30px 70px -30px rgba(58, 42, 31, .55);
  animation: coverIn 1.4s ease-out both;
}
.cover-card .frame-1 { position: absolute; inset: 6px; border: 1px solid var(--ink); border-radius: 212px 212px 3px 3px; pointer-events: none; }
.cover-card .frame-2 { position: absolute; inset: 11px; border: 1px solid var(--line); border-radius: 206px 206px 1px 1px; pointer-events: none; }
.cover-card .top-gem { position: absolute; top: -9px; left: 50%; width: 14px; height: 14px; margin-left: -7px; background: var(--wine); transform: rotate(45deg); box-shadow: 0 0 0 4px var(--paper); }
.cover-card .bottom-orn { position: absolute; bottom: 22px; left: 50%; width: 120px; margin-left: -60px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.cover-card .bottom-orn .rule { flex: 1; }
.hy {
  width: clamp(44px, 8svh, 58px); height: clamp(44px, 8svh, 58px);
  border: 1px solid var(--wine); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--wine); font-size: 30px; line-height: 1; font-family: serif;
}
.cover-label { font-family: var(--serif); font-size: 14px; letter-spacing: .32em; text-transform: uppercase; margin-top: 6px; }
.divider { display: flex; align-items: center; gap: 10px; }
.divider .rule { width: 44px; }
.cover-name { margin: 0; font-family: var(--script); font-weight: 400; font-size: clamp(40px, min(13vw, 9svh), 64px); line-height: 1.05; }
.cover-name.first { margin-top: 6px; }
.cover-amp { font-family: var(--script); font-size: 40px; line-height: 1; color: var(--wine); }
.cover-invite { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--muted); margin-top: 4px; }
.seal {
  margin-top: 8px; width: clamp(80px, 13svh, 96px); height: clamp(80px, 13svh, 96px);
  border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #9a4234 0%, #7c2f25 55%, #5e2019 100%);
  box-shadow: 0 8px 18px -6px rgba(58, 42, 31, .6), inset 0 0 0 5px rgba(0, 0, 0, .08);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.seal:hover { transform: scale(1.05); }
.seal-inner {
  width: 80%; height: 80%; border-radius: 50%; border: 1px dashed rgba(244, 236, 221, .55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--paper);
}
.seal-inner img { width: 58%; height: auto; margin-bottom: 2px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.seal-inner span { font-family: var(--serif); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }

/* ---------- page background + main column ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--noise), var(--glow); }
main {
  position: relative; z-index: 1; max-width: 520px; margin: 0 auto;
  background: var(--paper) var(--noise);
  box-shadow: 0 0 80px -20px rgba(58, 42, 31, .35);
  overflow: hidden;
}
section { padding: 64px 24px; text-align: center; }
.stack { display: flex; flex-direction: column; align-items: center; }

/* hero */
.hero { position: relative; padding: 56px 24px 64px; text-align: center; background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 70%); }
.hero-sub { font-family: var(--script); font-size: 34px; color: var(--muted); margin-top: 4px; }
.arch { margin-top: 28px; padding: 9px; border: 1px solid var(--wine); border-radius: 200px 200px 0 0; width: min(100%, 340px); }
.arch-photo { aspect-ratio: 3 / 4; border-radius: 190px 190px 0 0; overflow: hidden; background: var(--sand); }
.arch-photo img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.28) contrast(.96) saturate(.9); }
.hero-names { margin: 28px 0 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--script); font-weight: 400; font-size: clamp(40px, 11vw, 52px); line-height: 1.15; }
.hero-names span { white-space: nowrap; }
.hero-names .amp { font-size: .7em; line-height: 1; }

/* info */
.info { gap: 36px; }
.info .announce { font-family: var(--serif); font-size: 16px; letter-spacing: .2em; text-transform: uppercase; line-height: 1.7; }
.names-block { gap: 2px; }
.names-block .n { font-family: var(--script); font-size: 52px; line-height: 1.1; }
.names-block .a { font-family: var(--script); font-size: 34px; line-height: 1; color: var(--wine); }
.monogram { width: min(70%, 280px); height: auto; margin-top: 8px; }

/* family sections */
.family { gap: 30px; }
.family.alt { background: var(--paper-2); }
.parents { gap: 4px; }
.parent { font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.4; }
.address { font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: pretty; margin-top: 6px; max-width: 340px; }
.date-card {
  width: 100%; padding: 30px 18px; gap: 10px;
  border: 1px solid var(--wine); outline: 1px solid var(--line); outline-offset: 5px;
  background: var(--paper-3);
}
.date-card .lead { font-family: var(--serif); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; line-height: 1.7; }
.date-card .at { font-family: var(--serif); font-size: 14px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.date-card .time { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--wine); }
.date-row { display: flex; align-items: center; gap: 14px; font-family: var(--serif); font-size: 15px; letter-spacing: .18em; text-transform: uppercase; }
.date-row .bar { width: 1px; height: 34px; background: var(--ink); }
.date-row .day { font-size: 40px; letter-spacing: 0; line-height: 1; }
.date-card .year { font-family: var(--serif); font-size: 18px; letter-spacing: .3em; }
.date-card .lunar { font-style: italic; font-size: 15px; color: var(--muted); }
.date-card .venue { font-family: var(--serif); font-size: 15px; letter-spacing: .2em; line-height: 1.7; font-weight: 700; color: var(--wine); }

.schedule { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 24px; }
.schedule > .eyebrow { text-align: center; }
.sched-day { font-family: var(--serif); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--wine); padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.sched-row { display: grid; grid-template-columns: 72px 14px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sched-row .t { font-family: var(--serif); font-size: 24px; line-height: 1.1; color: var(--wine); font-variant-numeric: tabular-nums; }
.sched-row .dot { width: 9px; height: 9px; margin-top: 8px; border: 1px solid var(--wine); transform: rotate(45deg); }
.sched-row .what { font-size: 17px; font-weight: 500; }
.sched-row .desc { font-size: 15px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.sched-row .place { font-family: var(--serif); font-size: 15px; letter-spacing: .2em; color: var(--wine); font-weight: 700; margin-top: 2px; }

.map { width: 100%; gap: 12px; }
.map iframe { width: 100%; height: 220px; border: 1px solid var(--line); filter: saturate(.6) sepia(.15); }
.btn-dark {
  min-height: 46px; display: flex; align-items: center; padding: 0 26px;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: 15px; letter-spacing: .2em; text-transform: uppercase;
  transition: background .2s;
}
.btn-dark:hover { background: var(--wine); color: var(--paper); }

/* album */
.album { padding: 64px 16px; background: var(--paper-2); }
.album .title { margin: 4px 0 28px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo { padding: 0; border: none; background: var(--sand); cursor: zoom-in; aspect-ratio: 2 / 3; overflow: hidden; }
.photo.wide { grid-column: span 2; aspect-ratio: 3 / 2; }
.photo.solo { grid-column: 1 / span 2; justify-self: center; width: calc(50% - 4px); }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.22) saturate(.9); }

/* countdown */
.countdown { background: var(--ink); color: var(--paper); gap: 24px; }
.countdown .title { font-size: clamp(38px, 11vw, 48px); white-space: nowrap; }
.units { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 400px; }
.unit { padding: 14px 4px; border: 1px solid rgba(244, 236, 221, .4); }
.unit .v { font-family: var(--serif); font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.unit .l { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; color: var(--cream-soft); }
.calendar { width: 100%; max-width: 400px; background: var(--paper); color: var(--ink); padding: 24px 18px; border: 1px solid var(--line); outline: 1px solid var(--paper); outline-offset: 5px; }
.calendar .month { font-family: var(--serif); font-size: 24px; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-grid .wd { font-size: 13px; color: var(--muted); padding: 6px 0; }
.cal-grid .cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.cal-grid .hi { width: 90%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; background: var(--wine); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 500; }
.calendar .note { font-size: 14px; color: var(--muted); margin-top: 10px; }
.btn-ghost {
  min-height: 48px; display: flex; align-items: center; padding: 0 28px;
  border: 1px solid var(--paper); color: var(--paper);
  font-family: var(--serif); font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.btn-ghost:hover { background: var(--paper); color: var(--ink); }

/* rsvp */
.rsvp {
  position: relative; padding: 64px 16px 300px; text-align: left;
  background-color: var(--paper);
  background-image: linear-gradient(180deg, #f4ecdd 0%, rgba(244, 236, 221, .92) 40%, rgba(244, 236, 221, 0) 75%), url('assets/rsvp-vintage.jpg');
  background-size: cover; background-position: center 70%;
}
.rsvp-card { background: rgba(244, 236, 221, .96); border: 1px solid var(--line); padding: 32px 20px; }
.rsvp-head { text-align: center; margin-bottom: 24px; }
.rsvp-head .title { margin: 4px 0 8px; font-size: 46px; }
.rsvp-head p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 14px; letter-spacing: .18em; text-transform: uppercase; }
label.field { gap: 8px; }
.choices { display: grid; gap: 8px; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { min-height: 48px; padding: 8px 4px; cursor: pointer; font-size: 15px; background: #fff; color: var(--ink); border: 1px solid var(--field); }
.choices.three .choice { min-height: 52px; }
.choice[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.input { height: 48px; padding: 0 14px; border: 1px solid var(--field); background: #fbf6ea; font-size: 16px; color: var(--ink); outline: none; min-width: 0; }
.input:focus { border-color: var(--wine); }
textarea.input { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; height: 48px; border: 1px solid var(--field); background: #fff; }
.stepper button { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--ink); }
.stepper output { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 24px; }
.error { font-size: 15px; color: #8a2a1c; }
.error:empty { display: none; }
.submit { height: 54px; background: var(--ink); color: var(--paper); border: none; font-family: var(--serif); font-size: 16px; letter-spacing: .24em; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.submit:hover { background: var(--wine); }
.thanks { text-align: center; padding: 16px 0 4px; gap: 12px; }
.thanks .big { font-family: var(--script); font-size: 50px; color: var(--wine); line-height: 1; }
.thanks p { margin: 0; font-size: 17px; line-height: 1.6; }
.link-btn { margin-top: 8px; background: none; border: none; border-bottom: 1px solid var(--ink); padding: 4px 0; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; color: var(--ink); }
[hidden] { display: none !important; }

/* guestbook */
.guestbook .title { margin: 4px 0 24px; font-size: 46px; }
.empty { font-style: italic; font-size: 17px; color: var(--muted); }
.wishes { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.wish { padding: 16px 18px; border: 1px solid var(--line); background: var(--paper-3); }
.wish p { margin: 0; font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.wish .by { font-family: var(--serif); font-size: 16px; color: var(--wine); margin-top: 8px; }

/* footer */
footer { padding: 56px 24px 96px; background: var(--ink); color: var(--paper); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
footer .fleuron { color: var(--cream-soft); }
footer p { margin: 0; font-size: 17px; line-height: 1.6; max-width: 340px; text-wrap: pretty; }
footer .sig { font-family: var(--script); font-size: 42px; line-height: 1.1; margin-top: 8px; }
footer .date { font-family: var(--serif); font-size: 15px; letter-spacing: .3em; color: var(--cream-soft); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(30, 20, 12, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 12px 24px; gap: 14px; }
.lightbox img { max-width: 100%; max-height: calc(100svh - 150px); object-fit: contain; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border: none; background: none; color: var(--paper); font-size: 26px; cursor: pointer; }
.lb-nav { display: flex; align-items: center; gap: 20px; color: var(--paper); }
.lb-nav button { width: 48px; height: 48px; border: 1px solid rgba(244, 236, 221, .5); background: none; color: var(--paper); font-size: 22px; cursor: pointer; }
.lb-nav output { font-family: var(--serif); font-size: 18px; letter-spacing: .1em; min-width: 56px; text-align: center; }

/* music */
.music { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--field); background: rgba(244, 236, 221, .95); color: var(--ink); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px -12px rgba(58, 42, 31, .45); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petal { display: none; }
  .cover, .cover-card { transition: none; animation: none; }
}
