/* ---------- fonts (self-hosted) ---------- */
@font-face { font-family: "Great Vibes"; src: url(/fonts/great-vibes-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/nunito-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/nunito-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/nunito-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/nunito-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --blush: #f7f0e6;
  --lilac: #ece1d2;
  --petal: rgba(255, 252, 247, .8);
  --petal-solid: #fffcf7;
  --rose: #7d5c43;
  --rose-2: #ad8a69;
  --rose-soft: #f1e6d8;
  --ink: #3b3029;
  --muted: #7a6a5c;
  --line: rgba(125, 92, 67, .16);
  --line-strong: rgba(125, 92, 67, .32);
  --lilac-soft: #f5eee5;
  --mint: #e2f4ea; --mint-ink: #2f6b4a;
  --peach: #fde9d9; --peach-ink: #8a4d1c;
  --mist: #eeebe7; --mist-ink: #6b625a;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --glow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 18px 50px -20px rgba(125, 92, 67, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  background:
    radial-gradient(60vmax 50vmax at 8% 0%, rgba(255, 255, 255, .85), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 30%, rgba(232, 214, 186, .6), transparent 65%),
    radial-gradient(50vmax 40vmax at 0% 100%, rgba(240, 222, 204, .7), transparent 65%),
    linear-gradient(170deg, var(--blush) 0%, #f3e9dc 45%, var(--lilac) 100%);
  background-attachment: fixed;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font: italic 600 26px/1.15 var(--serif); color: var(--rose); }
h3 { font: italic 600 19px/1.2 var(--serif); color: var(--rose); margin-bottom: 8px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 40px 16px 72px; }
.wrap.narrow { max-width: 580px; }
.loading { color: var(--muted); text-align: center; padding: 120px 0; font: italic 500 22px var(--serif); }

.panel {
  background: var(--petal);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: var(--glow);
  padding: 26px;
}
.stack { display: grid; gap: 18px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; font-weight: 400; }
.strong { font-weight: 700; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif-note { font: italic 500 18px/1.3 var(--serif); color: var(--muted); }

/* ---------- the invitation (arched card) ---------- */
.invite {
  position: relative;
  text-align: center;
  padding: 92px 30px 34px;
  border-radius: 280px 280px 28px 28px / 220px 220px 28px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 250, 243, .84));
  border: 1px solid #fff;
  box-shadow: var(--glow), 0 0 0 8px rgba(255, 255, 255, .35);
  overflow: hidden;
  isolation: isolate;
}
.invite::before { /* inner hairline arch */
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 270px 270px 20px 20px / 210px 210px 20px 20px;
  pointer-events: none;
}
.sparkles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.sparkles .tw { animation: twinkle 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sparkles :nth-child(3n) .tw, .sparkles circle.tw:nth-child(3n) { animation-delay: -1.2s; }
.sparkles :nth-child(3n+1) .tw, .sparkles circle.tw:nth-child(3n+1) { animation-delay: -2.4s; animation-duration: 4.4s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sparkles .tw { animation: none; opacity: .7; } }

.kind { font: italic 500 20px/1.2 var(--serif); color: var(--muted); }
.title {
  font: 400 clamp(54px, 13vw, 84px)/1.05 var(--script);
  color: var(--rose);
  margin: 6px 0 2px;
  text-wrap: balance;
}
.flourish { display: block; margin: 8px auto 18px; color: var(--rose-2); }
.date-line { font: 600 24px/1.25 var(--serif); }
.time-line { font: italic 500 19px/1.3 var(--serif); color: var(--muted); }
.venue-line { font: 600 20px/1.3 var(--serif); margin-top: 12px; }
.host-line { margin-top: 18px; font-weight: 600; color: var(--muted); }
.desc { white-space: pre-line; margin: 10px auto 0; max-width: 40ch; }
.actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.tally-line { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.soft-pill { background: var(--lilac-soft); border-radius: 999px; padding: 5px 14px; font-size: 14px; color: var(--muted); }
.soft-pill strong { color: var(--ink); font-weight: 800; margin-right: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; background: none;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--rose), var(--rose-2)); box-shadow: 0 8px 20px -8px rgba(125, 92, 67, .6); }
.btn.primary:hover { box-shadow: 0 10px 26px -8px rgba(125, 92, 67, .75); }
.btn.outline { background: rgba(255, 255, 255, .75); border-color: var(--line-strong); color: var(--ink); }
.btn.outline:hover { border-color: var(--rose); }
.btn.whatsapp { background: #2a8a57; color: #fff; }
.btn.whatsapp:hover { background: #237649; }
.btn.block { width: 100%; }
.btn.icon-only { width: 46px; padding: 0; }
.small-btn { min-height: 38px; padding: 0 16px; font-size: 14px; }
:focus-visible { outline: 3px solid rgba(125, 92, 67, .4); outline-offset: 2px; }

/* ---------- details ---------- */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.info { background: var(--lilac-soft); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.info-label { display: flex; align-items: center; gap: 6px; font: italic 600 17px var(--serif); color: var(--rose); margin-bottom: 2px; }
.info a { text-decoration: none; color: var(--muted); }
.info a:hover { text-decoration: underline; }
.map-toggle { margin-top: 14px; }
.map-toggle summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--rose); font-weight: 700; }
.map-toggle summary::-webkit-details-marker { display: none; }
.map-toggle[open] summary svg { transform: rotate(180deg); }
.map-frame iframe { width: 100%; height: 260px; border: 0; border-radius: 16px; margin-top: 12px; }
.details-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.menu-wrap { position: relative; }
.dropdown {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--petal-solid); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(59, 48, 41, .3); padding: 6px; display: grid;
}
.dropdown[hidden] { display: none; }
.dropdown a, .dropdown button { text-align: left; padding: 10px 14px; border-radius: 10px; border: 0; background: none; text-decoration: none; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--rose-soft); }
.side .details-grid, .side .details-actions { grid-template-columns: 1fr; }
@media (max-width: 520px) { .details-grid, .details-actions { grid-template-columns: 1fr; } }

