/* ══════════════════════════════════════
   WEDDING INVITATION — STYLE
   Palette: Warm Café · Parchment · Gold
   ══════════════════════════════════════ */

:root {
  --beige:       #f5ede0;
  --parchment:   #ede0cc;
  --cafe:        #8b6347;
  --cafe-dark:   #5c3d2e;
  --gold:        #c9a96e;
  --gold-light:  #e8d5b0;
  --text-dark:   #3b2a1a;
  --text-mid:    #6b4f35;
  --text-soft:   #9a7a5e;
  --white:       #fdf8f2;

  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Jost', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--beige);
  color: var(--text-dark);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCENES ─────────────────────────── */
.scene {
  display: none;
  min-height: 100vh;
}
.scene.active { display: flex; }

/* ══════════════════════════════════════
   ENVELOPE SCENE
   ══════════════════════════════════════ */
#envelope-scene {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 40%, #ede0cc 0%, #d4b896 60%, #b89070 100%);
  position: relative;
  overflow: hidden;
}

/* Petal background decoration */
.petals-bg::before,
.petals-bg::after {
  content: '✿ ❀ ✿ ❀ ✿ ❀ ✿ ❀ ✿ ❀ ✿ ❀ ✿ ❀ ✿ ❀';
  position: absolute;
  color: rgba(255,255,255,0.12);
  font-size: 1.2rem;
  letter-spacing: 1rem;
  width: 200%;
  white-space: nowrap;
}
.petals-bg::before { top: 8%; left: -50%; transform: rotate(-8deg); }
.petals-bg::after  { bottom: 8%; left: -30%; transform: rotate(6deg); }

.envelope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  z-index: 2;
}

/* ── THE ENVELOPE ─── */
.envelope {
  position: relative;
  width: 360px;
  height: 260px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 20px 40px rgba(90,55,30,0.35));
}
.envelope:hover { transform: translateY(-6px) scale(1.02); }

/* Back layer */
.env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #d4b896, #b88f6a);
  border-radius: 4px 4px 6px 6px;
  z-index: 1;
}

/* Front */
.env-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, #ede0cc, #d9c4a3);
  border-radius: 4px 4px 6px 6px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  overflow: hidden;
}
.env-front::before,
.env-front::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
}
.env-front::before {
  left: 0;
  border-style: solid;
  border-width: 130px 0 0 180px;
  border-color: transparent transparent transparent #c8aa84;
}
.env-front::after {
  right: 0;
  border-style: solid;
  border-width: 130px 180px 0 0;
  border-color: transparent #c8aa84 transparent transparent;
}

/* Bottom flap (V shape center) */
.env-front .bottom-v {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 180px 130px 180px;
  border-color: transparent transparent #c4a07e transparent;
  z-index: 1;
}

/* Flap (top triangle that opens) */
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(170deg, #c8aa84, #b8935e);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  border-radius: 4px 4px 0 0;
}
.envelope.open .env-flap {
  transform: rotateX(180deg);
}

/* Wax seal */
.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, #c9a96e, #8b6347);
  border-radius: 50%;
  border: 3px solid #e8d5b0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff5e6;
  z-index: 6;
  box-shadow: 0 4px 15px rgba(90,55,30,0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.envelope.open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

/* Letter sliding up */
.env-letter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(0px);
  width: 88%;
  height: 85%;
  background: var(--white);
  border-radius: 3px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
              opacity 0.5s ease 0.3s;
  box-shadow: 0 -2px 20px rgba(90,55,30,0.2);
  border: 1px solid var(--gold-light);
  opacity: 0;
  pointer-events: none;
}
.envelope.open .env-letter {
  transform: translateX(-50%) translateY(-190px);
  opacity: 1;
}

.letter-content { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.letter-small { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-soft); font-family: var(--font-sans); }
.letter-names { font-family: var(--font-serif); font-size: 1.1rem; color: var(--cafe-dark); line-height: 1.3; font-style: italic; }
.amp { font-size: 1.4rem; color: var(--gold); display: block; }
.letter-invite { font-size: 0.55rem; color: var(--text-soft); letter-spacing: 0.1em; text-transform: uppercase; }
.std-badge {
  margin-top: 6px;
  padding: 4px 14px;
  border: 1px solid var(--gold);
  color: var(--cafe);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}

/* hint + button */
.tap-hint {
  color: var(--cafe-dark);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  font-family: var(--font-sans);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

.open-btn {
  padding: 14px 42px;
  background: linear-gradient(135deg, var(--cafe), var(--cafe-dark));
  color: #fff5e6;
  border: none;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 8px 24px rgba(90,55,30,0.3);
}
.open-btn:hover { opacity: 0.88; transform: translateY(-2px); }

/* ══════════════════════════════════════
   WEDDING PAGE
   ══════════════════════════════════════ */
#wedding-page {
  flex-direction: column;
  align-items: center;
  background: var(--white);
}

