:root {
  --bg: #f7f2ec;
  --bg-warm: #efe6dd;
  --bg-rose: #f3ece7;
  --bg-deep: #e9ddd4;
  --bg-mist: #ddd0c7;
  --card: rgba(255, 253, 248, 0.86);
  --text: #272420;
  --muted: #746d64;
  --line: #ded1c0;
  --accent: #b9937a;
  --accent-dark: #80624f;
  --shadow: 0 18px 48px rgba(58, 48, 40, 0.1);
  --page-gutter: clamp(16px, 5vw, 32px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  position: relative;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 253, 248, 0.95) 0 10rem, rgba(255, 253, 248, 0) 24rem),
    radial-gradient(circle at 86% 14%, rgba(239, 230, 221, 0.72) 0 9rem, rgba(239, 230, 221, 0) 25rem),
    radial-gradient(circle at 22% 48%, rgba(243, 236, 231, 0.78) 0 12rem, rgba(243, 236, 231, 0) 30rem),
    radial-gradient(circle at 82% 72%, rgba(221, 208, 199, 0.46) 0 10rem, rgba(221, 208, 199, 0) 28rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-rose) 38%, var(--bg-warm) 69%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(16px, 4.35vw, 19px);
  line-height: 1.65;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 8% 18%, rgba(255, 253, 248, 0.68) 0 12rem, transparent 30rem),
    radial-gradient(ellipse at 96% 36%, rgba(233, 221, 212, 0.52) 0 10rem, transparent 28rem),
    radial-gradient(ellipse at 12% 86%, rgba(239, 230, 221, 0.5) 0 12rem, transparent 30rem);
  filter: blur(18px);
}
body::after {
  z-index: 0;
  opacity: 0.26;
  background-image:
    radial-gradient(rgba(128, 98, 79, 0.16) 0.45px, transparent 0.55px),
    radial-gradient(rgba(255, 253, 248, 0.38) 0.45px, transparent 0.6px);
  background-position: 0 0, 10px 12px;
  background-size: 22px 22px, 26px 26px;
  mix-blend-mode: multiply;
}
a { color: inherit; overflow-wrap: anywhere; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; min-width: 0; }

