/* Nischithartham — rani pattu silk under a turmeric-cornered patrika.
   Every colour, size and space comes from the tokens below. */
:root {
  --rani: #9c1150;
  --rani-deep: #640934;
  --rani-bright: #b8195f;
  --pasupu: #f2b31b;
  --pasupu-deep: #b97f00;
  --kumkum: #c8102e;
  --paper: #fffbf4;
  --paper-edge: #eadcc4;
  --ink: #2b1220;
  --ink-soft: #6e4b5c;
  --on-silk: #fff6f9;
  --on-silk-soft: #f6cfe0;

  --font-te-display: 'Ramaraja', 'Noto Serif Telugu', serif;
  --font-display: 'Kalnia', 'Georgia', serif;
  --font-body: 'Anek Telugu', 'Noto Sans Telugu', system-ui, sans-serif;

  /* type scale (px): 14 / 17 / 20 / 26 / 34 / clamp hero */
  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lead: 1.25rem;
  --t-h3: 1.625rem;
  --t-h2: 2.125rem;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius-paper: 4px;
  --radius-pill: 999px;
  --column: 600px;
  --shadow-card: 0 24px 48px -18px rgba(58, 0, 22, 0.7), 0 2px 6px rgba(58, 0, 22, 0.25);
  --ease-meet: cubic-bezier(0.65, 0, 0.25, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.7;
  color: var(--on-silk);
  background: var(--rani);
  overflow-x: hidden;
}
/* The silk: diagonal sheen plus a fine weave, fixed behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px),
    radial-gradient(120% 70% at 15% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(118deg, var(--rani-deep) 0%, var(--rani) 32%, var(--rani-bright) 50%, var(--rani) 68%, var(--rani-deep) 100%);
}

[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
.te { font-family: var(--font-body); }
.en { display: block; }

:focus-visible { outline: 3px solid var(--pasupu); outline-offset: 3px; border-radius: 2px; }
.card :focus-visible { outline-color: var(--rani); }

/* ---------- Hero: the two tambulam plates ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  padding: var(--s6) var(--s4) var(--s7);
  text-align: center;
  overflow: hidden;
  position: relative;
}
.srirasthu {
  display: flex;
  gap: var(--s5);
  justify-content: center;
  font-family: var(--font-te-display);
  font-size: var(--t-lead);
  color: var(--pasupu);
  line-height: 1.4;
}
.stage {
  position: relative;
  width: min(100vw, 560px);
  aspect-ratio: 2 / 1;
  margin: var(--s2) 0;
}
.plate {
  position: absolute;
  top: 50%;
  width: 46%;
  aspect-ratio: 1;
  translate: -50% -50%;
  transition: transform 1.3s var(--ease-meet);
}
.plate-groom { left: 9%; transform: rotate(-10deg); }
.plate-bride { left: 91%; transform: rotate(46deg); }
.hero.is-open .plate-groom { transform: translateX(42%) rotate(14deg); }
.hero.is-open .plate-bride { transform: translateX(-42%) rotate(22deg); }

.rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  translate: -50% -50%;
  opacity: 0;
  transform: translateY(18%) scale(0.4);
  filter: drop-shadow(0 6px 10px rgba(58, 0, 22, 0.6)) drop-shadow(0 0 18px rgba(255, 214, 120, 0.55));
  transition: opacity 0.6s ease 1.05s, transform 0.8s cubic-bezier(0.3, 1.5, 0.5, 1) 1.05s;
}
.hero.is-open .rings { opacity: 1; transform: translateY(-12%) scale(1); }
.rings .spark { transform-origin: 24px -28px; opacity: 0; }
.hero.is-open .rings .spark { animation: spark 1.4s ease 1.8s 2; }
@keyframes spark { 0%, 100% { opacity: 0; transform: scale(0.2); } 45% { opacity: 1; transform: scale(1.15); } }

.names { display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.kicker {
  font-family: var(--font-te-display);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  color: var(--pasupu);
  line-height: 1.3;
  margin-bottom: var(--s2);
}
.name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 16vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--on-silk);
}
.amp {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  line-height: 1.1;
  color: var(--pasupu);
}
.names-te {
  font-family: var(--font-te-display);
  font-size: var(--t-lead);
  color: var(--on-silk-soft);
}
.hero-date .te { font-size: var(--t-lead); color: var(--on-silk); }
.hero-date .en { font-size: var(--t-body); color: var(--on-silk-soft); }
.hero .btn { margin-top: var(--s3); }
.hero.is-open #open-btn { opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }

/* ---------- Pattu border: turmeric paisleys ---------- */
.border-band {
  height: 30px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 30'%3E%3Crect width='44' height='30' fill='%23640934'/%3E%3Cpath d='M0 3.5H44M0 26.5H44' stroke='%23f2b31b' stroke-width='1.5'/%3E%3Cpath d='M14 22c-6 0-8-6-5-10s9-4 12-2c3-4 6-5 9-4-3 1-5 3-6 6-1 6-5 10-10 10z' fill='none' stroke='%23f2b31b' stroke-width='1.4'/%3E%3Ccircle cx='14' cy='16' r='2' fill='%23f2b31b'/%3E%3Ccircle cx='38' cy='15' r='1.6' fill='%23f2b31b'/%3E%3C/svg%3E")
    center / auto 100% repeat-x;
}

/* ---------- Paper cards with turmeric corners ---------- */
main { padding: var(--s7) var(--s4) var(--s8); display: grid; gap: var(--s7); }
.card {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: var(--s7) var(--s5);
  text-align: center;
  color: var(--ink);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-card);
  background:
    url('pasupu-a.svg') left -34px top -34px / 100px 100px no-repeat,
    url('pasupu-b.svg') right -34px top -34px / 100px 100px no-repeat,
    url('pasupu-b.svg') left -34px bottom -34px / 100px 100px no-repeat,
    url('pasupu-a.svg') right -34px bottom -34px / 100px 100px no-repeat,
    var(--paper);
}
.card > * + * { margin-top: var(--s4); }
.card h2 { display: flex; flex-direction: column; align-items: center; gap: 0; }
.card h2 .te { font-family: var(--font-te-display); font-weight: 400; font-size: var(--t-h2); line-height: 1.3; color: var(--rani); }
.card h2 .en { font-family: var(--font-display); font-weight: 400; font-size: var(--t-lead); color: var(--ink-soft); }
.card p.te, .card .te { line-height: 1.85; }
.card p.en { color: var(--ink-soft); }
.card > p.en { max-width: 34em; margin-left: auto; margin-right: auto; }