/* ── HERO ─── */
.hero {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(180deg, #f9f1e8 0%, var(--white) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--gold-light) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.3;
}

.hero-ornament {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  margin: 10px auto;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  animation: fadeUp 1s ease both 0.2s;
}
.hero-sub {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 24px;
  animation: fadeUp 1s ease both 0.4s;
}
.hero-groom, .hero-bride {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 300;
  color: var(--cafe-dark);
  line-height: 1.1;
  font-style: italic;
  animation: fadeUp 1s ease both 0.6s;
}
.hero-and {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--gold);
  margin: 14px 0;
  animation: fadeUp 1s ease both 0.7s;
}

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

/* ── VENUE ─── */
.venue-section {
  width: 100%;
  max-width: 600px;
  padding: 64px 24px;
  text-align: center;
}
.section-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 20px auto;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cafe-dark);
  margin-bottom: 16px;
}
.venue-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--cafe);
  margin-bottom: 8px;
}
.venue-addr {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-soft);
  letter-spacing: 0.1em;
}

/* ── COUNTDOWN ─── */
.countdown-section {
  width: 100%;
  padding: 60px 24px;
  text-align: center;
  background: linear-gradient(135deg, #f2e6d4, #ede0cc);
}
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0 20px;
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cd-unit span {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 300;
  color: var(--cafe-dark);
  min-width: 80px;
  line-height: 1;
}
.cd-unit label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.cd-sep {
  font-size: 1.2rem;
  color: var(--gold);
  padding-bottom: 24px;
  opacity: 0.6;
}
.wedding-date-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--text-mid);
  text-transform: uppercase;
}

/* ── PHOTO ─── */
.photo-section {
  width: 100%;
  padding: 80px 24px;
  display: flex;
  justify-content: center;
  background: var(--white);
}
.photo-frame {
  position: relative;
  max-width: 460px;
  width: 100%;
}
.couple-photo {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  filter: sepia(18%) saturate(0.9) brightness(1.02);
  box-shadow: 0 20px 60px rgba(90,55,30,0.22);
}
.photo-frame::before {
  content: '';
  position: absolute;
  inset: -12px;
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  z-index: -1;
}
.photo-caption {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-soft);
  margin-top: 20px;
}

/* ── TIMELINE ─── */
.story-section {
  width: 100%;
  max-width: 800px;
  padding: 80px 24px;
}
.story-section .section-title { text-align: center; margin-bottom: 48px; }

.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  transform: translateX(-50%);
}

.tl-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 48px;
  position: relative;
}
.tl-item.left  { flex-direction: row-reverse; }
.tl-item.right { flex-direction: row; }

.tl-dot {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--gold);
  z-index: 2;
}

.tl-card {
  width: 44%;
  background: #faf4ec;
  border: 1px solid var(--gold-light);
  padding: 22px 24px;
  border-radius: 2px;
}
.tl-item.left  .tl-card { margin-right: 56px; text-align: right; }
.tl-item.right .tl-card { margin-left: 56px; text-align: left; }

.tl-year {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}
.tl-card h4 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--cafe-dark);
  margin-bottom: 8px;
}
.tl-card p {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.7;
  font-weight: 300;
}

/* ── MEMORIES / CAROUSEL ─── */
.memories-section {
  width: 100%;
  padding: 80px 24px;
  background: linear-gradient(135deg, #f0e8d8, #e8d8c4);
  text-align: center;
}
.memories-section .section-title { margin-bottom: 40px; }

.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.carousel {
  flex: 1;
  overflow: hidden;
  border-radius: 3px;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.car-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.car-slide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 2px;
  filter: sepia(15%) brightness(1.03);
  box-shadow: 0 12px 36px rgba(90,55,30,0.18);
}
.car-slide p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-mid);
}

.car-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--cafe-dark);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.car-btn:hover { background: var(--gold); color: #fff5e6; }

.car-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}
.car-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.car-dot.active { background: var(--gold); transform: scale(1.3); }

/* ── FOOTER ─── */
.footer {
  width: 100%;
  padding: 60px 24px;
  text-align: center;
  background: var(--cafe-dark);
}
.footer-ornament {
  color: var(--gold);
  letter-spacing: 1.5rem;
  font-size: 0.7rem;
  margin-bottom: 20px;
}
.footer-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.footer-names {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,245,230,0.45);
}

/* ── RESPONSIVE ─── */
@media (max-width: 640px) {
  .envelope { width: 290px; height: 210px; }
  .env-letter { padding: 14px 12px; }
  .letter-names { font-size: 0.95rem; }

  .timeline::before { left: 24px; }
  .tl-item.left,
  .tl-item.right { flex-direction: row; }
  .tl-dot { left: 24px; }
  .tl-card { width: calc(100% - 56px); margin-left: 56px !important; margin-right: 0 !important; text-align: left !important; }

  .car-btn { width: 34px; height: 34px; font-size: 0.9rem; }
  .car-slide img { height: 220px; }
}
