
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,500;1,600&display=swap');

/* ===== BIẾN MÀU ===== */
:root {
  --pink: #e98aa9;
  --dark-pink: #b85d80;
  --light-pink: #fff0f5;
  --cream: #fffaf7;
  --text: #624451;
}

/* ===== RESET ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: 'DM Sans', Arial, sans-serif;
  overflow-x: hidden;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ===== MÀN HÌNH CHÀO MỪNG ===== */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(
    135deg,
    #fff0f5 0%,
    #ffe0eb 50%,
    #fff9f5 100%
  );
  text-align: center;
  overflow-y: auto;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}

.welcome-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-content {
  width: 100%;
  max-width: 550px;
  margin: auto;
  animation: welcomeAppear 1.3s ease both;
}

.welcome-heart {
  font-size: 80px;
  animation: heartbeat 1.8s ease-in-out infinite;
}

.welcome-small {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--dark-pink);
  margin: 20px 0;
}

.welcome-content h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.4;
  color: #994564;
  margin: 20px 0;
}

.welcome-description {
  font-size: 15px;
  color: #9c6b7f;
  line-height: 2;
  margin: 25px 0 35px;
}

.open-gift-btn {
  border: none;
  border-radius: 40px;
  background: var(--dark-pink);
  color: white;
  padding: 17px 38px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 25px #b85d8040;
  transition: transform 0.3s, background 0.3s;
}

.open-gift-btn:hover {
  transform: scale(1.06);
  background: #994564;
}

.welcome-note {
  margin-top: 40px;
  font-size: 12px;
  color: #bd8298;
}

@keyframes welcomeAppear {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===== THANH ĐIỀU HƯỚNG ===== */
.navbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 8%;
  background: var(--cream);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--dark-pink);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 25px;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}

nav a:hover {
  color: var(--dark-pink);
}

/* ===== TRANG CHỦ ===== */
.hero {
  min-height: 650px;
  padding: 85px 10%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 65px;
  background: linear-gradient(125deg, #fff0f5, #fff9f3);
}

.eyebrow {
  color: var(--dark-pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
}

h1 {
  font-size: clamp(36px, 5vw, 65px);
  line-height: 1.25;
  font-weight: 400;
  margin: 22px 0;
}

h1 em {
  color: var(--dark-pink);
}

.hero-text p {
  font-size: 15px;
  line-height: 2;
  max-width: 480px;
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  background: var(--dark-pink);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 15px 27px;
  text-decoration: none;
  font-size: 13px;
  transition: 0.3s;
}

.btn:hover {
  background: #994564;
  transform: translateY(-3px);
}

.hero-photo {
  position: relative;
  width: 100%;
  max-width: 370px;
  margin: auto;
}

.photo-frame {
  padding: 13px 13px 25px;
  background: white;
  box-shadow: 0 18px 45px #b85d802b;
  transform: rotate(4deg);
}

.photo-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.photo-caption {
  display: block;
  text-align: center;
  padding-top: 20px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--dark-pink);
}

.decoration {
  position: absolute;
  color: var(--pink);
  font-size: 50px;
}

.d1 { top: -35px; right: -30px; }
.d2 { bottom: -25px; left: -35px; }

/* ===== CÁC PHẦN NỘI DUNG ===== */
.intro,
.gallery-section,
.letter-section,
.ending {
  text-align: center;
  padding: 90px 8%;
}

.intro h2,
.gallery-section h2,
.letter-section h2,
.ending h2 {
  font-size: clamp(27px, 4vw, 39px);
  font-weight: 400;
  margin: 18px 0;
}

.intro p {
  max-width: 560px;
  margin: auto;
  line-height: 2;
  font-size: 15px;
}

.divider-heart {
  font-size: 32px;
  color: var(--pink);
  margin-top: 35px;
}

/* ===== ALBUM ẢNH ===== */
.gallery-section {
  background: var(--light-pink);
}

.section-desc {
  font-size: 14px;
  margin-bottom: 55px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 35px;
  max-width: 1050px;
  margin: auto;
}

.polaroid {
  min-width: 0;
  border: none;
  background: white;
  padding: 12px 12px 22px;
  box-shadow: 0 8px 25px #b85d8020;
  transition: transform 0.3s, box-shadow 0.3s;
  color: var(--text);
}

.polaroid:nth-child(odd) {
  transform: rotate(-3deg);
}

.polaroid:nth-child(even) {
  transform: rotate(3deg);
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-10px);
  box-shadow: 0 18px 35px #b85d8035;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: #ffe1eb;
}

