:root {
  --forest: #10261c;
  --forest-2: #163323;
  --moss: #29432f;
  --marigold: #f0a830;
  --marigold-hi: #ffd27a;
  --sindoor: #c0392b;
  --paper: #f8ecc9;
  --paper-dim: #d9cfae;
  --ink: #2a1a0e;

  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --deva: 'Yatra One', 'Noto Serif Devanagari', serif;

  /* type scale, ratio ~1.25 */
  --t-sm: 0.95rem;
  --t-base: 1.2rem;
  --t-md: 1.5rem;
  --t-lg: 2rem;
  --t-xl: clamp(2.4rem, 6vw, 3.6rem);
  --t-hero: clamp(4rem, min(17vw, 15vh), 9.5rem);

  --gutter: clamp(16px, 5vw, 48px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--forest);
  color: var(--paper);
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--marigold-hi); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--marigold); color: var(--forest); padding: 8px 14px; border-radius: 6px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 16px; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(140% 60% at 50% 78%, #e08a4a 0%, #b25a45 16%, #6a3a50 34%, #2c2a4a 55%, #142a3a 75%, var(--forest) 100%);
}
.moon {
  /* sits top-right, clear of the centred names */
  position: absolute; right: 7%; top: max(5%, env(safe-area-inset-top));
  width: clamp(56px, 12vw, 130px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff8e2, #f6dfa4 55%, #e3b866);
  box-shadow: 0 0 60px 20px rgba(255, 220, 150, .25), 0 0 180px 60px rgba(255, 190, 110, .12);
  will-change: transform;
}
.fireflies { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.forest { position: absolute; inset: 0; z-index: 2; }
.forest svg { position: absolute; left: 0; bottom: -2px; width: 100%; height: 100%; will-change: transform; }
.forest svg:nth-child(1) path { fill: #3d3a4a; }
.forest svg:nth-child(2) path { fill: #2b3a35; }
.forest svg:nth-child(3) path { fill: #1b3226; }
.forest svg:nth-child(4) { z-index: 4; }
.forest svg:nth-child(4) path { fill: var(--forest); }

.hero-copy {
  position: relative; z-index: 4;
  text-align: center;
  padding: 0 var(--gutter);
  margin-top: -16vh;
  will-change: transform, opacity;
}
.invocation { font-family: var(--deva); color: var(--marigold-hi); font-size: var(--t-base); letter-spacing: .02em; }
.names {
  font-weight: 500;
  font-style: italic;
  line-height: .86;
  margin: .3em 0 .25em;
  display: flex; flex-direction: column; align-items: center;
}
.name {
  font-size: var(--t-hero);
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff6dc 10%, #f6d38a 60%, #d9963a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 0 transparent;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .35));
}
.amp { font-size: calc(var(--t-hero) * .45); color: var(--marigold); margin: -.05em 0 -.1em; }
.hero-when { font-size: var(--t-md); font-weight: 500; color: var(--paper); text-shadow: 0 1px 12px rgba(16, 38, 28, .8); }
@media (min-width: 820px) {
  .moon { right: 14%; top: 12%; }
}
.countdown {
  /* one quiet line in gold, set off from the date by hairlines */
  display: flex; align-items: center; justify-content: center; gap: .8em;
  margin-top: 1em;
  font-size: clamp(1rem, 4vw, 1.1rem); font-weight: 500; letter-spacing: .03em;
  color: var(--marigold-hi); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(16, 38, 28, .9);
}
.countdown::before, .countdown::after {
  content: ''; width: 28px; height: 1px; background: currentColor; opacity: .6;
}
.cd-num { font-weight: 700; }

/* page-load sequence: the one orchestrated moment */
[data-intro] { opacity: 0; translate: 0 18px; filter: blur(6px); }
.ready [data-intro] {
  opacity: 1; translate: 0 0; filter: blur(0);
  transition: opacity 1.2s var(--ease-out), translate 1.2s var(--ease-out), filter 1.2s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 220ms + 200ms);
}
.ready .name[data-intro] { transition-duration: 1.8s; }

.scroll-cue {
  position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; z-index: 5;
  width: 28px; height: 46px; border: 1.5px solid rgba(248, 236, 201, .6); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: var(--marigold-hi); animation: cue 2s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(14px); opacity: 0; } }

/* ---------- INVITE ---------- */
.invite {
  position: relative;
  max-width: 40rem; margin: 0 auto;
  padding: clamp(72px, 14vw, 140px) var(--gutter) clamp(40px, 8vw, 80px);
  text-align: center;
}
.invite-from { font-size: var(--t-md); font-style: italic; color: var(--marigold-hi); margin-bottom: 2.4rem; }
.families { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; margin-bottom: 1.8rem; }
.family-label { font-style: italic; color: var(--marigold); font-size: var(--t-base); }
.family-names { font-size: var(--t-lg); font-weight: 600; line-height: 1.15; white-space: nowrap; }
.family-note { color: var(--paper-dim); font-size: var(--t-sm); }
.families .and { font-size: var(--t-md); color: var(--marigold); font-style: italic; }
.invite-line { font-size: var(--t-md); font-style: italic; line-height: 1.45; color: var(--paper); max-width: 30em; margin: 0 auto; }

/* ---------- EVENTS + THREAD ---------- */
.events { padding: clamp(40px, 8vw, 80px) var(--gutter) clamp(80px, 12vw, 140px); }
.section-title {
  font-size: var(--t-xl); font-weight: 500; line-height: 1.05;
  text-align: center; margin-bottom: clamp(40px, 8vw, 80px);
  text-wrap: balance;
}
.thread-wrap { position: relative; max-width: 960px; margin: 0 auto; }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.thread path { fill: none; stroke-linecap: round; }
.thread-base { stroke: rgba(240, 168, 48, .14); stroke-width: 2; stroke-dasharray: 2 8; }
.thread-live { stroke: var(--marigold); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(240, 168, 48, .55)); }

.event-list { list-style: none; position: relative; display: grid; gap: clamp(56px, 10vw, 110px); }
.event {
  --accent: var(--marigold);
  position: relative;
  padding-left: 56px; /* room for thread on mobile */
}
.knot {
  position: absolute; left: 24px; top: 1.1rem;
  width: 22px; height: 22px; translate: -50% -50%;
  border-radius: 50%;
  border: 2px solid rgba(240, 168, 48, .4);
  background: var(--forest);
  transition: background .5s, border-color .5s, box-shadow .6s, scale .6s var(--ease-out);
}
.event.lit .knot {
  background: var(--accent); border-color: var(--marigold-hi);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 28px 4px color-mix(in srgb, var(--accent) 55%, transparent);
  scale: 1.15;
}
.event-body > * { opacity: .18; translate: 0 10px; transition: opacity .9s var(--ease-out), translate .9s var(--ease-out); }
.event.lit .event-body > * { opacity: 1; translate: 0 0; }
.event.lit .event-body > :nth-child(2) { transition-delay: .08s; }
.event.lit .event-body > :nth-child(3) { transition-delay: .16s; }
.event.lit .event-body > :nth-child(4) { transition-delay: .24s; }
.event.lit .event-body > :nth-child(5) { transition-delay: .32s; }

.ev-hindi { font-family: var(--deva); font-size: clamp(2.6rem, 10vw, 4.4rem); line-height: 1.1; color: var(--accent); }
.ev-title { font-size: var(--t-lg); font-weight: 600; line-height: 1.1; margin-top: .1em; }
.ev-tagline { font-style: italic; color: var(--paper-dim); font-size: var(--t-base); margin-top: .15em; }
.ev-meta { margin-top: .9rem; display: grid; gap: .2rem; font-size: var(--t-base); }
.ev-meta dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ev-meta dd.when { font-weight: 600; }
/* mobile: date / time and venue / place each on their own line */
.ev-meta .ln { display: block; }
.ev-meta dd.where { margin-top: .6rem; }
@media (min-width: 820px) {
  .ev-meta .ln { display: inline; }
  .ev-meta dd.where { margin-top: 0; }
}
.ev-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .8rem; }
.ev-links a {
  color: var(--marigold-hi); font-size: var(--t-sm); text-decoration: none;
  border-bottom: 1px solid rgba(255, 210, 122, .35); padding-bottom: 1px;
}
.ev-links a:hover { border-bottom-color: var(--marigold-hi); }

@media (min-width: 820px) {
  .event { padding-left: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 128px; }
  .knot { left: 50%; }
  .event-body { grid-column: 1; text-align: right; }
  .event:nth-child(even) .event-body { grid-column: 2; text-align: left; }
  .event-body .ev-links { justify-content: flex-end; }
  .event:nth-child(even) .ev-links { justify-content: flex-start; }
}

/* ---------- RSVP ---------- */
.rsvp {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: clamp(64px, 12vw, 120px) var(--gutter);
  overflow: hidden;
}
/* scalloped torana edge where forest meets paper */
.rsvp::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 12px;
  background: radial-gradient(circle at 10px -2px, var(--forest) 9px, transparent 10px) 0 0 / 20px 12px repeat-x;
}
.rsvp-inner { position: relative; z-index: 2; max-width: 34rem; margin: 0 auto; }
.rsvp .section-title { color: var(--forest); margin-bottom: .4em; }
.rsvp-sub { text-align: center; font-style: italic; color: #6b4a2a; margin-bottom: 2.4rem; }

.rsvp-form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .4rem; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: var(--t-base); color: var(--forest); }
legend { margin-bottom: .5rem; }
.opt { font-weight: 400; font-style: italic; color: #7a6040; }
input[type=text], input[type=tel], input[type=number], select, textarea {
  font: inherit; font-size: 1.15rem; color: var(--ink);
  width: 100%; padding: .7rem .9rem;
  background: #fffaf0; border: 1.5px solid #cdbb8e; border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310261c' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(16, 38, 28, .15); }
input::placeholder, textarea::placeholder { color: #a8956c; font-style: italic; }
.field.invalid input { border-color: var(--sindoor); }
.err { display: none; color: var(--sindoor); font-size: var(--t-sm); font-style: italic; }
.field.invalid .err { display: block; }

.reply-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.reply { position: relative; cursor: pointer; }
.reply input, .chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.reply span {
  display: grid; place-items: center; text-align: center; min-height: 3.4rem; padding: .5rem;
  border: 1.5px solid #cdbb8e; border-radius: 10px; background: #fffaf0;
  font-weight: 600; font-size: 1.15rem; color: var(--forest);
  transition: background .25s, color .25s, border-color .25s;
}
.reply.yes input:checked + span { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.reply.no input:checked + span { background: #6b4a2a; color: var(--paper); border-color: #6b4a2a; }
.reply input:focus-visible + span, .chip input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 2px; }

.when-yes { display: grid; gap: 1.4rem; transition: opacity .35s; }
.when-yes[hidden] { display: none; }

.event-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip span {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem .5rem .7rem; border-radius: 999px;
  border: 1.5px solid #cdbb8e; background: #fffaf0; color: var(--forest);
  font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s;
}
.chip span::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--chip); background: transparent; transition: background .2s;
}
.chip input:checked + span { border-color: var(--forest); background: #fff3d1; }
.chip input:checked + span::before { background: var(--chip); }

.stepper { display: inline-grid; grid-template-columns: 3rem 4.5rem 3rem; align-items: stretch; width: max-content; }
.stepper input { text-align: center; border-radius: 0; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.step {
  font: inherit; font-size: 1.5rem; line-height: 1; color: var(--forest); cursor: pointer;
  background: #fff3d1; border: 1.5px solid #cdbb8e;
}
.step:first-child { border-radius: 10px 0 0 10px; }
.step:last-child { border-radius: 0 10px 10px 0; }

.send {
  position: relative; margin-top: .4rem;
  font: inherit; font-size: 1.3rem; font-weight: 600; color: var(--forest);
  padding: 1rem 1.4rem; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, var(--marigold-hi), var(--marigold));
  box-shadow: 0 2px 0 #b87612, 0 10px 24px -10px rgba(184, 118, 18, .8);
  transition: translate .15s, box-shadow .15s;
}
.send:active { translate: 0 2px; box-shadow: 0 0 0 #b87612, 0 6px 16px -10px rgba(184, 118, 18, .8); }
.send[disabled] { opacity: .7; cursor: progress; }
.form-status { min-height: 1.4em; text-align: center; font-style: italic; color: var(--sindoor); font-size: var(--t-sm); }

.thanks { text-align: center; padding: 1rem 0; animation: rise .8s var(--ease-out) both; }
.thanks:focus { outline: none; }
.thanks-title { font-size: var(--t-xl); font-weight: 500; font-style: italic; color: var(--forest); line-height: 1.1; }
.thanks-body { margin: 1rem auto 1.6rem; max-width: 26em; color: #4a3520; }
.link-btn {
  font: inherit; font-size: var(--t-base); color: var(--forest); background: none; border: 0; cursor: pointer;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
@keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

.petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

/* ---------- FOOTER ---------- */
.foot { text-align: center; padding: 56px var(--gutter) max(56px, env(safe-area-inset-bottom)); }
.hashtag { font-size: var(--t-lg); font-style: italic; color: var(--marigold); }
.contact { color: var(--paper-dim); margin-top: .4rem; }
.contact a { color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-intro], .event-body > * { opacity: 1 !important; translate: none !important; filter: none !important; }
}
