/* ============================================================
   AHMAD & DANA — WEDDING INVITATION STYLES
   Themes: gold (default) | sage  — switch in config.js
   ============================================================ */

/* ---------- THEME VARIABLES ---------- */
:root,
[data-theme="gold"] {
  --bg:          #efe6d3;
  --bg-2:        #e3d5b8;
  --bg-3:        #f6efdf;
  --card:        #fdf9ef;
  --card-2:      #f7efdd;
  --ink:         #4a3823;
  --ink-soft:    #7d6a4c;
  --accent:      #b08d57;
  --accent-deep: #7d5f34;
  --btn-deep:    #654e28;
  --line:        #cfb98f;
  --seal:        #a04b3c;
  --shadow:      rgba(120, 90, 40, .18);
  --petal:       rgba(214, 178, 120, .85);
  /* floral ornament colors — pink + white roses */
  --fl-leaf:     #8a9b6f;
  --fl-petal:    #f9f1f3;
  --fl-petal2:   #d98a96;
  --fl-center:   #9c5464;
  /* script name gradient */
  --name-1:      #8a6a3b;
  --name-2:      #b08d57;
}
[data-theme="sage"] {
  --bg:          #e8e9dc;
  --bg-2:        #d5dabd;
  --bg-3:        #f2f2e6;
  --card:        #f7f4e8;
  --card-2:      #efecdd;
  --ink:         #575047;
  --ink-soft:    #5e584c;
  --accent:      #93a075;
  --accent-deep: #57603f;
  --btn-deep:    #4c5537;
  --line:        #adb695;
  --seal:        #a4715f;
  --shadow:      rgba(95, 105, 70, .16);
  --petal:       rgba(206, 160, 158, .8); /* blush petals */
  /* floral ornament colors — sage leaves, pink + white roses */
  --fl-leaf:     #7f9463;
  --fl-petal:    #f9f1f3;
  --fl-petal2:   #d98a96;
  --fl-center:   #9c5464;
  /* script name gradient — muted taupe like the reference */
  --name-1:      #655a50;
  --name-2:      #a08a80;
}

/* ---------- BASE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* no css smooth-scroll: it animates every programmatic scrollTo and fights
   lenis + the instant jump-to-top on unlock (lenis provides the smoothing) */

body {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(90% 50% at 90% 100%, rgba(0,0,0,.05), transparent 55%),
    linear-gradient(165deg, var(--bg-3) 0%, var(--bg) 45%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100dvh; }

/* skip link: invisible until keyboard-focused */
.skip-link {
  position: fixed; top: .8rem; inset-inline-start: .8rem; z-index: 1000;
  padding: .7rem 1.2rem; background: var(--accent-deep); color: var(--card);
  border-radius: 999px; font-size: .85rem; text-decoration: none;
  transform: translateY(-300%); transition: transform .2s ease;
}
.skip-link:focus-visible { transform: none; outline: 2px solid var(--card); }

[dir="rtl"] body, [dir="rtl"] { font-family: 'Amiri', serif; }

.caps   { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 500; }
.script { font-family: 'Parisienne', cursive; font-weight: 400; }
[dir="rtl"] .caps   { letter-spacing: .02em; font-family: 'Amiri', serif; font-weight: 600; }
[dir="rtl"] .script { font-family: 'Amiri', serif; }

::selection { background: var(--accent); color: var(--card); }

/* ---------- LAYOUT ---------- */
#site { position: relative; z-index: 1; }
.section {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.4rem 1.25rem 0;
  text-align: center;
}

/* ---------- CARD (ornate frame) ---------- */
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px -16px var(--shadow), 0 2px 8px rgba(0,0,0,.04);
}
.card::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  opacity: .75;
  pointer-events: none;
}

/* arched variant (top rounded like a Moorish doorway) -
   fixed-depth elliptical arch: a width-scaled semicircle would eat
   half the card and clip the text inside */
