/* Reception invitation: purple floral paper, white type.
   Structure: tokens -> living background -> base -> controls -> cover -> hero -> sections -> footer -> music -> motion -> breakpoints.
   Colours and lettering follow the printed card: purple glitter-floral paper, white Times-style serif, flowing script names. */

:root {
  color-scheme: light;
  --purple: #f1e8df;        /* paper (name kept from the base theme) */
  --purple-mid: #e8dacd;
  --purple-deep: #7a2b48;   /* maroon: buttons */
  --purple-ink: #3a1424;
  --maroon: #7a2b48; --rose: #b0475e; --gold: #b8935a; --gold-deep: #8f6d37; --green: #1f7a45;
  --cream: #fff8f0;
  --white: #5a1f38;         /* MAIN TYPE colour (poster maroon ink) */
  --lilac: #93475f;         /* secondary type */
  --r-sm: 14px; --r-md: 18px; --r-lg: 30px;
  --fs-label: 0.8rem;
  --line: rgba(122, 43, 72, 0.5);
  --line-soft: rgba(184, 147, 90, 0.55);
  --glass: rgba(122, 43, 72, 0.55);
  --serif: "Noto Sans Tamil", "Tinos", "Times New Roman", "Liberation Serif", Times, serif;
  --script: "Noto Sans Tamil", "Tinos", Georgia, serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --glow: 0 1px 10px rgba(255, 248, 240, 0.9);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-variant-numeric: lining-nums;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--purple);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--white);
  background: var(--purple);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
  overflow-wrap: break-word;
  
  -webkit-tap-highlight-color: transparent;
}

body:not(.is-ready) .site { visibility: hidden; }
html.is-locked, html.is-locked body { overflow: hidden; }
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; }

/* ---------- Living background: floral paper, glitter, drifting light ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--purple); }
.bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, #f9f3ec 0%, transparent 75%); }
.bg-floral { display: none; }
.bg-glow { --mx: 50%; --my: 18%; position: absolute; inset: 0; background: radial-gradient(circle at var(--mx) var(--my), rgba(184, 147, 90, 0.16), transparent 42%); transition: background 0.4s ease-out; }
.bg-grain { display: none; }
.sparkles { position: absolute; inset: 0; }
.spark {
  position: absolute;
  width: var(--s);
  height: var(--s);
  background: #c9a05a;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}

.progress { position: fixed; z-index: 45; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, rgba(122, 43, 72, 0.55), #fff); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 10px rgba(122, 43, 72, 0.7); }

/* ---------- Shared type ---------- */
.eyebrow {
  margin: 1.8rem 0 0.4rem;
  font-size: 0.92rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  padding-left: 0.34em; /* optical centring of tracked caps */
}
.script-title, .cover-script { font-family: var(--script); font-weight: 400; line-height: 1.1; text-shadow: var(--glow); }
.script-title { font-size: clamp(3.1rem, 11vw, 4.8rem); }
.caps-title { font-size: clamp(1.15rem, 3.6vw, 1.5rem); font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; padding-left: 0.24em; }

.flourish { width: min(300px, 72%); height: 26px; margin: 0.9rem auto 1.4rem; background: url("../assets/flourish.svg") center / contain no-repeat; filter: drop-shadow(0 0 6px rgba(122, 43, 72, 0.35)); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10rem;
  min-height: 2.9rem;
  padding: 0.8rem 1.7rem;
  border: 1px solid var(--maroon);
  border-radius: 999px;
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 14px 30px -14px rgba(58, 20, 36, 0.7);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease);
}

/* ---------- Cover: the card, with two doors that part ---------- */
.cover { position: fixed; inset: 0; z-index: 30; display: flex; overflow: hidden auto; overscroll-behavior: contain; padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1.6rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.cover[hidden] { display: none; }
.door {
  position: fixed;
  inset: 0;
  background:
    url("../assets/corner-tl.png") left top / min(36vw, 190px) auto no-repeat,
    url("../assets/corner-tr.png") right top / min(36vw, 190px) auto no-repeat,
    url("../assets/corner-br.png") right bottom / min(30vw, 160px) auto no-repeat,
    radial-gradient(ellipse at 50% 38%, #f8f1e9 0%, transparent 70%),
    var(--purple);
  transition: transform 1.5s cubic-bezier(0.7, 0, 0.2, 1) 0.35s;
  will-change: transform;
}
.door-l { clip-path: inset(0 50% 0 0); }
.door-r { clip-path: inset(0 0 0 50%); }
/* the card's double frame, split across the two doors */
.door::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--line); box-shadow: inset 0 0 0 6px transparent, 0 0 0 5px transparent; }
.door-l::before { border-right: 0; border-radius: 26px 0 0 26px; }
.door-r::before { border-left: 0; border-radius: 0 26px 26px 0; }
.door::after { content: ""; position: absolute; inset: 22px; border: 1px solid var(--line-soft); }
.door-l::after { border-right: 0; border-radius: 20px 0 0 20px; }
.door-r::after { border-left: 0; border-radius: 0 20px 20px 0; }
.cover-seam { position: fixed; top: 14px; bottom: 14px; left: 50%; width: 1px; background: linear-gradient(transparent, rgba(122, 43, 72, 0.75), transparent); transition: opacity 0.4s ease; }

