:root {
  color-scheme: light;
  --ivory: #fbf6ee;
  --paper: #fffaf2;
  --ink: #2d2b23;
  --sage: #495635;
  --sage-dark: #35412a;
  --sage-wash: #e8ebdd;
  --gold: #a2793b;
  --line: #d9c6a8;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at top, #f0e4d3, transparent 550px), var(--ivory);
  font: 16px/1.6 var(--sans);
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font: 500 2rem/1.1 var(--serif); }
em { font-weight: 400; }
button, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem clamp(.85rem, 4vw, 3rem);
  background: var(--sage-dark);
  color: white;
  font-size: .8rem;
}
.preview-bar span { font-weight: 600; }
.preview-bar label { margin-right: .35rem; }
.preview-bar select {
  max-width: 100%;
  border: 1px solid #e1e6d8;
  border-radius: .35rem;
  background: #f9fbf6;
  color: var(--sage-dark);
  padding: .3rem .35rem;
}
main { max-width: 1440px; margin: auto; background: var(--ivory); }
.cover { display: grid; grid-template-columns: 1.18fr 1fr; min-height: calc(100svh - 48px); }
.hero-photo { overflow: hidden; background: #4a3a2e; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 46%; }
.cover .hero-photo img { max-height: max(650px, calc(100svh - 48px)); }
.cover-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.75rem;
  background: radial-gradient(ellipse at 50% 0, #e5e9d8, transparent 58%), var(--paper);
  text-align: center;
}
.cover-body::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line);
  border-radius: 6rem 6rem .75rem .75rem;
  pointer-events: none;
}
.eyebrow { font-size: .75rem; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; }
.cover h1, .intro h2 { font-size: clamp(3rem, 7vw, 7rem); letter-spacing: -.07em; }
.cover h1 { color: var(--sage); margin-top: .65rem; }
.cover h1 em { color: var(--gold); }
.flourish {
  display: flex;
  width: min(11rem, 70%);
  align-items: center;
  gap: .6rem;
  margin: .6rem auto;
  color: var(--gold);
  font: 1.65rem/1 var(--serif);
}
.flourish::before, .flourish::after { content: ''; flex: 1; height: 1px; background: currentColor; }
.date { font-family: var(--serif); font-size: clamp(1.1rem, 3vw, 1.45rem); }
.recipient { margin: 1.35rem 0 .85rem; }
.recipient p { font-size: .82rem; }
.recipient strong { color: var(--sage-dark); }
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .5rem 1.2rem;
  border-radius: 30px;
  border: 1px solid var(--sage);
  background: var(--sage);
  color: white;
  text-decoration: none;
  font-size: .88rem;
}
.primary:hover { background: var(--sage-dark); }
.primary:disabled { opacity: .6; cursor: default; }
.invitation-status { max-width: 27rem; margin-top: .75rem; font-size: .88rem; }
.invitation-status:empty { display: none; }
.secondary { background: transparent; color: var(--sage-dark); }
.secondary:hover { background: var(--sage-wash); }

