/* ═══════════════════════════════════════════════════════
   Աստղիկ & Սուրեն — wedding invitation
   palette: watercolor paper, olive, mauve (from the printed invite)
   fonts: Aida (Armenian serif) · Playfair Display (Latin serif) ·
          Victory & TAN Mon Cheri (her name) · Hack (his terminal) ·
          Cinzel (the &) · Gayane (invite closing)
   ═══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Gayane';
  src: url('../assets/fonts/Gayane-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gayane';
  src: url('../assets/fonts/Gayane-400i.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/Cinzel-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'TanMonCheri';
  src: url('../assets/fonts/TANMonCheri-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Victory';
  src: url('../assets/fonts/Victory-200.woff2') format('woff2');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aida';
  src: url('../assets/fonts/Aida-200.woff2') format('woff2');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aida';
  src: url('../assets/fonts/Aida-200i.woff2') format('woff2');
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Aida';
  src: url('../assets/fonts/Aida-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aida';
  src: url('../assets/fonts/Aida-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/fonts/PlayfairDisplay-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/fonts/PlayfairDisplay-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Hack';
  src: url('../assets/fonts/HackArm-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Hack';
  src: url('../assets/fonts/HackArm-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #f7f6f1;
  --paper-deep: #efeee6;
  --card: #fdfdfb;
  --ink: #2b2a26;
  --ink-soft: #5c5a51;
  --ink-faint: #8b887c;
  --olive: #6f7d57;
  --olive-deep: #55603f;
  --olive-wash: #eef0e6;
  --mauve: #c49a9b;
  --mauve-deep: #a5797c;
  --mauve-wash: #f5ecea;
  --line: #e3e1d6;
  --serif: 'Aida', Georgia, serif;
  --latin: 'Playfair Display', 'Aida', Georgia, serif;
  --mono: 'Hack', 'Aida', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--mauve-wash); color: var(--mauve-deep); }

.section {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.5rem;
}

.section__title {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--olive-deep);
  margin-bottom: 2.6rem;
}
.section__title::after {
  content: '';
  display: block;
  width: 56px; height: 1px;
  margin: 1.1rem auto 0;
  background: var(--mauve);
  opacity: 0.7;
}

/* ── reveal animation ─────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* paper texture behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
}

/* film grain overlay (hero only, animated) */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, transparent 62%, rgba(43, 42, 38, 0.10) 100%);
}
.hero__vignette::after {
  content: '';
  position: absolute;
  inset: -100px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-24px, 16px); }
  50% { transform: translate(18px, -22px); }
  75% { transform: translate(-14px, -12px); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__vignette::after { animation: none; }
}

/* section ornament divider */
.ornament {
  display: block;
  width: 200px;
  height: 20px;
  margin: 0 auto 2.6rem;
  opacity: 0.9;
}

/* ═══════════════════ HERO ═══════════════════ */

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* soft bottom fade so the photo melts into the page */
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background: linear-gradient(to top, var(--paper), transparent);
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
}

.lang { display: flex; align-items: center; gap: 0.4rem; }
.lang__btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  transition: color 0.2s;
}
.lang__btn.is-active { color: var(--olive-deep); font-weight: 700; }
.lang__sep { color: var(--ink-faint); font-size: 0.7rem; }

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.25rem;
}

.hero__eyebrow {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(0.8rem, 2.2vw, 1rem);
  letter-spacing: 0.9em; /* start wide — tracks in to 0.5em on entrance (js) */
  text-transform: uppercase;
  color: var(--olive-deep);
  margin-bottom: 1.6rem;
  text-indent: 0.5em; /* optically center letterspaced text */
  transition: letter-spacing 1.6s cubic-bezier(.16,.84,.28,1), opacity 1.2s ease;
}
html.no-js .hero__eyebrow { letter-spacing: 0.5em; }
/* entrance: eyebrow tracks in from wide */
html.js .hero.is-sequence-done .hero__eyebrow,
html.js .hero.is-entering .hero__eyebrow {
  letter-spacing: 0.5em;
  opacity: 1;
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  line-height: 1.05;
}

