:root {
  --velvet: #5A0B1A;
  --velvet-deep: #2F040C;
  --rose: #8C1326;
  --rose-dark: #6E0D1D;
  --white-gold: #DCCDA8;
  --gold-ink: #8A7243;
  --gold-line: #D9CBA9;
  --leaf: #24392B;
  --leaf-soft: #9DB59C;
  --paper: #FFFFFF;
  --blush: #F8F1F0;
  --ink: #2A1418;
  --ink-soft: #6B5559;

  --display: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --body: "Jost", "Segoe UI", system-ui, sans-serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 .75rem;
  color: var(--velvet);
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--ink-soft); }
.lede { margin: 0 0 1.75rem; color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white-gold);
  text-align: center;
  background:
    radial-gradient(120% 70% at 50% 18%, #7C1427 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, var(--velvet-deep) 0%, transparent 70%),
    var(--velvet);
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 1.5rem 6.5rem;
  overflow: hidden;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1;
  color: var(--white-gold); opacity: .8; font-size: .85rem; text-decoration: none; letter-spacing: .04em;
}
.scroll-cue::after { content: ""; display: block; width: 1px; height: 2rem; margin: .5rem auto 0; background: var(--white-gold); opacity: .6; }
.hero::after {
  /* the soft sheen of velvet */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.05) 48%, transparent 66%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 52rem; margin: 0 auto; }