.ganesha { font-family: var(--font-te-display); color: var(--rani); font-size: var(--t-body); }
.lead { font-size: var(--t-lead); }
.couple-te { display: flex; flex-direction: column; align-items: center; font-family: var(--font-te-display); font-size: var(--t-h3); line-height: 1.4; color: var(--rani); }
.couple-te .with { font-family: var(--font-body); font-size: var(--t-body); color: var(--ink-soft); }

.families { border-top: 1px solid var(--paper-edge); padding-top: var(--s5); margin-top: var(--s6); display: grid; gap: var(--s5); }
.families h3 { display: flex; flex-direction: column; font-weight: 400; }
.families h3 .te { font-family: var(--font-te-display); font-size: var(--t-lead); color: var(--rani); }
.families h3 .en { font-size: var(--t-small); color: var(--ink-soft); }
.family p:first-child .te { font-weight: 600; }
.family p:first-child .en { font-size: var(--t-small); color: var(--ink-soft); }
.family-names .te { font-size: var(--t-lead); }
.family-names .en { color: var(--ink-soft); }

/* ---------- When and where ---------- */
.countdown .te { font-family: var(--font-te-display); font-size: var(--t-h3); color: var(--rani); line-height: 1.4; }
.countdown .en { color: var(--ink-soft); }
.events { list-style: none; margin: var(--s5) auto 0; padding: 0; max-width: 26rem; display: grid; gap: var(--s3); }
.events li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--s3);
  align-items: baseline;
  text-align: left;
  padding: var(--s3) 0;
  border-bottom: 1px dashed var(--paper-edge);
}
.events li:last-child { border-bottom: 0; }
.ev-time .te { font-weight: 600; }
.ev-time .en, .ev-name .en { font-size: var(--t-small); color: var(--ink-soft); }
.venue { margin-top: var(--s5); }
.venue-name { font-weight: 600; font-size: var(--t-lead); }
.venue-addr { color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin-top: var(--s5); }
.map {
  display: block;
  width: 100%;
  height: 260px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-paper);
  margin-top: var(--s5);
  background: var(--paper-edge);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: var(--s2) var(--s5);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  font: inherit;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn .te { font-weight: 600; font-size: var(--t-body); }