.polaroid span {
  display: block;
  margin-top: 17px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 16px;
}

/* ===== THƯ TÌNH ===== */
.letter-section {
  background: var(--cream);
}

.letter-card {
  max-width: 680px;
  min-height: 330px;
  margin: 45px auto 0;
  padding: 45px;
  background: white;
  border: 1px solid #f8dce5;
  box-shadow: 0 12px 45px #b85d8015;
  border-radius: 8px;
}

.letter-icon {
  font-size: 42px;
}

.letter-card h3 {
  color: var(--dark-pink);
  font-size: 25px;
  font-weight: 400;
}

#typed-letter {
  white-space: pre-line;
  line-height: 2.1;
  min-height: 100px;
  font-size: 15px;
}

.signature {
  display: block;
  color: var(--dark-pink);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  margin: 22px 0;
}

/* ===== LỜI KẾT ===== */
.ending {
  background: linear-gradient(135deg, #ffe5ee, #fff2f5);
}

.big-heart {
  font-size: 75px;
  color: var(--dark-pink);
  animation: heartbeat 2s infinite;
}

.ending span {
  display: block;
  margin-top: 35px;
  color: var(--dark-pink);
}

footer {
  text-align: center;
  padding: 30px 15px;
  font-size: 12px;
  background: var(--cream);
}

/* ===== NÚT NHẠC ===== */
.music-btn {
  position: fixed;
  z-index: 20;
  right: 25px;
  bottom: 25px;
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 50%;
  background: var(--dark-pink);
  color: white;
  font-size: 25px;
  box-shadow: 0 5px 20px #b85d8050;
}

.music-btn.playing {
  animation: heartbeat 1.8s infinite;
}

/* ===== PHÓNG TO ẢNH ===== */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 15px;
  background: #160d15e8;
}

.lightbox img {
  max-width: 95%;
  max-height: 85vh;
  object-fit: contain;
  border: 5px solid white;
  border-radius: 5px;
}

#closeLightbox {
  position: absolute;
  right: 20px;
  top: 12px;
  color: white;
  background: transparent;
  border: none;
  font-size: 40px;
}

/* ===== TRÁI TIM BAY ===== */
.floating-heart {
  position: fixed;
  z-index: 1;
  bottom: -30px;
  pointer-events: none;
  color: #ed9cb7;
  opacity: 0;
  animation: floatUp linear forwards;
}

@keyframes floatUp {
  10% { opacity: 0.65; }
  85% { opacity: 0.65; }
  100% {
    transform: translateY(-105vh) rotate(25deg);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 750px) {
  .navbar {
    flex-direction: column;
    gap: 18px;
    padding: 20px;
  }

  nav {
    gap: 17px;
  }

  nav a {
    font-size: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 65px 8%;
    gap: 55px;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-photo {
    width: 75%;
    max-width: 300px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .polaroid span {
    font-size: 13px;
  }

  .letter-card {
    padding: 30px 20px;
  }

  .intro,
  .gallery-section,
  .letter-section,
  .ending {
    padding: 65px 6%;
  }
}

@media (max-width: 400px) {
  .gallery {
    grid-template-columns: 1fr;
    max-width: 270px;
  }

  .welcome-content h1 {
    font-size: 29px;
  }
}

/* ===== GIẢM CHUYỂN ĐỘNG NẾU CẦN ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