.hero__name--astghik {
  font-family: 'Victory', var(--serif);
  font-weight: 200;
  font-style: normal; /* Victory is upright — the didone look */
  font-size: clamp(3.4rem, 12.5vw, 7.2rem); /* matched with ՍՈՒՐԵՆ_ */
  letter-spacing: 0.14em;
  color: var(--ink);
  text-indent: 0.14em;
}
/* EN: her name in TAN Mon Cheri — a ligature font, so drop the wide
   tracking (it would break the ligatures) */
html[lang="en"] .hero__name--astghik {
  font-family: 'TanMonCheri', 'Victory', var(--serif);
  font-weight: 400;
  letter-spacing: 0;
  text-indent: 0;
}

.hero__amp {
  font-family: 'Cinzel', var(--latin);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  color: var(--mauve);
  line-height: 1;
  margin: 0.1rem 0;
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.18,.9,.26,1.28);
}
html.js .hero:not(.is-sequence-done) .hero__amp {
  opacity: 0;
  transform: translateY(10px) scale(0.85);
}
/* the & appears mid-sequence, ahead of the entrance gate */
html.js .hero__amp.is-in {
  opacity: 1 !important;
  transform: none !important;
}

.hero__name--suren {
  font-family: var(--mono);
  font-weight: 400;
  /* matched with Աստղիկ */
  font-size: clamp(3.4rem, 12.5vw, 7.2rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive-deep);
  text-indent: 0.1em;
  position: relative;
  min-height: 1.1em; /* holds height while typewriter fills in */
}
.hero__name--suren::after {
  /* real terminal block cursor — box aligned to the baseline,
     height ≈ Hack cap height, width ≈ one monospace cell */
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.78em;
  margin-left: 0.12em;
  vertical-align: baseline;
  background: var(--mauve);
  border-radius: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ═══════════════════ INVITE TEXT ═══════════════════ */

.invite { text-align: center; padding-top: clamp(4rem, 10vw, 7rem); letter-spacing: 0.3px; }

.invite__intro {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--mauve-deep);
  margin-bottom: 1.8rem;
}

.invite__body {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  line-height: 2;
  color: var(--ink-soft);
  max-width: 40em;
  margin: 0 auto;
}

.invite__closing {
  margin-top: 2.2rem;
  font-family: 'Gayane', var(--serif);
  font-weight: 400;
  font-style: italic; /* Gayane has a true italic face */
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  color: var(--olive-deep);
}

/* ═══════════════════ CALENDAR ═══════════════════
   thin serif month, hand-drawn heart sketch on the day,
   mono date, flourish — all on a rectangular card */

.calendar-section { padding-bottom: clamp(3rem, 8vw, 5rem); }

.calendar-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  width: min(92vw, 560px);
  margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 3.2rem) clamp(1.5rem, 5vw, 3.2rem) clamp(1.8rem, 5vw, 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  box-shadow:
    0 1px 2px rgba(43, 42, 38, 0.04),
    0 18px 50px rgba(43, 42, 38, 0.09);
  transition: transform 0.6s cubic-bezier(.16,.84,.28,1), box-shadow 0.6s ease;
}
.calendar-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(43, 42, 38, 0.05),
    0 24px 60px rgba(43, 42, 38, 0.10);
}
/* inner mat frame — a thin second border, like a card liner */
.calendar-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(196, 154, 155, 0.35);
  border-radius: 16px;
  pointer-events: none;
}

.calendar-card__month {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(1.3rem, 4.8vw, 1.8rem);
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  color: var(--olive-deep);
}

.calendar-card__year {
  font-family: var(--latin);
  font-weight: 400;
  font-size: clamp(0.9rem, 3.4vw, 1.1rem);
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  color: var(--ink-faint);
  margin: 0.2rem 0 clamp(1.2rem, 3.5vh, 1.6rem);
}

.calendar { width: 100%; max-width: 400px; margin: 0 auto; }

