/* Dhaaraa e-vite guest page. Mobile-first (360 px), warm paper, ink and gold — matches the app. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #FBF7F0;
  --surface: #FFFDF9;
  --sunk: #F4ECDF;
  --ink: #1E1A16;
  --ink-2: #5A4F45;
  --gold: #B8862F;
  --gold-text: #7A5318;
  --gold-wash: #F5E8CF;
  --line: #E6DACA;
  --field: #CDBFAE;
  --env: #EFE3CF;
  --seal: #C9973F;
  --radius: 14px;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-text); text-underline-offset: .2em; }
p { margin: .5rem 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.ev-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ev-muted { color: var(--ink-2); }

.ev { max-width: 32rem; margin: 0 auto; padding: 0 1.25rem 1rem; }

/* ── preview banner ─────────────────────────────────────────── */
.ev-preview {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -1.25rem; padding: .6rem 1.25rem;
  background: var(--ink); color: var(--gold-wash);
  font-size: .875rem; text-align: center;
}

/* ── cover ──────────────────────────────────────────────────── */
.ev-cover { padding-top: 2.5rem; text-align: center; }
.ev-kicker {
  margin: 0; color: var(--gold-text);
  font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
}
.ev-names {
  margin: .5rem 0 .35rem;
  font: 500 clamp(2.4rem, 11vw, 3.6rem)/1.05 var(--serif);
  letter-spacing: -.01em;
}
.ev-cover__line { margin: .2rem 0; color: var(--ink-2); font: italic 1.2rem/1.35 var(--serif); }
.ev-cover__when { margin: 1rem 0 0; font: 500 1.2rem/1.4 var(--serif); }
.ev-cover__message { margin: .75rem auto 0; max-width: 24rem; color: var(--ink-2); font: italic 1.15rem/1.45 var(--serif); }

/* Envelope. Without JS it is simply the cover card. */
.ev-envelope {
  position: relative;
  width: min(100%, 21rem);
  margin: 1.75rem auto 1.25rem;
  aspect-ratio: 750 / 1050;
  perspective: 1400px;
}
.ev-envelope__card {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgb(30 26 22 / .16), 0 2px 6px rgb(30 26 22 / .08);
}
.ev-envelope__front, .ev-envelope__flap, .ev-envelope__seal { display: none; }

