/* Ishani & Sankalp — colours and type taken from the wardrobe guide PDF */
:root {
  --cream: #fff7ed;
  --olive: #5c6b04;
  --olive-deep: #454f03;
  --olive-text: #554d05;
  --gold: #af742e;
  --gold-soft: #d6a866;
  --brown: #65381c;
  --navy-rule: #1c304b;
  --white: #ffffff;
  --frame-ratio: 1132 / 1634;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--brown);
  font-family: "Forum", Georgia, serif;
  overflow-x: hidden;
  min-height: 100vh;
}
body.locked { overflow: hidden; height: 100vh; }
img { display: block; max-width: 100%; }

/* ---------- Envelope intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 24px 16px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,247,237,.0) 0%, rgba(40,46,2,.55) 100%),
    var(--olive);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
#intro::before {
  content: ""; position: absolute; inset: 0;
  background: url("img/frame-sm.webp") center / cover no-repeat;
  opacity: .22; filter: blur(2px) saturate(1.1);
  pointer-events: none;
}
#intro.gone { opacity: 0; transform: scale(1.08); pointer-events: none; }

.env {
  position: relative; z-index: 1;
  width: min(82vw, 380px); aspect-ratio: 1.45;
  perspective: 1200px; cursor: pointer;
  outline: none;
  animation: env-float 4s ease-in-out infinite;
}
.env:focus-visible { filter: drop-shadow(0 0 0 2px var(--gold-soft)); }
.env.open { animation: none; cursor: default; }
@keyframes env-float {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-8px) rotate(.6deg); }
}
.env > * { position: absolute; }
.env-back {
  inset: 0; border-radius: 6px;
  background: linear-gradient(160deg, #4f5c03, #3c4602);
  box-shadow: 0 24px 50px rgba(20, 24, 0, .45), 0 4px 10px rgba(0,0,0,.25);
}
.env-letter {
  left: 6%; right: 6%; top: 6%; height: 88%;
  background: var(--white);
  border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  text-align: center; color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform 1.1s var(--ease);
  z-index: 2;
}
.env-letter img { width: 13%; }
.env-letter .ln { font-size: clamp(15px, 4.6vw, 21px); letter-spacing: .35em; padding-left: .35em; }
.env-letter .amp { font-family: "Pinyon Script", cursive; font-size: clamp(28px, 8vw, 38px); color: var(--olive-text); line-height: .8; }
.env-letter .dt { font-size: clamp(11px, 3vw, 13px); letter-spacing: .3em; color: var(--brown); margin-top: 2%; }
.env.open .env-letter { transform: translateY(-58%); }
.env-front { inset: 0; z-index: 3; pointer-events: none; }
.env-front svg, .env-flap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.env-flap {
  left: 0; right: 0; top: 0; height: 60%;
  z-index: 4; transform-origin: 50% 0;
  transition: transform .8s var(--ease), z-index 0s .4s;
  pointer-events: none;
}
.env.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.seal {
  z-index: 5; left: 50%; top: 60%; width: 22%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #e2b276, var(--gold) 55%, #7c4f1c);
  box-shadow: 0 4px 10px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25), inset 0 2px 4px rgba(255,255,255,.35);
  display: grid; place-items: center;
  transition: transform .5s var(--ease), opacity .4s;
}
.seal::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(214, 168, 102, .7);
  animation: seal-ring 2s ease-out infinite;
}
@keyframes seal-ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.seal img { width: 52%; filter: brightness(0) invert(1) sepia(.3); opacity: .95; }
.env.open .seal { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }

.intro-text { position: relative; z-index: 1; text-align: center; color: var(--cream); transition: opacity .5s; }
.intro-text h2 { font-family: "Pinyon Script", cursive; font-weight: 400; font-size: clamp(40px, 11vw, 58px); line-height: 1.1; color: #fdeccf; }
.intro-text p { font-family: "Lora", serif; font-style: italic; font-size: 16px; letter-spacing: .02em; opacity: .85; margin-top: 6px; animation: soft-pulse 2.4s ease-in-out infinite; }
@keyframes soft-pulse { 50% { opacity: .45; } }
#intro.opening .intro-text { opacity: 0; }

/* ---------- Falling flowers ---------- */
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.petal {
  position: absolute; top: 0; width: 22px; height: 22px;
  background: url("img/flower.png") center / contain no-repeat;
  opacity: 0;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { transform: translate(0, -8vh) rotate(0deg); opacity: 0; }
  8% { opacity: .95; }
  90% { opacity: .9; }
  100% { transform: translate(var(--dx, 40px), 108vh) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* ---------- Page ---------- */
main { padding: 32px 0 40px; }
.card {
  position: relative;
  width: min(100% - 32px, 560px);
  margin: 0 auto;
  aspect-ratio: var(--frame-ratio);
  background: url("img/frame.webp") center / 100% 100% no-repeat, var(--white);
  box-shadow: 0 18px 40px rgba(69, 79, 3, .16), 0 2px 6px rgba(69, 79, 3, .12);
  container-type: inline-size;
  overflow: hidden;
}
.card + .card, .section + .card, .card + .section, .section + .section, #events + .card, .section + #events { margin-top: 56px; }

/* each row is placed at the PDF's own position (centre x of the arch is 50.6%) */
.r {
  position: absolute; left: 50.6%; top: var(--y);
  transform: translate(-50%, -50%);
  text-align: center; white-space: nowrap;
}
.a {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 110ms + 120ms);
}
.card.in .a { opacity: 1; transform: none; }

.ganesh { width: 10.6cqw; }
.card.in .ganesh { animation: shimmer 3.2s ease-in-out 1.4s infinite; }
@keyframes shimmer { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 1.2cqw rgba(214, 168, 102, .75)); } }