.arch-card, .arch-card::before {
  border-radius: 50% 50% 12px 12px / 92px 92px 12px 12px;
}
.arch-card::before { border-radius: 50% 50% 8px 8px / 72px 72px 8px 8px; inset: 21px; }

/* ---------- ORNATE FRAME (vine band + paper grain, injected by JS) ---------- */
.ornate-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.ornate-frame .paper { fill: url(#pat-paper); }
.ornate-frame .edge-n { x: 26px; y: 4px;  width: calc(100% - 52px); height: 14px; }
.ornate-frame .edge-s { x: 26px; y: calc(100% - 18px); width: calc(100% - 52px); height: 14px; }
.ornate-frame .edge-w { x: 4px;  y: 26px; width: 14px; height: calc(100% - 52px); }
.ornate-frame .edge-e { x: calc(100% - 18px); y: 26px; width: 14px; height: calc(100% - 52px); }
/* arched top: only the bottom band (side vines would clip into the arch) */
.arch-card .edge-n, .arch-card .edge-e, .arch-card .edge-w { display: none; }

/* sheen sweep — one soft pass of light across the card after the reveal */
.card.sheen::after {
  content: ""; position: absolute; inset: -40% -20%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%);
  transform: translateX(-130%) rotate(0.001deg);
  animation: sheen 1.7s cubic-bezier(.4,0,.2,1) .1s forwards;
  pointer-events: none; z-index: 3;
}
@keyframes sheen { to { transform: translateX(130%); } }

/* floral corners */
.corner {
  position: absolute;
  width: 150px; height: 150px;
  color: var(--accent);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}
.c-tl { top: 4px;  left: 4px; }
.c-tr { top: 4px;  right: 4px;  transform: scaleX(-1); }
.c-bl { bottom: 4px; left: 4px; transform: scaleY(-1); }
.c-br { bottom: 4px; right: 4px; transform: scale(-1); }

/* top corners don't fit inside a fully arched top edge */
.arch-card .c-tl, .arch-card .c-tr { display: none; }

/* flowing satin backdrop — silk folds drift slowly behind the page;
   luminosity blend borrows the theme hue so it works on both palettes */
body::after {
  content: ""; position: fixed; inset: -18%; z-index: -1; pointer-events: none;
  background: url("images/bg-silk.webp") center / cover no-repeat;
  mix-blend-mode: luminosity;
  opacity: .4; /* sheen, not a competing photo - keeps bare text readable */
  animation: silk-flow 46s ease-in-out infinite alternate;
}
@keyframes silk-flow {
  from { transform: translate3d(-3.5%, -2%, 0) rotate(-.6deg) scale(1.05); }
  to   { transform: translate3d(3.5%, 2.5%, 0) rotate(.6deg) scale(1.12); }
}

/* ambient light — a warm glow drifting slowly behind the page */
body::before {
  content: ""; position: fixed; inset: -15%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 32% at 22% 16%, rgba(222,190,150,.16), transparent 70%),
    radial-gradient(34% 28% at 80% 78%, rgba(188,143,133,.12), transparent 70%);
  animation: ambient-drift 28s ease-in-out infinite alternate;
}
@keyframes ambient-drift { to { transform: translate3d(3.5%, 2.5%, 0) scale(1.05); } }

/* ---------- DIVIDERS ---------- */
.divider { width: 198px; height: 20px; color: var(--accent); display: block; margin: 1.1rem auto; }

/* ============================================================
   ENVELOPE INTRO
   ============================================================ */