/* ---------- form ---------- */
form { display: grid; gap: 18px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.label { font-weight: 700; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
input:not([type="radio"]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(255, 255, 255, .9);
}
select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d5c43' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(125, 92, 67, .14); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.rsvp-box { clear: both; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; clear: both; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg-opt span {
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2;
  min-height: 52px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .85); font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s;
}
.seg-opt input:checked + span { background: linear-gradient(135deg, var(--rose), var(--rose-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(125, 92, 67, .6); }
.seg-opt input:focus-visible + span { outline: 3px solid rgba(125, 92, 67, .4); outline-offset: 2px; }
.order-box { display: grid; gap: 14px; background: linear-gradient(160deg, #fff, var(--lilac-soft)); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.order-box[hidden] { display: none; }
.order-box legend { font: italic 600 22px var(--serif); color: var(--rose); margin-bottom: 0; }
.note summary { cursor: pointer; font-weight: 700; }
.note textarea { margin-top: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #9b1c3c; background: #fde4ea; border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 700; }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn.primary { flex: 1; }

/* ---------- reply summary ---------- */
.summary-head { font: 400 46px/1.1 var(--script); color: var(--rose); margin: 2px 0 6px; }
.picks { list-style: none; padding: 0; margin: 18px 0; background: var(--lilac-soft); border-radius: 18px; }
.picks li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.picks li + li { border-top: 1px solid rgba(255, 255, 255, .9); }
.picks li span:last-child { font-weight: 700; text-align: right; }
.note-view { font: italic 500 19px/1.4 var(--serif); color: var(--muted); margin: 0 0 18px; white-space: pre-line; }

/* ---------- host ---------- */
.host-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; position: relative; overflow: hidden; isolation: isolate; padding: 28px 30px; }
.host-head .kind { font-size: 18px; }
.host-head .title { font-size: clamp(44px, 7vw, 64px); margin: 0; }
.host-head .desc { margin: 4px 0 0; max-width: 60ch; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.refresh { display: inline-flex; align-items: center; gap: 10px; }
.link-plain { font-weight: 700; color: var(--rose); text-underline-offset: 4px; }
@media (max-width: 760px) { .host-head { grid-template-columns: 1fr; } .hero-actions { justify-content: flex-start; } }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; margin-top: 20px; }
.main, .side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.side { position: sticky; top: 20px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } .side { position: static; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.stat { padding: 16px 20px; border-radius: 20px; }
.stat strong { display: block; font: 800 34px/1.1 var(--sans); color: var(--rose); }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.chip { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 7px 15px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 600; margin-left: 3px; }
.chip.active { background: var(--rose); border-color: var(--rose); color: #fff; }
.chip.active span { color: rgba(255, 255, 255, .8); }
.table-wrap { overflow-x: auto; border-radius: 18px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--lilac-soft); text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 0; white-space: nowrap; }
th:not(:has(button)) { padding: 12px 12px; }
.th-sort { border: 0; background: none; font: inherit; color: inherit; padding: 12px 12px; cursor: pointer; width: 100%; text-align: left; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
td:first-child { white-space: nowrap; }
td:not(.note-cell) { min-width: 92px; }
.note-cell { max-width: 240px; white-space: pre-line; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.yes { background: var(--mint); color: var(--mint-ink); }
.badge.maybe { background: var(--peach); color: var(--peach-ink); }
.badge.no { background: var(--mist); color: var(--mist-ink); }
.link-danger { border: 0; background: none; color: #9b1c3c; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0; white-space: nowrap; }
.link-danger.armed { background: #9b1c3c; color: #fff; padding: 4px 10px; border-radius: 999px; }
.empty { border: 1.5px dashed var(--line-strong); border-radius: 18px; padding: 30px; text-align: center; background: rgba(255, 255, 255, .5); }
.empty .serif-note { color: var(--rose); }

.tally-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.tally-col { background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.tally-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.tally-col li { display: flex; justify-content: space-between; gap: 10px; }
.tally-col li strong { color: var(--rose); white-space: nowrap; }
@media (max-width: 720px) { .tally-grid { grid-template-columns: 1fr; } }

.copy-row { display: flex; gap: 8px; }
.copy-row input { min-width: 0; flex: 1; background: var(--lilac-soft); color: var(--muted); font-size: 14px; border-color: transparent; }
.side .panel { display: grid; gap: 10px; }

/* dialog */
.dialog { border: 0; border-radius: 26px; padding: 0; width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--petal-solid); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(59, 48, 41, .45); }
.dialog::backdrop { background: rgba(59, 48, 41, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog form { margin: 0; padding: 26px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  transition: all .25s; z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .wrap { padding-top: 18px; }
  .panel { padding: 22px 18px; }
  .invite { padding: 78px 20px 30px; }
}

/* landing page */
.home { margin-top: 8vh; padding-bottom: 56px; }