body:not(.fonts-ready) .cover-inner { opacity: 0; }
.cover-inner { position: relative; z-index: 2; width: 100%; max-width: 27rem; margin: auto; padding: 2.4rem 0 1.4rem; text-align: center; transition: opacity 0.55s ease, transform 0.8s var(--ease); }
.cover .deity-hero { width: min(118px, 34vw); }
.cover .eyebrow { margin-top: 1.1rem; }
.cover-script { margin-top: 0.1rem; font-size: clamp(2.6rem, 11.5vw, 3.5rem); }
.cover .flourish { margin: 0.35rem auto 0.7rem; }
.cover-names { font-family: var(--script); font-size: clamp(3.1rem, 15vw, 4.3rem); line-height: 1.02; text-shadow: var(--glow); }
.cover-names .person { display: block; }
.cover-names .union { display: block; font-size: 0.55em; line-height: 1; opacity: 0.9; }
.cover-date { margin-top: 0.8rem; font-size: 1.1rem; letter-spacing: 0.3em; padding-left: 0.3em; }
.cover-open { margin-top: 1.4rem; animation: pulse 2.6s ease-out infinite; }
.cover-hint { margin-top: 0.9rem; color: var(--lilac); font-size: 0.98rem; font-style: italic; }

.cover.is-leaving { pointer-events: none; }
.cover.is-leaving .cover-inner { opacity: 0; transform: scale(1.06) translateY(-12px); }
.cover.is-leaving .cover-seam { opacity: 0; }
.cover.is-leaving .door-l { transform: translateX(-102%); }
.cover.is-leaving .door-r { transform: translateX(102%); }

/* ---------- Deity (line art lifted from the card, white on purple) ---------- */
.deity { position: relative; margin: 0 auto; width: min(230px, 62vw); aspect-ratio: 650 / 466; }
.deity img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(122, 43, 72, 0.35)); }
.deity figcaption { display: none; }
.deity.is-empty { display: none; }
.deity::before { content: ""; position: absolute; inset: -22% -12%; background: radial-gradient(closest-side, rgba(122, 43, 72, 0.22), transparent); animation: halo 5s ease-in-out infinite; z-index: -1; }

