:root {
  color-scheme: light;
  --wine: #64172d;
  --deep-wine: #451020;
  --ink: #381e21;
  --muted: #67494a;
  --gold: #987039;
  --gold-line: #c8a572;
  --gold-light: #e4c79b;
  --paper: #fbf7ef;
  --cream: #f4e9d7;
  --serif: Baskerville, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, sans-serif;
  --script: "Snell Roundhand", "Segoe Script", "URW Chancery L", var(--serif);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.55 var(--serif); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 4;
  top: .5rem;
  left: .5rem;
  padding: .5rem 1rem;
  background: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.masthead {
  background: var(--deep-wine);
  color: var(--paper);
  border-bottom: 1px solid var(--gold-line);
}
.masthead-inner {
  max-width: 82rem;
  min-height: 4.55rem;
  padding: .65rem clamp(1.15rem, 4vw, 3.75rem);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.monogram {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: .17em;
  text-decoration: none;
  color: var(--gold-light);
  font-size: 1.8rem;
  line-height: 1;
  white-space: nowrap;
}
.monogram span { font-style: italic; font-size: .65em; }
nav { display: flex; align-items: center; gap: clamp(.75rem, 3.5vw, 2.75rem); }
nav a { text-decoration: none; font: 500 .875rem/1.2 var(--sans); }
nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
nav .nav-rsvp {
  padding: .64rem 1rem;
  border: 1px solid #cb9d68;
  color: #fff4de;
}
nav .nav-rsvp:hover { background: rgba(255, 245, 220, .1); text-decoration: none; }

.hero {
  background: radial-gradient(ellipse at 40% 42%, #fffdf7 8%, var(--paper) 57%, #f2e3cd 120%);
  padding: clamp(.7rem, 2.5vw, 2rem);
}
.hero-frame {
  --frame-inset: .375rem;
  position: relative;
  isolation: isolate;
  max-width: 81rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  align-items: center;
  min-height: min(41.5rem, 90vw);
  padding: clamp(2rem, 5.2vw, 4.8rem) clamp(1.8rem, 6vw, 5.4rem);
  gap: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--gold);
}
.hero-frame::after {
  content: "";
  z-index: -2;
  position: absolute;
  inset: var(--frame-inset);
  border: 1px solid #dfc59a;
  pointer-events: none;
}
.hero-frame::before {
  content: "";
  z-index: -1;
  position: absolute;
  width: clamp(5.4rem, 16vw, 12rem);
  aspect-ratio: 1.06;
  top: 0;
  left: 0;
  background: url("./assets/invitation.webp") 0 0 / 272% auto no-repeat;
  mask-image: linear-gradient(135deg, #000 35%, transparent 70%);
  pointer-events: none;
}
.hero-copy { position: relative; text-align: center; }
.rings {
  position: relative;
  display: block;
  width: 3rem;
  height: 2.15rem;
  margin: 0 auto .6rem;
}
.rings::before, .rings::after {
  content: "";
  position: absolute;
  top: .16rem;
  width: 1.48rem;
  height: 1.82rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.rings::before { left: .28rem; transform: rotate(-31deg); }
.rings::after { right: .28rem; transform: rotate(31deg); }
.eyebrow {
  font: 600 .875rem/1.45 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--wine); }
h1 {
  color: var(--wine);
  font: italic clamp(3.2rem, 6.6vw, 7.3rem)/1.12 var(--script);
  letter-spacing: -.045em;
  margin: .05em -.12em .1em;
}
h1 span { font: italic .48em var(--serif); letter-spacing: 0; }
.divider {
  width: min(80%, 16.5rem);
  margin: .85rem auto 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: var(--gold-line);
}
.divider::before, .divider::after { content: ""; height: 1px; background: currentColor; flex: 1; }
.divider i { width: .35rem; height: .35rem; background: currentColor; transform: rotate(45deg); }
.couple {
  color: var(--wine);
  font: 600 clamp(1.85rem, 4vw, 3.85rem)/1.03 var(--serif);
  letter-spacing: -.035em;
}
.couple em { color: var(--gold); font-weight: 400; }
.surname {
  padding-top: .38rem;
  font: 600 .875rem/1.4 var(--sans);
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: .31em;
  text-indent: .31em;
}
.occasion { margin: 1.05rem 0 1.12rem; font-size: clamp(1.125rem, 1.8vw, 1.38rem); }
.hero-date { font-size: clamp(1.16rem, 1.8vw, 1.42rem); font-weight: 700; color: var(--wine); }
.city { color: var(--muted); }
.hero-actions { margin-top: 1.45rem; display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; align-items: center; justify-content: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .83rem 1.32rem;
  min-height: 2.85rem;
  border: 1px solid var(--wine);
  background: var(--wine);
  color: #fffaf2;
  font: 600 .9rem/1.25 var(--sans);
  text-decoration: none;
}
.button:hover { background: #7b2440; border-color: #7b2440; }
.text-link {
  display: inline-block;
  width: fit-content;
  border: 0;
  padding: .45rem 0;
  color: var(--wine);
  background: transparent;
  font: 600 .875rem/1.25 var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: .28em;
}
.text-link:hover { text-decoration-color: currentColor; }

.portrait {
  --rim: clamp(.28rem, .75vw, .55rem);
  width: min(100%, 24.1rem);
  margin-inline: auto;
  background: #f9f0e2;
  padding: var(--rim);
  border: 1px solid var(--gold);
  border-radius: 50% 50% 3px 3px / 53% 53% 3px 3px;
  box-shadow: 0 1.35rem 2.7rem -1.5rem #53283070;
}
.portrait-window {
  position: relative;
  overflow: hidden;
  aspect-ratio: 520 / 755;
  border: 1px solid #bf9c6a;
  border-radius: inherit;
  background: #f7f0e6;
}
.portrait-window img {
  position: absolute;
  max-width: none;
  width: 166.54%;
  height: auto;
  top: -22.14%;
  left: 0;
}

.section-inner { width: min(calc(100% - 3rem), 69rem); margin-inline: auto; }
.celebration {
  padding: clamp(2.8rem, 6.2vw, 5rem) 0 clamp(2.8rem, 6.8vw, 5.2rem);
  background:
    radial-gradient(ellipse at 50% -15%, #731d37 0%, transparent 76%),
    var(--deep-wine);
  color: var(--paper);
}
.section-heading { text-align: center; }
.celebration .eyebrow { color: var(--gold-light); }
h2 {
  font: 400 clamp(2.35rem, 5vw, 4.3rem)/1.04 var(--serif);
  letter-spacing: -.045em;
}
.section-heading h2 { margin-top: .35rem; }
.celebration .divider { margin-block: 1.15rem 2.25rem; }
.venue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.95rem, 2.5vw, 1.6rem); }
.venue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.2rem, 3.5vw, 2rem);
  border: 1px solid #b78d5c;
  background: #280a172b;
}
.venue h3 { margin-top: .58rem; font: 400 clamp(1.6rem, 3.2vw, 2.45rem)/1.12 var(--serif); color: #fff7ea; }
.venue .mass { color: #ffe9c1; font-weight: 700; margin-top: .7rem; }
.venue address { color: #f2e4d8; font-style: normal; margin: .6rem 0 1rem; line-height: 1.42; }
.venue .text-link { color: #fff5e5; margin-top: auto; }

.attire {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
  padding: clamp(2.3rem, 5.6vw, 4.75rem) 0;
}
.attire .eyebrow, .response .eyebrow { color: #805821; margin-bottom: .3rem; }
.attire h2, .response h2 { color: var(--wine); }
.palette {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(6rem, 1fr));
  gap: clamp(.4rem, 2vw, 1.6rem);
  padding: 0;
  margin: 0;
  text-align: center;
  color: var(--wine);
}
.palette li { font-weight: 600; line-height: 1.2; }
.swatch {
  display: block;
  width: clamp(2.75rem, 6vw, 4.6rem);
  aspect-ratio: 1;
  margin: 0 auto .65rem;
  border: 1px solid #b59670;
  outline: 1px solid #d7bc93;
  outline-offset: 3px;
  border-radius: 50%;
}
.swatch.burgundy { background: #68172d; }
.swatch.champagne { background: #d9b67e; }
.swatch.ivory { background: #fffcf2; }

.response { padding: clamp(2.6rem, 6.2vw, 5rem) 0; border-top: 1px solid #dfc7a5; background: #f3e7d6; }
.response-inner { display: grid; grid-template-columns: .85fr 1fr; gap: clamp(1.5rem, 6vw, 4.7rem); align-items: start; }
.response h2 { margin-bottom: .65rem; }
.response-copy > p:not(.eyebrow) { font-size: 1.25rem; }
.call { color: var(--wine); margin-top: .65rem; }
.call a { text-decoration-color: var(--gold); text-underline-offset: .22em; }
blockquote {
  border-top: 1px solid #c5a677;
  padding-top: 1rem;
  margin-top: 1.55rem;
  color: var(--wine);
  font-size: clamp(1.26rem, 2.7vw, 1.8rem);
  font-style: italic;
}
.reply-card { padding: clamp(1.15rem, 3.35vw, 2rem); border: 1px solid #c3a371; background: #fffaf2; font: .9375rem/1.5 var(--sans); }
label, legend { font-weight: 600; }
input:not([type="radio"]), textarea {
  display: block;
  width: 100%;
  background: #fffdf9;
  border: 1px solid #aa937e;
  padding: .68rem .75rem;
  margin-top: .3rem;
  color: var(--ink);
  font-size: 1rem;
  border-radius: 0;
}
fieldset { border: 0; margin: 1rem 0; padding: 0; }
legend { padding: 0; }
.reply-options { display: flex; flex-wrap: wrap; gap: .2rem 1.05rem; margin-top: .3rem; }
.reply-options label { display: flex; align-items: center; gap: .45rem; min-height: 2rem; font-weight: 500; }
input[type="radio"] { margin: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--wine); }
#party-size { max-width: 7.5rem; }
.form-help { color: var(--muted); font-size: .875rem; margin: .75rem 0; }
.form-help:empty { display: none; }
.reply-preview h3 { color: var(--wine); margin-bottom: .65rem; font: 600 1.85rem/1.1 var(--serif); }
.reply-preview textarea { resize: vertical; }
.reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .75rem; }

footer {
  padding: 1.55rem 1rem 1.75rem;
  background: var(--deep-wine);
  color: #fff6e6;
  text-align: center;
}
.footer-monogram { color: var(--gold-light); font-size: 1.6rem; line-height: 1; margin-bottom: .35rem; }
footer p { color: #f3e1d0; }

dialog {
  width: min(37.5rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--gold);
}
dialog::backdrop { background: #290e19cc; }
.dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--gold-line);
  background: var(--paper);
}
.dialog-head h2 { font-size: 1.65rem; color: var(--wine); }
dialog img { width: 100%; height: auto; }

@media (max-width: 770px) {
  .hero-frame { grid-template-columns: 1fr; gap: 1.7rem; padding: 2rem 1rem 1.5rem; }
  h1 { font-size: clamp(3rem, 11vw, 5.5rem); }
  .couple { font-size: clamp(1.95rem, 7vw, 3.25rem); }
  .portrait { width: min(77%, 19.5rem); }
  .attire { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .palette { width: min(100%, 25rem); }
  .response-inner { grid-template-columns: 1fr; }
}

@media (max-width: 490px) {
  .masthead-inner { min-height: 3.95rem; padding-inline: .9rem; }
  .monogram { font-size: 1.5rem; }
  nav { gap: .65rem; }
  nav .nav-rsvp { padding: .56rem .65rem; }
  .hero-frame { --frame-inset: .25rem; }
  .hero-frame::before { width: 4.85rem; }
  .hero-actions { margin-top: 1.2rem; }
  .section-inner { width: calc(100% - 2rem); }
  .venue-grid { grid-template-columns: 1fr; }
  .palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.party-person {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .5rem .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid #dfc7a5;
}
.party-person label:first-child { flex: 1 1 12rem; }
.party-person input[type="number"] { max-width: 7rem; }
.party-person select {
  display: block;
  padding: .68rem .45rem;
  margin-top: .3rem;
  border: 1px solid #aa937e;
  background: #fffdf9;
  color: var(--ink);
  font: 1rem var(--sans);
}
.party-actions { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .5rem; }
.party-actions button:disabled { opacity: .55; cursor: default; }
.admin .party-person select { width: auto; }