#envelope-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(80% 60% at 50% 20%, rgba(255,255,255,.5), transparent 60%),
    linear-gradient(165deg, color-mix(in srgb, var(--bg-3) 88%, transparent), color-mix(in srgb, var(--bg-2) 88%, transparent)),
    url("images/bg-silk.webp") center / cover no-repeat;
}
.env-scene {
  perspective: 1000px; text-align: center; padding: 1rem;
  max-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.envelope {
  position: relative;
  /* capped by viewport height too: height = width/1.42 stays ~58dvh max,
     so invite + envelope + hint always fit on short screens */
  width: min(430px, 84vw, 82dvh);
  aspect-ratio: 1.42;
  margin: 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.envelope:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 8px; }
.env-back {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 30px 60px -20px var(--shadow);
}
.env-card {
  position: absolute; inset: 6px 10px;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid; place-content: center; gap: .5rem;
  transition: transform .95s cubic-bezier(.5,.05,.25,1) .4s, box-shadow .6s ease .4s, z-index 0s .45s;
}
.envelope.open .env-card {
  transform: translateY(-86%) scale(1.04);
  z-index: 5; /* paper slides out ON TOP of the envelope */
  box-shadow: 0 20px 44px -14px rgba(60, 45, 25, .35);
}
.env-card-bismillah { font-family: 'Amiri', serif; color: var(--accent-deep); font-size: 1.05rem; }
.env-card-names { font-family: 'Parisienne', cursive; font-size: 2rem; color: var(--ink-soft); }
[dir="rtl"] .env-card-names { font-family: 'Amiri', serif; }
.env-front {
  position: absolute; inset: 0;
  z-index: 2;
  background: linear-gradient(200deg, var(--card) 0%, var(--card-2) 100%);
  border-radius: 6px;
  clip-path: polygon(0 0, 50% 46%, 100% 0, 100% 100%, 0 100%);
  border: 1px solid var(--line);
}
/* printed inner frame — clipped to the envelope's V shape */
.env-front::after {
  content: ""; position: absolute; inset: 9px;
  border: 1px solid var(--line); border-radius: 4px; opacity: .5;
}
.env-flap {
  position: absolute; top: 0; left: 0; right: 0;
  height: 52%;
  z-index: 3;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  border-radius: 6px 6px 0 0;
  /* clip-path eats the element's border, so redraw the top edge inside the clip */
  box-shadow: inset 0 1.5px 0 var(--line);
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.08));
}
.envelope.open .env-flap { transform: rotateX(178deg); z-index: 1; transition: transform .9s cubic-bezier(.6,.05,.3,1), z-index 0s .35s; }
.wax-seal {
  position: absolute; z-index: 4;
  top: 44%; left: 50%;
  translate: -50% -50%;
  width: clamp(56px, 20%, 74px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #c76b58, var(--seal) 60%, #7c3a2e);
  color: #f7e8d8;
  font-family: 'Parisienne', cursive;
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 0 0 4px rgba(255,255,255,.12);
  transition: transform .35s, opacity .35s;
}
/* postmark rings around the seal — one engraved, one slowly rotating */
.wax-seal::before {
  content: ""; position: absolute; inset: -12px;
  border: 1.5px dashed var(--accent); border-radius: 50%; opacity: .45;
  animation: seal-spin 32s linear infinite;
}
.wax-seal::after {
  content: ""; position: absolute; inset: -17px;
  border: 1px solid var(--line); border-radius: 50%; opacity: .4;
}
@keyframes seal-spin { to { transform: rotate(360deg); } }
.envelope.open .wax-seal { transform: scale(.6); opacity: 0; }
.envelope.open .wax-seal::before, .envelope.open .wax-seal::after { opacity: 0; }

.env-hint {
  margin-top: clamp(.7rem, 2.6vh, 1.6rem);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: pulse 1.8s ease-in-out infinite;
}
[dir="rtl"] .env-hint { letter-spacing: .05em; font-family: 'Amiri', serif; }
@keyframes pulse { 50% { opacity: .35; } }

/* short screens (landscape phones, small windows): shrink chrome, keep the scene whole */
@media (max-height: 520px) {
  .env-hint { margin-top: .6rem; font-size: .72rem; }
  .envelope { width: min(430px, 84vw, 74dvh); }
}

/* ============================================================
   LANGUAGE TOGGLE
   ============================================================ */
#lang-toggle {
  position: fixed; top: 1rem; inset-inline-end: 1rem; z-index: 50;
  padding: .5rem 1rem;
  font-family: 'Amiri', serif; font-size: .85rem; font-weight: 600;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
#lang-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px var(--shadow); }

/* ---------- MUSIC TOGGLE ---------- */
#music-toggle {
  position: fixed; bottom: 1.2rem; inset-inline-end: 1rem; z-index: 50;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
#music-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px var(--shadow); }
#music-toggle .mute-slash { opacity: 0; transition: opacity .25s; }
#music-toggle.muted .mute-slash { opacity: 1; }
#music-toggle:not(.muted) { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* equalizer — shown while playing, driven by the live audio spectrum */
#music-toggle .eq {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
#music-toggle:not(.muted) .eq { display: flex; }
#music-toggle:not(.muted) svg { display: none; }
#music-toggle .eq i {
  width: 3px; height: 18px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleY(.15);
  transform-origin: bottom;
}