.rose {
  display: block;
  width: auto;
  height: clamp(190px, 30vh, 280px);
  margin: 0 auto 1.75rem;
  animation: bloom-in 2.4s ease-out both;
}
@keyframes bloom-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-kicker {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  margin: 0 0 .5rem;
  color: var(--white-gold);
  opacity: .9;
}
.name {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.9rem, 12vw, 5rem);
  line-height: 1;
  letter-spacing: .005em;
  margin: 0;
  color: #FFF9EE;
}
.name span { display: block; }
.name span + span { margin-top: .15em; }
.life-dates {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--white-gold);
}
.hero-when {
  margin: 2.25rem auto 0;
  padding-top: 1.75rem;
  max-width: 22rem;
  border-top: 1px solid rgba(220, 205, 168, .35);
}
.hero-when p { margin: 0; font-size: 1.05rem; letter-spacing: .02em; color: #F3E9D6; }
.hero-when p + p { color: var(--white-gold); }

.hero-actions {
  margin-top: 2.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 400 1rem/1.2 var(--body);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }
.hero .btn:focus-visible { outline-color: var(--white-gold); }

.btn-light { background: var(--white-gold); color: var(--velvet-deep); }
.btn-light:hover { background: #EDE1C4; }
.btn-ghost-light { color: var(--white-gold); border-color: rgba(220, 205, 168, .55); background: transparent; }
.btn-ghost-light:hover { background: rgba(220, 205, 168, .12); }

.btn-primary { background: var(--rose); color: #FFF9EE; }
.btn-primary:hover { background: var(--rose-dark); }
.btn-outline { background: transparent; color: var(--velvet); border-color: var(--gold-line); }
.btn-outline:hover { border-color: var(--gold-ink); background: #FCF8EF; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }

.row-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Sections ---------- */
.story, .details, .rsvp, .watch, .book { padding: clamp(3.5rem, 9vw, 5.5rem) 0; }

.story { text-align: left; }
.story h2 { text-align: center; }
.story h2::after, .details h2::after {
  content: "";
  display: block;
  width: 3rem; height: 1px;
  margin: 1rem auto 0;
  background: var(--gold-line);
}
.story-text p {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.7;
  margin: 0 0 1.1em;
}
.story-text p:first-child { margin-top: 2rem; }
.portrait {
  margin: 0 auto 2.5rem;
  width: min(15rem, 70%);
  padding: .5rem;
  border: 1px solid var(--gold-line);
}
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.details { background: var(--paper); border-top: 1px solid #F0E8DF; text-align: center; }
.detail-list {
  margin: 2.5rem 0 2.25rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.detail-list dt { font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--gold-ink); }
.detail-list dd { margin: .3rem 0 0; font-size: 1.05rem; }
.details .row-actions { justify-content: center; }

/* ---------- RSVP (on velvet) ---------- */
.rsvp {
  background:
    radial-gradient(120% 70% at 50% 0%, #7C1427 0%, transparent 60%),
    var(--velvet);
  color: var(--white-gold);
}
.card { max-width: 30rem; margin: 0 auto; text-align: center; }
.rsvp h2 { color: #FFF9EE; font-size: clamp(2.3rem, 6vw, 2.9rem); }
.rsvp .lede { color: var(--white-gold); }
.rsvp .field label { color: #F3E9D6; }
.rsvp .field input[type="text"], .rsvp .stepper input { background: #FFFDFB; border-color: transparent; }
.rsvp .step { background: transparent; color: var(--white-gold); border-color: rgba(220, 205, 168, .55); }
.rsvp .step:hover { background: rgba(220, 205, 168, .12); }
.rsvp .field-error, .rsvp .form-error { color: #FFD2CF; }
.rsvp .field input[aria-invalid="true"] { border-color: #FFD2CF; box-shadow: 0 0 0 1px #FFD2CF; }
.rsvp .btn:focus-visible, .rsvp input:focus-visible, .rsvp .step:focus-visible { outline-color: var(--white-gold); }
.rsvp .spinner { border-color: rgba(47, 4, 12, .25); border-top-color: var(--velvet-deep); }
.rsvp .thanks-rose { stroke: var(--white-gold); }
.rsvp .thanks-title { color: #FFF9EE; }
.rsvp .thanks-summary { color: var(--white-gold); }
.rsvp .btn-outline { color: var(--white-gold); border-color: rgba(220, 205, 168, .55); }
.rsvp .btn-outline:hover { background: rgba(220, 205, 168, .12); }
.card form { text-align: left; }
.field { margin-bottom: 1.5rem; }
.field label { display: block; margin-bottom: .45rem; font-weight: 400; }
.field input[type="text"], .stepper input {
  width: 100%;
  min-height: 3.1rem;
  padding: .7rem .9rem;
  border: 1px solid #D8CCC4;
  border-radius: var(--radius);
  font: 400 1.05rem var(--body);
  color: var(--ink);
  background: #FFFDFB;
}
.field input:focus { border-color: var(--leaf); }
.field input[aria-invalid="true"] { border-color: var(--rose); }
.field-error, .form-error { color: var(--rose); font-size: .95rem; margin: .45rem 0 0; }
.form-error { text-align: center; margin-top: 1rem; }

.stepper { display: grid; grid-template-columns: 3.1rem 1fr 3.1rem; gap: .5rem; }
.stepper input { text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  border: 1px solid var(--gold-line); background: var(--paper); color: var(--velvet);
  border-radius: var(--radius); font-size: 1.4rem; cursor: pointer;
}
.step:hover { background: #FCF8EF; }
.step:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.spinner {
  display: none;
  width: 1.05rem; height: 1.05rem;
  border: 2px solid rgba(255, 249, 238, .35);
  border-top-color: #FFF9EE;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.thanks { outline: none; animation: rise .5s ease-out; }
.thanks-rose {
  width: 84px; margin: 0 auto .75rem;
  fill: none; stroke: var(--rose); stroke-width: 3; stroke-linecap: round;
}
.thanks-title { font-family: var(--display); font-size: 2rem; color: var(--velvet); margin: 0; line-height: 1.2; }
.thanks-summary { margin: .5rem 0 1.75rem; color: var(--ink-soft); }
.thanks .row-actions { justify-content: center; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Watch ---------- */
.watch { text-align: center; }
.link-box {
  display: flex; gap: .5rem;
  max-width: 34rem; margin: 0 auto;
  padding: .4rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: #FFFDFB;
}
.link-box input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  padding: 0 .6rem;
  font: 400 1rem var(--body); color: var(--ink);
}
.soon {
  display: inline-block;
  margin: 0;
  padding: .85rem 1.75rem;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--velvet);
  background: #FFFDFB;
}
.copied { min-height: 1.6rem; margin: .6rem 0 .9rem; color: var(--leaf); font-size: .95rem; }
.watch .row-actions { justify-content: center; }

/* ---------- Book ---------- */
.book {
  background:
    radial-gradient(80% 90% at 20% 0%, #2F4A37 0%, transparent 70%),
    var(--leaf);
  color: #EAE3D2;
}
.book h2 { color: #FFF9EE; }
.book .lede { color: #CFC8B6; }
.book .muted { color: #CFC8B6; }
.book-wrap { display: grid; grid-template-columns: 11rem 1fr; gap: clamp(1.75rem, 5vw, 3rem); align-items: center; max-width: 46rem; }
.book-cover {
  aspect-ratio: 3 / 4;
  background: var(--velvet);
  border: 1px solid rgba(220, 205, 168, .5);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .55), inset 6px 0 0 rgba(0,0,0,.18);
  display: grid; place-items: center;
  overflow: hidden;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-plain { display: grid; justify-items: center; gap: .5rem; color: var(--white-gold); }
.book-cover-plain svg { width: 4.25rem; height: auto; }
.book-cover-plain span { font-family: var(--display); font-style: italic; font-size: 1.6rem; }
.book .btn-primary { background: var(--white-gold); color: var(--velvet-deep); }
.book .btn-primary:hover { background: #EDE1C4; }
.book .btn-outline { color: #F3E9D6; border-color: rgba(220, 205, 168, .55); }
.book .btn-outline:hover { background: rgba(220, 205, 168, .1); }
.book .btn:focus-visible { outline-color: var(--white-gold); }

/* ---------- Footer ---------- */
.footer {
  background: var(--velvet-deep);
  color: var(--white-gold);
  text-align: center;
  padding: 2.25rem 1.25rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
}
.footer p { margin: 0; }

/* ---------- Bottom bar ---------- */
body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(47, 4, 12, .96);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid rgba(220, 205, 168, .3);
  padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom));
}
.dock a {
  display: grid; justify-items: center; gap: .15rem;
  padding: .35rem 0; border-radius: 4px;
  color: var(--white-gold); text-decoration: none; font-size: .82rem; letter-spacing: .02em;
  opacity: .75; transition: opacity .2s;
}
.dock a[aria-current="true"] { opacity: 1; color: #FFF9EE; }
.dock a:focus-visible { outline: 2px solid var(--white-gold); outline-offset: -2px; }
.dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[id] { scroll-margin-bottom: 5rem; }

@media (min-width: 900px) {
  .dock {
    left: 50%; right: auto; transform: translateX(-50%); bottom: 1rem;
    width: 30rem; border: 1px solid rgba(220, 205, 168, .3); border-radius: 8px;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .detail-list { grid-template-columns: 1fr; gap: 1.1rem; }
  .book-wrap { grid-template-columns: 1fr; text-align: center; }
  .book-cover { width: 10rem; margin: 0 auto; }
  .book .row-actions { justify-content: center; }
  .row-actions .btn { flex: 1 1 100%; }
  .link-box { flex-direction: column; }
  .link-box input { min-height: 2.6rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rose { animation: none; }
  .thanks, .spinner { animation: none; }
}