.section, .footer {
  width: min(calc(100% - (var(--page-gutter) * 2) - var(--safe-left) - var(--safe-right)), 1080px);
  margin-inline: auto;
  padding-block: clamp(56px, 14vw, 72px);
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  text-align: center;
  padding: calc(48px + var(--safe-top)) max(20px, var(--safe-right)) calc(72px + var(--safe-bottom)) max(20px, var(--safe-left));
  overflow: hidden;
  z-index: 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 253, 248, 0.74) 0 13rem, rgba(255, 253, 248, 0) 32rem),
    radial-gradient(circle at 18% 70%, rgba(239, 230, 221, 0.42) 0 8rem, rgba(239, 230, 221, 0) 24rem);
}
@supports (min-height: 100dvh) { .hero { min-height: 100dvh; } }
.hero__content {
  width: 100%;
  max-width: 760px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hero__content::before {
  content: '';
  position: absolute;
  inset: clamp(-26px, -4vw, -16px) clamp(-20px, -3vw, -10px);
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 253, 248, 0.58) 0%, rgba(255, 253, 248, 0) 68%);
  filter: blur(6px);
}
.hero::before, .hero::after {
  content: '♡';
  position: absolute;
  z-index: 0;
  color: rgba(185, 147, 122, 0.24);
  font-size: clamp(2.4rem, 13vw, 6rem);
  pointer-events: none;
}
.hero::before { top: max(11%, var(--safe-top)); left: max(14px, 7vw); }
.hero::after { right: max(14px, 7vw); bottom: max(14%, var(--safe-bottom)); transform: rotate(15deg); }
h1, h2 {
  max-width: 100%;
  margin: 0;
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-weight: 400;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(3.1rem, 15.5vw, 9rem); }
.hero__names {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-inline: clamp(4px, 2vw, 12px);
  box-sizing: border-box;
  text-align: center;
  font-size: clamp(3rem, 13.5vw, 9rem);
  overflow-wrap: normal;
  word-break: normal;
}
.hero__name-line {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
}
.hero__name-line--second {
  margin-top: -0.08em;
}
.hero__amp {
  display: inline;
  color: var(--accent-dark);
}
h2 { font-size: clamp(2.45rem, 10.5vw, 5.8rem); }
p { margin: 0 0 1rem; }
.eyebrow {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: clamp(0.72rem, 2.8vw, 0.78rem);
  font-weight: 600;
  letter-spacing: clamp(0.12em, 1.1vw, 0.22em);
  text-transform: uppercase;
}
.hero__date { margin-top: 1rem; font-size: clamp(1.2rem, 5.3vw, 2.1rem); line-height: 1.3; }
.hero__phrase { color: var(--muted); font-style: italic; }
.ornament { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 14px); width: 100%; margin: clamp(14px, 5vw, 20px) auto; color: var(--accent); }
.ornament span { width: clamp(34px, 16vw, 56px); max-width: 30%; height: 1px; background: var(--line); }
.scroll-hint { position: absolute; bottom: calc(18px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); display: inline-flex; flex-direction: column; align-items: center; gap: 4px; max-width: calc(100% - 32px); color: var(--muted); font-size: clamp(0.82rem, 3.6vw, 0.95rem); text-decoration: none; z-index: 1; }
.invitation, .location { display: grid; gap: clamp(22px, 7vw, 32px); align-items: center; }
.section__text { min-width: 0; background: rgba(255, 253, 248, 0.72); border: 1px solid rgba(222, 209, 192, 0.72); border-radius: clamp(22px, 7vw, 28px); padding: clamp(22px, 6vw, 48px); box-shadow: var(--shadow); }
.date-section,
.countdown-section,
.timeline-section,
.dress-code,
.rsvp {
  isolation: isolate;
}
.date-section::before,
.countdown-section::before,
.timeline-section::before,
.dress-code::before,
.rsvp::before {
  content: '';
  position: absolute;
  inset: clamp(18px, 5vw, 34px) 0;
  z-index: -1;
  border: 1px solid rgba(222, 209, 192, 0.28);
  border-radius: clamp(28px, 8vw, 44px);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.36), rgba(243, 236, 231, 0.2));
  box-shadow: 0 18px 52px rgba(58, 48, 40, 0.045);
}
.photo-card { width: 100%; min-width: 0; min-height: clamp(260px, 78vw, 380px); aspect-ratio: 4 / 5; display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: clamp(24px, 8vw, 34px); background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(217,198,173,.28)), repeating-linear-gradient(45deg, transparent 0 22px, rgba(185,147,122,.08) 22px 23px); background-position: center; background-size: cover; box-shadow: var(--shadow); transition: transform 450ms ease; }
.photo-card:hover { transform: scale(1.012); }
.photo-card::before { content: '♡'; color: rgba(185, 147, 122, 0.36); font-size: clamp(3.5rem, 18vw, 5rem); }
.photo-card span { position: absolute; bottom: 20px; max-width: calc(100% - 32px); color: var(--muted); letter-spacing: .08em; text-align: center; text-transform: uppercase; font-size: .78rem; }
.photo-card.has-image::before, .photo-card.has-image span { opacity: 0; }
.calendar { width: min(100%, 460px); margin: 28px auto 12px; padding: clamp(12px, 4vw, 22px); border: 1px solid var(--line); border-radius: clamp(22px, 7vw, 28px); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.calendar__weekdays, .calendar__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1.3vw, 8px); text-align: center; }
.calendar__weekdays { color: var(--muted); font-size: clamp(.72rem, 3.1vw, .85rem); margin-bottom: 10px; }
.calendar__day { min-width: 0; min-height: clamp(32px, 9.5vw, 40px); display: grid; place-items: center; border-radius: 999px; font-size: clamp(.88rem, 4vw, 1rem); }
.calendar__day--wedding { background: var(--accent); color: white; position: relative; }
.calendar__day--wedding::after { content: '♡'; position: absolute; top: -12px; right: -2px; color: var(--accent-dark); font-size: .9em; }
.date-section, .countdown-section, .timeline-section, .dress-code, .rsvp, .footer { text-align: center; }
.countdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 3vw, 12px); margin-top: 28px; }
.countdown div { min-width: 0; padding: clamp(16px, 5vw, 20px) 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.countdown strong { display: block; font-size: clamp(2rem, 12vw, 4rem); line-height: 1; overflow-wrap: normal; }
.countdown span { color: var(--muted); font-size: clamp(.82rem, 3.7vw, 1rem); }
.button { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 48px; margin-top: 14px; padding: 12px 26px; border: 1px solid var(--accent-dark); border-radius: 999px; background: var(--text); color: #fffdf8; font: inherit; text-align: center; text-decoration: none; cursor: pointer; transition: background 220ms ease, transform 220ms ease, box-shadow 220ms ease; }
.button:hover, .button:focus-visible { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(128,98,79,.2); }
.timeline { max-width: 620px; margin: 34px auto 0; padding: 0; list-style: none; text-align: left; }
.timeline li { display: grid; grid-template-columns: minmax(56px, .34fr) minmax(0, 1fr); gap: clamp(12px, 4vw, 18px); position: relative; padding-bottom: 28px; }
.timeline li::before { content: ''; position: absolute; left: clamp(68px, 24vw, 101px); top: 12px; bottom: -2px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline__time { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.timeline__title { min-width: 0; }
.timeline__title::before { content: '♡'; margin-right: 8px; color: var(--accent); }
.palette { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 5vw, 18px); margin-top: 26px; }
.palette__item { flex: 0 1 76px; display: grid; gap: 8px; justify-items: center; color: var(--muted); font-size: .9rem; }
.palette__swatch { width: clamp(52px, 16vw, 62px); height: clamp(52px, 16vw, 62px); border: 1px solid rgba(39,36,32,.16); border-radius: 50%; box-shadow: inset 0 0 0 6px rgba(255,255,255,.35); }
form { max-width: 640px; margin: 28px auto 0; display: grid; gap: 18px; text-align: left; }
label, legend { font-weight: 600; }
input, textarea { width: 100%; min-height: 48px; margin-top: 6px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); font-size: max(16px, 1em); }
textarea { min-height: 132px; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(185,147,122,.28); border-color: var(--accent); }
fieldset { display: grid; gap: 8px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; }
fieldset label { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
fieldset input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; }
.rsvp .button, .location .button { width: 100%; }
.form-message { min-height: 1.6em; color: var(--accent-dark); text-align: center; }
.footer { padding-bottom: calc(48px + var(--safe-bottom)); color: var(--muted); }
.footer p:first-of-type { color: var(--text); font-size: clamp(1.2rem, 5vw, 1.4rem); }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 650ms ease, transform 650ms ease; will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: translateY(0); will-change: auto; }

@media (max-width: 420px) {
  body {
    background-attachment: scroll;
    background:
      radial-gradient(circle at 22% 4%, rgba(255, 253, 248, 0.9) 0 8rem, rgba(255, 253, 248, 0) 20rem),
      radial-gradient(circle at 86% 16%, rgba(239, 230, 221, 0.64) 0 7rem, rgba(239, 230, 221, 0) 18rem),
      linear-gradient(155deg, var(--bg) 0%, var(--bg-rose) 44%, var(--bg-warm) 100%);
  }
  .hero {
    padding-inline: max(14px, var(--safe-right)) max(14px, var(--safe-left));
  }
  .hero__names {
    font-size: clamp(2.85rem, 13.8vw, 3.55rem);
  }
}

@media (max-width: 359px) {
  .hero__names {
    padding-inline: 0;
    font-size: clamp(2.75rem, 13.2vw, 3rem);
  }
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline li { grid-template-columns: 58px minmax(0, 1fr); }
  .timeline li::before { left: 70px; }
}

@media (min-width: 480px) {
  :root { --page-gutter: clamp(24px, 5vw, 40px); }
  body { font-size: clamp(17px, 2.6vw, 19px); }
  .section, .footer { padding-block: 76px; }
  .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .countdown div { padding-inline: 6px; }
  .countdown strong { font-size: clamp(1.85rem, 7.2vw, 3.2rem); }
  .rsvp .button, .location .button { width: auto; }
}

@media (min-width: 768px) {
  :root { --shadow: 0 24px 70px rgba(58, 48, 40, 0.1); }
  .section, .footer { padding-block: 96px; }
  .hero { padding-block: calc(80px + var(--safe-top)) calc(80px + var(--safe-bottom)); }
  .invitation, .location { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 54px; }
  .location .photo-card { order: 0; }
  .photo-card--tall { min-height: 560px; }
  .photo-card--wide { min-height: 440px; aspect-ratio: 6 / 5; }
  .timeline li { grid-template-columns: 82px minmax(0, 1fr); }
  .timeline li::before { left: 101px; }
}

@media (min-width: 1024px) {
  h1 { font-size: clamp(5.5rem, 11vw, 9rem); }
  h2 { font-size: clamp(3.8rem, 7vw, 5.8rem); }
}

@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: auto; padding-block: calc(32px + var(--safe-top)) calc(56px + var(--safe-bottom)); }
  .scroll-hint { position: static; transform: none; margin-top: 20px; justify-self: center; }
  h1 { font-size: clamp(2.8rem, 10vw, 5rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; will-change: auto; }
}