/* ============================================================
   PETALS CANVAS
   ============================================================ */
#petals {
  position: fixed; inset: 0; z-index: 5;
  pointer-events: none;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 3.5rem 1rem;
}
.lanterns { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lantern {
  position: absolute; top: 0;
  width: clamp(52px, 9vw, 84px);
  color: var(--accent);
  opacity: .9;
  filter: drop-shadow(0 0 14px rgba(216,184,140,.45));
  animation: sway 5.5s ease-in-out infinite alternate, lantern-glow 3.2s ease-in-out infinite alternate;
  transform-origin: top center;
}
@keyframes lantern-glow {
  from { filter: drop-shadow(0 0 8px rgba(216,184,140,.3)); }
  to   { filter: drop-shadow(0 0 20px rgba(216,184,140,.6)); }
}
.lantern-l { inset-inline-start: 2%; }
.lantern-r { inset-inline-end: 2%; animation-delay: -2.7s; animation-duration: 6.4s; }
@keyframes sway {
  from { transform: rotate(-2.4deg); }
  to   { transform: rotate(2.4deg); }
}

.hero-card {
  width: min(680px, 100%);
  padding: 1.6rem 2.2rem;
  text-align: center;
}
.bismillah {
  font-family: 'Amiri', serif;
  font-size: clamp(1.5rem, 4.6vw, 2.1rem);
  color: var(--accent-deep);
  margin-bottom: .3rem;
}
.bismillah-tr { color: var(--ink-soft); }
.bismillah-tr:empty { display: none; }

.hero-dua { font-family: 'Amiri', serif; font-size: clamp(1.05rem, 3.4vw, 1.3rem); line-height: 2.1; color: var(--ink); max-width: 30ch; margin: .5rem auto 0; }
.joy-line { color: var(--ink); max-width: 40ch; margin: 0 auto; line-height: 2; }
.honor-line { color: var(--ink-soft); font-size: .85rem; margin: 1.2rem 0 .4rem; }
.parents {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .15rem 1rem;
  color: var(--ink); font-weight: 600; font-size: 1.02rem; line-height: 1.9;
}
.parents-sep { width: 1px; height: 1.15em; background: var(--accent-deep); opacity: .55; }
.invite-line { color: var(--ink-soft); max-width: 42ch; margin: .5rem auto 0; line-height: 1.9; }
.join-line { font-style: italic; color: var(--ink-soft); }
.join-line:empty { display: none; }
[dir="rtl"] .join-line { font-style: normal; }
.date-line { color: var(--ink); margin-top: 1.3rem; }
.date-nums { font-size: 1.5rem; letter-spacing: .18em; color: var(--accent-deep); margin: .35rem 0 1.1rem; font-variant-numeric: tabular-nums; }
[dir="rtl"] .date-nums { font-family: 'Amiri', serif; letter-spacing: .1em; }

.names {
  margin: 1.4rem 0 .6rem;
  font-weight: 400;
  display: flex; flex-wrap: wrap;
  align-items: baseline; justify-content: center;
  gap: .2em .35em;
}
.names .name {
  font-family: 'Parisienne', cursive;
  font-size: clamp(2.4rem, 13vw, 4.4rem);
  line-height: 1.1;
  background: linear-gradient(120deg, var(--name-1), var(--name-2) 45%, var(--name-1));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: name-sheen 8s ease-in-out infinite;
}
@keyframes name-sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
[dir="rtl"] .names .name { font-family: 'Amiri', serif; font-weight: 700; font-size: clamp(2.4rem, 9vw, 4rem); }
.names .amp { font-family: 'Parisienne', cursive; font-size: clamp(1.8rem, 6vw, 3rem); color: var(--name-2); }
[dir="rtl"] .names .amp { font-family: 'Amiri', serif; }

.venue       { color: var(--ink); font-size: .85rem; }
.venue-hotel { color: var(--ink-soft); font-size: .95rem; margin-top: .35rem; font-style: italic; }
[dir="rtl"] .venue-hotel { font-style: normal; }

/* scroll hint */
.scroll-hint {
  position: absolute; bottom: 1.6rem; left: 50%; translate: -50% 0;
  width: 26px; height: 42px;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  opacity: .7;
}
.scroll-hint span {
  position: absolute; top: 7px; left: 50%; translate: -50% 0;
  width: 4px; height: 8px; border-radius: 3px;
  background: var(--accent);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 60% { transform: translateY(12px); opacity: 0; } 100% { transform: translateY(12px); opacity: 0; } }

/* ============================================================
   SECTION TITLES
   ============================================================ */
.sec-title {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  color: var(--accent-deep);
  font-weight: 400;
}

/* ============================================================
   DETAILS
   ============================================================ */
.details-card { padding: 1.8rem 2.4rem; text-align: start; }
.detail-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem;
  padding: .9rem 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--accent-deep); }