.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.5rem;
}
.calendar__weekdays span {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(0.66rem, 2.7vw, 0.78rem);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding: 0.35rem 0;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 0.3rem;
}

.calendar__day {
  position: relative;
  font-family: var(--latin);
  font-size: clamp(0.95rem, 3.6vw, 1.12rem);
  color: var(--ink);
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
}
.calendar__day--muted { color: var(--ink-faint); opacity: 0.55; }

.day-num { position: relative; z-index: 1; }

/* the day itself: plain ink, no fill — the heart does the work */
.calendar__day--today { font-weight: 600; color: var(--ink); }

/* hand-drawn tilted heart sketch: a thin, incomplete outline with a
   fainter oversketch — like a pencil sketch that was never finished */
.day-heart {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 3em;
  aspect-ratio: 120 / 100;
  transform: translate(-50%, -50%) rotate(-14deg);
  pointer-events: none;
}
.day-heart svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* the date in terminal mono — ties the card to the SUREN_ theme */
.calendar-card__date {
  font-family: var(--mono);
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  letter-spacing: 0.18em;
  color: var(--mauve-deep);
  margin-top: clamp(1.1rem, 3.5vh, 1.6rem);
}

.flourish {
  width: clamp(120px, 30vw, 160px);
  height: auto;
  margin: clamp(1rem, 3vh, 1.6rem) auto 0;
  display: block;
}

/* ═══════════════════ SIDE PHOTOS ═══════════════════
   the four moments live WITH their sections — each photo
   accompanies the content it belongs to (invite, calendar,
   program, rsvp). No photo gallery anywhere on the page. */

.side-photo {
  margin: 0;
  display: flex;
  align-items: stretch;
}
.side-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.calendar__photo img { object-position: 50% 38%; } /* faces fully inside the slice (30–47%) */
.rsvp__photo img { object-position: 50% 48%; }

/* the program photo shows the full image — no crop,
   natural 2:3 aspect, centered in its column */
.program__photo {
  display: block;
  align-self: center;
}
.program__photo img {
  height: auto;
  object-fit: initial;
}

.program__main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(2.2rem, 6vw, 3.2rem) clamp(1.5rem, 5vw, 3.2rem);
  box-shadow: 0 18px 50px rgba(43, 42, 38, 0.06);
  position: relative;
}

/* invite: no photo — the letter is a compact page, not a full empty screen
   (full rule lives after .story__slide so min-height: 0 wins the cascade) */

/* split layouts — photo + content side by side */
/* layered composition — cards sit in front (z 2), the photos slide
   underneath them (z 1) with a small negative overlap */
.calendar-card,
.program__main { position: relative; z-index: 2; }
.calendar__photo,
.program__photo { position: relative; z-index: 1; }
@media (max-width: 820px) {
  /* stacked: photos tuck up under the card/program above them.
     grid gap (~24px) eats part of the pull — net visible overlap ~24px */
  .calendar__photo { margin-top: -3rem; }
  .program__photo { margin-top: -3rem; }
  /* border-to-border: section photos run edge to edge, no rounding */
  .calendar__photo,
  .program__photo {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
  }
}
@media (min-width: 821px) {
  /* side by side: photos tuck under the card/program's edge.
     desktop grid gap can be up to 40px — pull 64px → net overlap ~24px */
  .calendar__photo { margin-left: -4rem; }
  .program__photo { margin-left: -4rem; }
}

.invite__split,
.calendar__split,
.program__split,
.rsvp__split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
.invite__split { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; } /* the letter stands alone, centered */
.calendar__split { grid-template-columns: 1.25fr 0.75fr; }
.program__split { grid-template-columns: 1.15fr 0.85fr; }
.rsvp__split { grid-template-columns: 0.85fr 1.15fr; }

.invite__text { text-align: left; }

