/* ═══════════════════════════════════════════════════════════
   WEDDING INVITATION — CSS
   Palette: ivory, warm gold, dusty sage, deep charcoal
═══════════════════════════════════════════════════════════ */

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

:root {
  --ivory: #f9f5ef;
  --cream: #f2ebe0;
  --gold: #b89a5a;
  --gold-light: #d4b87a;
  --gold-dark: #8a7040;
  --charcoal: #2c2c2c;
  --muted: #7a7060;
  --white: #ffffff;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Montserrat", sans-serif;

  --section-pad: clamp(60px, 10vw, 120px);
  --radius: 4px;
  --transition: 0.4s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.hidden {
  display: none !important;
}
/* ═══════════════════════════════════════
   OPENER
═══════════════════════════════════════ */
.opener {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}

.opener.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opener__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: var(--ivory);
  animation: float 3s ease-in-out infinite;
  transform-origin: top center;
  perspective: 1200px;
}

.opener__inner.is-opening {
  animation: envelope-open 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes envelope-open {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  60%  { transform: rotateX(180deg); opacity: 1; }
  100% { transform: rotateX(180deg); opacity: 0; }
}

.opener__envelope {
  width: 100vw;
  height: 100vh;
  background-image: url("../assets/m-and-d-envelope.png");
  background-size: 150%;
  background-repeat: no-repeat;
  background-position: center;
}

.opener:hover .opener__envelope {
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.2));
}

.opener__hint {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-size: 0.875rem;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: var(--charcoal);
  animation: pulse 2.5s ease-in-out infinite;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ═══════════════════════════════════════
   INVITATION WRAPPER
═══════════════════════════════════════ */
.invitation {
  opacity: 0;
  transition: opacity 1s ease 0.2s;
}

.invitation.visible {
  display: block !important;
  opacity: 1;
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 100px;
  background: linear-gradient(160deg, #f9f5ef 0%, #ede5d5 50%, #e8dcc8 100%);
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      ellipse at 20% 20%,
      rgba(184, 154, 90, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(184, 154, 90, 0.06) 0%,
      transparent 60%
    );
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__names {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--charcoal);
}

.hero__amp {
  font-style: italic;
  color: var(--gold);
}

.hero__tagline {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--muted);
  max-width: 520px;
  line-height: 1.9;
  font-weight: 300;
}

/* Countdown */
.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 16px;
  border-top: 1px solid rgba(184, 154, 90, 0.25);
  border-bottom: 1px solid rgba(184, 154, 90, 0.25);
  padding: 24px 0;
  width: 100%;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}

.countdown__value {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  color: var(--charcoal);
  line-height: 1;
}

.countdown__label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
}

.hero__scroll-hint span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  margin: 0 auto;
  animation: scrollLine 1.8s ease-in-out infinite;
}

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* ═══════════════════════════════════════
   DIVIDER
═══════════════════════════════════════ */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 40px;
  color: var(--gold);
}

.divider svg {
  width: min(200px, 60vw);
  height: 20px;
}

/* ═══════════════════════════════════════
   DETAILS
═══════════════════════════════════════ */
.details {
  padding: var(--section-pad) 24px;
  display: flex;
  justify-content: center;
  background: var(--ivory);
}

.details__card {
  background: var(--white);
  border: 1px solid rgba(184, 154, 90, 0.2);
  border-radius: 2px;
  padding: clamp(40px, 8vw, 80px) clamp(32px, 8vw, 80px);
  max-width: 600px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.details__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.details__day {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 300;
  color: var(--charcoal);
  line-height: 1.3;
}

.details__venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.details__venue-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  font-style: italic;
  color: var(--charcoal);
}

.details__venue-city {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.details__venue-note {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 380px;
  text-align: center;
  line-height: 1.7;
}

.details__map-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 11px 28px;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition:
    background var(--transition),
    color var(--transition);
}

.details__map-btn:hover {
  background: var(--gold);
  color: var(--white);
}

.details__reception {
  border-top: 1px solid rgba(184, 154, 90, 0.2);
  padding-top: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.details__reception-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.details__reception-time {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--charcoal);
}

.details__reception-venue {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   GALLERY
═══════════════════════════════════════ */
.gallery {
  padding: var(--section-pad) clamp(20px, 6vw, 80px);
  background: var(--cream);
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  font-style: italic;
  color: var(--charcoal);
  margin-bottom: 48px;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 280px 280px;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery__item {
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery__item img {
  object-position: top;
  transition: transform 0.6s ease;
}

.gallery__item--1 img {
  object-position: center 10%;
}

.gallery__item--2 img {
  object-position: center 25%;
}

.gallery__item--3 img {
  object-position: center 15%;
}

.gallery__item--4 img {
  object-position: center 55%;
}

.gallery__item:hover img {
  transform: scale(1.04);
}

.gallery__item--tall {
  grid-row: span 2;
}

.gallery__item--wide {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .gallery__grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .gallery__item--tall,
  .gallery__item--wide {
    grid-row: auto;
    grid-column: auto;
  }

  .gallery__item {
    height: 260px;
  }
}

/* ═══════════════════════════════════════
   RSVP
═══════════════════════════════════════ */
.rsvp {
  padding: var(--section-pad) 24px;
  background: var(--ivory);
  text-align: center;
}

.rsvp__deadline {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: -24px;
  margin-bottom: 48px;
}

.rsvp__form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-input,
.form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(184, 154, 90, 0.3);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b89a5a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 154, 90, 0.12);
}

.form-input::placeholder {
  color: #bbb;
}

.rsvp__submit {
  margin-top: 8px;
  padding: 16px 40px;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--transition),
    transform 0.2s ease;
}

.rsvp__submit:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

.rsvp__success {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gold-dark);
  margin-top: 16px;
}

/* ═══════════════════════════════════════
   FADE-IN ANIMATIONS (scroll)
═══════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE TWEAKS
═══════════════════════════════════════ */
@media (max-width: 480px) {
  .countdown {
    gap: 6px 14px;
  }

  .details__card {
    padding: 36px 24px;
  }
}
