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

:root {
  --blush: #f2d0d0;
  --rose: #e8b4b8;
  --deep-rose: #c97b7b;
  --ivory: #fdf6f0;
  --cream: #faf0e6;
  --text: #5a3a3a;
  --light-text: #9e6b6b;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--ivory);
  color: var(--text);
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── PASSWORD GATE ── */
#password-gate {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #fdf0f0, #fce8e8);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.gate-box {
  text-align: center;
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(200,120,120,0.15);
  max-width: 360px; width: 90%;
}

.lock-icon { font-size: 3rem; margin-bottom: 1rem; }

.gate-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.gate-box p { color: var(--light-text); margin-bottom: 1.5rem; font-size: 0.95rem; }

.gate-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--rose);
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  text-align: center;
  outline: none;
  color: var(--text);
  background: var(--ivory);
  margin-bottom: 1rem;
}

.gate-box button {
  background: linear-gradient(135deg, var(--rose), var(--deep-rose));
  color: white;
  border: none;
  padding: 0.75rem 2.5rem;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gate-box button:hover { opacity: 0.85; }
.error { color: var(--deep-rose); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2em; }

/* ── PETALS ── */
#petals {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  font-size: 1.4rem;
  opacity: 1;
  animation: fall linear infinite;
}

@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ── HERO ── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(253,240,240,0.92) 0%, rgba(253,246,240,0.92) 100%);
  z-index: 1;
}

.polaroid-drop {
  margin-bottom: 2rem;
  animation: dropIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

@keyframes dropIn {
  0%   { transform: translateY(-120px) rotate(-8deg); opacity: 0; }
  60%  { transform: translateY(10px) rotate(3deg); opacity: 1; }
  80%  { transform: translateY(-5px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(2deg); opacity: 1; }
}

.polaroid {
  background: white;
  padding: 12px 12px 36px;
  box-shadow: 0 6px 24px rgba(180,100,100,0.18);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border-radius: 2px;
}

.polaroid img {
  display: block;
  width: 260px; height: 200px;
  object-fit: cover;
}

#hero-polaroid .polaroid img {
  width: 360px;
  height: 280px;
}

#hero-polaroid .polaroid p {
  width: 360px;
}

.polaroid p {
  text-align: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  color: var(--light-text);
  margin-top: 8px;
  width: 260px;
  word-wrap: break-word;
  white-space: normal;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  color: var(--text);
  animation: fadeUp 1s 0.8s both;
}

.heart { color: var(--deep-rose); }

.hero-text .subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: var(--light-text);
  animation: fadeUp 1s 1s both;
}

.hero-text .since {
  font-size: 0.9rem;
  color: var(--light-text);
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  animation: fadeUp 1s 1.1s both;
}

.hero-text .tagline {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--deep-rose);
  margin-top: 1rem;
  animation: fadeUp 1s 1.3s both;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  font-size: 0.85rem;
  color: var(--light-text);
  animation: fadeUp 1s 1.8s both, bob 2s 2.8s ease-in-out infinite;
}

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

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

/* ── TIMELINE ── */
#timeline {
  position: relative;
  padding: 4rem 1rem 4rem;
  z-index: 1;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-align: center;
  color: var(--text);
  margin-bottom: 3rem;
}

.timeline-track {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

.curvy-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100%;
  top: 0;
  z-index: 0;
}

.line-hearts {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 100%;
  top: 0;
  z-index: 2;
  pointer-events: none;
}

.line-heart {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  animation: heartBob 2.5s ease-in-out infinite;
}

.line-heart:nth-child(2) { animation-delay: 0.4s; }
.line-heart:nth-child(3) { animation-delay: 0.8s; }
.line-heart:nth-child(4) { animation-delay: 1.2s; }
.line-heart:nth-child(5) { animation-delay: 1.6s; }
.line-heart:nth-child(6) { animation-delay: 2.0s; }
.line-heart:nth-child(7) { animation-delay: 0.6s; }
.line-heart:nth-child(8) { animation-delay: 1.0s; }
.line-heart:nth-child(9) { animation-delay: 1.4s; }

@keyframes heartBob {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%       { transform: translateX(-50%) scale(1.3) rotate(10deg); }
}

