:root {
  --gold: #b08b57;
  --dark: #2c2620;
  --cream: #faf6f0;
  --line: #e7ddd0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', serif;
  color: var(--dark);
  background: var(--cream);
  text-align: center;
}

section {
  padding: 100px 20px;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 10px;
}

section h3 {
  font-size: 2.4rem;
  font-weight: 500;
  margin-bottom: 40px;
}

/* Lock scrolling while envelope intro is showing */
body.locked {
  overflow: hidden;
  height: 100vh;
}

/* ===== ENVELOPE INTRO ===== */
.envelope-intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  background: radial-gradient(circle at center, #4a3c2c 0%, var(--dark) 100%);
  transition: opacity 0.6s ease 0.1s, visibility 0.6s ease 0.1s;
  overflow: hidden;
}

.envelope-intro.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* White flash layer that sweeps in as the envelope zooms forward,
   so the transition into the site feels like passing through light
   rather than an abrupt scale-and-cut */
.envelope-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.6s ease;
}

.envelope-flash.show {
  opacity: 1;
}

/* Wrapper handles the zoom-in transform, kept separate from the
   envelope's own flap-flip transform so they don't fight each other */
.envelope-wrap {
  transition: transform 1s cubic-bezier(.22,1,.36,1), opacity 0.85s ease, filter 1s cubic-bezier(.22,1,.36,1);
  transform: scale(1);
  filter: blur(0px);
  opacity: 0;
  animation: envelopeEntrance 1.1s cubic-bezier(.22,1,.36,1) 0.2s forwards;
}

@keyframes envelopeEntrance {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.envelope-wrap.zoom {
  transform: scale(7);
  filter: blur(6px);
  opacity: 0;
}

/* Gentle floating/breathing idle motion while waiting for a tap */
.envelope {
  position: relative;
  width: min(78vw, 420px);
  height: min(53vw, 285px);
  cursor: pointer;
  perspective: 1000px;
  animation: envelopeFloat 4.5s ease-in-out 1.3s infinite;
  transition: transform 0.4s cubic-bezier(.22,1,.36,1);
}

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

/* Hover lift — pauses the idle float and lifts toward the cursor */
.envelope:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.02);
}

.envelope.opened {
  animation: none;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: var(--cream);
  border: 1px solid #d8c9b3;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
  z-index: 2;
  transition: box-shadow 0.4s ease;
}

.envelope:hover .envelope-back {
  box-shadow: 0 32px 70px rgba(0,0,0,0.55);
}

.envelope-letter {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18%;
  height: 78%;
  background: #fffdfa;
  border: 1px solid #e7ddd0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  transition: top 1s cubic-bezier(.22,1,.36,1), z-index 0s 0.1s;
  z-index: 1;
}

.letter-names {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--dark);
  margin-bottom: 8px;
}

.letter-sub {
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: var(--dark);
  opacity: 0.8;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: min(39vw, 210px) solid transparent;
  border-right: min(39vw, 210px) solid transparent;
  border-top: min(26.5vw, 142px) solid #efe4d3;
  transform-origin: top;
  transition: transform 0.85s cubic-bezier(.22,1,.36,1);
  z-index: 3;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

.envelope-seal {
  position: absolute;
  top: min(19vw, 102px);
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  z-index: 4;
  transition: opacity 0.5s cubic-bezier(.22,1,.36,1), transform 0.5s cubic-bezier(.22,1,.36,1);
}

.envelope:hover .envelope-seal {
  transform: translateX(-50%) scale(1.08);
}

.envelope-hint {
  color: #f0e6d8;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.8rem;
  opacity: 0.85;
  animation: pulse 1.8s infinite;
  transition: opacity 0.4s ease;
}

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

.envelope-hint.hidden {
  opacity: 0;
}

/* Opened state */
.envelope.opened .envelope-seal {
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
}

.envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 0;
}

