/* ── Theme tokens ─────────────────────────────────────────── */
:root,
.theme-green {
  --paper: #ffffff;
  --ink: #1f3a2e;          /* deep garden green */
  --accent: #5f8a6b;       /* sage */
  --soft: #e9f0ea;         /* pale leaf */
  --muted: #5d6c63;
  --line: #d8e3da;
}
.theme-hydrangea {
  --ink: #22325a;          /* deep navy-blue */
  --accent: #6f8fcb;       /* hydrangea blue */
  --soft: #e9eef8;         /* pale petal */
  --muted: #5d6680;
  --line: #d9e0ef;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* soft bloom of colour behind the top of the page */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -20vw auto;
  height: 70vh;
  background:
    radial-gradient(40% 55% at 18% 30%, var(--soft), transparent 70%),
    radial-gradient(35% 50% at 85% 10%, var(--soft), transparent 70%);
  opacity: .9;
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2 { margin: 0; font-weight: 400; }

.invite {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 1.5rem 4rem;
  text-align: center;
}

/* ── Hero ─────────────────────────────────────────────────── */
.salutation {
  font-family: "Bodoni Moda", Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  margin: 0;
}
.greeting {
  max-width: 28rem;
  margin: .75rem auto 0;
  color: var(--muted);
}
.rule {
  display: block;
  width: 3.5rem;
  height: 1px;
  margin: 2.5rem auto;
  background: var(--accent);
  transform-origin: center;
}
.intro {
  max-width: 24rem;
  margin: 0 auto 1.75rem;
  font-size: .95rem;
  letter-spacing: .02em;
  color: var(--muted);
}
.names {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(3.25rem, 15vw, 5.5rem);
  line-height: .95;
  letter-spacing: -.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.names .amp {
  font-style: italic;
  font-size: .5em;
  color: var(--accent);
  margin: .35em 0 .25em;
}
.date {
  margin: 2rem 0 0;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: .04em;
}
.countdown {
  margin: .25rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}

/* ── Details ──────────────────────────────────────────────── */
.details {
  margin-top: 4.5rem;
  display: grid;
  gap: 2.5rem;
}
.detail h2, .gifts h2 {
  font-family: "Bodoni Moda", Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: .4rem;
}
.detail p, .gifts p { margin: 0; }
.detail > p:first-of-type { font-weight: 400; }
.detail .sub { color: var(--muted); font-size: .98rem; }
.detail .links {
  margin-top: .6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  font-size: .9rem;
}

.gifts {
  margin: 4rem auto 0;
  padding: 2rem 1.5rem;
  max-width: 30rem;
  background: var(--soft);
  border-radius: 1.25rem;
}
.gifts p { color: var(--ink); }

/* ── RSVP ─────────────────────────────────────────────────── */
.rsvp {
  margin-top: 4.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--line);
}
.rsvp-title {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(2rem, 8vw, 2.6rem);
  line-height: 1.1;
}
.rsvp-note { margin: .75rem 0 2rem; color: var(--muted); }

.rsvp-stage {
  position: relative;
  min-height: 8.5rem;
  display: grid;
  place-items: center;
}
.rsvp-stage > * { grid-area: 1 / 1; }
[hidden] { display: none !important; }
.rsvp[data-state="yes"] .deadline, .rsvp[data-state="no"] .deadline { display: none; }

.btn {
  font: inherit;
  font-weight: 400;
  letter-spacing: .06em;
  border-radius: 999px;
  border: 1px solid var(--ink);
  padding: 1rem 2.25rem;
  min-height: 3.25rem;
  cursor: pointer;
  transition: transform .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--soft); }

.rsvp-open {
  font-size: 1.15rem;
  letter-spacing: .3em;
  padding: 1.15rem 3.5rem 1.15rem calc(3.5rem + .3em);
  position: relative;
}
/* a slow, gentle halo so the button invites a tap */
.rsvp-open::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--accent);
  animation: halo 2.8s ease-out infinite;
}
@keyframes halo {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* button → splits into two choices */
.rsvp-open.is-leaving { animation: shrink .35s ease forwards; }
@keyframes shrink { to { transform: scale(.6); opacity: 0; letter-spacing: 0; } }

.rsvp-choice {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: min(100%, 20rem);
}
.rsvp-choice .btn { width: 100%; }
.rsvp-choice.is-entering .btn { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.rsvp-choice.is-entering .btn:nth-child(2) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

.btn.is-loading { pointer-events: none; color: transparent; position: relative; }
.btn.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.2rem; height: 1.2rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-color: var(--paper) var(--paper) var(--paper) transparent;
  animation: spin .8s linear infinite;
}
.btn-ghost.is-loading::before { border-color: var(--ink) var(--ink) var(--ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.rsvp-choice.is-picked .btn:not(.is-loading) { opacity: .25; transition: opacity .3s; }

/* the confirmed answer */
.rsvp-done { max-width: 24rem; }
.rsvp-done.is-entering { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.seal { width: 4.25rem; height: 4.25rem; margin: 0 auto 1rem; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 151; stroke-dashoffset: 151; }
.seal-mark { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.rsvp-done.is-entering .seal-ring { animation: draw .8s .1s ease forwards; }
.rsvp-done.is-entering .seal-mark { animation: draw .45s .75s ease forwards; }
.rsvp-done:not(.is-entering) .seal-ring,
.rsvp-done:not(.is-entering) .seal-mark { stroke-dashoffset: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.done-title {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0;
}
.done-sub { margin: .5rem 0 1.25rem; color: var(--muted); }
.link-btn {
  font: inherit;
  font-size: .9rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: .5rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: .25em;
}
.link-btn:hover { color: var(--ink); text-decoration-color: var(--accent); }

.rsvp-error { margin: 1rem 0 0; color: #a3412f; font-size: .95rem; }

/* ── Footer ───────────────────────────────────────────────── */
.foot { margin-top: 5rem; }
.closing {
  font-family: "Bodoni Moda", Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  margin: 0;
}
.monogram {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 2.25rem;
  margin: 2rem 0 .5rem;
  letter-spacing: .05em;
}
.monogram span { font-style: italic; font-size: .55em; color: var(--accent); margin: 0 .2em; vertical-align: .25em; }
.contact { font-size: .9rem; color: var(--muted); margin: 0; }

/* ── Petal canvas ─────────────────────────────────────────── */
.petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* ── One page-load sequence ──────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 1s cubic-bezier(.2,.8,.2,1) both; }
  .hero .salutation { animation-delay: .1s; }
  .hero .greeting   { animation-delay: .25s; }
  .hero .rule       { animation: grow 1.1s .45s cubic-bezier(.6,0,.2,1) both; }
  .hero .intro      { animation-delay: .7s; }
  .hero .names      { animation-delay: .85s; }
  .hero .date       { animation-delay: 1.05s; }
  .hero .countdown  { animation-delay: 1.15s; }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .seal-ring, .seal-mark { stroke-dashoffset: 0 !important; }
}

/* ── Simple pages (not found, login, admin) ──────────────── */
.plain { max-width: 30rem; margin: 0 auto; padding: 18vh 1.5rem 4rem; text-align: center; }
.plain h1 { font-family: "Bodoni Moda", Georgia, serif; font-size: 2.4rem; line-height: 1.15; }
.plain p { color: var(--muted); }
.field {
  font: inherit; width: 100%; padding: .9rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-align: center;
  margin: 1.5rem 0 1rem;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