/* the calendar card fits its split column */
.calendar__split .calendar-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .rsvp-form { gap: 2rem; padding: 2.4rem 1.6rem 2rem; }
  .field { gap: 0.8rem; }
  .input { padding: 0.8rem 0.15rem; font-size: 1.1rem; }
  .input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
  .input[type="number"]::-webkit-outer-spin-button,
  .input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  /* mobile: pills stack full-width — one big tap target per row */
  .seg { flex-direction: column; gap: 0.7rem; }
  .seg__opt span { padding: 0.9rem 1rem; font-size: 1rem; }
  .rsvp__deadline { margin-top: 0.4rem; line-height: 1.6; }
  /* mobile: story slides flow naturally — no 100svh traps, full photos reachable */
  .invite__split,
  .calendar__split,
  .program__split,
  .rsvp__split {
    grid-template-columns: 1fr;
  }
  .side-photo { height: clamp(240px, 38vh, 340px); }
  .program__photo { height: auto; }       /* full piggyback, no crop */
  .program__photo img { height: auto; }
  .calendar__photo { order: 2; }
  .program__photo { order: 2; }
  .rsvp__photo { order: 1; }
  .invite__text { text-align: center; }
}

/* ═══════════════════ PROGRAM ═══════════════════ */

.program { text-align: center; }

.program__item {
  padding: 0.5rem 0 1.5rem;
}

.program__time {
  font-family: var(--latin);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  color: var(--olive-deep);
  text-shadow: 0 2px 20px rgba(85, 96, 63, 0.12);
}

.program__name {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.program__venue {
  margin-top: 0.4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  color: var(--mauve-deep);
}

.program__address {
  font-family: var(--serif);
  font-weight: 200;
  font-size: 0.92rem;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}

.program__divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(340px, 70%);
  margin: 1.6rem auto;
}
.program__divider::before, .program__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.program__divider span {
  width: 8px; height: 8px;
  border: 1.5px solid var(--mauve);
  border-radius: 50%;
}

/* ═══════════════════ BUTTONS ═══════════════════ */

.btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.62rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  color: var(--olive-deep);
  border: 1.5px solid var(--olive);
  border-radius: 999px;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.btn:hover {
  background: var(--olive);
  color: #fff;
  box-shadow: 0 10px 26px rgba(85, 96, 63, 0.30);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 40%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: none;
}
.btn:hover::after { left: 130%; transition: left 0.7s ease; }

.btn--solid {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
  width: 100%;
  max-width: 340px;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}
.btn--solid:hover { background: var(--olive-deep); box-shadow: 0 12px 30px rgba(85, 96, 63, 0.34); }
.btn--solid:disabled { opacity: 0.55; cursor: wait; }

/* sending state — replaces the form the instant it's submitted */
.rsvp-sending {
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--olive-deep);
}
.rsvp-sending__spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid var(--olive-wash);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════ RSVP STATE MACHINE ═══════════════════
   [data-rsvp="form"]    → default, form visible
   [data-rsvp="sending"] → spinner visible
   [data-rsvp="done"]    → thank-you visible */

[data-rsvp] .rsvp-form,
[data-rsvp] .rsvp-sending,
[data-rsvp] .rsvp-done    { display: none; }

[data-rsvp="form"]    .rsvp-form    { display: flex; flex-direction: column; gap: 1.5rem; }
[data-rsvp="sending"] .rsvp-sending { display: flex; }
[data-rsvp="done"]    .rsvp-done    { display: block; }

/* ═══════════════════ RSVP ═══════════════════ */

.rsvp { text-align: center; background: var(--paper-deep); }

.rsvp__deadline {
  margin-top: -1.2rem;
  margin-bottom: 2.4rem;
  display: inline-block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  color: var(--mauve-deep);
  background: var(--mauve-wash);
  border: 1px solid var(--mauve);
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
}

.rsvp__extra:not([hidden]) { animation: rsvpIn 0.4s ease; }
@keyframes rsvpIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.rsvp-form {
  max-width: 460px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.6rem, 5vw, 2.6rem);
  text-align: left;
  box-shadow: 0 18px 50px rgba(43, 42, 38, 0.06);
  /* flex layout comes from [data-rsvp="form"] .rsvp-form in the state machine */
}

