/* ------------------------------------------------------------------
 * Invitation base styles. Every template (/themes/*.css) only sets
 * the variables below + optional flourishes. Layouts are shared:
 * [data-layout] = arch | frame | bloom | minimal | confetti | stars | neon
 * ------------------------------------------------------------------ */
:root {
  --bg: #fbf6ee; --bg2: #f1e6d6; --ink: #2b1d1d; --muted: #7a6a66;
  --accent: #b88a3e; --accent2: #8c2f39; --card: #ffffffcc; --line: color-mix(in srgb, var(--accent) 45%, transparent);
  --btn-bg: var(--accent); --btn-ink: #fff;
  --f-script: "Great Vibes", cursive; --f-display: "Cormorant Garamond", serif; --f-body: "Lato", system-ui, sans-serif;
  --f-deva: "Tiro Devanagari Hindi", serif;
  --radius: 18px; --shadow: 0 18px 50px -24px rgb(0 0 0 / .35);
  --cover-bg: radial-gradient(120% 80% at 50% 0%, var(--bg) 0%, var(--bg2) 100%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg2); color: var(--ink);
  font: 16px/1.6 var(--f-body), var(--f-deva); -webkit-font-smoothing: antialiased;
}
body:not(.is-open) { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* loading / error */
.inv-loading { min-height: 100dvh; display: grid; place-items: center; background: #1d1220; }
.loader { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #ffffff22; border-top-color: #d6b26a; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inv-error { min-height: 100dvh; display: grid; place-content: center; text-align: center; padding: 24px; font-family: system-ui; background: #fbf6ee; color: #2b1d1d; }

/* ---------- shell ---------- */
.inv { color: var(--ink); font-family: var(--f-body), var(--f-deva); position: relative; max-width: 540px; margin: 0 auto; background: var(--bg); min-height: 100dvh; box-shadow: 0 0 80px -30px rgb(0 0 0 / .5); overflow-x: clip; }
.demo-bar { position: sticky; top: 0; z-index: 60; text-align: center; font: 600 12.5px/1.2 system-ui, sans-serif; padding: 9px 12px; background: #1d1220; color: #f5e9d6; letter-spacing: .01em; }
.demo-bar a { color: #e9c77f; margin-left: 6px; text-decoration: none; }

/* ---------- ornaments ---------- */
.orn-wrap { color: var(--accent); width: 150px; margin: 0 auto 10px; }
.orn-wrap svg { width: 100%; height: auto; display: block; }
[data-motif="mandala"] .orn-wrap, [data-motif="marigold"] .orn-wrap { width: 118px; }
[data-motif="toran"] .orn-wrap { width: 260px; max-width: 80%; }
[data-motif="stars"] .cover .orn-wrap, [data-motif="stars"] .hero .orn-wrap,
[data-motif="confetti"] .cover .orn-wrap, [data-motif="confetti"] .hero .orn-wrap {
  position: absolute; inset: 0; width: auto; margin: 0; pointer-events: none; opacity: .9;
}
[data-motif="stars"] .orn-wrap svg, [data-motif="confetti"] .orn-wrap svg { width: 100%; height: 100%; }
[data-motif="stars"] .inv-foot .orn-wrap, [data-motif="confetti"] .inv-foot .orn-wrap { height: 90px; width: 100%; }

/* ---------- cover ---------- */
.cover {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 28px 20px;
  grid-template-columns: minmax(0, 1fr); justify-items: center;
  background: var(--cover-bg); transition: transform .9s cubic-bezier(.7, 0, .2, 1), opacity .9s;
  max-width: 540px; margin: 0 auto; overflow: hidden;
}
.cover.opened { transform: translateY(-100%); opacity: .6; pointer-events: none; }
.cover-frame, .hero-frame { position: relative; text-align: center; width: 100%; max-width: 420px; padding: 34px 24px 30px; }
.cover-frame > *:not(.orn-wrap), .hero-frame > *:not(.orn-wrap) { position: relative; }
.blessing { font-family: var(--f-deva); color: var(--accent2); font-size: 15px; margin: 0 0 6px; letter-spacing: .02em; }
.kicker { font-family: var(--f-display), var(--f-deva); text-transform: uppercase; letter-spacing: .26em; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.names { font-family: var(--f-script), var(--f-deva); font-weight: 400; font-size: clamp(46px, 13vw, 66px); line-height: 1.05; margin: 8px 0 14px; color: var(--ink); }
.names span { display: block; white-space: nowrap; }
.names.wrap span { white-space: normal; overflow-wrap: anywhere; }
.names .amp { font-size: .55em; color: var(--accent); margin: 2px 0; }
.cover-date { font-family: var(--f-display); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; margin: 0 0 14px; }
.cover-guest { margin: 18px auto 22px; padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--f-display), var(--f-deva); font-size: 22px; max-width: 280px; }
.cover-guest small { display: block; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-family: var(--f-body), var(--f-deva); }
.btn-open, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink); padding: 14px 28px; font-weight: 700; letter-spacing: .04em; text-decoration: none;
  box-shadow: 0 10px 24px -12px var(--accent); transition: transform .2s, box-shadow .2s;
}
.btn-open { animation: pulse 2.4s ease-in-out infinite; }
.btn-open:active, .btn:active { transform: scale(.97); }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 18%, transparent); } }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }

/* ---------- layouts (cover + hero) ---------- */
[data-layout="arch"] .cover-frame, [data-layout="arch"] .hero-frame {
  border: 1.5px solid var(--accent); border-radius: 210px 210px 16px 16px; padding-top: 46px;
  outline: 1px solid var(--line); outline-offset: 7px; background: color-mix(in srgb, var(--bg) 70%, transparent);
}
[data-layout="frame"] .cover-frame, [data-layout="frame"] .hero-frame {
  border: 1px solid var(--accent); outline: 1px solid var(--line); outline-offset: -9px;
  background: linear-gradient(var(--accent), var(--accent)) top left / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) top left / 2px 22px no-repeat,
              linear-gradient(var(--accent), var(--accent)) bottom right / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) bottom right / 2px 22px no-repeat;
}
[data-layout="minimal"] .cover-frame, [data-layout="minimal"] .hero-frame { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-layout="bloom"] .orn-wrap { width: 230px; margin-bottom: 0; }
[data-layout="confetti"] .cover-frame, [data-layout="confetti"] .hero-frame { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); }
[data-layout="neon"] .cover-frame, [data-layout="neon"] .hero-frame { border: 2px solid var(--accent); border-radius: 22px; box-shadow: 0 0 18px var(--accent), inset 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent); }

/* Devanagari text must not be letter-spaced or uppercased (breaks conjuncts) */
.deva { letter-spacing: 0 !important; text-transform: none !important; font-family: var(--f-deva) !important; }
.kicker.deva { font-size: 17px; color: var(--accent2); }

/* ---------- content ---------- */
.content { position: relative; }
.sec { padding: 46px 22px; text-align: center; position: relative; }
.sec:nth-of-type(even) { background: color-mix(in srgb, var(--bg2) 55%, var(--bg)); }
.sec-title { font-family: var(--f-script), var(--f-deva); font-weight: 400; font-size: 44px; line-height: 1.1; margin: 0 0 24px; color: var(--accent2); }
.hero { padding-top: 40px; min-height: min(92dvh, 900px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; background: var(--cover-bg) !important; }
.hero-line { margin: 4px 0; color: var(--muted); font-family: var(--f-display), var(--f-deva); font-size: 17px; }
.hero-date { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .16em; font-size: 14px; }
.hero-date span + span { color: var(--muted); font-size: 12px; }

.greet-hello { font-family: var(--f-display), var(--f-deva); font-size: 26px; margin: 0 0 6px; color: var(--accent2); }
.greet-line { font-family: var(--f-deva), var(--f-display); font-size: 20px; margin: 0; }
.intro p { max-width: 400px; margin: 0 auto; font-family: var(--f-display), var(--f-deva); font-size: 19px; line-height: 1.6; }
.intro .sign { margin-top: 14px; font-style: italic; color: var(--muted); font-size: 16px; }

.cd-label { margin: 0 0 14px; color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.cd-label b { color: var(--ink); }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 380px; margin: 0 auto; }
.cd div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px 8px; }
.cd span { display: block; font-family: var(--f-display); font-size: 32px; font-weight: 600; line-height: 1; color: var(--accent2); font-variant-numeric: tabular-nums; }
.cd small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cd-done { font-family: var(--f-script), var(--f-deva); font-size: 34px; color: var(--accent2); margin: 0; }