/* ---------- Petals (generated by main.js) ---------- */
.petals { position: fixed; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.petal-fall { position: absolute; top: -40px; will-change: transform; animation: fall linear infinite backwards; }
.petal { display: block; width: var(--size); height: var(--size); opacity: 0.85; animation: flutter ease-in-out infinite alternate; }
.petal-jasmine { background: url("../assets/jasmine.svg") center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(58, 20, 36, 0.45)); }
.petal-lilac, .petal-blush { border-radius: 0 100% 0 100%; height: calc(var(--size) * 0.75); box-shadow: 0 1px 3px rgba(58, 20, 36, 0.3); }
.petal-lilac { background: linear-gradient(135deg, #f3dcae, #c9a05a); }
.petal-blush { background: linear-gradient(135deg, #f7c9d2, #c9607a); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 130ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal { transform: translateY(22px) scale(0.95); transition-duration: 1.1s; transition-delay: calc(var(--i, 0) * 200ms); }
.hero .reveal.is-visible { transform: none; }
.flourish.reveal { transform: scaleX(0.25); }
.flourish.reveal.is-visible { transform: none; }
.stagger:not(.is-visible) > * { opacity: 0; }
.stagger.is-visible > * { animation: rise 0.9s var(--ease) both; }
.stagger.is-visible > :nth-child(2) { animation-delay: 0.15s; }
.stagger.is-visible > :nth-child(3) { animation-delay: 0.3s; }
.stagger.is-visible > :nth-child(4) { animation-delay: 0.45s; }

/* ---------- Hero ---------- */
.site { position: relative; z-index: 1; outline: none; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 6.5rem); min-height: calc(100svh - 6.5rem); padding: 4rem 1.4rem 3.2rem; text-align: center; }
.hero .deity { width: min(200px, 54vw, 26vh); }
.hero-names { font-family: var(--script); font-weight: 400; font-size: clamp(3.4rem, min(17vw, 13.5vh), 7.6rem); line-height: 1.02; text-shadow: var(--glow); }
.hero-names .person { display: block; }
.hero-names .union { display: block; font-size: 0.5em; line-height: 1.1; margin: 0.05em 0; }
.ch { display: inline-block; opacity: 0; transform: translateY(0.35em) scale(0.9); filter: blur(10px); }
body.is-open .ch { animation: letter 1.1s var(--ease) forwards; animation-delay: calc(1.3s + var(--n) * 85ms); }
body.is-open .hero-names { animation: nameglow 6s ease-in-out 4s infinite; }

.datebox { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: min(26rem, 100%); margin: 0.2rem auto 0; }
.db-month, .db-year { font-size: clamp(1.25rem, 4.6vw, 1.55rem); letter-spacing: 0.04em; }
.db-month { text-align: right; padding-right: 1.2rem; }
.db-year { text-align: left; padding-left: 1.2rem; }
.db-day { display: flex; flex-direction: column; align-items: center; padding: 0.15rem 1.5rem 0.25rem; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); line-height: 1; }
.db-day b { font-size: clamp(3.6rem, 14vw, 5.2rem); font-weight: 700; line-height: 1; }
.db-day i { margin-top: 0.15rem; font-style: normal; font-size: clamp(1.1rem, 3.6vw, 1.3rem); letter-spacing: 0.1em; }
.hero-time { margin-top: 1.1rem; font-size: 1.4rem; letter-spacing: 0.05em; }
.hero-actions { margin: 1.7rem 0 0; }


/* Scroll cue: a glass pill with bouncing chevrons, floating over the first screen */
.scroll-cue {
  position: fixed;
  z-index: 34;
  left: 50%;
  bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 1.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(58, 20, 36, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  text-shadow: none;
  box-shadow: 0 12px 26px -12px rgba(58, 20, 36, 0.85);
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  touch-action: manipulation;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
body.is-open .scroll-cue:not(.is-away) { opacity: 1; visibility: visible; transition-delay: 4.2s, 4.2s; animation: cuepulse 2.4s ease-out 5s infinite; }
.sc-text { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; padding-left: 0.2em; white-space: nowrap; }
.sc-arrows { width: 20px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sc-arrows path:first-child { animation: chev 1.4s ease-in-out infinite; }
.sc-arrows path:last-child { animation: chev 1.4s ease-in-out 0.2s infinite; }

/* ---------- Sections ---------- */
.section { position: relative; padding: 4.2rem 1.1rem; text-align: center; }
.wrap { max-width: 840px; margin: 0 auto; }
.panel {
  position: relative;
  padding: 3.2rem 1.4rem 3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 252, 247, 0.62);
  box-shadow: 0 34px 56px -40px rgba(90, 31, 56, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.panel::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line-soft); border-radius: 24px; pointer-events: none; }

.hosts { max-width: 36rem; margin: 0 auto 1.1rem; }
.hosts-line { margin: 0.3rem 0 0; font-size: 1.5rem; line-height: 1.45; }
.hosts-line strong, .couple-parents strong { font-weight: 700; }
.title { font-weight: 400; }
.host-name { white-space: nowrap; }
.amp { font-weight: 400; }
.hosts-place { margin-top: 0.2rem; color: var(--lilac); font-size: 1.12rem; }
.lede { max-width: 31rem; margin: 0 auto; font-size: 1.3rem; line-height: 1.65; }

.couple { display: grid; gap: 0.2rem; margin: 1.6rem auto 0; }
.person-card { text-align: center; }
.couple-name { font-family: var(--script); font-weight: 400; font-size: clamp(3.4rem, 12.5vw, 5rem); line-height: 1.12; text-shadow: var(--glow); }
.couple-join { font-family: var(--script); font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1.1; }
.couple-lead { margin-top: 0.4rem; font-size: 1.25rem; }
.couple-parents { margin-top: 0.3rem; font-size: 1.4rem; line-height: 1.5; }
.couple-place { margin-top: 0.15rem; color: var(--lilac); font-size: 1.1rem; }

/* Countdown */
.band { position: relative; padding: 3.4rem 1rem 3.6rem; text-align: center; }
.ticks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; max-width: 640px; margin: 1.8rem auto 0; }
.tick { padding: 1.05rem 0.3rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--glass); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 18px 30px -22px rgba(58, 20, 36, 0.8); }
.tick-num { display: block; font-size: clamp(2.1rem, 5.4vw, 3.1rem); font-weight: 700; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.tick-num.bump { animation: bump 0.45s var(--ease); }
.tick-label { display: block; margin-top: 0.5rem; font-size: var(--fs-label); letter-spacing: 0.2em; text-transform: uppercase; padding-left: 0.2em; }
.arrived { margin: 1.2rem 0 0; font-style: italic; }

/* Venue */
.venue-at { margin-top: 0.7rem; font-size: 1.5rem; line-height: 1; }
.venue-name { margin-top: 0.3rem; font-size: clamp(1.9rem, 7.4vw, 2.7rem); letter-spacing: 0.2em; padding-left: 0.2em; text-transform: uppercase; text-shadow: var(--glow); }
.venue-sub { margin-top: 0.3rem; font-size: clamp(1.4rem, 5vw, 1.7rem); }
.venue-address { max-width: 25rem; margin: 0.6rem auto 0; font-size: 1.25rem; line-height: 1.55; }
.map-frame { max-width: 720px; margin: 2rem auto 0; padding: 7px; border: 1px solid var(--line); border-radius: 22px; background: var(--glass); box-shadow: 0 30px 50px -30px rgba(58, 20, 36, 0.85); }
.map-frame { position: relative; }
.map-frame.is-locked iframe { pointer-events: none; }
.map-lock {
  position: absolute;
  z-index: 2;
  inset: 7px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 1rem;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(transparent 55%, rgba(58, 20, 36, 0.55));
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px rgba(58, 20, 36, 0.8);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.map-lock[hidden] { display: none; }
.map-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: var(--purple-mid); }

.events { display: grid; justify-content: center; margin: 1.6rem auto 0; }
.event { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.event-name { font-size: 0.9rem; letter-spacing: 0.26em; text-transform: uppercase; padding-left: 0.26em; }
.event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0; }
.textlink {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.3s ease, transform 0.3s var(--ease);
}

/* Closing blessing */
.closing { padding-bottom: 2.5rem; }
.closing .wrap { max-width: 34rem; }
.closing-line { margin-bottom: 1.4rem; font-size: 1.3rem; line-height: 1.7; }
.closing-regards { margin-top: 2.4rem; font-size: 1.25rem; letter-spacing: 0.04em; }
.closing-names { margin-top: 0.5rem; font-size: clamp(1.6rem, 6vw, 2.1rem); font-weight: 700; letter-spacing: 0.06em; text-shadow: var(--glow); }
.closing-family { margin-top: 0.2rem; font-size: 1.4rem; }
.closing .flourish { margin-top: 2rem; }

/* ---------- Footer ---------- */
.footer { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1.6rem 1rem calc(2.8rem + env(safe-area-inset-bottom, 0px)); text-align: center; }
.footer-line { font-size: 0.88rem; letter-spacing: 0.22em; text-transform: uppercase; }
.credit { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.3rem 0.9rem; }
.credit-text { color: var(--lilac); font-size: 0.92rem; letter-spacing: 0.06em; }
.enquire {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.15rem 0 1rem;
  border-radius: 999px;
  background: #147a3d;
  color: #fff;
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-shadow: none;
  touch-action: manipulation;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.6);
  transition: background 0.25s ease, transform 0.3s var(--ease);
}
.enquire svg { width: 1.15rem; height: 1.15rem; flex: none; }
.footer { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px)); } /* room for the quick bar and the music button */

