:root {
  --bg: #1a0d14;
  --bg-2: #2a1320;
  --rose: #ff7b9c;
  --rose-soft: #ffb3c6;
  --gold: #f4d9a6;
  --cream: #fff5f7;
  --text: #ffe9ef;
  --text-dim: #e6c3cf;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Quicksand", sans-serif;
  background:
    radial-gradient(1200px 800px at 50% -10%, #3a1828 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 20%, #43182f 0%, transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===================== TELA DE ABERTURA ===================== */
.opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(800px 600px at 50% 40%, #43182f 0%, transparent 70%),
    linear-gradient(160deg, var(--bg) 0%, #20101a 100%);
  text-align: center;
  padding: 24px;
  transition: opacity 1s ease, visibility 1s ease;
}
.opening.hidden { opacity: 0; visibility: hidden; }

.opening-inner { max-width: 520px; animation: rise 1s ease both; }

.opening-heart {
  font-size: 64px;
  animation: heartbeat 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255, 123, 156, 0.6));
}

.opening-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(28px, 6vw, 46px);
  margin: 18px 0 10px;
  line-height: 1.2;
  color: var(--cream);
}

.opening-sub {
  color: var(--text-dim);
  font-size: clamp(15px, 3.5vw, 18px);
  margin-bottom: 30px;
}

.enter-btn {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #2a1320;
  background: linear-gradient(135deg, var(--rose-soft), var(--gold));
  border: none;
  padding: 16px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 123, 156, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.enter-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 40px rgba(255, 123, 156, 0.55); }
.enter-btn:active { transform: scale(0.98); }

/* ===================== CONTEÚDO ===================== */
.content {
  opacity: 0;
  transition: opacity 1.2s ease;
  position: relative;
  z-index: 1;
}
.content.visible { opacity: 1; }

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(28px, 5vw, 42px);
  text-align: center;
  color: var(--gold);
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

/* ===================== HERO ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

.hero-photo-wrap { position: relative; margin-bottom: 32px; }

.hero-photo {
  width: clamp(220px, 60vw, 340px);
  height: clamp(220px, 60vw, 340px);
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 179, 198, 0.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
  background: #2a1320;
}

.hero-photo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 123, 156, 0.5) 0%, transparent 70%);
  filter: blur(20px);
  z-index: 1;
  animation: pulse 3s ease-in-out infinite;
}

.hero-names {
  font-family: "Dancing Script", cursive;
  font-size: clamp(44px, 11vw, 88px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--rose-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-date {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(18px, 4vw, 24px);
  color: var(--text-dim);
  letter-spacing: 2px;
}

.scroll-hint {
  margin-top: 60px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.7;
  animation: bob 2s ease-in-out infinite;
}
.scroll-arrow { font-size: 28px; line-height: 1; margin-top: -4px; }

/* ===================== CARTA ===================== */
.letter { padding: 80px 24px; max-width: 760px; margin: 0 auto; }

.letter-card {
  background: linear-gradient(160deg, rgba(255, 245, 247, 0.06), rgba(255, 179, 198, 0.04));
  border: 1px solid rgba(255, 179, 198, 0.2);
  border-radius: 24px;
  padding: clamp(28px, 6vw, 56px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
}

.letter-text {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(19px, 3.4vw, 24px);
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
}

.letter-sign {
  font-family: "Dancing Script", cursive;
  font-size: clamp(24px, 5vw, 34px);
  color: var(--rose-soft);
  margin-top: 28px;
  white-space: pre-wrap;
  text-align: right;
}

/* ===================== TIMELINE ===================== */
.timeline-section { padding: 60px 24px 100px; max-width: 900px; margin: 0 auto; }

.timeline-sub {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(17px, 3.5vw, 22px);
  color: var(--text-dim);
  margin: -24px auto 48px;
  max-width: 560px;
}

.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(255, 179, 198, 0.5) 12%, rgba(255, 179, 198, 0.5) 88%, transparent);
  transform: translateX(-50%);
}

.tl-item {
  position: relative;
  width: 50%;
  padding: 24px 40px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.tl-item.show { opacity: 1; transform: translateY(0); }

.tl-item:nth-child(odd) { left: 0; text-align: right; }
.tl-item:nth-child(even) { left: 50%; text-align: left; }

.tl-item::after {
  content: "❤";
  position: absolute;
  top: 30px;
  font-size: 18px;
  color: var(--rose);
  background: var(--bg);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 179, 198, 0.5);
}
.tl-item:nth-child(odd)::after { right: -15px; }
.tl-item:nth-child(even)::after { left: -15px; }

.tl-card {
  background: linear-gradient(160deg, rgba(255, 245, 247, 0.07), rgba(255, 179, 198, 0.03));
  border: 1px solid rgba(255, 179, 198, 0.18);
  border-radius: 18px;
  padding: 16px;
  display: inline-block;
  text-align: left;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  max-width: 360px;
}

.tl-photo {
  width: 100%;
  max-width: 320px;
  max-height: 440px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 0;
  background: #2a1320;
  display: block;
}
.tl-card:has(.tl-text) .tl-photo,
.tl-card:has(.tl-date) .tl-photo { margin-bottom: 14px; }
.tl-date + .tl-text { margin-top: 6px; }

.tl-date {
  font-family: "Quicksand", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rose-soft);
}

.tl-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--gold);
  margin: 4px 0 8px;
}

.tl-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ===================== FINAL ===================== */
.ending {
  text-align: center;
  padding: 60px 24px 120px;
}
.ending-heart {
  font-size: 56px;
  animation: heartbeat 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255, 123, 156, 0.6));
}
.ending-text {
  font-family: "Dancing Script", cursive;
  font-size: clamp(28px, 6vw, 44px);
  color: var(--rose-soft);
  margin-top: 20px;
}

/* ===================== BOTÃO DE MÚSICA ===================== */
.music-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 50;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 198, 0.4);
  background: rgba(42, 19, 32, 0.8);
  color: var(--rose-soft);
  font-size: 22px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
  display: none;
}
.music-toggle.visible { display: block; }
.music-toggle:hover { transform: scale(1.08); }
.music-toggle .music-icon { display: inline-block; animation: spin 4s linear infinite; }
.music-toggle.paused .music-icon { animation-play-state: paused; opacity: 0.5; }

/* ===================== CORAÇÕES FLUTUANTES ===================== */
.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.floating-heart {
  position: absolute;
  bottom: -40px;
  font-size: 20px;
  opacity: 0;
  animation: floatUp linear forwards;
}

/* ===================== ANIMAÇÕES ===================== */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-110vh) scale(1.1); }
}

/* ===================== MOBILE ===================== */
@media (max-width: 680px) {
  .timeline::before { left: 22px; }
  .tl-item { width: 100%; left: 0 !important; text-align: left !important; padding: 16px 16px 16px 50px; }
  .tl-item::after { left: 7px !important; right: auto !important; }
  .tl-card { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: opacity 0.3s ease !important; }
  html { scroll-behavior: auto; }
}
