:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b665f;
  --line: #e7e1d8;
  --accent: #7a5c2e;
  --accent-ink: #ffffff;
  --accent-soft: #f2ebe0;
  --ok: #2f6b45;
  --err: #a33a2c;
  --radius: 12px;
  --serif: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 .75rem; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; color: var(--muted); margin-bottom: .5rem; }
.lead { font-size: 1.075rem; max-width: 40rem; margin-left: auto; margin-right: auto; }
.center-text { text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.center { justify-content: center; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .6rem 16px; background: rgb(250 248 245 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-brand { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; padding: .25rem 0; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: .25rem; }
  .nav-links { margin-left: 0; width: 100%; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 36px; padding: .35rem .85rem; font-size: .9rem; }
.btn.ghost { background: transparent; }
.btn.disabled { opacity: .6; cursor: default; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Hero */
.hero { min-height: 88vh; min-height: 88svh; display: grid; place-items: center; text-align: center; padding: 3rem 16px; background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.hero.has-photo { background: linear-gradient(rgb(20 16 10 / .45), rgb(20 16 10 / .55)), var(--hero) center / cover no-repeat; color: #fff; }
.hero.has-photo .kicker, .hero.has-photo .hero-verse { color: rgb(255 255 255 / .85); }
.hero.has-photo .btn:not(.primary) { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .5); }
.hero-inner { max-width: 44rem; }
.hero-verse { font-family: var(--serif); font-style: italic; color: var(--muted); margin-bottom: 2rem; }
.hero-verse span { display: block; font-style: normal; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; margin-top: .25rem; }
.hero-names { font-size: clamp(3rem, 13vw, 6rem); font-weight: 400; margin: .5rem 0; }
.hero-names .amp, .names .amp { display: block; font-size: .5em; font-style: italic; color: var(--accent); margin: .1em 0; }
.hero.has-photo .amp { color: #f0d9b0; }
.hero-tagline { font-family: var(--serif); font-size: 1.25rem; font-style: italic; }
.hero-date { letter-spacing: .12em; text-transform: uppercase; font-size: .9rem; margin: 1.25rem 0 1.75rem; }

/* Sections */
main { display: block; }
.section { max-width: 64rem; margin: 0 auto; padding: 3.5rem 16px; text-align: center; }
.section > .card, .section > details.card, .section > .flash { text-align: left; max-width: 36rem; margin: 1rem auto; }
.page { max-width: 64rem; margin: 0 auto; padding-bottom: 2rem; }
.page .section { padding-top: 2rem; padding-bottom: 1.5rem; }
.page.narrow { max-width: 40rem; padding: 1.5rem 16px 3rem; }
.page.narrow > .card { margin-bottom: 1rem; }
.invite .names { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; text-align: left; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: 1rem; }

.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); margin-top: 1.5rem; }

/* Countdown */
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; max-width: 30rem; margin: 1rem auto; }
.count-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem .25rem; }
.count-num { display: block; font-family: var(--serif); font-size: clamp(1.6rem, 7vw, 2.4rem); font-variant-numeric: tabular-nums; }
.count-unit { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Couple & family */
.person { text-align: center; }
.person-photo { width: 10rem; height: 10rem; object-fit: cover; border-radius: 50%; margin: 0 auto 1rem; }
.family { text-align: center; }
.family-group { margin-top: 1rem; }
.family-group p { margin: 0; }
.label { font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: .25rem !important; }

/* Events */
.events { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin-top: 1.5rem; }
.event dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 1rem 0; }
.event dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: .25rem; }
.event dd { margin: 0; }
.note { background: var(--accent-soft); border-radius: 8px; padding: .6rem .8rem; font-size: .925rem; }

/* Quote */
.quote blockquote { margin: 0 auto; max-width: 40rem; font-family: var(--serif); font-size: 1.35rem; font-style: italic; }
.quote cite { display: block; margin-top: .75rem; font-style: normal; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 2rem auto 0; max-width: 40rem; position: relative; }
.timeline::before { content: ''; position: absolute; left: 1.25rem; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 3.5rem; margin-bottom: 1.25rem; }
.timeline .dot { position: absolute; left: 0; top: .75rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; font-size: 1.1rem; }
.timeline-photo { border-radius: 8px; margin: .75rem 0; width: 100%; max-height: 22rem; object-fit: cover; }

/* Gallery */
.gallery { columns: 3 14rem; column-gap: .75rem; margin-top: 1.5rem; }
.gallery figure { margin: 0 0 .75rem; break-inside: avoid; }
.gallery img { width: 100%; border-radius: 8px; }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding: .25rem 0; text-align: left; }
@media (max-width: 480px) { .gallery { columns: 2; } }

