:root {
  --bg: #f7efe6;
  --bg-deep: #e9d8c3;
  --surface: rgba(255, 250, 244, 0.72);
  --surface-strong: rgba(255, 248, 239, 0.9);
  --text: #2d1d17;
  --muted: #6f5449;
  --accent: #a56a43;
  --accent-dark: #7f4d31;
  --line: rgba(88, 56, 42, 0.14);
  --shadow: 0 24px 80px rgba(82, 53, 39, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(135deg, #f9f2e9 0%, #efe2d2 45%, #e1c8ad 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -8rem;
  right: -8rem;
  background: rgba(255, 244, 229, 0.9);
}

body::after {
  bottom: -10rem;
  left: -8rem;
  background: rgba(209, 167, 134, 0.45);
}

/* === MOBILE FIRST DEFAULT STYLES === */

.page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 0;
  background: rgba(255, 248, 241, 0.44);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero {
  position: relative;
  padding: 1.2rem 1.2rem 4rem;
  min-height: auto;
  display: grid;
  align-items: start;
  background:
    linear-gradient(rgba(53, 29, 22, 0.16), rgba(53, 29, 22, 0.28)),
    linear-gradient(160deg, rgba(255, 248, 241, 0.45), rgba(165, 106, 67, 0.26)),
    url("https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1600&q=80")
      center/cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 2rem 2rem auto;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 244, 234, 0.55);
  border-radius: 50%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.4rem 0 0.4rem;
}

.topbar__monogram,
.topbar__link {
  color: #fff6ee;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-decoration: none;
}

.hero__content {
  max-width: 700px;
  margin: auto;
  padding: 3rem 1rem 0;
  text-align: center;
  color: #fff8f1;
}

.eyebrow {
  margin: 0 0 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  opacity: 0.82;
}

.hero h1,
.section__heading h2,
.detail-card h3 {
  font-family: "Cormorant Garamond", serif;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 12vw, 7rem);
  line-height: 0.92;
  font-weight: 600;
}

.hero h1 span {
  display: inline-block;
  margin: 0 0.4rem;
  font-style: italic;
  color: #ffd9b5;
}

.hero__date {
  margin: 1.5rem 0 0;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}

.hero__message,
.story-card p,
.detail-card p,
.timeline__item p,
.rsvp__copy,
.rsvp-form label {
  line-height: 1.75;
}

.hero__message {
  max-width: 540px;
  margin: 1.25rem auto 0;
  font-size: 1rem;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  max-width: 540px;
  margin: 2rem auto 0;
}

.countdown__item {
  padding: 1rem 0.8rem;
  border: 1px solid rgba(255, 247, 239, 0.28);
  border-radius: 18px;
  background: rgba(255, 248, 241, 0.12);
  backdrop-filter: blur(10px);
}

.countdown__item strong {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1;
}

.countdown__item span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 248, 241, 0.84);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease, border-color 200ms ease, box-shadow 300ms ease;
}

.button:hover {
  transform: translateY(-4px);
}

.button--solid {
  background: linear-gradient(135deg, var(--accent) 0%, #c88e63 100%);
  color: #fff7ef;
  box-shadow: 0 18px 36px rgba(120, 72, 45, 0.24);
}

.button--solid:hover {
  box-shadow: 0 24px 48px rgba(165, 106, 67, 0.35);
}

.button--ghost {
  color: #fff7ef;
  border-color: rgba(255, 247, 239, 0.5);
  background: rgba(255, 247, 239, 0.08);
}

.button--ghost:hover {
  background: rgba(255, 247, 239, 0.15);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.section {
  padding: 2.5rem clamp(1.2rem, 3vw, 3rem);
}

.section__heading {
  max-width: 720px;
  margin-bottom: 2rem;
}

.section__heading h2 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 0.95;
  font-weight: 600;
}

.section--story {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  align-items: center;
}

.story-card,
.detail-card,
.rsvp__panel,
.timeline__item {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 400ms ease, background 400ms ease;
  max-width: 100%;
  box-sizing: border-box;
}

.story-card:hover,
.detail-card:hover,
.timeline__item:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 80px rgba(82, 53, 39, 0.18);
  background: rgba(255, 250, 244, 0.85);
}

