/* ================================================================
   Wedding Invitation — Refined Design
   Rose gold · Cream · Elegant minimal
   ================================================================ */

/* ---------- Variables ---------- */
:root {
  --rose: #b8866e;
  --rose-light: #d4a99a;
  --rose-dark: #8b5e4e;
  --gold: #c9a96e;
  --gold-light: #dec28b;
  --cream: #fefaf7;
  --cream-dark: #f7f0e6;
  --white: #fffbf9;

  --text: #5d3a3a;
  --text-mid: #8c6a6a;
  --text-soft: #b89595;

  --shadow-sm: 0 2px 16px rgba(139, 94, 78, 0.07);
  --shadow-md: 0 6px 30px rgba(139, 94, 78, 0.10);
  --shadow-lg: 0 12px 48px rgba(139, 94, 78, 0.14);
  --shadow-photo: 0 4px 20px rgba(139, 94, 78, 0.18), 0 0 0 1px rgba(201, 169, 110, 0.15);

  --font-script: "Georgia", "STKaiti", "KaiTi", "Brush Script MT", cursive;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", "Georgia", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--cream);
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(249, 228, 224, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 25%, rgba(247, 240, 230, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 45% 55%, rgba(242, 207, 198, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 85%, rgba(249, 228, 224, 0.3) 0%, transparent 55%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.65;
}

/* ---------- Scroll Reveal ---------- */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal           { transform: translateY(36px); }
.reveal-left      { transform: translateX(-40px); }
.reveal-right     { transform: translateX(40px); }
.reveal.revealed,
.reveal-left.revealed,
.reveal-right.revealed { opacity: 1; transform: translate(0); }

/* ---------- Music Player ---------- */
.music-player {
  position: fixed; bottom: 28px; right: 28px; z-index: 100;
  width: 50px; height: 50px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(184, 134, 110, 0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.music-player:hover { transform: scale(1.07); box-shadow: 0 6px 26px rgba(184, 134, 110, 0.55); }
.music-player.playing { background: linear-gradient(135deg, #7a2e3f, var(--rose-dark)); }
.music-player.playing .music-icon { animation: noteBounce 0.6s ease-in-out infinite; }
.music-icon { display: block; line-height: 1; }
@keyframes noteBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.music-tip {
  position: fixed; bottom: 86px; right: 20px; z-index: 100;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(6px);
  border: 1px solid rgba(184,134,110,0.25); border-radius: 18px;
  padding: 7px 15px; font-size: 0.82rem; color: var(--rose-dark);
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.music-tip.hidden { display: none; }

/* ---------- Petals ---------- */
.petal {
  position: absolute; top: -40px; pointer-events: none; z-index: 2;
  border-radius: 50% 0 50% 0;
  background: radial-gradient(circle at 30% 30%, #f9d6cf, #eeaca0);
  opacity: 0;
  animation: petalFall var(--duration, 10s) var(--delay, 0s) ease-in infinite;
}
@keyframes petalFall {
  0%   { transform: translateY(-5vh) rotate(0deg) translateX(0); opacity: 0; }
  8%   { opacity: 0.7; }
  85%  { opacity: 0.4; }
  100% { transform: translateY(105vh) rotate(720deg) translateX(var(--drift, 40px)); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero-section {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; padding: 60px 24px;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(249,228,224,0.55) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 65%, rgba(247,240,230,0.4) 0%, transparent 55%);
}
.hero-content { position: relative; z-index: 3; max-width: 600px; }

.hero-eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--rose);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  text-shadow: 0 1px 2px rgba(184,134,110,0.1);
}

.couple-name {
  display: block;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--rose) 35%, var(--gold) 65%, var(--rose-light) 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: shimmer 4.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(184,134,110,0.25));
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-date {
  font-size: 1.3rem; font-weight: 300; color: var(--text);
  letter-spacing: 0.18em; margin-bottom: 4px;
}
.hero-location { font-size: 1rem; color: var(--text-mid); margin-bottom: 16px; }
.hero-sub      { font-size: 1rem; color: var(--rose); letter-spacing: 0.1em; }

/* Scroll indicator */
.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 3; }
.scroll-arrow {
  display: block; width: 26px; height: 26px;
  border-right: 2px solid var(--rose-light); border-bottom: 2px solid var(--rose-light);
  transform: rotate(45deg); animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0,0); opacity: 0.45; }
  50% { transform: rotate(45deg) translate(7px,7px); opacity: 1; }
}

/* Sparkles */
.hero-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.hero-sparkle {
  position: absolute; width: 3px; height: 3px; background: var(--gold-light);
  border-radius: 50%; animation: sparkleFloat 5.5s ease-in-out infinite;
  box-shadow: 0 0 6px 1.5px rgba(201,169,110,0.5);
}
.hero-sparkle:nth-child(1) { top: 12%; left: 12%; animation-delay: 0s; }
.hero-sparkle:nth-child(2) { top: 28%; left: 78%; animation-delay: 1.1s; animation-duration: 6s; }
.hero-sparkle:nth-child(3) { top: 48%; left: 18%; animation-delay: 2.3s; }
.hero-sparkle:nth-child(4) { top: 62%; left: 72%; animation-delay: 0.5s; animation-duration: 6.5s; }
.hero-sparkle:nth-child(5) { top: 35%; left: 48%; animation-delay: 2.9s; }
.hero-sparkle:nth-child(6) { top: 72%; left: 52%; animation-delay: 1.7s; animation-duration: 5.8s; }
@keyframes sparkleFloat {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.4); }
  25% { opacity: 0.85; transform: translateY(-18px) scale(1.1); }
  50% { opacity: 0.25; transform: translateY(-8px) scale(0.7); }
  75% { opacity: 0.75; transform: translateY(-22px) scale(1); }
}

/* ---------- Section Layout ---------- */
.section-inner { width: min(960px, 90vw); margin: 0 auto; padding: 56px 0; }
.section-title {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 600; color: var(--text); text-align: center;
  margin-bottom: 30px; letter-spacing: 0.08em;
}
.section-divider {
  width: 130px; height: 1.5px; margin: 36px auto 0;
  background: linear-gradient(90deg, transparent, var(--rose-light), var(--gold), var(--rose-light), transparent);
  position: relative;
}
.section-divider::before {
  content: "❦"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: var(--rose); font-size: 11px;
  background: var(--cream); padding: 0 14px;
}

/* ---------- Countdown ---------- */
.countdown-section { padding: 20px 0; }
.countdown-grid { display: flex; justify-content: center; gap: clamp(10px, 3vw, 24px); flex-wrap: wrap; }
.countdown-card {
  background: rgba(255,255,255,0.78); backdrop-filter: blur(8px);
  border: 1px solid rgba(184,134,110,0.18); border-radius: 14px;
  padding: 20px clamp(14px, 3vw, 28px); text-align: center;
  box-shadow: var(--shadow-sm); min-width: 72px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.countdown-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.countdown-number {
  display: block; font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 300; color: var(--rose-dark); line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
}
.countdown-label {
  display: block; font-size: 0.85rem; color: var(--text-mid);
  margin-top: 5px; letter-spacing: 0.1em;
}

/* ================================================================
   Photo + Poem Layouts
   ================================================================ */

/* --- Shared photo card styling --- */
.photo-card {
  position: relative;
  background-color: #efe0db;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-photo);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Gold inner frame line */
.photo-card::after {
  content: "";
  position: absolute; inset: 8px; z-index: 2; pointer-events: none;
  border: 1px solid rgba(201,169,110,0.32);
  border-radius: 4px;
}

.photo-card img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; position: relative; z-index: 1;
  opacity: 0; transition: opacity 0.45s ease;
}
.photo-card.loaded img { opacity: 1; }
.photo-card.loaded { background-image: none !important; }
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* --- Layout: photo-row (side-by-side) --- */
.photo-row {
  display: flex; align-items: center; gap: clamp(28px, 5vw, 56px);
}
.photo-row.reverse { flex-direction: row-reverse; }
.photo-row .photo-card { flex: 0 1 52%; max-width: 480px; }
.photo-row .poem-card  { flex: 0 1 44%; max-width: 400px; }
.photo-row.reverse .poem-card { text-align: right; }
.photo-row:not(.reverse) .poem-card { text-align: left; }

/* --- Layout: photo-stack (vertical) --- */
.photo-stack {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.photo-stack .photo-card { width: 100%; max-width: 500px; }
.photo-stack .poem-card  { width: 100%; max-width: 480px; text-align: center; padding: 18px 24px; }

/* Stack reverse: poem first, photo second */
.photo-stack.reverse .poem-card { order: -1; }

/* --- Layout: photo-spread (wide photo, centered poem) --- */
.photo-spread {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
.photo-spread .photo-card { width: 100%; max-width: 680px; }
.photo-spread .poem-card  { width: 100%; max-width: 500px; text-align: center; padding: 20px 28px; }

/* --- Poem card --- */
.poem-card {
  position: relative; padding: 22px;
}
.poem-number {
  display: inline-block;
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: rgba(184,134,110,0.3);
  line-height: 1; margin-bottom: 14px; letter-spacing: 0.02em;
}
.poem-text {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.6vw, 1.18rem);
  line-height: 2.3; color: var(--text);
  letter-spacing: 0.07em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* Section separator between photo groups */
.photo-section + .photo-section::before {
  content: "─ ✿ ─";
  display: block; text-align: center;
  font-size: 0.7rem; color: rgba(184,134,110,0.18);
  letter-spacing: 0.35em; padding-bottom: 8px;
}

/* ---------- Wedding Details ---------- */
.details-section .section-inner { max-width: 560px; }
.details-card {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border: 1px solid rgba(184,134,110,0.18); border-radius: var(--radius);
  padding: 32px clamp(20px, 4vw, 40px); box-shadow: var(--shadow-sm);
}
.detail-item {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid rgba(184,134,110,0.1);
}
.detail-item:last-child { border-bottom: none; }
.detail-icon   { font-size: 1.7rem; flex-shrink: 0; }
.detail-label  { font-size: 0.82rem; color: var(--text-soft); letter-spacing: 0.1em; }
.detail-value  { font-size: 1.02rem; font-weight: 600; color: var(--text); }

/* ---------- RSVP Form ---------- */
.rsvp-section .section-inner { max-width: 480px; }
.rsvp-intro { text-align: center; color: var(--text-mid); margin-bottom: 26px; font-size: 0.92rem; }
#rsvp-form {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border: 1px solid rgba(184,134,110,0.18); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.form-group input {
  width: 100%; border: 1px solid rgba(184,134,110,0.28); border-radius: 10px;
  padding: 11px 13px; font-size: 0.98rem; font-family: inherit; color: var(--text);
  background: rgba(255,255,255,0.65); outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.form-group input:focus {
  border-color: var(--rose); box-shadow: 0 0 0 3px rgba(184,134,110,0.1);
}
.submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 6px; padding: 13px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff; font-size: 1.02rem; font-weight: 600; font-family: inherit;
  cursor: pointer; letter-spacing: 0.06em;
  transition: transform 0.2s, box-shadow 0.25s;
}
.submit-btn:hover { transform: translateY(-1.5px); box-shadow: 0 6px 22px rgba(184,134,110,0.35); }
.submit-btn:active { transform: translateY(0); }
.message { min-height: 22px; text-align: center; font-weight: 600; margin-top: 4px; }
.message.success { color: #2f8a4f; }
.message.error   { color: #bd2f4d; }

/* ---------- Closing ---------- */
.closing-section { padding: 30px 0 80px; }
.closing-content { text-align: center; }
.closing-text {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--rose); font-weight: 400; letter-spacing: 0.1em;
  margin-bottom: 8px; text-shadow: 0 1px 2px rgba(184,134,110,0.15);
}
.closing-date   { font-size: 1.05rem; color: var(--text-mid); letter-spacing: 0.2em; margin-bottom: 22px; }
.closing-names  { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 14px; }
.closing-name   { font-size: 1.35rem; font-weight: 500; color: var(--text); letter-spacing: 0.1em; }
.closing-heart  { font-size: 1.6rem; color: var(--rose); animation: heartBeat 1.5s ease-in-out infinite;
                  filter: drop-shadow(0 2px 3px rgba(184,134,110,0.3)); }
.closing-thanks { font-size: 0.9rem; color: var(--text-soft); letter-spacing: 0.07em; }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
}

/* ================================================================
   Responsive — Tablet (769–1024)
   ================================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .photo-row { gap: 28px; }
  .photo-row .photo-card { max-width: 420px; }
  .photo-row .poem-card  { max-width: 340px; }
  .poem-number { font-size: 1.9rem; }
  .poem-text { font-size: 1.02rem; }
}

/* ================================================================
   Responsive — Phone (380–768)
   Keep side-by-side where possible, compact size
   ================================================================ */
@media (min-width: 380px) and (max-width: 768px) {
  .photo-row,
  .photo-row.reverse {
    flex-direction: row !important;
    gap: 12px; align-items: center;
  }
  .photo-row .photo-card { flex: 0 1 48%; max-width: 48%; }
  .photo-row .poem-card  { flex: 0 1 48%; max-width: 48%; padding: 8px 2px; }
  .photo-row .poem-number { font-size: 1.3rem; margin-bottom: 4px; }
  .photo-row .poem-text   { font-size: 0.72rem; line-height: 1.65; letter-spacing: 0.02em; }

  .photo-spread .photo-card { max-width: 100%; }
  .photo-spread .poem-card  { max-width: 100%; }
  .photo-spread { gap: 20px; }

  .photo-stack .photo-card { max-width: 100%; }
  .photo-stack .poem-card  { max-width: 100%; }
  .photo-stack { gap: 18px; }

  .section-inner { padding: 38px 0; }
  .poem-number { font-size: 1.6rem; }
  .poem-text   { font-size: 0.85rem; line-height: 1.85; }
}

/* ================================================================
   Responsive — Small phone (< 380)
   Everything stacks vertically
   ================================================================ */
@media (max-width: 379px) {
  .music-player { bottom: 18px; right: 18px; width: 44px; height: 44px; font-size: 18px; }
  .music-tip    { bottom: 72px; right: 10px; font-size: 0.75rem; padding: 5px 11px; }
  .hero-section { padding: 40px 18px; }
  .hero-eyebrow { font-size: 1rem; }
  .couple-name  { font-size: 1.85rem; }
  .hero-date    { font-size: 1.1rem; }

  .countdown-grid { gap: 8px; }
  .countdown-card { padding: 14px 14px; min-width: 64px; border-radius: 10px; }
  .countdown-number { font-size: 1.45rem; }
  .countdown-label  { font-size: 0.75rem; }

  .photo-row,
  .photo-row.reverse { flex-direction: column !important; gap: 18px; }
  .photo-row .photo-card,
  .photo-row .poem-card,
  .photo-spread .photo-card,
  .photo-spread .poem-card,
  .photo-stack .photo-card,
  .photo-stack .poem-card { max-width: 100% !important; width: 100%; flex: auto; }
  .photo-row .poem-card,
  .photo-row.reverse .poem-card { text-align: center !important; }

  .poem-number { font-size: 1.7rem; }
  .poem-text   { font-size: 0.88rem; line-height: 1.95; }
  .section-inner { padding: 32px 0; }
  .section-title { margin-bottom: 20px; }

  #rsvp-form { padding: 22px 18px; }
  .details-card { padding: 22px 18px; }
  .closing-section { padding-bottom: 100px; }
  .closing-text { font-size: 1.3rem; }

  .petal:nth-child(n+9) { display: none; }
}

/* ================================================================
   Responsive — Max 768px shared overrides (legacy catch-all)
   ================================================================ */
@media (max-width: 768px) {
  .photo-card::after { inset: 6px; }
}