.ev-list { display: grid; gap: 16px; text-align: left; }
.ev-card { display: grid; grid-template-columns: 64px 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; border-radius: 12px; background: var(--accent); color: var(--btn-ink); }
.ev-date .d { font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1; }
.ev-date .m { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; }
.ev-body h3 { margin: 0 0 4px; font-family: var(--f-display), var(--f-deva); font-size: 23px; line-height: 1.2; }
.ev-body h3 small { display: block; font-family: var(--f-deva); font-size: 15px; color: var(--accent2); font-weight: 400; }
.ev-body p { margin: 4px 0; font-size: 14.5px; }
.ev-when { color: var(--accent2); font-weight: 700; }
.ev-where, .ev-note { color: var(--muted); }
.ev-dress { font-style: italic; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ev-actions a, .ev-actions button { font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; }
.ev-map .map-frame { margin-top: 12px; }

.gal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gal-item { padding: 0; border: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.gal-item:nth-child(3n + 1) { grid-row: span 2; aspect-ratio: auto; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gal-item:hover img { transform: scale(1.05); }
.gal-item.broken img { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .88); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 86dvh; border-radius: 12px; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 40px; }

.venue-name { font-family: var(--f-display); font-size: 24px; margin: 0; font-weight: 600; }
.venue-addr { color: var(--muted); margin: 2px 0 16px; }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--bg2); margin-bottom: 16px; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.rsvp-by { color: var(--muted); margin: -12px 0 18px; font-size: 14px; }
.rsvp-form { display: grid; gap: 16px; text-align: left; max-width: 420px; margin: 0 auto; }
.rsvp-form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.rsvp-form input:not([type="radio"]):not([type="checkbox"]), .rsvp-form select, .rsvp-form textarea {
  font: 16px var(--f-body), var(--f-deva); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 100%;
}
.rsvp-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rsvp-form legend { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding: 0; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; }
.pill input:checked + span { background: var(--accent); color: var(--btn-ink); border-color: var(--accent); }
.pill input:focus-visible + span { outline: 2px solid var(--accent2); outline-offset: 2px; }
.rsvp-done { font-family: var(--f-display); font-size: 21px; margin: 0 0 6px; }
.rsvp-sum { color: var(--muted); margin: 0 0 16px; }

.contacts ul { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 10px; max-width: 420px; text-align: left; }
.contacts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.contacts li small { display: block; color: var(--muted); font-size: 12.5px; }
.contacts li span { display: flex; gap: 6px; }
.contacts li a { font-size: 12.5px; font-weight: 700; text-decoration: none; padding: 7px 11px; border-radius: 999px; background: var(--accent); color: var(--btn-ink); }

.inv-foot { padding: 46px 20px 90px; text-align: center; background: var(--cover-bg); position: relative; overflow: hidden; }
.foot-names { font-family: var(--f-script), var(--f-deva); font-size: 38px; margin: 6px 0 18px; }
.made { font-size: 12.5px; color: var(--muted); text-decoration: none; }
.made b { color: var(--ink); }

.music-btn { position: fixed; z-index: 55; right: max(16px, calc(50% - 270px + 16px)); bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(8px); color: var(--accent2); display: grid; place-items: center; box-shadow: var(--shadow); }
.music-btn[hidden] { display: none; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.bars i { width: 3px; height: 5px; background: currentColor; border-radius: 2px; }
.music-btn.on .bars i { animation: eq .9s ease-in-out infinite; }
.music-btn.on .bars i:nth-child(2) { animation-delay: .2s; }
.music-btn.on .bars i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 50% { height: 16px; } }

/* language switch (bottom-left, mirrors the music button) */
.lang-switch {
  position: fixed; z-index: 55; left: max(16px, calc(50% - 270px + 16px)); bottom: 18px; display: grid; gap: 3px; padding: 4px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(8px); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s, bottom .45s cubic-bezier(.2, .8, .2, 1);
}
body.is-open .lang-switch { opacity: 1; visibility: visible; }
.lang-switch button {
  min-width: 40px; height: 32px; padding: 0 7px; border: 0; border-radius: 999px; background: none; color: var(--ink); cursor: pointer;
  font: 700 12px/1 var(--f-body), var(--f-deva); letter-spacing: .04em; -webkit-tap-highlight-color: transparent;
}
.lang-switch button[lang="hi"] { font-family: var(--f-deva), var(--f-body); font-size: 15px; letter-spacing: 0; }
.lang-switch button[data-lang="both"] { font-size: 11px; }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--btn-ink); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }
/* closed: one small chip with the current language; open: all choices stacked above it */
.lang-switch:not(.open) { padding: 2px; }
.lang-switch:not(.open) button[aria-pressed="false"] { display: none; }
.lang-switch:not(.open) button[aria-pressed="true"] {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 28px; padding: 0 9px 0 7px; background: none; color: var(--ink);
}
.lang-switch .ls-ico { display: none; width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .75; }
.lang-switch:not(.open) .ls-ico { display: block; }
.lang-switch.open { animation: ls-open .18s ease-out; transform-origin: bottom left; }
@keyframes ls-open { from { transform: scale(.92); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .lang-switch.open { animation: none; } }
/* on phones, step up out of the way when the cinematic quick-nav bar slides in */
@media (max-width: 600px) { .inv:has(.cine-nav.show) .lang-switch { bottom: 76px; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .btn-open { animation: none; } .cover { transition: none; } }

@media (min-width: 560px) { .sec { padding-left: 34px; padding-right: 34px; } }

/* ---------- traditional sections ---------- */
.fam-grid { display: grid; gap: 16px; max-width: 440px; margin: 0 auto; }
.fam-card { position: relative; padding: 34px 20px 22px; border-radius: 120px 120px 20px 20px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.fam-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 16px; border-radius: 999px; background: var(--accent2); color: #fff; font: 700 11.5px var(--f-body), var(--f-deva); letter-spacing: .14em; text-transform: uppercase; }
.fam-card h3 { margin: 6px 0 8px; font-family: var(--f-display), var(--f-deva); font-size: 24px; color: var(--ink); }
.fam-card p { margin: 3px 0; color: var(--muted); font-size: 15px; }
.fam-card .fam-addr { margin-top: 10px; font-size: 13.5px; opacity: .85; }
.namelist ul { list-style: none; padding: 0; margin: 0 auto; max-width: 400px; display: grid; gap: 6px; font-family: var(--f-display), var(--f-deva); font-size: 18px; }
.namelist li + li { border-top: 1px dashed var(--line); padding-top: 6px; }
.manuhar-text { max-width: 380px; margin: 0 auto; padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); font-family: var(--f-deva), var(--f-display); font-size: 21px; line-height: 1.5; color: var(--accent2); }
.manuhar-from { margin: 12px 0 0; color: var(--muted); font-style: italic; }

/* ---------- card language ---------- */
.sec-title .bi { display: block; margin-top: 6px; font: 600 11.5px/1.3 var(--f-body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); opacity: .9; }
.greet-line.en { margin-top: 6px; font-family: var(--f-display), serif; font-size: 16px; color: var(--muted); }
/* Devanagari breaks if letter-spaced: Hindi dates get normal spacing */
.inv[data-lang="hi"] :is(.cover-date, .hero-date, .ev-date .m, .date-pill, .intro-date) { letter-spacing: 0; text-transform: none; }