.story-card {
  padding: 2rem;
  border-radius: 24px;
  font-size: 1.05rem;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.calendar-action {
  margin-top: 3.5rem;
  text-align: center;
}

.calendar-btn {
  color: var(--accent-dark);
  border-color: rgba(165, 106, 67, 0.4);
}

.calendar-btn:hover {
  background: rgba(165, 106, 67, 0.12);
}

.detail-card {
  padding: 1.7rem;
  border-radius: 24px;
}

.detail-card__label {
  margin-top: 0;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-card h3 {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 600;
}

.map-link {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(165, 106, 67, 0.4);
  text-underline-offset: 4px;
  font-weight: 600;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.map-link:hover {
  color: var(--text);
  text-decoration-color: var(--accent-dark);
}

.timeline__items {
  display: grid;
  gap: 1rem;
}

.timeline__item {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  align-items: start;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
}

.timeline__item span {
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.timeline__item p {
  margin: 0;
}

.rsvp {
  padding-bottom: 4rem;
}

.rsvp__panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border-radius: 28px;
  background: var(--surface-strong);
}

.rsvp-form {
  display: grid;
  gap: 1rem;
}

.rsvp__guest {
  margin: 0 0 1.2rem;
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.rsvp-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(165, 106, 67, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  outline: none;
}

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: var(--muted);
  font-style: italic;
  opacity: 0.65;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(165, 106, 67, 0.15);
}

.rsvp-form select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a56a43'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 1.2rem;
  padding-right: 3rem;
}

.rsvp-form textarea {
  resize: vertical;
  min-height: 130px;
}

.rsvp-form__status {
  margin: 0.2rem 0 0;
  min-height: 1.5rem;
  color: var(--accent-dark);
  font-weight: 700;
}

/* Animations & Transitions */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  background: radial-gradient(circle, rgba(255, 230, 200, 1) 0%, rgba(200, 142, 99, 0.2) 60%, transparent 80%);
  border-radius: 50%;
  animation: fall linear forwards;
  opacity: 0;
}

@keyframes fall {
  0% { transform: translateY(-5vh) scale(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.8; transform: translateY(5vh) scale(1) rotate(45deg); }
  90% { opacity: 0.6; transform: translateY(95vh) scale(1) rotate(180deg); }
  100% { transform: translateY(105vh) scale(0) rotate(220deg); opacity: 0; }
}

.rsvp-form {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.rsvp-form.is-submitted {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: relative;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.rsvp__success {
  display: none;
  text-align: center;
  padding: 2rem 0;
  animation: fadeUp 0.6s 0.2s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.rsvp__success.is-visible {
  display: block;
}

.rsvp__success h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}

.rsvp__success p {
  color: var(--muted);
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* === DESKTOP RESPONSIVE ENHANCEMENTS (Mobile-First) === */

@media (min-width: 640px) {
  .page-shell {
    width: min(100% - 2rem, 100%);
    margin: 1rem auto;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.42);
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
  }

  .hero__actions {
    flex-direction: row;
  }
  
  .button {
    width: auto;
    min-width: 170px;
  }
  
  .timeline__item {
    grid-template-columns: 140px 1fr;
  }
}

@media (min-width: 860px) {
  .page-shell {
    width: min(1120px, calc(100% - 2rem));
    border-radius: 32px;
  }

  .hero {
    min-height: 100vh;
    padding-bottom: 6rem;
  }
  
  .hero__content {
    padding-top: 4rem;
  }

  .section {
    padding: 3.5rem clamp(1.2rem, 3vw, 3rem);
  }

  .section--story {
    grid-template-columns: 1fr 1.1fr;
  }

  .details-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .rsvp__panel {
    grid-template-columns: 0.9fr 1.1fr;
  }
}