.noscript { position: relative; z-index: 50; max-width: 36rem; margin: 2rem auto; text-align: center; }
:focus-visible { outline: 2px solid var(--maroon); outline-offset: 4px; }

/* ---------- Music button ---------- */
.music-btn {
  position: fixed;
  z-index: 36;
  right: calc(1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(58, 20, 36, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(58, 20, 36, 0.8);
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s var(--ease), visibility 0s linear 0.6s;
}
.music-btn[hidden] { display: none; }
.music-btn.is-shown { opacity: 1; visibility: visible; transform: none; transition-delay: 1.6s, 1.6s, 0s; }
.music-btn svg { width: 22px; height: 22px; }
.music-btn .bar { fill: currentColor; transform-box: fill-box; transform-origin: center bottom; transform: scaleY(0.55); }
.music-btn .slash { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.music-btn[aria-pressed="true"] .slash { display: none; }
.music-btn[aria-pressed="true"] .b1 { animation: eq 0.9s ease-in-out infinite alternate; }
.music-btn[aria-pressed="true"] .b2 { animation: eq 0.7s ease-in-out -0.3s infinite alternate; }
.music-btn[aria-pressed="true"] .b3 { animation: eq 1.1s ease-in-out -0.6s infinite alternate; }

@media (hover: hover) {
  .btn:hover { background: var(--rose); transform: translateY(-2px); }
  .enquire:hover { background: #0f6431; transform: translateY(-2px); }
  .textlink:hover { background: rgba(122, 43, 72, 0.2); transform: translateY(-2px); }
}

/* ---------- Keyframes ---------- */
@keyframes drift { from { translate: -1.5% 0; } to { translate: 1.5% -1.5%; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); } 50% { opacity: 0.95; transform: scale(1) rotate(45deg); } }
@keyframes halo { 0%, 100% { opacity: 0.55; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes fall { from { transform: translate3d(0, -6vh, 0); } to { transform: translate3d(var(--drift), 108vh, 0); } }
@keyframes flutter { from { transform: translateX(-14px) rotate(-25deg) rotateY(0deg); } to { transform: translateX(14px) rotate(35deg) rotateY(160deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(28px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes bump { from { opacity: 0.35; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(122, 43, 72, 0.55); } 70%, 100% { box-shadow: 0 0 0 18px rgba(122, 43, 72, 0); } }
@keyframes eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }
@keyframes letter { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes nameglow { 0%, 100% { text-shadow: 0 0 18px rgba(122, 43, 72, 0.25), 0 2px 16px rgba(58, 20, 36, 0.45); } 50% { text-shadow: 0 0 34px rgba(122, 43, 72, 0.6), 0 2px 16px rgba(58, 20, 36, 0.45); } }
@keyframes chev { 0%, 100% { opacity: 0.25; transform: translateY(-2px); } 50% { opacity: 1; transform: translateY(3px); } }
@keyframes cuepulse { 0% { box-shadow: 0 0 0 0 rgba(122, 43, 72, 0.5); } 70%, 100% { box-shadow: 0 0 0 16px rgba(122, 43, 72, 0); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Breakpoints ---------- */
@media (min-width: 740px) {
  .panel { padding: 4rem 3rem 3.4rem; }
  .section { padding: 5rem 1.25rem; }
  .cover .deity-hero { width: 150px; }
  .hero .deity { width: 220px; }
}

@media (min-width: 1024px) {
  body { font-size: 1.3rem; }
  .wrap { max-width: 900px; }
  .hosts-line { font-size: 1.75rem; }
  .hosts-place, .couple-place { font-size: 1.25rem; }
  .lede, .closing-line { font-size: 1.5rem; }
  .couple-lead { font-size: 1.4rem; }
  .couple-parents { font-size: 1.6rem; }
  .venue-address { font-size: 1.4rem; max-width: 30rem; }
  .closing .wrap { max-width: 40rem; }
  .tick-num { font-size: 3.4rem; }
  .textlink, .btn { font-size: 1rem; }
}

@media (max-width: 520px) {
  .ticks { grid-template-columns: 1fr 1fr; gap: 0.6rem; max-width: 19rem; }
  .map-frame iframe { aspect-ratio: 4 / 3; }
  .db-month { padding-right: 0.8rem; }
  .db-year { padding-left: 0.8rem; }
  .db-day { padding-inline: 1rem; }
}

@media (max-width: 400px) {
  .scroll-cue { padding-inline: 0.9rem; }
}

@media (max-width: 360px) {
  .scroll-cue { left: calc(50% - 1.6rem); } /* keeps clear of the music button */
}

@media (max-width: 400px) {
  .sc-text { font-size: 0.75rem; letter-spacing: 0.05em; }
}

@media (max-width: 380px) {
  body { font-size: 1.1rem; }
  .section { padding: 3.4rem 0.8rem; }
  .panel { padding-inline: 1rem; }
  .hosts-line { font-size: 1.3rem; }
  .couple-parents .host-name { white-space: normal; }
  .couple-parents { font-size: 1.25rem; }
}

/* Short phones: tighten the first screen so the scroll cue never covers the date */
@media (max-height: 740px), (min-width: 900px) and (max-height: 920px) {
  .hero { min-height: 0; padding: 4.2rem 1.2rem 6.4rem; }
  .hero .deity { width: min(150px, 42vw, 19vh); }
  .hero .eyebrow { margin-top: 0.7rem; }
  .hero-names { font-size: clamp(3rem, min(15vw, 10.5vh), 5.5rem); }
  .hero .flourish { margin: 0.3rem auto 0.7rem; }
  .db-day b { font-size: 3.1rem; }
  .hero-time { margin-top: 0.6rem; font-size: 1.25rem; }
  .hero-actions { display: none; }
  .hero + .section { padding-top: 2.6rem; }
  .scroll-cue { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}

@media (max-height: 700px) {
  .cover .deity-hero { width: 88px; }
  .cover .eyebrow { margin-top: 0.6rem; }
  .cover-open { margin-top: 1rem; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .cover-inner { padding-top: 1rem; }
  .cover .deity-hero { display: none; }
  .hero { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-floral, .deity::before, .tick-num.bump, .cover-open, .sc-arrows path { animation: none; }
  body.is-open .scroll-cue:not(.is-away) { animation: none; }
  .petals, .sparkles { display: none; }
  .ch, body.is-open .ch { opacity: 1; transform: none; filter: none; animation: none; }
  body.is-open .hero-names { animation: none; }
  .reveal, .hero .reveal, .flourish.reveal { opacity: 1; transform: none; transition: none; }
  .stagger > *, .stagger.is-visible > * { animation: none; opacity: 1; }
  .door, .cover-inner, .cover-seam, .music-btn { transition: none; }
  .music-btn[aria-pressed="true"] .bar { animation: none; transform: scaleY(0.8); }
}

/* [hidden] must win over display rules set on the same elements */
.ticks[hidden], .caps-title[hidden], .arrived[hidden] { display: none; }

/* ---------- Language switch ---------- */
.lang-switch {
  position: fixed;
  z-index: 41;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  right: calc(0.6rem + env(safe-area-inset-right, 0px));
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(58, 20, 36, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px -12px rgba(58, 20, 36, 0.8);
}
.lang-switch button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: var(--serif);
  font-size: 0.88rem;
  text-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.25s ease, color 0.25s ease;
}
.lang-switch button[aria-pressed="true"] { background: var(--maroon); color: var(--cream); font-weight: 700; }

/* Tamil and Kannada: no letter-spacing (it breaks the joined letters), roomier lines, headings in the serif face */
html[lang="ta"] *, html[lang="kn"] * { letter-spacing: normal !important; }
html[lang="ta"] body, html[lang="kn"] body { line-height: 1.75; }
html[lang="ta"] .script-title, html[lang="kn"] .script-title,
html[lang="ta"] .cover-script, html[lang="kn"] .cover-script { font-family: var(--serif); font-weight: 700; font-size: clamp(1.9rem, 8.2vw, 2.8rem); line-height: 1.4; }
html[lang="ta"] .caps-title, html[lang="kn"] .caps-title { font-weight: 700; }
html[lang="ta"] .sc-text, html[lang="kn"] .sc-text { font-size: 0.8rem; }

/* ---------- Quick bar ---------- */
.quickbar {
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 2px;
  width: min(26rem, calc(100% - 1.4rem));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(58, 20, 36, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 34px -14px rgba(58, 20, 36, 0.9);
  transform: translate(-50%, 160%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.55s var(--ease), opacity 0.4s ease, visibility 0s linear 0.55s;
}
.quickbar.is-shown { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition-delay: 0s; }
.qb {
  flex: 1 1 0;
  min-width: 0;
  min-height: 3.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.3rem 0.2rem;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #fff;
  font-family: var(--serif);
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.qb[hidden] { display: none; }
.qb svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qb:active { background: rgba(122, 43, 72, 0.16); }
.qb + .qb { border-left: 1px solid var(--line-soft); border-radius: 0; }
.music-btn { transition: opacity 0.6s ease, transform 0.6s var(--ease), bottom 0.5s var(--ease), visibility 0s linear 0.6s; }
body.has-quickbar .music-btn { bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)); }

.sheet {
  position: fixed;
  z-index: 36;
  left: 0;
  right: 0;
  margin-inline: auto; /* centred without transform, so the entrance animation cannot knock it sideways */
  bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 0.5rem;
  justify-items: stretch;
  width: min(19rem, calc(100% - 2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(58, 20, 36, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 44px -16px rgba(58, 20, 36, 0.95);
  text-align: center;
  animation: sheetin 0.35s var(--ease) both;
}
.sheet[hidden] { display: none; }
.sheet-title { margin-bottom: 0.2rem; font-size: 0.9rem; letter-spacing: 0.16em; text-transform: uppercase; }
.sheet .textlink { justify-content: center; }

.toast {
  position: fixed;
  z-index: 44;
  left: 50%;
  bottom: calc(6.2rem + env(safe-area-inset-bottom, 0px));
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(58, 20, 36, 0.92);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: none;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- RSVP / call / share and "good to know" ---------- */
.respond { padding-top: 2.6rem; padding-bottom: 1.6rem; }
.respond .lede { max-width: 28rem; margin-top: 0.8rem; font-size: 1.2rem; }
.respond-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.6rem; }
.respond-actions .btn { min-width: min(17rem, 100%); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--line); box-shadow: none; }
.info-list { display: grid; gap: 1.1rem; max-width: 30rem; margin: 1.6rem auto 0; }
.info-row { display: grid; gap: 0.15rem; }
.info-label { margin: 0; font-size: 0.82rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lilac); }
.info-text { margin: 0; font-size: 1.25rem; }

@media (hover: hover) {
  .lang-switch button:not([aria-pressed="true"]):hover { background: rgba(122, 43, 72, 0.18); }
  .btn-ghost:hover { background: rgba(122, 43, 72, 0.18); color: #fff; }
  .qb:hover { background: rgba(122, 43, 72, 0.12); }
}
@media (max-width: 360px) {
  .qb { font-size: 0.72rem; }
  .lang-switch button { min-width: 2.75rem; padding: 0 0.55rem; font-size: 0.82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .quickbar, .toast, .sheet, .lang-switch button { transition: none; animation: none; }
}

@keyframes sheetin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.qb:focus-visible { outline-offset: -4px; border-radius: 18px; }
/* The language switch tucks away while reading downwards and returns as soon as the guest scrolls up */
.lang-switch { transition: opacity 0.3s ease, transform 0.4s var(--ease); }
.lang-switch.is-away { opacity: 0; transform: translateY(-140%); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .lang-switch { transition: none; } }

.privacy { max-width: 34rem; margin: 0 auto 0.9rem; padding: 0 1.25rem; font-size: 0.8rem; line-height: 1.5; text-align: center; color: rgba(122, 43, 72, 0.82); }

/* =====================================================================
   Valaikappu: poster look (cream paper, maroon ink, gold, hanging garlands)
   ===================================================================== */
body { background: var(--purple); }
.lede, .closing-line { white-space: pre-line; }
.lede { color: var(--rose); }
.hero::before, .hero::after { content: ""; position: absolute; top: 0; z-index: 0; width: min(33vw, 170px); aspect-ratio: 400 / 640; background-size: 100% 100%; background-repeat: no-repeat; pointer-events: none; }
.hero::before { left: 0; background-image: url("../assets/corner-tl.png"); }
.hero::after { right: 0; background-image: url("../assets/corner-tr.png"); }
.hero > * { position: relative; z-index: 1; }
.footer { position: relative; }
.footer::before { content: ""; position: absolute; right: 0; bottom: 0; width: min(30vw, 150px); aspect-ratio: 315 / 560; background: url("../assets/corner-br.png") right bottom / 100% 100% no-repeat; pointer-events: none; z-index: -1; opacity: 0.95; }
.deity img { filter: none; }
.deity::before { display: none; }

/* couple photo in an arch with a gold double line */
.photo-section { padding-top: 1rem; padding-bottom: 1rem; }
.couple-photo { position: relative; width: min(19rem, 78vw); margin: 0 auto; padding: 0.55rem; border: 1.5px solid var(--gold); border-radius: 999px 999px 26px 26px; background: rgba(255, 255, 255, 0.5); box-shadow: 0 26px 40px -26px rgba(90, 31, 56, 0.55); }
.couple-photo::before { content: ""; position: absolute; inset: -9px; border: 1px solid var(--line-soft); border-radius: 999px 999px 34px 34px; pointer-events: none; }
.couple-photo img { display: block; width: 100%; height: auto; aspect-ratio: 764 / 1084; object-fit: cover; object-position: 50% 30%; border-radius: 999px 999px 20px 20px; }

/* Tamil lettering: no letter-spacing, bold Noto Sans Tamil like the poster */
html[lang="ta"] body { line-height: 1.75; }
html[lang="ta"] .script-title, html[lang="ta"] .cover-script { font-weight: 700; font-size: clamp(2rem, 8.6vw, 3.1rem); line-height: 1.35; color: #1f1a1c; }
html[lang="ta"] .cover-names, html[lang="ta"] .hero-names, html[lang="ta"] .couple-name { font-weight: 700; line-height: 1.3; color: var(--white); }
html[lang="ta"] .cover-names { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
html[lang="ta"] .hero-names { font-size: clamp(2.1rem, min(9.6vw, 7vh), 3.6rem); }
html[lang="ta"] .couple-name { font-size: clamp(1.9rem, 8.4vw, 3rem); }
html[lang="ta"] .couple-join, html[lang="ta"] .cover-names .union, html[lang="ta"] .hero-names .union { font-weight: 400; color: var(--gold-deep); }
html[lang="ta"] .eyebrow, html[lang="ta"] .caps-title, html[lang="ta"] .tick-label, html[lang="ta"] .footer-line, html[lang="ta"] .venue-name, html[lang="ta"] .btn, html[lang="ta"] .qb span, html[lang="ta"] .sc-text { letter-spacing: 0; text-indent: 0; padding-left: 0; text-transform: none; }
html[lang="ta"] .caps-title { font-weight: 700; font-size: clamp(1.3rem, 5.2vw, 1.7rem); color: #1f1a1c; }
html[lang="ta"] .venue-name { font-weight: 700; font-size: clamp(1.6rem, 6.4vw, 2.2rem); color: var(--green); }
html[lang="ta"] .btn { font-size: 1rem; }
html[lang="ta"] .lede, html[lang="ta"] .closing-line { font-size: 1.12rem; line-height: 1.95; }
html[lang="ta"] .db-month, html[lang="ta"] .db-year, html[lang="ta"] .db-day i, html[lang="ta"] .hero-time { font-weight: 700; }
html[lang="ta"] .hero-time { color: var(--rose); letter-spacing: 0; }
.eyebrow { color: var(--rose); }
.caps-title { color: #1f1a1c; }
.venue-name { color: var(--green); }
.tick-num { color: var(--maroon); }
.flourish { filter: none; }
.hero-place { margin-top: 0.3rem; font-size: 1.2rem; font-weight: 700; color: var(--green); }
.hero::before, .hero::after { width: min(34vw, 175px); aspect-ratio: auto; height: min(54vw, 280px); }
.hero::before { background-image: url("../assets/corner-tl.png"); background-size: auto 100%; background-position: left top; }
.hero::after { background-image: url("../assets/corner-tr.png"); background-size: auto 100%; background-position: right top; }
.deity { aspect-ratio: 480 / 555; }
.hero .deity { width: min(140px, 38vw, 20vh); }
.cover .deity-hero { width: min(104px, 30vw); }
.tick { background: rgba(255, 252, 247, 0.7); border-color: var(--line-soft); }
.footer::before { width: min(26vw, 130px); opacity: 0.85; }

/* English names: keep each word whole and size to fit a phone */
.wd { display: inline-block; white-space: nowrap; }
html[lang="en"] .hero-names { font-size: clamp(2.6rem, min(12.5vw, 10vh), 5.6rem); }
html[lang="en"] .cover-names { font-size: clamp(2rem, 9.5vw, 3.4rem); }
html[lang="en"] .couple-name { font-size: clamp(1.9rem, 8.5vw, 2.8rem); }

/* Tamil: centre the text inside every button */
html[lang="ta"] .btn, html[lang="ta"] .quickbar a, html[lang="ta"] .quickbar button, html[lang="ta"] .sheet a, html[lang="ta"] .sheet button, html[lang="ta"] .scroll-cue, html[lang="ta"] .lang-switch button, html[lang="ta"] .enquiry a, html[lang="ta"] .cover-open {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.3;
}
html[lang="ta"] .quickbar a, html[lang="ta"] .quickbar button { flex-direction: column; }
html[lang="ta"] .btn, html[lang="ta"] .cover-open { letter-spacing: 0; text-indent: 0; padding-left: 1.2rem; padding-right: 1.2rem; white-space: normal; min-width: 11rem; }
[hidden] { display: none !important; }