.invitation-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(18px + var(--safe-top)) max(16px, var(--safe-right)) calc(18px + var(--safe-bottom)) max(16px, var(--safe-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 253, 248, 0.88) 0 12rem, rgba(255, 253, 248, 0) 30rem),
    linear-gradient(145deg, rgba(247, 242, 236, 0.86), rgba(239, 230, 221, 0.82));
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 650ms ease, visibility 650ms ease;
}
@supports (min-height: 100dvh) { .invitation-overlay { min-height: 100dvh; } }
.invitation-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.invitation-overlay__card {
  width: min(100%, 680px);
  padding: clamp(28px, 8vw, 58px) clamp(18px, 7vw, 52px);
  border: 1px solid rgba(222, 209, 192, 0.82);
  border-radius: clamp(28px, 8vw, 44px);
  background: rgba(255, 253, 248, 0.7);
  box-shadow: var(--shadow);
  text-align: center;
}
.invitation-overlay__title {
  font-size: clamp(2.9rem, 13vw, 6.6rem);
}
.invitation-overlay__text {
  max-width: 34rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 4.5vw, 1.35rem);
}
.invitation-overlay__button {
  margin-top: clamp(12px, 4vw, 20px);
}

.music-toggle {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 10;
  display: inline-grid;
  place-items: center;
  width: 52px;
  min-width: 48px;
  height: 52px;
  min-height: 48px;
  border: 1px solid rgba(128, 98, 79, 0.52);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.9);
  color: var(--accent-dark);
  box-shadow: 0 12px 28px rgba(58, 48, 40, 0.14);
  cursor: pointer;
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.music-toggle[hidden] { display: none; }
.music-toggle:hover,
.music-toggle:focus-visible {
  background: #fffdf8;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(58, 48, 40, 0.18);
}
.music-toggle:focus-visible {
  outline: 3px solid rgba(185, 147, 122, 0.34);
  outline-offset: 4px;
}
.music-toggle__icon {
  width: 25px;
  height: 25px;
  fill: currentColor;
}
.music-toggle__icon--on { display: none; }
.music-toggle.is-playing .music-toggle__icon--on { display: block; }
.music-toggle.is-playing .music-toggle__icon--off { display: none; }
.music-toggle.is-playing { animation: musicButtonBreath 2400ms ease-in-out infinite; }

@keyframes musicButtonBreath {
  0%, 100% { box-shadow: 0 12px 28px rgba(58, 48, 40, 0.14); }
  50% { box-shadow: 0 12px 30px rgba(185, 147, 122, 0.28); }
}

.rsvp {
  padding-bottom: calc(96px + var(--safe-bottom));
}

@media (max-width: 480px) {
  .music-toggle {
    right: calc(12px + var(--safe-right));
    bottom: calc(12px + var(--safe-bottom));
    width: 50px;
    height: 50px;
  }
  .rsvp {
    padding-bottom: calc(92px + var(--safe-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .music-toggle.is-playing { animation: none; }
}
