/* Ceremony card tokens — see DESIGN.md */
:root {
  --paper: #F3E9D6;
  --card: #FBF4E6;
  --ink: #2B1A12;
  --sindoor: #7B1B28;
  --gold: #B8922F;
  --marigold: #D4892A;
  --muted: #6E5A4A;
  --frame: rgba(184, 146, 47, 0.55);
  --frame-strong: rgba(184, 146, 47, 0.9);
  --shadow: 0 18px 50px rgba(43, 26, 18, 0.12);
  --serif-ne: "Noto Serif Devanagari", "Noto Serif", Georgia, serif;
  --serif-en: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans Devanagari", "Segoe UI", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(212, 137, 42, 0.08), transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(123, 27, 40, 0.06), transparent 50%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  padding: 28px 18px 48px;
  width: 100%;
  max-width: 100%;
}

/* ── Card face ─────────────────────────────────────────── */
.card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 36px 24px 32px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--frame-strong);
  outline: 1px solid var(--frame);
  outline-offset: 5px;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.corner {
  position: absolute;
  width: 36px;
  height: 36px;
  color: var(--gold);
  pointer-events: none;
}
.corner-tl { top: 10px; left: 10px; }
.corner-tr { top: 10px; right: 10px; transform: scaleX(-1); }
.corner-bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.corner-br { bottom: 10px; right: 10px; transform: scale(-1); }

/* ── Blessing & ornament ───────────────────────────────── */
.blessing {
  margin-bottom: 20px;
}

.sanskrit {
  margin: 0;
  font-family: var(--serif-ne);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sindoor);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px auto 0;
  color: var(--gold);
}

.ornament-wide {
  margin: 28px auto;
}

.ornament .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--frame-strong), transparent);
  max-width: 88px;
}

.ornament .lotus {
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

/* ── Type hierarchy ────────────────────────────────────── */
.eyebrow {
  margin: 0 0 10px;
  font-family: var(--serif-ne);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--sindoor);
  text-transform: none;
}

.eyebrow .sep {
  color: var(--gold);
  margin: 0 6px;
  font-weight: 400;
}