.field { display: flex; flex-direction: column; gap: 0.55rem; }

.field__label {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.input {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 0.45rem 0.1rem;
  outline: none;
  transition: border-color 0.25s;
  width: 100%;
}
.input:focus { border-color: var(--mauve); }
.input::placeholder { color: var(--ink-faint); }

/* segmented radio */
.seg { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.seg__opt {
  flex: 1 1 auto;
  position: relative;
  cursor: pointer;
}
.seg__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg__opt span {
  display: block;
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  transition: all 0.22s;
  white-space: nowrap;
}
.seg__opt input:checked + span {
  border-color: var(--mauve);
  background: var(--mauve-wash);
  color: var(--mauve-deep);
}
.seg__opt input:focus-visible + span {
  outline: 2px solid var(--mauve);
  outline-offset: 2px;
}

/* honeypot — invisible to humans */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.rsvp-form__err {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: #b34a43;
  text-align: center;
}

/* done state */
.rsvp-done { text-align: center; padding: 2rem 0; }
.rsvp-done__line {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  letter-spacing: 0.06em;
  color: var(--olive-deep);
}
.rsvp-done__sub {
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-weight: 200;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ═══════════════════ FOOTER ═══════════════════ */

.footer {
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  background: var(--paper-deep);
}
.footer__line {
  font-family: var(--serif);
  font-weight: 200;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.footer__names {
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--ink);
}
.footer__amp {
  font-family: 'Cinzel', var(--latin);
  font-style: normal;
  font-weight: 400;
  color: var(--mauve);
  font-size: 1.05em;
}
.footer__date {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink-faint);
}

/* name hidden until the entrance sequence reveals it (js only) */
html.js .hero__name--astghik.is-hidden { opacity: 0; }

/* letter-by-letter materialize — left-to-right, like the typewriter,
   staggered via JS inline delay */
.hero__name--astghik .nm {
  display: inline-block;
  opacity: 0;
  transform: translateX(-0.5em) scale(0.85);
  filter: blur(5px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(.16, .84, .28, 1), filter 0.7s ease;
}
.hero__name--astghik.is-revealed .nm { opacity: 1; transform: none; filter: none; }

/* no-motion users: names just appear */
@media (prefers-reduced-motion: reduce) {
  html.js .hero__name--astghik.is-hidden { opacity: 1; }
  .hero__name--astghik .nm { opacity: 1; transform: none; filter: none; }
}

/* ── mobile tweaks ─────────────────────────────── */
@media (max-width: 420px) {
  .calendar__day { font-size: 0.9rem; }
  .seg { flex-direction: column; }
  .seg__opt span { white-space: normal; }
}

/* ═══════════════════ SCROLL STORY ═══════════════════
   pinned full-screen slides */

.story { position: relative; }

.story__slide {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8vh;
  padding-bottom: 8vh;
  overflow-y: auto;
  /* overflow-y:auto would implicitly compute overflow-x to auto too
     (visible+auto → auto), making slides pan sideways — pin it */
  overflow-x: hidden;
  background: var(--paper-deep); /* all slides share the same paper-deep background */
}
/* invite: no photo — the letter is a compact page, not a full empty screen */
.invite { min-height: 0; padding-bottom: clamp(4rem, 10vw, 7rem); }

.story__slide > .section__title { margin-top: 0; }

/* mobile: slides flow naturally — this must come AFTER the sticky base rule
   to win the cascade (position: static kills the 100svh trap) */
@media (max-width: 820px) {
  .story__slide { position: static; min-height: 0; height: auto; padding-top: 4.5vh; padding-bottom: 4.5vh; }
  .story-progress { display: none; }
}

/* progress rail */
.story-progress {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 30vh;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
  z-index: 30;
  opacity: 0.85;
  pointer-events: none;
}
.story-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--mauve), var(--olive));
  transform: scaleY(0);
  transform-origin: top;
}

