:root {
  --color-bg: #f5ebd0;
  --color-bg-deep: #efe1bc;
  --color-text: #3d2817;
  --color-text-soft: #6b4a32;
  --color-primary: #b8342c;
  --color-primary-dark: #8e2520;
  --color-accent: #e8b547;
  --color-leaf: #6b8e4e;
  --color-blush: #f4b5a0;
  --color-paper: #fbf4dd;
  --radius-photo: 32px;
  --radius-card: 24px;
  --shadow-soft: 0 18px 38px -22px rgba(61, 40, 23, 0.4);
  --shadow-paper: 0 24px 60px -28px rgba(61, 40, 23, 0.55);
  --max-width: 560px;
  --section-gap: clamp(48px, 9vw, 96px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(232, 181, 71, 0.18), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(184, 52, 44, 0.12), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.16 0 0 0 0 0.09 0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: auto, auto, 220px 220px;
  color: var(--color-text);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 16px;
  position: relative;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero ---------- */
.hero {
  padding: 60px 0 32px;
  position: relative;
  text-align: center;
}

.hero__corner {
  position: absolute;
  top: 0;
  width: 78px;
  pointer-events: none;
  animation: sway 7s ease-in-out infinite;
  transform-origin: top center;
}
.hero__corner--left {
  left: -6px;
}
.hero__corner--right {
  right: -6px;
  transform: scaleX(-1);
  animation-delay: -3s;
}

.hero__intro {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 32px auto 18px;
  max-width: 320px;
}

.ribbon-title {
  display: inline-block;
  margin: 12px auto 8px;
  position: relative;
}
.ribbon-title__svg {
  display: block;
  height: auto;
  width: min(360px, 78vw);
  animation: sway 9s ease-in-out infinite;
  transform-origin: center;
  filter: drop-shadow(0 6px 10px rgba(184, 52, 44, 0.25));
}

.hero__title {
  color: var(--color-text);
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: clamp(3rem, 11vw, 4.5rem);
  font-weight: 700;
  line-height: 0.95;
  margin: 14px 0 6px;
  text-shadow: 1px 1px 0 rgba(245, 235, 208, 0.6);
  transform: rotate(-2deg);
}

.hero__date {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 18px auto 28px;
}
.hero__date-block {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.hero__date-block strong {
  display: block;
  font-size: 1.6rem;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.hero__date-divider {
  background: var(--color-text);
  height: 36px;
  opacity: 0.4;
  width: 1px;
}

/* ---------- Photo card ---------- */
.photo-stage {
  display: block;
  margin-inline: auto;
  margin-block: 0;
  max-width: min(320px, 88vw);
  position: relative;
  width: 100%;
}
.photo-stage__temple {
  left: 50%;
  opacity: 0.55;
  position: absolute;
  top: 8%;
  transform: translateX(-50%);
  width: 118%;
  z-index: 0;
  pointer-events: none;
}
.photo-stage__photo {
  border-radius: var(--radius-photo);
  box-shadow: var(--shadow-paper);
  display: block;
  margin: 0 auto;
  position: relative;
  width: 100%;
  z-index: 1;
}
.photo-stage__heart {
  position: absolute;
  width: 44px;
  z-index: 2;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(232, 181, 71, 0.4));
}
.photo-stage__heart--top {
  right: 4px;
  top: 12%;
}
.photo-stage__heart--bottom {
  bottom: 10%;
  left: 4px;
  animation-delay: -2.5s;
}

/* ---------- Address ribbon ---------- */
.address-ribbon {
  margin: 28px auto 0;
  max-width: 100%;
  position: relative;
  text-align: center;
}
.address-ribbon__svg {
  display: block;
  width: 100%;
  height: auto;
}
.address-ribbon__text {
  color: #fff5e1;
  font-size: 0.68rem;
  font-weight: 700;
  left: 50%;
  letter-spacing: 0.1em;
  padding: 0 14px;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-shadow: 0 1px 2px rgba(80, 18, 14, 0.5);
}

/* ---------- Sections ---------- */
.section {
  margin-top: var(--section-gap);
}
.section__heading {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  text-align: center;
}
.section__kicker {
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.section__title {
  font-family: 'Caveat', cursive;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  padding: 0 8px;
}

.divider {
  display: flex;
  justify-content: center;
  margin: 36px 0;
}
.divider svg {
  height: 18px;
  width: 80%;
  max-width: 280px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 22px 18px;
  position: relative;
}
.card::before {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.16 0 0 0 0 0.09 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  border-radius: inherit;
  content: '';
  inset: 0;
  opacity: 0.9;
  pointer-events: none;
  position: absolute;
}

.details-list {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.details-list__item {
  align-items: flex-start;
  display: flex;
  gap: 14px;
}
.details-list__icon {
  flex: 0 0 32px;
  margin-top: 2px;
}
.details-list__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
  text-transform: uppercase;
  color: var(--color-primary);
}
.details-list__value {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Map ---------- */
.map-card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}
.map-card iframe {
  border: 0;
  display: block;
  height: 260px;
  width: 100%;
}

/* ---------- Form ---------- */
.rsvp-form {
  display: grid;
  gap: 18px;
  min-width: 0;
  position: relative;
  width: 100%;
  z-index: 1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.field input {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(61, 40, 23, 0.18);
  border-radius: 14px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
  max-width: 100%;
  min-width: 0;
  padding: 14px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  width: 100%;
}
.field input[type="date"],
.field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 50px;
}
.field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(184, 52, 44, 0.12);
  outline: none;
  transform: translateY(-1px);
}
.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 420px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ---------- Choice (radio cards) ---------- */
.choice {
  border: none;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 0;
}
.choice legend {
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
  padding: 0;
  text-transform: uppercase;
}
.choice__option {
  cursor: pointer;
  display: block;
  position: relative;
}
.choice__option input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}
.choice__pill {
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(61, 40, 23, 0.18);
  border-radius: 14px;
  display: block;
  padding: 14px 16px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.choice__pill strong {
  color: var(--color-text);
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}
.choice__pill small {
  color: var(--color-text-soft);
  display: block;
  font-size: 0.78rem;
  margin-top: 2px;
}
.choice__option:hover .choice__pill {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.choice__option input:checked + .choice__pill {
  background: rgba(184, 52, 44, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(184, 52, 44, 0.12);
}
.choice__option input:focus-visible + .choice__pill {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}
.timeline__item {
  display: grid;
  gap: 12px;
  grid-template-columns: 52px 1fr;
  position: relative;
}
.timeline__item::before {
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  content: '';
  left: 23px;
  position: absolute;
  top: 32px;
  bottom: -20px;
  width: 3px;
  opacity: 0.4;
}
.timeline__item:last-child::before {
  display: none;
}
.timeline__time {
  align-items: center;
  background: var(--color-primary);
  border-radius: 999px;
  color: #fff5e1;
  display: inline-flex;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  font-weight: 700;
  height: 48px;
  justify-content: center;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  width: 48px;
  box-shadow: 0 8px 16px -8px rgba(184, 52, 44, 0.6);
  animation: float 6s ease-in-out infinite;
  flex-shrink: 0;
}
.timeline__item:nth-child(2) .timeline__time {
  background: var(--color-accent);
  color: var(--color-text);
  animation-delay: -2s;
}
.timeline__title {
  color: var(--color-text);
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 2px;
}
.timeline__where {
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.timeline__desc {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.button {
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  color: #fff5e1;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 16px 20px;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px -14px rgba(184, 52, 44, 0.7);
  width: 100%;
}
.button:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 18px 28px -14px rgba(184, 52, 44, 0.7);
}
.button:active:not(:disabled) {
  transform: translateY(0);
}
.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.form-status {
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
  position: relative;
  z-index: 1;
}
.form-status[data-state='success'] {
  color: var(--color-leaf);
}
.form-status[data-state='error'] {
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.footer {
  margin: var(--section-gap) -20px 0;
  padding: 40px 20px 50px;
  position: relative;
  text-align: center;
}
.footer__ribbon {
  display: block;
  margin: 0 auto 14px;
  width: 80%;
  max-width: 320px;
  animation: sway 8s ease-in-out infinite;
  transform-origin: center;
}
.footer__text {
  color: var(--color-text-soft);
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
}
.footer__signature {
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  margin-top: 10px;
  text-transform: uppercase;
}

/* ---------- Animations ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -3px); }
}

.hero__corner--left { animation-name: drift; }
.hero__corner--right { animation-name: drift; }

@media (min-width: 480px) {
  .page { padding: 0 20px; }
  .hero { padding: 80px 0 40px; }
  .hero__corner { width: 110px; }
  .hero__corner--left { left: -10px; }
  .hero__corner--right { right: -10px; }
  .photo-stage { max-width: 360px; }
  .photo-stage__heart { width: 52px; }
  .photo-stage__heart--top { right: -8px; }
  .photo-stage__heart--bottom { left: -10px; }
  .address-ribbon__text { font-size: 0.78rem; letter-spacing: 0.16em; }
  .section__title { font-size: 2.6rem; }
  .card { padding: 28px 24px; }
  .button { width: auto; font-size: 0.85rem; letter-spacing: 0.22em; padding: 16px 28px; }
  .timeline__item { grid-template-columns: 64px 1fr; gap: 14px; }
  .timeline__item::before { left: 28px; top: 36px; }
  .timeline__time { width: 56px; height: 56px; font-size: 1.15rem; }
}

@media (min-width: 720px) {
  .hero__corner { width: 150px; }
  .section__title { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