.title {
  font-family: "Lora", serif; font-style: italic; font-weight: 700;
  font-size: 4.8cqw; color: var(--olive-text);
}
.couple { height: 25.8cqw; width: auto; margin: 0 auto; }
.card.in .couple { animation: drift 6s ease-in-out 1.6s infinite; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1cqw); } }

.month { font-family: "Noto Serif", serif; font-size: 2.6cqw; letter-spacing: .06em; color: var(--gold); }
.daterow { display: flex; align-items: center; gap: 2.4cqw; }
.daterow .side {
  position: relative; width: 18cqw; padding: 1.4cqw 0;
  font-family: "Noto Serif", serif; font-size: 2.6cqw; color: var(--gold); letter-spacing: .02em;
}
.daterow .side::before, .daterow .side::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--navy-rule) 15%, var(--navy-rule) 85%, transparent);
  opacity: .55;
}
.daterow .side::before { top: 0; }
.daterow .side::after { bottom: 0; }
.daterow .num { font-family: "Noto Serif", serif; font-weight: 700; font-size: 7cqw; color: var(--gold); line-height: 1; }
.year { font-family: "Noto Serif", serif; font-size: 2.4cqw; letter-spacing: .28em; padding-left: .28em; color: var(--gold); }
.theme { font-family: "Forum", serif; color: var(--olive-text); font-size: 2.5cqw; letter-spacing: .4em; padding-left: .4em; line-height: 1.6; font-weight: 700; white-space: normal; width: 40cqw; }
.theme b { display: block; font-weight: 700; }
.dress { font-family: "Forum", serif; font-size: 3.4cqw; color: var(--brown); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.attire { font-family: "Forum", serif; font-size: 3.4cqw; color: var(--brown); line-height: 1.3; }
.swatches { display: flex; gap: 1.4cqw; }
.sw {
  width: 5.8cqw; height: 5.8cqw;
  border-radius: 52% 48% 55% 45% / 48% 55% 45% 52%;
  transform: scale(0); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1);
  transition-delay: calc(var(--i) * 120ms + 1.3s);
}
.sw.img { border-radius: 50%; background-size: cover; background-position: center; }
.card.in .sw { transform: scale(1); }