.detail-val   { color: var(--ink); font-size: 1.02rem; }

/* ============================================================
   MAP
   ============================================================ */
.map-sub { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 1.4rem; line-height: 1.9; }
.map-card { padding: 2.2rem; }
.map-card #map-frame {
  width: 100%; height: 280px;
  border: 0; border-radius: 4px;
  display: block;
}
/* recolor the tiles into the sage palette */
.map-card .leaflet-tile-pane { filter: grayscale(.8) sepia(.5) saturate(.55) hue-rotate(50deg) brightness(1.05) contrast(.92); }
.map-pin svg { width: 30px; height: 40px; display: block;
  filter: drop-shadow(0 2px 4px rgba(60,64,50,.35)); }
.map-pin path { fill: var(--accent-deep); }
.map-pin circle { fill: var(--card); }
.leaflet-control-attribution { background: rgba(255,255,255,.65) !important;
  font-size: 9px !important; color: var(--ink-soft) !important; }
.leaflet-control-attribution a { color: var(--accent-deep) !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  margin-top: 1.4rem;
  padding: .85rem 2.6rem;
  font-family: inherit;
  font-size: .8rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--card);
  background: linear-gradient(120deg, var(--accent-deep), var(--btn-deep));
  border: 0; border-radius: 999px;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 10px 24px -10px var(--shadow);
}
[dir="rtl"] .btn { letter-spacing: .04em; font-family: 'Amiri', serif; font-weight: 600; }
.btn:hover  { transform: translateY(-3px); box-shadow: 0 16px 30px -10px var(--shadow); }
.btn:active { transform: translateY(-1px); }

/* ============================================================
   RSVP
   ============================================================ */
.rsvp-card { padding: 4.5rem 2.4rem 2.8rem; }
.rsvp-sub { color: var(--ink-soft); max-width: 46ch; margin: .4rem auto 1.8rem; line-height: 1.9; }