.envelope.opened .envelope-letter {
  top: -55%;
  z-index: 5;
  transition: top 1s cubic-bezier(.22,1,.36,1) 0.15s, z-index 0s;
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('images/hero-bg.jpg') center/cover no-repeat,
              linear-gradient(160deg, #3a3128, var(--dark) 60%);
  color: #fff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20,17,14,0.25), rgba(20,17,14,0.55));
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 0.8rem;
  margin-bottom: 22px;
  opacity: 0.9;
}

.couple-names {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1.15;
  margin-bottom: 26px;
}

.couple-names .amp {
  display: block;
  font-family: 'Great Vibes', cursive;
  font-size: 0.55em;
  color: var(--gold);
  margin: 4px 0;
}

.wedding-date {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.hero-rsvp {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  letter-spacing: 3px;
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.9;
}

.scroll-cue {
  animation: bounce 2s infinite;
  font-size: 1.1rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* WELCOME */
.welcome {
  background: radial-gradient(circle at center, #4a3c2c 0%, var(--dark) 100%);
  color: #f2ebe0;
}

.welcome-icon,
.gifts-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  color: var(--gold);
}

.welcome-icon svg,
.gifts-icon svg {
  width: 100%;
  height: 100%;
}

.welcome .section-label {
  font-family: 'Cormorant Garamond', serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 2.6rem;
  color: #fff;
  margin-bottom: 40px;
}

.welcome-card {
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 36px 30px;
  line-height: 1.7;
  font-size: 1.15rem;
}

.welcome-card p + p {
  margin-top: 16px;
}

/* COUNTDOWN */
.countdown-section {
  background: radial-gradient(circle at center, #4a3c2c 0%, var(--dark) 100%);
  color: #fff;
}

.countdown-section h3 {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.countdown-sub {
  font-style: italic;
  opacity: 0.75;
  margin-bottom: 44px;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.c-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 24px 10px;
  background: rgba(250,246,240,0.08);
  border: 1px solid rgba(250,246,240,0.18);
  border-radius: 6px;
}

.c-block span {
  font-size: 2.6rem;
  color: var(--cream);
  font-weight: 500;
  font-family: 'Cormorant Garamond', serif;
}

.c-block small {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  margin-top: 8px;
  color: var(--gold);
}

/* SECTION SUB (shared) */
.section-sub {
  opacity: 0.7;
  margin-top: -28px;
  margin-bottom: 40px;
  font-style: italic;
}

/* VENUES */
.venues {
  background: #fff;
  border-top: 1px solid var(--line);
}

.venue-cards {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.venue-card {
  flex: 1;
  min-width: 260px;
  max-width: 380px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 32px 24px;
  text-align: center;
}

.venue-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  color: var(--gold);
}

.venue-icon svg {
  width: 100%;
  height: 100%;
}

.venue-card h4 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.venue-time {
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.venue-place {
  opacity: 0.8;
  line-height: 1.5;
  margin-bottom: 18px;
}

.venue-photo {
  width: 100%;
  height: 160px;
  border-radius: 4px;
  background: linear-gradient(135deg, #cbb896, #8f7350) center/cover no-repeat;
  margin-bottom: 18px;
}

.venue-btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 1px;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.venue-btn:hover {
  background: var(--gold);
  color: #fff;
}

.calendar-btn {
  display: block;
  margin: 36px auto 0;
  padding: 13px 34px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 4px;
  letter-spacing: 1px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.calendar-btn:hover {
  background: #4a3c2c;
}

/* ORDER OF THE DAY */
.timeline-section {
  background: var(--cream);
}

.timeline-card {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 34px 30px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(44,38,32,0.06);
}

.timeline-date {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 600;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
}

.timeline-date svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}

.timeline-time {
  background: var(--dark);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 4px;
  min-width: 58px;
  text-align: center;
  flex-shrink: 0;
}

.timeline-icon {
  width: 26px;
  height: 26px;
  color: var(--gold);
  flex-shrink: 0;
}

.timeline-icon svg {
  width: 100%;
  height: 100%;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.timeline-place {
  font-size: 0.9rem;
  opacity: 0.65;
}

/* DRESS CODE */
.dress-code {
  background: radial-gradient(circle at center, #4a3c2c 0%, var(--dark) 100%);
  color: #fff;
}

.dress-code h3 {
  font-size: 2.6rem;
}

.dress-code .section-sub {
  opacity: 0.7;
}

.dress-card {
  max-width: 640px;
  margin: 0 auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 40px 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.dress-col {
  flex: 1;
  min-width: 160px;
}

.dress-col h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.dress-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.2);
}

.dress-note {
  flex-basis: 100%;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  margin-top: 10px;
  font-style: italic;
  opacity: 0.8;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* GIFTS */
.gifts {
  background: var(--cream);
}

.gifts-card {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px 30px;
  line-height: 1.7;
}

.gifts-heart {
  width: 30px;
  height: 30px;
  margin: 0 auto 16px;
  color: var(--gold);
}

.gifts-heart svg {
  width: 100%;
  height: 100%;
}

.gifts-card p + p {
  margin-top: 12px;
}

/* RSVP */
.rsvp {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rsvp-sub {
  margin-bottom: 30px;
  opacity: 0.75;
}

.rsvp-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px 32px;
  box-shadow: 0 10px 30px rgba(44,38,32,0.06);
  text-align: left;
}

#rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: none;
  padding: 0;
  margin: 0;
}

.form-field label,
.form-field legend {
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
}

.icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-label svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.fieldset-caption,
.counter-caption {
  font-size: 0.9rem;
  opacity: 0.75;
  text-transform: none;
  letter-spacing: 0;
  margin-top: -2px;
}

#rsvp-form input[type="text"],
#rsvp-form input[type="email"],
#rsvp-form select,
#rsvp-form textarea {
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#rsvp-form input:focus,
#rsvp-form select:focus,
#rsvp-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176,139,87,0.15);
}

#rsvp-form textarea {
  min-height: 90px;
  resize: vertical;
}

.radio-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dark);
  font-size: 1rem;
  cursor: pointer;
}

.radio-row input,
.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.guest-counter {
  display: flex;
  align-items: center;
  gap: 18px;
}

.guest-counter button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: #fff;
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.guest-counter button:hover {
  background: var(--gold);
  color: #fff;
}

.guest-counter span {
  font-size: 1.4rem;
  min-width: 24px;
  text-align: center;
}

.confirming-text {
  font-size: 0.9rem;
  opacity: 0.75;
  text-transform: none;
  letter-spacing: 0;
}

.guest-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.guest-name-field label {
  font-size: 0.8rem;
  opacity: 0.75;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dark);
}

.guest-name-field:last-child {
  margin-bottom: 0;
}

#rsvp-form button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}

#rsvp-form button[type="submit"]:hover {
  background: #8f6f41;
}

.rsvp-note {
  font-size: 0.8rem;
  opacity: 0.6;
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .rsvp-card {
    padding: 30px 22px;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-grid img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* FOOTER */
footer {
  padding: 50px 20px;
  background: var(--dark);
  color: #fff;
}

.footer-names {
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.footer-date {
  letter-spacing: 3px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  section h3 {
    font-size: 1.8rem;
  }
  .countdown {
    gap: 12px;
  }
  .c-block {
    min-width: 80px;
    padding: 18px 6px;
  }
  .c-block span {
    font-size: 2rem;
  }
  .venue-cards {
    flex-direction: column;
    align-items: center;
  }
  .dress-divider {
    display: none;
  }
}