/* cover */
.intro-line { font-family: "Lora", serif; font-style: italic; font-weight: 600; font-size: 3.05cqw; line-height: 1.55; color: var(--brown); letter-spacing: .03em; }
.name { font-family: "Forum", serif; font-size: 6.3cqw; letter-spacing: .62em; padding-left: .62em; color: var(--gold); }
.name span { display: inline-block; opacity: 0; transform: translateY(.4em); filter: blur(4px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }
.card.in .name span { opacity: 1; transform: none; filter: none; }
.amp { font-family: "Pinyon Script", cursive; font-size: 12cqw; line-height: 1; color: var(--olive-text); }
.on { font-family: "Lora", serif; font-style: italic; font-weight: 700; font-size: 4.2cqw; color: var(--olive); }
.bigdate { font-family: "Forum", serif; font-size: 5cqw; color: #4a2c16; }
.ornament { width: 22cqw; }
.hashtag { font-family: "Lora", serif; font-style: italic; font-weight: 700; font-size: 2.9cqw; color: var(--olive-text); }

/* closing note card */
.note { font-family: "Lora", serif; font-style: italic; font-size: 3.4cqw; line-height: 1.5; color: var(--olive-text); white-space: normal; width: 68cqw; }
.reserved { list-style: none; margin: 22px auto 0; max-width: 420px; text-align: left; }
.reserved li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 4px; border-bottom: 1px dashed rgba(175, 116, 46, .45);
}
.reserved li:first-child { border-top: 1px dashed rgba(175, 116, 46, .45); }
.reserved span { font-family: "Lora", serif; font-style: italic; font-weight: 700; color: var(--olive-text); font-size: 17px; }
.reserved b { font-family: "Forum", serif; font-weight: 400; color: var(--brown); font-size: 17px; text-align: right; }

/* ---------- Sections between cards ---------- */
.section { width: min(100% - 32px, 560px); margin: 0 auto; text-align: center; }
.kicker { font-family: "Noto Serif", serif; font-size: 12px; letter-spacing: .4em; padding-left: .4em; color: var(--gold); text-transform: uppercase; }
.script { font-family: "Pinyon Script", cursive; font-weight: 400; font-size: clamp(40px, 10vw, 54px); color: var(--olive-text); line-height: 1.15; margin-top: 4px; }
.sub { font-family: "Lora", serif; font-style: italic; color: var(--brown); font-size: 16px; margin-top: 6px; }
.rule { width: 160px; margin: 18px auto 0; opacity: .9; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.countdown { display: flex; justify-content: center; gap: clamp(8px, 3vw, 16px); margin-top: 24px; }
.cd {
  width: clamp(66px, 19vw, 96px); padding: 18px 0 12px;
  background: var(--white);
  border: 1px solid rgba(175, 116, 46, .45);
  border-radius: 999px 999px 10px 10px;
  box-shadow: 0 8px 20px rgba(69, 79, 3, .08);
}
.cd b { display: block; font-family: "Noto Serif", serif; font-weight: 700; font-size: clamp(24px, 7vw, 34px); color: var(--gold); font-variant-numeric: tabular-nums; }
.cd span { display: block; font-size: 12px; letter-spacing: .2em; padding-left: .2em; color: var(--olive-text); text-transform: uppercase; margin-top: 4px; }
.cd b.tick { animation: tick .45s var(--ease); }
@keyframes tick { from { transform: translateY(-6px); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- Blessing ---------- */
.blessing { text-align: center; font-family: "Noto Serif", serif; color: var(--gold); font-size: 15px; letter-spacing: .22em; margin: 4px 16px 18px; }

/* ---------- Scratch to reveal (arch-shaped, like the PDF) ---------- */
.scratch {
  position: relative; width: min(100%, 300px); aspect-ratio: 3 / 4; margin: 24px auto 0;
  border-radius: 999px 999px 14px 14px; overflow: hidden;
  box-shadow: 0 16px 34px rgba(69, 79, 3, .2);
  user-select: none; -webkit-user-select: none;
}
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .8s var(--ease); }
.scratch.done canvas { opacity: 0; pointer-events: none; }
.scratch-under {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--white); border: 2px solid var(--gold); border-radius: inherit;
}
.scratch-under img { width: 40px; margin-bottom: 10px; }
.su-day { font-family: "Noto Serif", serif; font-size: 14px; letter-spacing: .4em; padding-left: .4em; color: var(--gold); }
.su-date { font-family: "Noto Serif", serif; font-weight: 700; font-size: 84px; line-height: 1; color: var(--gold); }
.su-date span { font-size: .32em; vertical-align: super; font-weight: 400; }
.su-month { font-size: 20px; letter-spacing: .3em; padding-left: .3em; color: var(--olive-text); }
.su-what { font-family: "Lora", serif; font-style: italic; font-size: 15px; color: var(--brown); margin-top: 12px; }
.scratch.done .scratch-under > * { animation: pop .7s var(--ease) both; }
.scratch.done .scratch-under > :nth-child(2) { animation-delay: .08s; } .scratch.done .scratch-under > :nth-child(3) { animation-delay: .16s; }
.scratch.done .scratch-under > :nth-child(4) { animation-delay: .24s; } .scratch.done .scratch-under > :nth-child(5) { animation-delay: .32s; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.reveal-link { margin-top: 12px; background: none; border: 0; color: var(--gold); font-family: "Lora", serif; font-style: italic; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reveal-link[hidden] { display: none; }

/* ---------- Presence, families, venue ---------- */
.sub.big { font-size: 19px; line-height: 1.5; max-width: 420px; margin: 10px auto 0; }
.fam-card {
  margin: 22px auto 0; max-width: 360px; padding: 64px 20px 30px;
  background: var(--white); border: 1px solid rgba(175, 116, 46, .45);
  border-radius: 50% 50% 14px 14px / 90px 90px 14px 14px;
  box-shadow: 0 12px 28px rgba(69, 79, 3, .1);
}
.fam-pre { font-family: "Lora", serif; font-style: italic; color: var(--brown); font-size: 16px; }
.fam-name { font-size: clamp(24px, 7vw, 30px); letter-spacing: .2em; padding-left: .2em; color: var(--gold); margin-top: 10px; text-transform: uppercase; }
.fam-amp { font-family: "Pinyon Script", cursive; font-size: 40px; color: var(--olive-text); line-height: .9; margin-top: 6px; }
.venue-name { font-size: 24px; letter-spacing: .08em; color: var(--olive-text); margin-top: 14px; }
.venue-addr { font-family: "Lora", serif; font-style: italic; font-size: 16px; line-height: 1.55; color: var(--brown); margin-top: 6px; }
.map {
  margin-top: 20px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(175, 116, 46, .45); box-shadow: 0 12px 28px rgba(69, 79, 3, .12); background: #eee;
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.directions {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 13px 24px; border-radius: 999px;
  background: var(--olive); color: var(--cream); text-decoration: none; font-size: 17px; letter-spacing: .06em;
  box-shadow: 0 8px 18px rgba(69, 79, 3, .25);
}
.directions svg { width: 18px; height: 18px; }

footer { text-align: center; padding: 64px 16px 96px; }
footer .script { font-size: clamp(34px, 9vw, 46px); }
footer .tag { font-family: "Lora", serif; font-style: italic; font-weight: 700; color: var(--olive); margin-top: 10px; font-size: 17px; }

/* ---------- Music button ---------- */
#music {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--olive); color: #fdeccf;
  box-shadow: 0 6px 18px rgba(40, 46, 2, .35);
  display: none; place-items: center;
}
#music.show { display: grid; }
#music svg { width: 22px; height: 22px; }
#music.playing::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--olive); animation: seal-ring 2s ease-out infinite;
}
#music .off { display: none; }
#music.muted .on-i { display: none; }
#music.muted .off { display: block; }

/* ---------- Desktop / wide screens ---------- */
.side-leaf { display: none; }
@media (min-width: 900px) {
  body { background: radial-gradient(ellipse 70% 60% at 50% 30%, #fffaf2, var(--cream) 70%), var(--cream); }
  .side-leaf {
    display: block; position: fixed; bottom: -40px; z-index: 0; pointer-events: none;
    width: min(30vw, 440px); opacity: .9; transform-origin: 50% 100%;
    animation: leaf-sway 7s ease-in-out infinite;
  }
  .side-leaf.leaf-l { left: -6vw; }
  .side-leaf.leaf-r { right: -6vw; animation-name: leaf-sway-r; animation-delay: -3.5s; }
  @keyframes leaf-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
  @keyframes leaf-sway-r { 0%, 100% { transform: scaleX(-1) rotate(-1.5deg); } 50% { transform: scaleX(-1) rotate(1.5deg); } }
  main, footer { position: relative; z-index: 1; }

  .card { width: min(100% - 64px, 600px); }
  .section { width: min(100% - 64px, 680px); }
  .blessing { font-size: 18px; margin-bottom: 22px; }
  .kicker { font-size: 14px; }
  .script { font-size: 64px; }
  .sub { font-size: 19px; }
  .sub.big { font-size: 22px; max-width: 560px; }
  .card + .card, .section + .card, .card + .section, .section + .section, #events + .card, .section + #events { margin-top: 88px; }

  .scratch { width: 340px; }
  .su-date { font-size: 96px; }
  .countdown { gap: 22px; }
  .cd { width: 120px; padding: 24px 0 16px; }
  .cd b { font-size: 44px; }
  .cd span { font-size: 13px; }

  /* events side by side, like the reference */
  #events { display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; gap: 56px 48px; width: min(100% - 64px, 1100px); margin-left: auto; margin-right: auto; }
  #events .card { width: 100%; margin: 0; }
  #events .card + .card { margin-top: 0; }
  #events .card:last-child:nth-child(odd) { grid-column: 1 / -1; width: min(100%, 520px); justify-self: center; }

  .reserved { max-width: 520px; }
  .reserved span, .reserved b { font-size: 19px; }
  .fam-card { max-width: 440px; padding-top: 80px; border-radius: 50% 50% 16px 16px / 110px 110px 16px 16px; }
  .fam-pre { font-size: 18px; }
  .fam-name { font-size: 34px; }
  .venue-name { font-size: 30px; }
  .venue-addr { font-size: 18px; }
  .map { aspect-ratio: 16 / 9; }
  .directions { font-size: 18px; padding: 15px 30px; }
  footer .script { font-size: 56px; }
  footer .tag { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  #petals { display: none; }
}