.ev-cover[data-sealed] .ev-envelope { cursor: pointer; }
.ev-cover[data-sealed] .ev-envelope__front {
  display: block; position: absolute; inset: 0; border-radius: 8px;
  background:
    linear-gradient(to top right, transparent calc(50% - .6px), rgb(122 83 24 / .22) 50%, transparent calc(50% + .6px)) left bottom / 50% 58% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .6px), rgb(122 83 24 / .22) 50%, transparent calc(50% + .6px)) right bottom / 50% 58% no-repeat,
    radial-gradient(120% 70% at 50% 100%, rgb(255 255 255 / .35), transparent 70%),
    var(--env);
  box-shadow: 0 18px 40px rgb(30 26 22 / .18), inset 0 0 0 1px rgb(122 83 24 / .18);
}
.ev-cover[data-sealed] .ev-envelope__flap {
  display: block; position: absolute; inset: 0 0 auto; height: 100%;
  clip-path: polygon(0 0, 100% 0, 50% 44%);
  background: linear-gradient(180deg, rgb(255 255 255 / .28), transparent 40%), #E3D3B8;
  background: linear-gradient(180deg, rgb(255 255 255 / .28), transparent 40%), color-mix(in srgb, var(--env) 86%, #7A5318);
  transform-origin: 50% 0;
  backface-visibility: hidden;
}
.ev-cover[data-sealed] .ev-envelope__seal {
  display: grid; place-items: center;
  position: absolute; left: 50%; top: 44%;
  width: 4.25rem; height: 4.25rem; margin: -2.125rem 0 0 -2.125rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3D79E, var(--seal) 55%, #8C6422);
  box-shadow: 0 6px 16px rgb(60 40 10 / .35), inset 0 0 0 2px rgb(255 240 210 / .45);
  color: #4A3410; font: 600 1.6rem/1 var(--serif);
}
.ev-envelope__seal img { width: 2.4rem; height: 2.4rem; object-fit: contain; }

.ev-cover[data-animating] .ev-envelope__seal { animation: seal-off .35s ease-in forwards; }
.ev-cover[data-animating] .ev-envelope__flap { animation: flap-open .7s .2s cubic-bezier(.3, .6, .25, 1) forwards; }
.ev-cover[data-animating] .ev-envelope__front { animation: front-away .65s .7s cubic-bezier(.45, 0, .3, 1) forwards; }
.ev-cover[data-animating] .ev-envelope__card { animation: card-settle 1.3s ease-out; }
@keyframes seal-off { to { transform: scale(.6); opacity: 0; } }
@keyframes flap-open { 60% { opacity: 1; } to { transform: rotateX(178deg); opacity: 0; } }
@keyframes front-away { to { transform: translateY(18%); opacity: 0; } }
@keyframes card-settle { from { transform: scale(.97); } to { transform: none; } }

.ev-open { margin: 0 auto; }
.ev-cover[data-sealed] ~ .ev-body { display: none; }
.ev-cover[data-opened] .ev-envelope, .ev-cover[data-opened] .ev-open { display: none; }

/* ── buttons ───────────────────────────────────────────────── */
.ev-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: .7rem 1.4rem;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ev-btn--primary { background: var(--ink); color: var(--paper); }
.ev-btn--primary:hover { background: #3A2F24; }
.ev-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ev-btn--ghost:hover { border-color: var(--gold); }
.ev-btn--block { width: 100%; }
.ev-btn:disabled { opacity: .55; cursor: default; }
.ev-round {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink);
  font: 500 1.5rem/1 var(--sans); cursor: pointer;
}
.ev-round:hover:not(:disabled) { border-color: var(--gold); }
.ev-round:disabled { opacity: .35; cursor: default; }

/* ── sections ──────────────────────────────────────────────── */
.ev-section { padding-top: 2.25rem; }
.ev-section + .ev-section::before {
  content: "✦"; display: block; margin: 0 0 1.75rem;
  color: var(--gold); text-align: center; font-size: .9rem;
}
.ev-h2 { margin: 0 0 1rem; text-align: center; font: 500 2rem/1.15 var(--serif); }
.ev-cards .ev-h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ev-cards { padding-top: 1.5rem; }
.ev-body:focus { outline: none; }

/* Cards carousel */
.ev-cards__track {
  display: flex; gap: 1rem;
  width: min(100%, 21rem); margin: 0 auto; padding: 0 0 .5rem;
  list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.ev-cards__track::-webkit-scrollbar { display: none; }
.ev-card { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.ev-card img {
  width: 100%; aspect-ratio: 750 / 1050; object-fit: cover; border-radius: 8px; background: var(--sunk);
  box-shadow: 0 10px 24px rgb(30 26 22 / .12), 0 1px 4px rgb(30 26 22 / .08);
}
.ev-card__label { margin: .75rem 0 0; text-align: center; color: var(--ink-2); font: italic 1.1rem/1.3 var(--serif); }
.ev-cards__nav { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-top: .75rem; }
.ev-cards__count { margin: 0; min-width: 4rem; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Functions */
.ev-functions__list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.ev-fn {
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ev-fn__name { margin: 0 0 .6rem; font: 600 1.6rem/1.15 var(--serif); }
.ev-fn__note { color: var(--ink-2); white-space: pre-line; }
.ev-facts { display: grid; gap: .55rem; margin: 0; }
.ev-facts > div { display: grid; grid-template-columns: 4.25rem 1fr; gap: .75rem; align-items: baseline; }
.ev-facts dt { color: var(--gold-text); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ev-facts dd { margin: 0; }
.ev-facts--wide > div { grid-template-columns: 6rem 1fr; }
.ev-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.ev-actions .ev-btn { flex: 1 1 9rem; padding-inline: 1rem; }
.ev-functions__all { margin-top: 1.1rem; text-align: center; }
.ev-functions__all a { display: inline-block; padding: .7rem 0; }

/* RSVP */
.ev-rsvp__by { margin-top: -.4rem; text-align: center; color: var(--gold-text); font-weight: 600; }
.ev-rsvp__preview {
  padding: .75rem 1rem; border-radius: 10px;
  background: var(--gold-wash); color: var(--gold-text); text-align: center;
}
.ev-rsvp__fields { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.ev-rsvp__fields:disabled { opacity: .6; }
.ev-q {
  margin: 0 0 1rem; padding: 1.1rem 1.1rem 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-inline-size: 0;
}
.ev-q[data-missing] { border-color: #A3402F; }
.ev-q__title { float: left; width: 100%; padding: 0; margin: 0 0 .85rem; font: 600 1.45rem/1.2 var(--serif); }
.ev-q__when { display: block; margin-top: .15rem; color: var(--ink-2); font: .9rem/1.35 var(--sans); }
.ev-q__choices { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ev-choice { position: relative; display: block; }
.ev-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ev-choice span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .55rem .75rem;
  border: 1px solid var(--field); border-radius: 12px; background: var(--paper);
  font-weight: 600; text-align: center; line-height: 1.2;
}
.ev-choice input:checked + span { border-color: var(--gold); background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.ev-choice input:checked[value="yes"] + span::before { content: "✓"; margin-right: .4rem; color: var(--gold-text); }
.ev-choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.ev-q__count { display: none; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.ev-q[data-attending] .ev-q__count { display: flex; }
.ev-q__count-label { color: var(--ink-2); font-size: .95rem; line-height: 1.3; }
.ev-stepper { display: flex; align-items: center; gap: .35rem; }
.ev-stepper input {
  width: 3rem; min-height: 48px; padding: 0;
  border: 0; background: transparent; color: var(--ink);
  font: 600 1.35rem/1 var(--sans); text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.ev-stepper input::-webkit-inner-spin-button, .ev-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.ev-field { margin: 1.1rem 0 0; }
.ev-field__label { display: block; margin-bottom: .35rem; font-weight: 600; }
.ev-field input, .ev-report textarea {
  width: 100%; min-height: 48px; padding: .65rem .9rem;
  border: 1px solid var(--field); border-radius: 12px; background: var(--surface); color: var(--ink);
  font: 1rem/1.4 var(--sans);
}
.ev-field input:focus, .ev-report textarea:focus { border-color: var(--gold); outline: 2px solid var(--gold); outline-offset: 0; }
.ev-field input[aria-invalid="true"] { border-color: #A3402F; }
.ev-fineprint { margin: 1rem 0; color: var(--ink-2); font-size: .875rem; }
.ev-rsvp__status { min-height: 1.6em; margin: .75rem 0 0; text-align: center; color: var(--gold-text); font-weight: 600; }
.ev-rsvp__done {
  padding: 1.75rem 1.25rem; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ev-rsvp__done:focus { outline: none; }
.ev-rsvp__tick {
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto .5rem;
  border-radius: 50%; background: var(--gold-wash); color: var(--gold-text); font-size: 1.6rem; font-weight: 700;
}
.ev-rsvp__thanks { margin: 0 0 .35rem; font: 600 1.8rem/1.2 var(--serif); }
.ev-rsvp__summary { margin: 0 0 1.25rem; color: var(--ink-2); }

/* ── footer + plain pages ──────────────────────────────────── */
.ev-footer {
  max-width: 32rem; margin: 2.5rem auto 0; padding: 1.75rem 1.25rem 2.5rem;
  border-top: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: .875rem;
}
.ev-footer__brand { margin: 0 0 .5rem; color: var(--ink); font: 600 1.15rem/1.2 var(--serif); }
.ev-footer__brand span { color: var(--gold); }
.ev-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; }
.ev-footer__links a { display: inline-block; padding: .7rem 0; color: var(--ink-2); }
.ev-footer__fine { margin: .5rem 0 0; font-size: .8rem; }

.ev-plain__main { max-width: 32rem; margin: 0 auto; padding: 3.5rem 1.25rem 1rem; }
.ev-plain__title { margin: .5rem 0 1rem; font: 500 2.4rem/1.1 var(--serif); }
.ev-report { margin: 1.5rem 0; }
.ev-report textarea { min-height: 8rem; margin-bottom: 1rem; resize: vertical; }

@media (min-width: 40rem) {
  .ev-cover { padding-top: 4rem; }
  .ev-names { font-size: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