/* Forms */
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 500; }
.form label.inline { display: flex; align-items: center; gap: .5rem; }
input:not([type=checkbox]):not([type=radio]), textarea, select { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
fieldset.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
fieldset.choice legend { font-weight: 500; margin-bottom: .5rem; }
fieldset.choice label { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; cursor: pointer; font-weight: 400; }
fieldset.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { background: #eaf4ec; color: var(--ok); border: 1px solid #cfe5d5; border-radius: 8px; padding: .75rem 1rem; }
.flash.error { background: #fbeceb; color: var(--err); border-color: #f0cfcb; }

.rsvp-summary dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; }
.rsvp-summary dt { color: var(--muted); }
.rsvp-summary dd { margin: 0; }

/* FAQ, contacts */
.faq { max-width: 40rem; margin: 1.5rem auto 0; text-align: left; }
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6rem 0 0; }
.contacts { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); margin-top: 1.5rem; }
.contact { display: grid; gap: .6rem; }
.contact span { display: block; font-size: .9rem; }

/* Wishes */
.wishes { columns: 2 18rem; column-gap: 1rem; margin-top: 1.5rem; text-align: left; }
.wish { break-inside: avoid; margin: 0 0 1rem; }
.wish img { border-radius: 8px; margin-bottom: .75rem; }
.wish blockquote { margin: 0; font-family: var(--serif); font-size: 1.1rem; white-space: pre-line; }
.wish figcaption { margin-top: .5rem; color: var(--muted); font-size: .9rem; }

/* Registry */
.registry-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-top: 1rem; text-align: left; }
.registry-grid.compact { margin: 1.5rem 0; }
.item { display: flex; flex-direction: column; gap: .35rem; }
.item img, .item .img-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f4f1ec; border-radius: 8px; margin-bottom: .5rem; }
.item .img-ph { display: grid; place-items: center; font-size: 2.5rem; }
.item h3 { margin: 0; }
.item p { margin: 0; }
.item .desc { font-size: .925rem; color: var(--muted); }
.item .row { margin-top: auto; padding-top: .75rem; }
.item.gifted { opacity: .7; }
a.item { color: inherit; text-decoration: none; }
a.item:hover { border-color: var(--accent); }
.price { font-weight: 600; font-size: 1.1rem; }

.progress-wrap { margin: .5rem 0; }
.progress { height: 10px; background: #efe9e0; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.progress-label { font-size: .85rem; color: var(--muted); margin: .35rem 0 0 !important; }

.cash-card { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; color: inherit; text-decoration: none; background: var(--accent-soft); border-color: transparent; }
.cash-card:hover { border-color: var(--accent); }
.cash-card > div { flex: 1; }
@media (max-width: 640px) { .cash-card { flex-direction: column; align-items: stretch; } }

/* Give flow */
.give-head { display: flex; gap: 1rem; align-items: flex-start; }
.give-head img { width: 7rem; height: 7rem; object-fit: contain; background: #f4f1ec; border-radius: 8px; flex-shrink: 0; }
.give-head > div { flex: 1; min-width: 0; }
.give-head h1 { font-size: 1.6rem; }
.step { margin-bottom: 1rem; }
.step h2 { font-size: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.step-n { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--sans); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.chip { min-height: 40px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.amount-input { display: flex; align-items: center; gap: .5rem; }
.amount-input > span { font-size: 1.25rem; font-weight: 600; }
.amount-input input { font-size: 1.25rem !important; font-weight: 600; }
.js .amount-input [data-nojs] { display: none; }
.pay { display: flex; gap: 1.25rem; align-items: center; }
.qr { width: 13rem; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .25rem; }
.qr svg { display: block; width: 100%; height: auto; }
.pay-side { display: grid; gap: .6rem; min-width: 0; }
.pay-amount { font-size: 1.5rem; font-weight: 700; margin: 0; }
.upi-id { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.upi-id code { background: #f4f1ec; padding: .25rem .5rem; border-radius: 6px; word-break: break-all; }
.mobile-only { display: none; }
@media (max-width: 640px) {
  .pay { flex-direction: column; align-items: stretch; }
  .qr { width: min(15rem, 100%); margin: 0 auto; }
  .mobile-only { display: inline-flex; }
}
.bank { margin-top: 1rem; }
.bank summary { cursor: pointer; }
.bank pre { white-space: pre-wrap; font: inherit; background: #f4f1ec; padding: .75rem; border-radius: 8px; }
.big-emoji { font-size: 3rem; margin: 0; }

.share { padding-top: 0; }
.footer { text-align: center; padding: 2.5rem 16px 3rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer-mono { font-family: var(--serif); font-size: 1.5rem; color: var(--accent); letter-spacing: .2em; }
