:root {
  --champagne: #efe0bd;
  --champagne-deep: #b8944d;
  --cream: #fffaf0;
  --white: #ffffff;
  --ink: #2d2418;
  --muted: #7a6a51;
  --line: rgba(184, 148, 77, 0.28);
  --shadow: 0 24px 80px rgba(91, 70, 35, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.88), transparent 34rem),
    linear-gradient(180deg, #fffdf7 0%, #f5ead4 48%, #fffaf0 100%);
  font-family: "Montserrat", system-ui, sans-serif;
}

body.loaded .loader {
  pointer-events: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--cream);
  animation: loaderGone 0.2s ease 2.4s forwards;
}

.door {
  position: absolute;
  top: 0;
  width: 50.2%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent 24%, rgba(147, 115, 54, 0.18)),
    linear-gradient(135deg, #fff8e9, #dcc489);
  box-shadow: inset 0 0 0 1px rgba(184, 148, 77, 0.28);
}

.door::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(184, 148, 77, 0.42);
}

.door span {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.8rem, 7vw, 7rem);
  font-weight: 700;
  color: rgba(91, 70, 35, 0.42);
}

.door-left {
  left: 0;
  transform-origin: left center;
  animation: openLeft 2.2s cubic-bezier(0.77, 0, 0.18, 1) 0.45s forwards;
}

.door-right {
  right: 0;
  transform-origin: right center;
  animation: openRight 2.2s cubic-bezier(0.77, 0, 0.18, 1) 0.45s forwards;
}

.loader-center {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: centerFade 1.8s ease forwards;
}

.loader-center p,
.eyebrow,
.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--champagne-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.loader-center strong {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 7vw, 5.8rem);
}

.hero {
  position: relative;
  min-height: 96vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 2rem clamp(1.2rem, 5vw, 5rem);
  background:
    linear-gradient(90deg, rgba(45, 36, 24, 0.28), rgba(255, 250, 240, 0.34) 48%, rgba(255, 250, 240, 0.9)),
    url("assets/wedding-hero.png") center / cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24vh;
  z-index: -1;
  background: linear-gradient(0deg, #fffaf0, transparent);
}

.nav {
  position: absolute;
  top: 1.25rem;
  right: clamp(1.2rem, 5vw, 5rem);
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.62);
  backdrop-filter: blur(14px);
}

.nav a {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  color: #47371e;
  font-size: 0.82rem;
  font-weight: 700;
}

.nav a:hover {
  background: var(--white);
}

.hero-content {
  width: min(46rem, 100%);
  transform: translateY(1rem);
  opacity: 0;
  animation: riseIn 1.1s ease 2.1s forwards;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  line-height: 0.94;
}

h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  max-width: 8ch;
}

h2 {
  font-size: clamp(2.4rem, 6vw, 5.4rem);
}

.hero-copy {
  max-width: 34rem;
  margin: 1.3rem 0 1.5rem;
  color: #4f412b;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
}

.date-pill {
  display: inline-grid;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(184, 148, 77, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 250, 240, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.date-pill strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
}

.date-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.petal-field span {
  position: absolute;
  top: -4rem;
  width: 0.75rem;
  height: 1.15rem;
  border-radius: 80% 20% 80% 20%;
  background: rgba(255, 255, 255, 0.78);
  filter: drop-shadow(0 8px 8px rgba(184, 148, 77, 0.18));
  animation: petalFall linear infinite;
}

.petal-field span:nth-child(1) { left: 7%; animation-duration: 9s; animation-delay: 0s; }
.petal-field span:nth-child(2) { left: 18%; animation-duration: 12s; animation-delay: 2s; }
.petal-field span:nth-child(3) { left: 31%; animation-duration: 10s; animation-delay: 1s; }
.petal-field span:nth-child(4) { left: 42%; animation-duration: 13s; animation-delay: 4s; }
.petal-field span:nth-child(5) { left: 55%; animation-duration: 9s; animation-delay: 3s; }
.petal-field span:nth-child(6) { left: 66%; animation-duration: 14s; animation-delay: 1s; }
.petal-field span:nth-child(7) { left: 73%; animation-duration: 11s; animation-delay: 5s; }
.petal-field span:nth-child(8) { left: 82%; animation-duration: 10s; animation-delay: 2s; }
.petal-field span:nth-child(9) { left: 90%; animation-duration: 15s; animation-delay: 0s; }
.petal-field span:nth-child(10) { left: 96%; animation-duration: 12s; animation-delay: 6s; }

section:not(.hero) {
  padding: clamp(4rem, 9vw, 7rem) clamp(1.2rem, 6vw, 6rem);
}

.countdown-section,
.timeline-section,
.location-section {
  text-align: center;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: min(58rem, 100%);
  margin: 2rem auto 0;
}

.countdown div,
.timeline article,
.music-card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.countdown div {
  padding: clamp(1rem, 3vw, 1.8rem);
}

.countdown strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.3rem, 6vw, 5rem);
}