.milestones {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 2rem;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.milestone.visible { opacity: 1; transform: translateY(0) scale(1); }

.milestone.left  { flex-direction: row; justify-content: flex-start; padding-left: 5%; }
.milestone.right { flex-direction: row-reverse; justify-content: flex-start; padding-right: 5%; }

.milestone .polaroid { flex-shrink: 0; transform: rotate(-3deg); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.milestone.right .polaroid { transform: rotate(3deg); }
.milestone .polaroid:hover { transform: rotate(0deg) scale(1.05) !important; box-shadow: 0 12px 36px rgba(180,100,100,0.28); }

.milestone .polaroid img { width: 220px; height: 170px; }
.milestone .polaroid p { width: 220px; }

.milestone-info { max-width: 240px; }

.m-date {
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  color: var(--deep-rose);
  display: block;
  margin-bottom: 0.4rem;
  animation: none;
}

.milestone.visible .m-date {
  animation: popIn 0.5s 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.m-caption {
  font-size: 0.95rem;
  color: var(--light-text);
  line-height: 1.6;
}

/* ── LETTER ── */
#letter {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
  background: linear-gradient(180deg, rgba(253,240,240,0.92) 0%, rgba(253,240,240,0.92) 100%);
  text-align: center;
}

.letter-wrap { max-width: 680px; margin: 0 auto; }

.letter-body {
  background: white;
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 8px 40px rgba(200,120,120,0.1);
  margin-top: 2rem;
  border: 1px solid var(--blush);
}

.letter-text {
  font-family: 'Dancing Script', cursive;
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text);
  text-align: left;
}

/* ── COUNTDOWN ── */
#countdown {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(253,240,240,0.92) 0%, rgba(252,232,232,0.92) 100%);
}

.countdown-heart {
  font-size: 4.5rem;
  animation: heartbeat 1.2s ease-in-out infinite;
  line-height: 1;
  margin-bottom: 1.5rem;
  display: block;
  text-align: center;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.25); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.18); }
  56%       { transform: scale(1); }
}

.countdown-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: white;
  border-radius: 20px;
  padding: 2rem 3rem;
  border: 1.5px solid var(--blush);
  animation: softGlow 2.5s ease-in-out infinite;
}

@keyframes softGlow {
  0%, 100% { box-shadow: 0 8px 30px rgba(200,120,120,0.15), 0 0 0 0 rgba(220,130,130,0.15); }
  50%       { box-shadow: 0 8px 40px rgba(200,120,120,0.28), 0 0 18px 4px rgba(220,130,130,0.18); }
}

.days-number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 9vw, 5rem);
  color: var(--deep-rose);
  line-height: 1;
}

.days-label {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--light-text);
  margin-top: 0.3rem;
}

.countdown-sub {
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  color: var(--light-text);
  line-height: 1.8;
  margin-top: 0.8rem;
  text-align: center;
}

.countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.countdown-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  justify-content: center;
}

.countdown-polaroid {
  display: flex;
  justify-content: center;
}

.countdown-polaroid .polaroid img {
  width: 320px;
  height: 240px;
}

.countdown-polaroid .polaroid p {
  width: 320px;
}

.countdown-polaroid .polaroid {
  animation: softGlow 2.5s ease-in-out infinite;
  animation-delay: 1.25s;
}


#mute-btn {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 100;
  background: white;
  border: 1.5px solid var(--rose);
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200,120,120,0.2);
  transition: transform 0.2s;
}
#mute-btn:hover { transform: scale(1.1); }

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(90,40,40,0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#lightbox.open { display: flex; }

.lb-polaroid {
  background: white;
  padding: 16px 16px 16px;
  box-shadow: 0 16px 60px rgba(100,40,40,0.35);
  border-radius: 2px;
  position: relative;
  cursor: default;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

#lb-img {
  display: block;
  max-width: min(70vw, 560px);
  max-height: 65vh;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-polaroid p {
  text-align: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: var(--light-text);
  margin-top: 10px;
  width: 100%;
  word-wrap: break-word;
  white-space: normal;
}

.lb-close {
  position: absolute;
  top: 8px; right: 10px;
  background: none; border: none;
  font-size: 1.1rem;
  color: var(--light-text);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
  transition: background 0.15s;
}
.lb-close:hover { background: var(--blush); }

/* make milestone & hero polaroids clickable */
.milestone .polaroid, #hero .polaroid, .countdown-polaroid .polaroid { cursor: pointer; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .milestone { flex-direction: column !important; padding: 0 1rem !important; align-items: center; text-align: center; }
  .milestone .polaroid img { width: 180px; height: 140px; }
  .milestone .polaroid p { width: 180px; }
  .milestone-info { max-width: 100%; }
  .curvy-line { display: none; }
  .letter-body { padding: 2rem 1.2rem; }
}