.sticky-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(.7rem, 3vw, 2.5rem);
  row-gap: .25rem;
  position: sticky;
  z-index: 5;
  top: 0;
  padding: .55rem .55rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.sticky-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--sage-dark);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: clamp(.65rem, 1.3vw, .78rem);
  font-weight: 600;
}
.sticky-nav a:hover { text-decoration: underline; }
.section { padding: clamp(2.5rem, 5vw, 4.8rem) clamp(1rem, 5vw, 3rem); scroll-margin-top: 6rem; }
.section-content { max-width: 1040px; margin: auto; text-align: center; }
.narrow { max-width: 590px; }
.intro { padding: 0; position: relative; background: var(--sage-dark); overflow: hidden; }
.intro .hero-photo { height: clamp(310px, 53vw, 600px); }
.intro::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #120d07c9 0%, #120d0766 34%, transparent 70%); }
.intro-title { position: absolute; z-index: 1; left: 6%; bottom: 17%; color: #fff7e8; }
.intro-title h2 { margin: .3rem 0; }
.intro-title h2 em { color: #efd5a4; }
.welcome-note { padding: 2.5rem 1rem 0; text-align: center; font: italic 1.35rem/1.45 var(--serif); }
.wedding-verse { margin: 1.25rem auto 0; max-width: 36rem; }
.wedding-verse blockquote {
  margin: 0;
  font: italic clamp(1.05rem, 2.5vw, 1.25rem)/1.65 var(--serif);
  text-wrap: pretty;
}
.wedding-verse figcaption {
  margin-top: .65rem;
  color: #806032;
  font: 600 .75rem/1.5 var(--sans);
  letter-spacing: .14em;
}
.section-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.65rem, 3vw, 1.4rem);
  margin-bottom: 1.75rem;
  color: var(--sage);
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  font-style: italic;
  white-space: nowrap;
}
.section-title::before, .section-title::after { content: ''; width: min(10vw, 6rem); height: 1px; background: var(--gold); }
.section-note { max-width: 39rem; margin: -.7rem auto 1.15rem; }
.couple-grid, .event-grid, .gift-grid {
  display: grid;
  gap: clamp(.9rem, 3vw, 1.75rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 800px;
  margin: auto;
}
.person, .event-card, .gift-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  padding: 1.25rem;
}
.person { padding: .65rem .65rem 1.25rem; }
.person img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 34%; border-radius: .7rem; }
.person-name { margin: .85rem 0 .3rem; color: var(--sage); font: italic 1.95rem/1 var(--serif); }
.person h3 { font-size: clamp(1.18rem, 2.6vw, 1.6rem); margin-bottom: .55rem; }
.person h3 + p { font-size: .84rem; }
.event-card:only-child { grid-column: 1/-1; width: min(100%, 25rem); justify-self: center; }
.event-card h3 { color: var(--sage); font-style: italic; }
.event-card p { margin: .7rem 0 1rem; }
.event-card a { margin-top: .2rem; }
#events, #gift { background: #f4ecdf; }
.bank { color: #214b70; font-size: 1.3rem; }
.account { font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; }
.gift-card .secondary { margin-top: .65rem; }
.status { min-height: 1.6em; margin-top: .45rem; }
.gallery-count { font-size: .83rem; color: var(--sage-dark); margin-bottom: 1.4rem; }
.gallery-grid { columns: 3; column-gap: .9rem; }
.gallery-item { break-inside: avoid; margin-bottom: .9rem; }
.gallery-open { display: block; width: 100%; padding: 0; border: 0; border-radius: .85rem; overflow: hidden; background: var(--sage-wash); cursor: zoom-in; }
.gallery-open img { width: 100%; height: auto; }
.gallery-item figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gallery-dialog {
  width: min(97vw, 1000px);
  height: min(91dvh, 850px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--paper);
}
.gallery-dialog::backdrop { background: #171910e8; }
.gallery-dialog-inner { position: relative; height: 100%; display: flex; flex-direction: column; }
.gallery-image-area { position: relative; display: grid; place-items: center; flex: 1; min-height: 0; padding: 3rem .6rem .6rem; }
.gallery-image-area img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-close, .gallery-arrow {
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--sage-dark);
  font-size: 1.65rem;
  line-height: 1;
}
.gallery-close { top: 4px; right: 9px; }
.gallery-arrow { top: 50%; transform: translateY(-50%); }
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-detail { display: flex; justify-content: space-between; padding: .65rem 1rem; color: var(--sage-dark); }
footer { background: var(--sage-dark); color: var(--paper); text-align: center; padding: 2.75rem 1rem; }
.thanks { font: italic 2.8rem/1.2 var(--serif); }

@media (max-width: 760px) {
  .cover { grid-template-columns: 1fr; }
  .cover .hero-photo { height: clamp(245px, 65vw, 450px); }
  .cover-body { padding-block: 2.9rem; }
  .intro .hero-photo { height: clamp(300px, 65vw, 470px); }
  .intro::after { background: linear-gradient(0deg, #120d07de 0%, #120d0722 65%, transparent 90%); }
  .intro-title { left: 5%; bottom: 7%; }
  .gallery-grid { columns: 2; }
}
@media (max-width: 520px) {
  .preview-bar label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .preview-bar select { max-width: 60vw; }
  .sticky-nav { column-gap: .6rem; }
  .event-grid, .gift-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-grid { columns: 1; max-width: 420px; margin: auto; }
  .gallery-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.botanical {
  position: absolute;
  top: 0;
  left: .75rem;
  width: 5.5rem;
  height: 5.5rem;
  color: #7c8a5d;
  pointer-events: none;
}
.botanical::before {
  content: '';
  position: absolute;
  top: .8rem;
  left: 2.05rem;
  height: 4rem;
  width: 1px;
  background: #8b916c;
  transform: rotate(-42deg);
}
.botanical i {
  position: absolute;
  width: 1.6rem;
  height: .72rem;
  border-radius: 95% 0 95% 0;
  background: linear-gradient(150deg, #a9ac81, #78875b);
}
.botanical i:nth-child(1) { top: 1rem; left: .2rem; rotate: 32deg; }
.botanical i:nth-child(2) { top: 1.4rem; left: 1.35rem; rotate: -48deg; }
.botanical i:nth-child(3) { top: 2.6rem; left: 1rem; rotate: 38deg; }
.botanical i:nth-child(4) { top: 2.6rem; left: 2.3rem; rotate: -42deg; }
.botanical b { position: absolute; top: 3.05rem; left: 2.6rem; color: #a2793b; font-size: 1.35rem; }
.cover-body .botanical { left: 1.1rem; top: .4rem; }
.invitation-paper {
  --frame-inset: clamp(.4rem, 1.7vw, 1.5rem);
  position: relative;
  overflow: clip;
  padding-inline: clamp(.9rem, 4vw, 3.75rem);
  background: linear-gradient(90deg, #f4ebdb, var(--ivory) 8% 92%, #f4ebdb);
}
.invitation-paper > .section { padding-inline: clamp(.65rem, 3vw, 2.5rem); }
.side-frame {
  position: absolute;
  z-index: 1;
  inset: .65rem var(--frame-inset);
  border-inline: 3px double #a886564d;
  border-radius: .65rem;
  pointer-events: none;
}
.frame-sprig { opacity: .65; scale: var(--sprig-x, .82) var(--sprig-y, .82); }
.frame-left { left: -.1rem; transform-origin: top left; }
.frame-right { --sprig-x: -.82; left: auto; right: -.1rem; transform-origin: top center; }
.frame-top { top: -.15rem; }
.frame-bottom { top: auto; bottom: -.25rem; --sprig-y: -.82; transform-origin: center; }
@media (max-width: 720px) {
  .cover-body .botanical { scale: .7; transform-origin: top left; }
  .side-frame { border-inline-width: 1px; border-inline-style: solid; }
  .frame-sprig { --sprig-x: .36; --sprig-y: .36; opacity: .55; transform-origin: center; }
  .frame-left { left: -1.65rem; }
  .frame-right { --sprig-x: -.36; right: -1.65rem; }
  .frame-top { top: -1.45rem; }
  .frame-bottom { --sprig-y: -.36; bottom: -1.45rem; }
}

#rsvpForms { display: grid; gap: .9rem; text-align: left; }
.rsvp-form { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(.8rem, 4vw, 1.35rem); }
.rsvp-form h3 { color: var(--sage-dark); font-size: 1.45rem; }
.rsvp-form p { margin: .35rem 0; font-size: .88rem; }
.rsvp-form p:empty { display: none; }
.rsvp-saved { font-weight: 650; color: var(--sage-dark); }
.rsvp-form fieldset { border: 0; margin: .75rem 0 0; padding: 0; min-width: 0; }
.rsvp-form legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.rsvp-form label { display: block; font-size: .9rem; margin-bottom: .65rem; }
.rsvp-form select, .rsvp-form input { display: block; min-height: 44px; margin-top: .25rem; padding: .35rem .55rem; width: 100%; border: 1px solid var(--line); border-radius: .35rem; background: white; color: var(--ink); font: inherit; }
.rsvp-form input { max-width: 7rem; }

.countdown {
  position: fixed;
  z-index: 6;
  inset-inline-end: max(.65rem, env(safe-area-inset-right));
  inset-block-end: max(.65rem, env(safe-area-inset-bottom));
  color: var(--sage-dark);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: 0 .2rem .85rem #29281724;
  max-width: calc(100vw - 1.3rem);
}
.countdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .42rem;
  width: 100%;
  min-height: 44px;
  padding: .4rem .62rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: 650 .79rem/1.25 var(--sans);
  text-align: left;
}
.countdown-icon { font-size: 1.1rem; }
.countdown-chevron {
  width: .46rem;
  height: .46rem;
  margin: 0 .17rem .2rem .27rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.countdown-toggle[aria-expanded="false"] .countdown-chevron { transform: rotate(225deg); margin-bottom: -.18rem; }
.countdown-panel { padding: 0 .55rem .45rem; }
.countdown-timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(2rem, 1fr));
  gap: .25rem;
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: .34rem;
}
.countdown-timer span { display: grid; }
.countdown-timer strong { font-size: .97rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown-timer small { font-size: .65rem; }
#invitation:has(.countdown:not([hidden])) footer { padding-bottom: max(6.3rem, calc(env(safe-area-inset-bottom) + 5.6rem)); }
@media (max-width: 520px) {
  #invitation:has(.rsvp-form :is(select, input):focus) .countdown { visibility: hidden; }
}