.eyebrow-en {
  font-family: var(--serif-en);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.child-name {
  margin: 8px 0 4px;
  font-family: var(--serif-ne);
  font-size: clamp(28px, 7.5vw, 48px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

.child-name-en {
  margin: 0 0 18px;
  font-family: var(--serif-en);
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.occasion {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.occasion-ne {
  display: block;
  font-family: var(--serif-ne);
  font-size: 22px;
  font-weight: 600;
  color: var(--sindoor);
  line-height: 1.35;
}

.occasion-en {
  display: block;
  margin-top: 6px;
  font-family: var(--serif-en);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.blessing-copy {
  max-width: 38em;
  margin: 0 auto 28px;
}

.blessing-copy .ne {
  margin: 0 0 10px;
  font-family: var(--serif-ne);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.blessing-copy .en {
  margin: 0;
  font-family: var(--serif-en);
  font-size: 16px;
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Details strip ─────────────────────────────────────── */
.details {
  display: grid;
  gap: 16px;
  margin: 0 0 22px;
  padding: 18px 8px;
  border-top: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
}

.detail-rule {
  display: none;
}

.detail-label {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.detail-label span {
  font-family: var(--serif-en);
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: none;
  font-weight: 500;
}

.detail-value {
  margin: 0;
  font-family: var(--serif-ne);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.detail-sub {
  margin: 2px 0 0;
  font-family: var(--serif-en);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.35;
}

.hosts {
  margin: 0 0 18px;
}

.hosts-ne {
  display: block;
  font-family: var(--serif-ne);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.hosts-en {
  display: block;
  margin-top: 4px;
  font-family: var(--serif-en);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}

/* ── Map link ──────────────────────────────────────────── */
.map-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 10px 18px 12px;
  color: var(--sindoor);
  text-decoration: none;
  border: 1px solid var(--frame-strong);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.map-link:hover {
  background: rgba(123, 27, 40, 0.06);
  border-color: var(--sindoor);
}

.map-link:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
}

.map-ne {
  font-family: var(--serif-ne);
  font-size: 15px;
  font-weight: 600;
}

.map-en {
  font-family: var(--serif-en);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.map-icon {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  fill: currentColor;
  opacity: 0.85;
}

/* ── RSVP ──────────────────────────────────────────────── */
.rice-bowl {
  color: var(--gold);
  margin-bottom: 4px;
}

.rice-bowl svg {
  width: 72px;
  height: 50px;
}

.rsvp-title {
  margin: 0 0 6px;
  border: 0;
  padding: 0;
}

.rsvp-title-ne {
  display: block;
  font-family: var(--serif-ne);
  font-size: 22px;
  font-weight: 700;
  color: var(--sindoor);
  line-height: 1.35;
}

.rsvp-title-en {
  display: block;
  margin-top: 4px;
  font-family: var(--serif-en);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rsvp-lead {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--muted);
}

.rsvp-form {
  display: grid;
  gap: 18px;
  text-align: left;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.field label span,
.field legend span {
  font-family: var(--serif-ne);
  color: var(--sindoor);
}

.optional {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1.5px solid var(--frame-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  appearance: none;
  transition: border-color 0.15s ease;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(110, 90, 74, 0.55);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-bottom-color: var(--marigold);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--sindoor);
  box-shadow: 0 1px 0 0 var(--sindoor);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.choice input:focus-visible + .choice-face {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
}

.field select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 8px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.attendance {
  margin: 0;
  padding: 0;
  border: 0;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.choice {
  cursor: pointer;
  min-width: 0;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--frame-strong);
  background: transparent;
  text-align: center;
  overflow-wrap: break-word;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.choice:hover .choice-face {
  border-color: var(--marigold);
  background: rgba(212, 137, 42, 0.06);
}

.choice input:checked + .choice-face {
  border-color: var(--sindoor);
  background: rgba(123, 27, 40, 0.08);
  box-shadow: inset 0 0 0 1px var(--sindoor);
}

.choice-ne {
  font-family: var(--serif-ne);
  font-size: 17px;
  font-weight: 600;
  color: var(--sindoor);
}

.choice-en {
  margin-top: 2px;
  font-family: var(--serif-en);
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--sindoor);
  background: rgba(123, 27, 40, 0.06);
  color: var(--sindoor);
  font-size: 14px;
}

.submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 12px 16px;
  border: 1px solid var(--sindoor);
  border-radius: 0;
  background: var(--sindoor);
  color: var(--card);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.submit:hover:not(:disabled) {
  background: transparent;
  color: var(--sindoor);
}

.submit:active:not(:disabled) {
  background: rgba(123, 27, 40, 0.15);
}

.submit:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
}

.submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.submit-ne {
  font-family: var(--serif-ne);
  font-size: 16px;
  font-weight: 600;
}

.submit-en {
  font-family: var(--serif-en);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ── Success ───────────────────────────────────────────── */
.success {
  padding: 12px 0 8px;
  text-align: center;
}

.seal {
  width: 56px;
  height: 56px;
  color: var(--gold);
  margin-bottom: 8px;
}

.success-ne {
  margin: 0 0 6px;
  font-family: var(--serif-ne);
  font-size: 18px;
  font-weight: 600;
  color: var(--sindoor);
}

.success-en {
  margin: 0 0 10px;
  font-family: var(--serif-en);
  font-size: 16px;
  color: var(--ink);
}

.success-note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ── Footer ────────────────────────────────────────────── */
.card-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--frame);
  color: var(--muted);
}

.card-foot p {
  margin: 0;
  font-family: var(--serif-ne);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.foot-en {
  margin-top: 4px !important;
  font-family: var(--serif-en) !important;
  font-size: 13px !important;
  font-style: italic;
  letter-spacing: 0.02em !important;
  color: var(--muted) !important;
}

/* ── Desktop: three-up details ─────────────────────────── */
@media (min-width: 540px) {
  .page {
    padding: 48px 24px 64px;
  }

  .card {
    padding: 48px 40px 40px;
  }

  .details {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: start;
    gap: 8px;
    padding: 22px 0;
  }

  .detail-rule {
    display: block;
    width: 1px;
    height: 72px;
    background: var(--frame-strong);
    justify-self: center;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 30px 14px 26px;
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .child-name {
    font-size: 28px;
  }

  .detail-value {
    font-size: 17px;
  }
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .ornament .lotus {
    animation: pulse-soft 4s ease-in-out infinite;
  }

  .success .seal {
    animation: seal-in 0.45s ease both;
  }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes seal-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
