:root {
  --bg: #fff6ef;
  --paper: #ffffff;
  --ink: #24161c;
  --ink-soft: #6f5763;
  --pink: #ef5b87;
  --pink-deep: #cf3a68;
  --pink-soft: #fde1ea;
  --pink-tint: #fff1f6;
  --line: #f4d4df;
  --gold: #e8b443;
  --error: #b3261e;
  --radius: 26px;
  --font: "Noto Sans Georgian", system-ui, -apple-system, sans-serif;
  --font-fun: "Fredoka", "Noto Sans Georgian", system-ui, sans-serif;
}

*, *::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);
  color: var(--ink);
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 50% -10%, #ffd9e5 0%, rgba(255, 217, 229, 0) 60%),
    radial-gradient(circle, rgba(239, 91, 135, 0.14) 2.6px, transparent 3.2px);
  background-size: 100% 100%, 30px 30px;
}

img { max-width: 100%; display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- layout ---------- */

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 16px calc(100px + env(safe-area-inset-bottom));
  display: grid;
  gap: 26px;
}

.content { display: grid; gap: 18px; min-width: 0; }

/* ---------- hero ---------- */

.hero { text-align: center; }

.photo-wrap {
  position: relative;
  width: min(62vw, 260px);
  margin: 14px auto 24px;
}

.photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 32px 32px;
  overflow: hidden;
  border: 6px solid var(--paper);
  box-shadow: 0 0 0 5px var(--pink), 0 28px 50px -22px rgba(207, 58, 104, 0.55);
  transform: rotate(-2deg);
  background: var(--pink-soft);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.bow {
  position: absolute;
  top: -20px;
  left: -24px;
  width: 30%;
  min-width: 84px;
  transform: rotate(-20deg);
  filter: drop-shadow(0 6px 8px rgba(36, 22, 28, 0.18));
}
.bow-fill { fill: var(--pink); }
.bow-line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.bow ellipse.bow-line { fill: var(--pink); }

.sparkle {
  position: absolute;
  fill: var(--gold);
  animation: twinkle 2.6s ease-in-out infinite;
}
.s1 { width: 28px; top: 14%; right: -30px; }
.s2 { width: 20px; bottom: 22%; left: -28px; fill: var(--pink); animation-delay: .6s; }
.s3 { width: 16px; top: -8px; right: 18%; animation-delay: 1.2s; }
.s4 { width: 24px; bottom: -14px; right: 8%; animation-delay: 1.8s; }

@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(.55) rotate(30deg); opacity: .55; }
}

.kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.title {
  margin: 0;
  display: grid;
  justify-items: center;
  line-height: 1;
}

.title-top,
.title-age span {
  font-size: clamp(1.9rem, 8vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -.01em;
}

.title-age {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-age b {
  font-family: var(--font-fun);
  font-weight: 700;
  font-size: clamp(6rem, 28vw, 8rem);
  line-height: .95;
  color: var(--pink);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(207, 58, 104, .25);
}

.title-age span { transform: rotate(-4deg); }

.lead {
  max-width: 34ch;
  margin: 14px auto 0;
  font-size: 1.06rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.countdown {
  display: inline-block;
  margin: 16px 0 0;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px dashed var(--pink);
  font-weight: 800;
  color: var(--pink-deep);
}

/* ---------- cards ---------- */

.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -26px rgba(207, 58, 104, .45);
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
}

.tile {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--pink-tint);
}
.tile-wide { grid-column: 1 / -1; }

.tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: .8rem;
  font-weight: 800;
  color: var(--pink-deep);
}
.tile-head svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-value { font-size: 1.14rem; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.tile-sub { color: var(--ink-soft); font-size: .93rem; line-height: 1.45; }

.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: .92rem;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.pill:hover { border-color: var(--pink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}

.btn-primary {
  width: 100%;
  font-size: 1.1rem;
  color: #fff;
  background: var(--pink);
  box-shadow: 0 6px 0 var(--pink-deep);
}
.btn-primary:hover { background: #f2678f; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--pink-deep); }
.btn-primary:disabled { opacity: .7; cursor: progress; }

.btn-soft {
  min-height: 50px;
  padding: 6px 10px;
  font-size: .92rem;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--ink);
  background: var(--pink-tint);
  border: 2px solid var(--line);
}
.btn-soft:hover { background: var(--pink-soft); border-color: var(--pink); }

.btn-ghost {
  min-height: 44px;
  color: var(--ink-soft);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
}

.btn:focus-visible,
.pill:focus-visible,
.sticky-cta:focus-visible,
.stepper button:focus-visible,
.choice-card:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- RSVP ---------- */

.rsvp { border: 3px solid var(--pink); scroll-margin-top: 16px; }

.rsvp-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
}

.rsvp-by { margin: 6px 0 0; text-align: center; color: var(--ink-soft); }

#rsvp-form { display: grid; gap: 18px; margin-top: 18px; }

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 108px;
  padding: 14px 8px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice-card:hover { border-color: var(--pink-soft); background: var(--pink-tint); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-emoji { font-size: 2rem; line-height: 1.1; }
.choice-text { font-weight: 800; font-size: .98rem; line-height: 1.3; }

.choice-card:has(input:checked) {
  border-color: var(--pink);
  background: var(--pink-tint);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pink-soft);
}
.choice-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: -10px;
  right: -8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-weight: 900;
  font-size: .85rem;
}