.countdown span,
.timeline time {
  color: var(--champagne-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.couple-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(18rem, 0.7fr);
  gap: clamp(2rem, 7vw, 5rem);
  align-items: center;
}

.couple-copy p,
.music-card p,
.location-section p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.portrait-wrap {
  position: relative;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 50% 50% 0.75rem 0.75rem;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  animation: floatImage 5s ease-in-out infinite;
}

.portrait-wrap img {
  border-radius: 50% 50% 0.45rem 0.45rem;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.2rem auto 0;
  width: min(72rem, 100%);
}

.timeline article {
  position: relative;
  padding: 1.35rem;
  text-align: left;
  overflow: hidden;
}

.timeline article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.28rem;
  background: linear-gradient(90deg, var(--champagne-deep), var(--champagne));
}

.timeline h3 {
  margin: 0.8rem 0 0.35rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.65rem;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.music-section {
  background: linear-gradient(90deg, rgba(239, 224, 189, 0.5), rgba(255, 255, 255, 0.18));
}

.music-card {
  display: grid;
  grid-template-columns: minmax(14rem, 0.45fr) minmax(0, 0.8fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
  width: min(68rem, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.8rem);
}

.music-card img {
  width: 100%;
  border-radius: 0.5rem;
  animation: glowPulse 3.8s ease-in-out infinite;
}

.location-section {
  display: grid;
  gap: 1.7rem;
  justify-items: center;
}

.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 18px 46px rgba(45, 36, 24, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.map-button:hover {
  transform: translateY(-2px);
  background: #4a3921;
}

footer {
  padding: 2rem 1rem 3rem;
  text-align: center;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(1.8rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@keyframes openLeft {
  to {
    transform: perspective(900px) rotateY(-108deg);
  }
}

@keyframes openRight {
  to {
    transform: perspective(900px) rotateY(108deg);
  }
}

@keyframes loaderGone {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes centerFade {
  0%, 55% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

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

@keyframes petalFall {
  0% {
    transform: translate3d(0, -6rem, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate3d(4rem, 110vh, 0) rotate(320deg);
    opacity: 0;
  }
}

@keyframes floatImage {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.8rem);
  }
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(184, 148, 77, 0.1));
  }
  50% {
    filter: drop-shadow(0 18px 34px rgba(184, 148, 77, 0.28));
  }
}

@media (max-width: 840px) {
  .hero {
    min-height: 94vh;
    align-items: end;
    padding-bottom: 4rem;
    background:
      linear-gradient(180deg, rgba(255, 250, 240, 0.16), rgba(255, 250, 240, 0.94) 68%),
      url("assets/wedding-hero.png") center / cover;
  }

  .nav {
    left: 1rem;
    right: 1rem;
    justify-content: center;
  }

  h1 {
    font-size: clamp(3.8rem, 18vw, 6rem);
  }

  .countdown,
  .timeline,
  .couple-section,
  .music-card {
    grid-template-columns: 1fr;
  }

  .timeline article {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .nav a {
    padding: 0.62rem 0.6rem;
    font-size: 0.72rem;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .door span {
    writing-mode: vertical-rl;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