.btn .en { font-size: var(--t-small); opacity: 0.85; }
.btn:active { transform: translateY(1px); }
.btn-pasupu { background: var(--pasupu); color: var(--rani-deep); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.btn-pasupu:hover { background: #ffc53a; }
.btn-primary { background: var(--rani); color: var(--on-silk); }
.btn-primary:hover { background: var(--rani-deep); }
.btn-ghost { background: transparent; color: var(--rani); border-color: var(--rani); }
.btn-ghost:hover { background: rgba(156, 17, 80, 0.08); }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- RSVP form ---------- */
#rsvp-form { text-align: left; margin-top: var(--s5); display: grid; gap: var(--s5); }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s2); }
.field > label, .field > legend { display: block; padding: 0; margin-bottom: var(--s2); }
.field > label .te, .field > legend .te { font-weight: 600; display: inline; }
.field > label .en, .field > legend .en { font-size: var(--t-small); color: var(--ink-soft); }
.field small { color: var(--ink-soft); font-size: var(--t-small); }
input[type='text'], input[type='tel'], input[type='number'], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-paper);
  padding: var(--s3) var(--s4);
  min-height: 52px;
}
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--rani); outline-offset: 1px; border-color: var(--rani); }
textarea { resize: vertical; min-height: 96px; }
.field-error { color: var(--kumkum); font-size: var(--t-small); line-height: 1.4; }
.field-error .en { display: inline; margin-left: var(--s2); }
[aria-invalid='true'] { border-color: var(--kumkum) !important; }

.choice { grid-template-columns: 1fr 1fr; gap: var(--s3); }
.choice legend { grid-column: 1 / -1; }
.choice .field-error { grid-column: 1 / -1; }
.choice-opt { position: relative; cursor: pointer; }
.choice-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-opt > span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 64px;
  padding: var(--s2) var(--s3);
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-paper);
  background: #fff;
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.choice-opt > span .te { font-weight: 600; }
.choice-opt > span .en { font-size: var(--t-small); color: var(--ink-soft); }
.choice-opt:hover > span { border-color: var(--rani); }
.choice-opt input:checked + span { background: var(--rani); border-color: var(--rani); color: var(--on-silk); }
.choice-opt input:checked + span .en { color: var(--on-silk-soft); }
.choice-opt input:focus-visible + span { outline: 3px solid var(--rani); outline-offset: 2px; }

.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: var(--s2); max-width: 15rem; }
.stepper input { text-align: center; font-weight: 600; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-paper);
  border: 1.5px solid var(--rani);
  background: #fff;
  color: var(--rani);
  cursor: pointer;
}
.step:hover { background: rgba(156, 17, 80, 0.08); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; text-align: center; color: var(--kumkum); font-size: var(--t-small); }

.rsvp-done { margin-top: var(--s5); }
.rsvp-done:focus { outline: none; }
.done-title { font-family: var(--font-te-display); font-size: var(--t-h3); color: var(--rani); }
.done-sub { color: var(--ink-soft); margin: var(--s2) auto var(--s5); max-width: 30em; }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s5); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-paper); }
.photo-grid img:first-child:nth-last-child(odd) { grid-column: 1 / -1; aspect-ratio: 3 / 2; }

/* ---------- Footer ---------- */
.foot-inner {
  padding: var(--s7) var(--s4) var(--s8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}
.rings-small { width: 96px; filter: drop-shadow(0 4px 8px rgba(58, 0, 22, 0.5)); }
.rings-small .spark { display: none; }
.foot-te { font-family: var(--font-te-display); font-size: var(--t-h2); color: var(--pasupu); line-height: 1.3; }
.foot-en { font-family: var(--font-display); font-size: var(--t-lead); color: var(--on-silk-soft); }
.foot .btn { margin-top: var(--s4); }
.sign { margin-top: var(--s5); font-size: var(--t-small); color: var(--on-silk-soft); }
.contacts { margin-top: var(--s4); width: 100%; max-width: 26rem; }
.contacts .te { font-weight: 600; }
.contacts .en { font-size: var(--t-small); color: var(--on-silk-soft); }
.contacts ul { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s3); }
.contacts li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.contact-actions { display: flex; gap: var(--s2); }
.foot .btn-ghost { color: var(--on-silk); border-color: var(--on-silk-soft); min-height: 44px; padding: var(--s1) var(--s4); }
.foot .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Petals (one burst when the plates meet) ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.petal {
  position: absolute;
  top: -24px;
  left: var(--x);
  width: var(--w, 10px);
  height: calc(var(--w, 10px) * 1.5);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--c);
  opacity: 0.95;
  animation: fall var(--d) cubic-bezier(0.35, 0.1, 0.6, 1) var(--delay) forwards;
}
@keyframes fall {
  to { transform: translate3d(var(--drift), 110vh, 0) rotate(var(--rot)); opacity: 0.85; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  .card { padding: var(--s8) var(--s7); }
  .families { grid-template-columns: 1fr 1fr; }
  .families h3 { grid-column: 1 / -1; }
  .map { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate, .rings, .hero.is-open #open-btn { transition: none !important; }
  .hero.is-open .rings .spark { animation: none; }
  .petals { display: none; }
}
