:root {
  --paper: #F4EBDD; --paper-2: #EBDFCB; --paper-3: #FAF4E9;
  --ink: #322820; --ink-soft: #6a5a4b; --verm: #922F28; --gold: #A38149;
  --dev: "Noto Serif Devanagari", "Cormorant Garamond", serif;
  --lat: "Cormorant Garamond", "Noto Serif Devanagari", serif;
  --gutter: 24px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--dev); font-size: 17px; line-height: 1.8; letter-spacing: 0;
  /* the one faint static paper texture */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .18  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body[data-lang="en"] { font-family: var(--lat); font-size: 20px; line-height: 1.65; }
body.locked { overflow: hidden; }
p, h1, h2, h3, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--verm); outline-offset: 3px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Gate: flat envelope ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px; padding: 24px; background: var(--paper); background-image: inherit; text-align: center; cursor: pointer;
}
.gate-greet { max-width: 20em; font-size: 20px; line-height: 1.6; overflow-wrap: anywhere; }
body[data-lang="en"] .gate-greet { font-size: 26px; font-style: italic; }
.env { position: relative; width: min(84vw, 400px); aspect-ratio: 7 / 5; }
.env > * { position: absolute; }
.env-back { inset: 0; background: var(--paper-2); box-shadow: 0 1px 0 rgba(50,40,32,.12), 0 18px 30px -18px rgba(50,40,32,.35); }
.env-letter { left: 5%; right: 5%; top: 7%; bottom: 4%; background: var(--paper-3); padding: 14% 12% 0; display: flex; flex-direction: column; gap: 10%; }
.env-letter i { display: block; height: 1px; background: rgba(50,40,32,.18); }
.env-front { inset: 0; background: var(--paper-2); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); filter: none; }
.env-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(50,40,32,.05), transparent 60%); }
.env-flap { left: 0; right: 0; top: 0; height: 56%; background: #E4D5BC; clip-path: polygon(0 0, 100% 0, 50% 100%); z-index: 3; backface-visibility: visible; }
.band { top: 0; bottom: 0; width: 50%; z-index: 4; }
.band::before { content: ""; position: absolute; top: 42%; height: 16%; left: 0; right: 0; background: var(--verm); }
.band-l { left: 0; } .band-r { right: 0; }
.seal {
  left: 50%; top: 50%; width: 22%; aspect-ratio: 1; translate: -50% -50%; z-index: 5; border-radius: 50%;
  background: var(--verm); color: var(--paper); display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 3px var(--verm), inset 0 0 0 4px rgba(244,235,221,.55);
}
.seal span { font-family: var(--dev); font-weight: 600; font-size: clamp(20px, 6vw, 30px); line-height: 1; }
.seal-shine { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 38%, rgba(255,240,215,.55) 50%, transparent 62%); transform: translateX(-140%); }
.open-btn {
  font: inherit; font-family: var(--dev); font-size: 17px; color: var(--paper); background: var(--verm);
  border: 0; border-radius: 2px; padding: 14px 28px; min-height: 48px; cursor: pointer;
}
body[data-lang="en"] .open-btn { font-family: var(--lat); font-size: 20px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Toolbar ---------- */
.toolbar { position: fixed; top: 8px; right: 8px; z-index: 60; display: flex; gap: 2px; }
.tool {
  font: inherit; font-size: 15px; color: var(--ink); background: none; border: 0; min-width: 44px; min-height: 44px;
  padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
body[data-lang="en"] .tool { font-size: 17px; }
.tool:hover { color: var(--verm); }
.mute .i-off { display: none; } .mute.is-muted .i-on { display: none; } .mute.is-muted .i-off { display: block; }

/* ---------- Card ---------- */
.card { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter) 24px; outline: none; }

/* hero, the only bordered thing */
.hero {
  margin: 56px 0 0; padding: 48px 20px 44px; border: 1px solid var(--gold); text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.greet { font-size: 17px; max-width: 24em; overflow-wrap: anywhere; color: var(--ink-soft); }
body[data-lang="en"] .greet { font-size: 22px; font-style: italic; }
.invocation { margin-top: 32px; color: var(--verm); font-size: 20px; font-weight: 600; }
body[data-lang="en"] .invocation { font-family: var(--lat); font-size: 19px; letter-spacing: .12em; text-transform: uppercase; }
.heading { margin-top: 8px; font-size: 16px; font-weight: 400; color: var(--ink-soft); }
body[data-lang="en"] .heading { font-size: 18px; letter-spacing: .14em; text-transform: uppercase; }
.names { margin: 28px 0 24px; display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.names .name {
  font-size: clamp(44px, 15.5vw, 112px); font-weight: 600; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere;
}
body[data-lang="en"] .names .name { font-family: var(--lat); font-size: clamp(48px, 16vw, 140px); line-height: 1; padding: .06em 0; }
.names .amp { font-family: var(--lat); font-style: italic; font-weight: 500; font-size: 32px; line-height: 1.2; color: var(--gold); margin: 2px 0; }
.hero-line { font-size: 17px; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.hero-line [data-lagan] { color: var(--verm); font-weight: 600; }
.hero-place { color: var(--ink-soft); font-size: 15px; }
body[data-lang="en"] .hero-line { font-size: 21px; }
body[data-lang="en"] .hero-place { font-size: 18px; }

/* countdown */
.countdown-strip { margin: 32px 0 0; text-align: center; }
.cd-title { font-size: 14px; color: var(--ink-soft); }
body[data-lang="en"] .cd-title { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.countdown { display: flex; justify-content: center; margin-top: 10px; border-block: 1px solid rgba(163,129,73,.5); }
.cd-unit { flex: 1 1 0; max-width: 130px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.cd-unit + .cd-unit { border-left: 1px solid rgba(163,129,73,.35); }
.cd-num { font-family: var(--lat); font-weight: 600; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
body[data-lang="np"] .cd-num { font-family: var(--dev); font-size: 28px; line-height: 1.4; }
.cd-label { font-size: 13px; color: var(--ink-soft); }
body[data-lang="en"] .cd-label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.cd-done { padding: 14px; }

/* sections */
.sec { margin-top: 64px; }
.sec-title { font-size: 15px; font-weight: 600; color: var(--verm); text-align: left; margin-bottom: 18px; }
body[data-lang="en"] .sec-title { font-size: 16px; letter-spacing: .16em; text-transform: uppercase; }

.letter { max-width: 640px; margin-inline: auto; text-align: left; }
.invitation { font-size: 18px; line-height: 1.95; overflow-wrap: break-word; }
body[data-lang="en"] .invitation { font-size: 23px; line-height: 1.55; }
.letter .closing { margin-top: 24px; color: var(--ink-soft); font-size: 16px; }
body[data-lang="en"] .letter .closing { font-size: 20px; font-style: italic; }

/* provenance */
.couple { display: grid; gap: 28px; max-width: 760px; margin-inline: auto; }
.person { display: flex; flex-direction: column; gap: 2px; padding-top: 18px; border-top: 1px solid rgba(163,129,73,.55); text-align: left; }
.person-name { font-size: 24px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.person-rel { font-size: 14px; color: var(--verm); }
.person-parents { margin-top: 6px; }
.person-addr { color: var(--ink-soft); font-size: 15px; }
body[data-lang="en"] .person-name { font-size: 32px; line-height: 1.15; }
body[data-lang="en"] .person-rel { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
body[data-lang="en"] .person-addr { font-size: 18px; }
.couple-and { font-family: var(--lat); font-style: italic; font-size: 24px; color: var(--gold); text-align: center; line-height: 1; }

/* schedule: open ruled rows */
.schedule { max-width: 760px; margin-inline: auto; }
.event { --r: 1; position: relative; padding: 22px 0 20px; display: grid; gap: 2px; }
.event::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--gold); transform: scaleX(var(--r)); transform-origin: left; }
.event:last-child { border-bottom: 1px solid rgba(163,129,73,.5); }
.ev-title { font-size: 19px; font-weight: 600; line-height: 1.5; }
.ev-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-top: 2px; }
.ev-bs { font-weight: 600; }
.ev-day { color: var(--ink-soft); font-size: 15px; }
.ev-ad { flex-basis: 100%; font-size: 14px; color: var(--ink-soft); }
.ev-time { font-size: 20px; color: var(--verm); font-weight: 600; margin-top: 2px; }
.ev-note { font-weight: 400; color: var(--ink-soft); font-size: 15px; }
.ev-venue { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
body[data-lang="en"] .ev-title { font-size: 25px; line-height: 1.2; }
body[data-lang="en"] .ev-bs { font-size: 21px; }
body[data-lang="en"] .ev-day, body[data-lang="en"] .ev-venue { font-size: 18px; }
body[data-lang="en"] .ev-ad, body[data-lang="en"] .ev-note { font-size: 17px; }
body[data-lang="en"] .ev-time { font-size: 24px; }
/* the lagan row (the one carrying the शुभ साइत note) */
.event:has(.ev-note) { padding: 40px 0 38px; margin: 10px 0; }
.event:has(.ev-note)::before { height: 2px; background: var(--verm); }
.event:has(.ev-note) .ev-title { font-size: 24px; color: var(--verm); }
.event:has(.ev-note) .ev-time { font-size: 28px; }
body[data-lang="en"] .event:has(.ev-note) .ev-title { font-size: 34px; }
body[data-lang="en"] .event:has(.ev-note) .ev-time { font-size: 32px; }

/* venue */
.venue { max-width: 760px; margin-inline: auto; }
.venue-name { font-size: 30px; font-weight: 600; line-height: 1.4; }
body[data-lang="en"] .venue-name { font-size: 42px; line-height: 1.1; }
.venue-addr { color: var(--ink-soft); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; min-height: 52px; margin-top: 24px; padding: 0 28px; background: var(--verm);
  color: var(--paper); text-decoration: none; border-radius: 2px; font-size: 17px;
}
body[data-lang="en"] .btn { font-weight: 600; font-size: 19px; letter-spacing: .08em; text-transform: uppercase; }
.btn:hover { background: #7b241f; }
.travel, .heritage { max-width: 760px; margin-inline: auto; }
.prose { color: var(--ink-soft); max-width: 640px; }
.map-frame { margin-top: 28px; padding: 8px; border: 1px solid var(--gold); background: var(--paper-3); }
.map { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; filter: sepia(.25) saturate(.8); }

button.btn { border: 0; font-family: inherit; cursor: pointer; }
.btn-alt { background: transparent; color: var(--verm); box-shadow: inset 0 0 0 1px var(--verm); }
.btn-alt:hover { background: var(--paper-2); }
.actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 32px; }
.actions .btn { margin-top: 0; justify-content: center; text-align: center; }
.ev-dress { font-size: 15px; font-style: italic; color: var(--ink-soft); margin-top: 2px; }
body[data-lang="en"] .ev-dress { font-size: 18px; }

/* family */
.family, .contact { max-width: 760px; margin-inline: auto; }
.family-list { display: grid; grid-template-columns: 1fr; border-top: 1px solid rgba(163,129,73,.55); }
.fam { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(163,129,73,.3); }
.fam-name { overflow-wrap: anywhere; }
.fam-rel { color: var(--ink-soft); font-size: 14px; text-align: right; flex: none; }
body[data-lang="en"] .fam-rel { font-size: 17px; font-style: italic; }
.family-all { margin-top: 20px; font-weight: 600; }

/* contacts */
.contacts { border-top: 1px solid rgba(163,129,73,.55); }
.contact-link {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; padding: 10px 0;
  color: inherit; text-decoration: none; border-bottom: 1px solid rgba(163,129,73,.3);
}
.contact-name { overflow-wrap: anywhere; }
.contact-phone { font-size: 21px; font-weight: 600; color: var(--verm); white-space: nowrap; }
body[data-lang="en"] .contact-phone { font-family: var(--lat); font-size: 26px; }
.contact-link:hover .contact-phone { text-decoration: underline; }

.signoff { margin: 72px 0 40px; text-align: center; }
.signoff .invocation { margin: 0; }

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  :root { --gutter: 48px; }
  .hero { margin-top: 64px; padding: 72px 48px 64px; }
  .names { margin: 36px 0 32px; }
  .sec { margin-top: 96px; }
  .couple { grid-template-columns: 1fr auto 1fr; align-items: start; gap: 40px; }
  .couple-and { align-self: center; padding-top: 18px; }
  .family-list { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .countdown-strip { margin-top: 48px; }
  .countdown { max-width: 560px; margin-inline: auto; }
  .event { grid-template-columns: 1.1fr 1fr; column-gap: 40px; }
  .event .ev-title { grid-column: 1; grid-row: 1 / span 3; }
  .event .ev-date, .event .ev-time, .event .ev-venue, .event .ev-dress { grid-column: 2; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .event:has(.ev-note) .ev-title { align-self: center; }
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