.field { display: grid; gap: 8px; }
.field[hidden] { display: none; }
.field-label { font-weight: 800; }

.field input[type="text"] {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font: inherit;
  font-size: 1.06rem;
  color: var(--ink);
}
.field input[type="text"]::placeholder { color: #b7a0aa; }
.field input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
.field input[aria-invalid="true"] { border-color: var(--error); }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font: 700 1.7rem/1 var(--font-fun);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stepper button:hover { background: #fbd0de; }
.stepper button:active { transform: scale(.94); }
.stepper input {
  width: 76px;
  height: 56px;
  border: 2px solid var(--line);
  border-radius: 16px;
  text-align: center;
  font: 700 1.7rem/1 var(--font-fun);
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff0ee;
  color: var(--error);
  font-weight: 700;
}

.thanks { display: grid; justify-items: center; gap: 12px; text-align: center; }
.thanks[hidden], #rsvp-form-wrap[hidden] { display: none; }
.thanks-emoji { font-size: 3.4rem; line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.thanks-text { margin: 0; color: var(--ink-soft); max-width: 34ch; }

.calendar {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border-radius: 20px;
  background: var(--pink-tint);
}
.calendar[hidden] { display: none; }
.calendar-title { margin: 0 0 10px; font-weight: 800; font-size: .95rem; }
.calendar-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calendar .btn-soft { background: var(--paper); }

@keyframes pop {
  from { transform: scale(.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- footer ---------- */

.footer { text-align: center; color: var(--ink-soft); font-weight: 500; }
.footer p { margin: 4px 0; }
.footer a { color: var(--pink-deep); font-weight: 800; }

/* ---------- sticky CTA (mobile) ---------- */

.sticky-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: 488px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--pink-deep), 0 18px 30px -12px rgba(207, 58, 104, .7);
  transition: transform .3s ease, opacity .3s ease;
}
.sticky-cta.is-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
}

/* ---------- desktop ---------- */

@media (min-width: 960px) {
  .page {
    max-width: 1240px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
    column-gap: clamp(48px, 6vw, 96px);
    align-items: start;
    padding: 48px 40px 64px;
  }

  .photo-wrap { width: min(23vw, 290px); margin: 8px auto 26px; }
  .title-top, .title-age span { font-size: 2.7rem; }
  .title-age b { font-size: 8.5rem; -webkit-text-stroke-width: 8px; }
  .lead { max-width: 42ch; font-size: 1.12rem; }

  .card { padding: 26px 26px; }
  .details { padding: 12px; }
  .tile { padding: 16px 18px; }
  .tile-value { font-size: 1.3rem; }
  .rsvp-title { font-size: 1.8rem; }

  .sticky-cta { display: none; }
}

@media (min-width: 960px) and (min-height: 760px) {
  .hero { position: sticky; top: 40px; }
}

/* ---------- entrance ---------- */

.photo-wrap, .hero-text, .card, .footer { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero-text { animation-delay: .1s; }
.details { animation-delay: .2s; }
.rsvp { animation-delay: .28s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