#rsvp-form { display: grid; gap: 1.1rem; text-align: start; }
.field { display: grid; gap: .45rem; }
.field > span, .field-label { color: var(--accent-deep); margin-bottom: .3rem; display: block; }
.field input, .field textarea {
  font: inherit;
  color: var(--ink);
  padding: .8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 84px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
[dir="rtl"] .field input, [dir="rtl"] .field textarea { font-family: 'Amiri', serif; }

.attend-options { display: grid; grid-template-columns: 1fr; gap: .7rem; }
.attend {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  font-size: .92rem;
  transition: border-color .2s, background .2s, color .2s;
}
.attend input { accent-color: var(--accent-deep); }
.attend:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--accent-deep);
  font-weight: 600;
}
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; transition: opacity .3s, max-height .3s; }
.counts.hidden { opacity: .25; pointer-events: none; }

#rsvp-submit { justify-self: center; margin-top: .4rem; }
#rsvp-submit[disabled] { opacity: .6; cursor: wait; transform: none; }

/* success state */
#rsvp-success { text-align: center; padding: 1.5rem 0 .5rem; }
.success-seal { width: 84px; height: 84px; color: var(--accent-deep); margin: 0 auto 1rem; display: block; }
#seal-check { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .8s .25s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-text { font-size: 1.1rem; color: var(--ink); }
.demo-note { margin-top: .8rem; font-size: .8rem; color: var(--ink-soft); font-style: italic; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { text-align: center; padding: 4.5rem 1.5rem 3rem; }
.footer-names { font-size: clamp(2.6rem, 9vw, 3.8rem); color: var(--name-1); }
[dir="rtl"] .footer-names { font-family: 'Amiri', serif; }
.footer-date { color: var(--ink-soft); margin-top: .4rem; }
.footer-line { font-style: italic; color: var(--ink-soft); margin-top: .8rem; }
[dir="rtl"] .footer-line { font-style: normal; }
.footer-heart { color: var(--accent); margin-top: 1rem; font-size: 1.3rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ---------- DESKTOP ENHANCEMENTS (the base styles ARE the mobile design) ---------- */
@media (min-width: 361px) {
  .hero-card { padding: 2rem 2.4rem; }
}

@media (min-width: 561px) {
  .section { padding-top: 4.5rem; }
  .corner { width: 112px; height: 112px; }
  .hero-card { padding: clamp(2.2rem, 6vw, 3.6rem) clamp(2.4rem, 5vw, 3rem); }
  .names .name { font-size: clamp(3rem, 11vw, 5.2rem); }
  .detail-row { grid-template-columns: 130px 1fr; gap: 1rem; }
  .details-card { padding: 2.4rem clamp(2.2rem, 5vw, 3rem); }
  .map-card #map-frame { height: 340px; }
  .attend-options { grid-template-columns: 1fr 1fr; }
  .lantern-l { inset-inline-start: 6%; }
  .lantern-r { inset-inline-end: 6%; }
  .rsvp-card { padding: clamp(4.5rem, 10vw, 6rem) clamp(2.4rem, 5vw, 3.2rem) 2.8rem; }
  .env-hint { letter-spacing: .3em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   OG-MODE — wide 1.91:1 card render used to generate og-cover
   (visit index.html#open-og)
   ============================================================ */
.og-mode .hero { padding: 0; }
.og-mode .lanterns, .og-mode .scroll-hint, .og-mode #lang-toggle,
.og-mode #music-toggle, .og-mode #petals { display: none !important; }
.og-mode .hero-card {
  width: 1140px; height: 597px; max-width: 1140px;
  padding: 2rem 3.2rem;
  display: flex; flex-direction: row; align-items: center; gap: 2.8rem;
}
.og-mode .hero-card .names { font-size: clamp(2.6rem, 4vw, 3.4rem); }
.og-mode .hero-card .og-text { flex: 1; text-align: center; }
.og-mode .hero-card .og-photo {
  width: 300px; height: 470px; object-fit: cover; flex-shrink: 0;
  border-radius: 170px 170px 14px 14px;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 7px var(--card), 0 0 0 8px var(--line), 0 16px 34px -14px var(--shadow);
}