@media (prefers-reduced-motion: reduce) {
  .story__slide { position: static; min-height: 0; }
  .story-progress { display: none; }
}

.hero__names { position: relative; z-index: 1; }

/* ═══════════════════ PHOTO HERO ═══════════════════
   light text + scrim for contrast. The photo is portrait (2:3);
   object-fit/position do the responsive cropping: wide screens get
   the couple + glow band, phones get the full shot. */

.hero__photo {
  top: -12vh;                       /* parallax headroom */
  height: calc(100% + 24vh);
  object-fit: cover;
  object-position: 50% 76%;         /* desktop: couple + horizon band */
  will-change: transform;
}
/* phones (portrait viewport): show the whole vertical — the couple, fully */
@media (orientation: portrait) and (max-width: 820px) {
  .hero__photo { object-position: 50% 42%; }
}
/* ultrawide: focus lower, keep the couple + glow in frame */
@media (min-aspect-ratio: 2/1) {
  .hero__photo { object-position: 50% 84%; }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(22, 24, 20, 0.45) 0%,
    rgba(22, 24, 20, 0.10) 26%,
    rgba(22, 24, 20, 0.20) 44%,
    rgba(22, 24, 20, 0.46) 84%,
    rgba(22, 24, 20, 0.60) 100%);
}

/* light-on-photo text */
.hero__content { margin-top: -14vh; } /* nudge the lockup up, off the couple */
.hero__eyebrow {
  color: var(--paper);
  text-shadow: 0 1px 3px rgba(22, 24, 20, 0.55), 0 0 18px rgba(22, 24, 20, 0.35);
}
.hero__name--astghik {
  color: var(--paper);
  text-shadow: 0 2px 6px rgba(22, 24, 20, 0.45);
  font-style: normal; /* Victory is upright — the didone look */
}
.hero__amp { color: #e2bcbe; text-shadow: 0 1px 4px rgba(22, 24, 20, 0.5); }
.hero__name--suren { color: var(--paper); text-shadow: 0 1px 4px rgba(22, 24, 20, 0.5); }
.hero__name--suren::after { background: #e2bcbe; }

/* dark bottom fade so the photo melts into the page */
.hero::after {
  background: linear-gradient(to top, rgba(22, 24, 20, 0.5), transparent);
}

.topbar .lang__btn { color: rgba(247, 246, 241, 0.85); text-shadow: 0 1px 3px rgba(22, 24, 20, 0.55); }
.topbar .lang__btn.is-active { color: var(--paper); font-weight: 700; }
.topbar .lang__sep { color: rgba(247, 246, 241, 0.5); }

/* ═══════════════════ NAME FLOURISH ═══════════════════
   Աստղիկ simply appears: a soft bloom behind the letters,
   letters materializing left-to-right, a calligraphic stroke
   drawing beneath the name. */

.hero__name--astghik { position: relative; }

.hero__name--astghik::before { /* bloom — a slow, soft inhale */
  content: '';
  position: absolute;
  left: 50%;
  top: 56%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.5);
  background: radial-gradient(circle,
    rgba(247, 246, 241, 0.40) 0%,
    rgba(247, 246, 241, 0.12) 42%,
    transparent 68%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 1.4s ease 0.15s, transform 3.4s ease-in-out 0.15s;
}
.hero__name--astghik.is-revealed::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hero__flourish {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.14em);
  width: 78%;
  transform: translateX(-50%);
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}
.hero__flourish path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  /* waits for the letters to rise, then draws slowly */
  transition: stroke-dashoffset 2.1s cubic-bezier(.45, .05, .2, 1) 0.95s;
}
.hero__name--astghik.is-revealed .hero__flourish {
  opacity: 1;
  transition: opacity 0.4s ease 1s;
}
.hero__name--astghik.is-revealed .hero__flourish path {
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero__name--astghik::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: none;
  }
  .hero__flourish { opacity: 1; }
  .hero__flourish path { stroke-dashoffset: 0; transition: none; }
}
