/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #080808;
  --dark: #0f0f0f;
  --card: #151515;
  --border: rgba(255,255,255,0.07);
  --pink: #e8798a;
  --pink-soft: #f2a7b4;
  --pink-glow: rgba(232,121,138,0.25);
  --red: #c0392b;
  --white: #f8f4f4;
  --muted: rgba(248,244,244,0.45);
  --font-body: 'Poppins', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --transition: 0.4s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   GLASS UTILITY
═══════════════════════════════════════════ */
.glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
}

/* ═══════════════════════════════════════════
   HIDDEN UTILITY
═══════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   1. INTRO SCREEN
═══════════════════════════════════════════ */
#intro-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1s ease, visibility 1s ease;
}

#intro-screen.fade-out { opacity: 0; visibility: hidden; }

#intro-text { text-align: center; }

.intro-line {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  color: var(--white);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease, transform 1.2s ease;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.intro-line.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════
   2. PASSWORD SCREEN
═══════════════════════════════════════════ */
#password-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a0a0f 0%, #000 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#password-screen.fade-out { opacity: 0; visibility: hidden; }

.password-card {
  padding: 3rem 2.5rem;
  width: min(420px, 92vw);
  text-align: center;
}

.lock-icon { font-size: 3rem; margin-bottom: 1rem; animation: pulse 2s infinite; }

.password-card h2 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--white), var(--pink-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.password-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.8rem; }

.input-wrapper {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.input-wrapper input {
  flex: 1;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.input-wrapper input:focus { border-color: var(--pink); }

.input-wrapper button {
  padding: 0.85rem 1.3rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--pink), #b5485c);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--pink-glow);
}

.pw-error {
  color: var(--pink-soft);
  font-size: 0.9rem;
  animation: shake 0.4s ease;
}

/* ═══════════════════════════════════════════
   MUSIC BUTTON
═══════════════════════════════════════════ */
#music-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(232,121,138,0.15);
  backdrop-filter: blur(12px);
  color: var(--pink-soft);
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 500;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

#music-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 24px var(--pink-glow);
  background: rgba(232,121,138,0.28);
}

#music-btn.playing #music-icon { animation: spin 3s linear infinite; }

/* ═══════════════════════════════════════════
   SECTIONS — SHARED
═══════════════════════════════════════════ */
.section {
  padding: 7rem 1.5rem;
  position: relative;
}

.full-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 1rem;
  border: 1px solid rgba(232,121,138,0.3);
  padding: 0.3rem 1rem;
  border-radius: 50px;
  background: rgba(232,121,138,0.08);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 30%, var(--pink-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-sub { color: var(--muted); font-size: 1rem; margin-bottom: 2.5rem; }

/* Reveal on scroll */
.reveal-section { opacity: 0; transform: translateY(50px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal-section.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════
   3. HERO
═══════════════════════════════════════════ */
#hero {
  background: radial-gradient(ellipse at 30% 60%, #2b0a14 0%, #000 65%);
  min-height: 100vh;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e8798a' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { text-align: center; z-index: 2; padding: 2rem; }

.typing-wrapper {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-style: italic;
  color: var(--white);
  margin-bottom: 1.5rem;
  min-height: 1.3em;
}

.cursor {
  display: inline-block;
  color: var(--pink);
  animation: blink 0.8s step-end infinite;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.02em;
  max-width: 520px;
  margin: 0 auto 3rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s ease 2s, transform 1s ease 2s;
}

.hero-subtitle.visible { opacity: 1; transform: translateY(0); }

.scroll-indicator {
  opacity: 0.5;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  animation: fadeInUp 1s ease 3s forwards;
}

.scroll-arrow {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  animation: bounce 2s ease infinite;
}

/* Floating hearts */
.floating-hearts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.heart-particle {
  position: absolute;
  bottom: -20px;
  font-size: 1rem;
  opacity: 0;
  animation: floatUp linear infinite;
  color: var(--pink);
}

/* ═══════════════════════════════════════════
   5. LOVE TIMER
═══════════════════════════════════════════ */
#timer-section {
  background: linear-gradient(180deg, #000 0%, #0d0508 100%);
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 3rem;
  margin: 0 auto 2rem;
  max-width: 700px;
  flex-wrap: wrap;
}

.timer-unit { text-align: center; }

.timer-unit span {
  display: block;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #fff, var(--pink-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.timer-unit label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink);
  margin-top: 0.4rem;
  display: block;
}

.timer-sep {
  font-size: 3rem;
  color: var(--pink);
  margin-bottom: 1.2rem;
  opacity: 0.6;
}

.timer-label { color: var(--muted); font-size: 1rem; font-style: italic; }

/* ═══════════════════════════════════════════
   6. GALLERY
═══════════════════════════════════════════ */
#gallery-section { background: #000; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/5; /* More portrait/premium feel */
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.6s ease;
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px rgba(232, 121, 138, 0.25), 
              0 0 0 1px rgba(232, 121, 138, 0.2);
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.1);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.gallery-item .play-overlay {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.2rem;
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.gallery-item:hover .play-overlay { 
  opacity: 0;
  transform: scale(0.8);
}

.gallery-info {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 40%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.8rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-item:hover .gallery-info {
  opacity: 1;
  transform: translateY(0);
}

.gallery-label {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.gallery-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pink-soft);
  font-weight: 500;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #1a0a0f, #0f0f1a);
  color: var(--pink-soft);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   7. OPEN WHEN LETTERS
═══════════════════════════════════════════ */
#letters-section { background: linear-gradient(180deg, #000 0%, #0a0005 100%); }

.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  text-align: left;
}

.letter-card {
  padding: 2rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-radius: 20px;
  overflow: hidden;
}

.letter-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px var(--pink-glow);
  border-color: rgba(232,121,138,0.25);
}

.letter-front { display: flex; flex-direction: column; gap: 0.8rem; }

.letter-emoji { font-size: 2.2rem; }

.letter-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--white);
}

.letter-tap {
  font-size: 0.78rem;
  color: var(--pink);
  letter-spacing: 0.05em;
}

.letter-message {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.letter-message p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(248,244,244,0.8);
}

.letter-card.open .letter-message { display: block; animation: fadeInDown 0.5s ease; }
.letter-close { display: block; margin-top: 1rem; font-size: 0.78rem; color: var(--pink); cursor: pointer; }

/* ═══════════════════════════════════════════
   8. CHAT REPLAY
═══════════════════════════════════════════ */
#chat-section { background: #000; }

.chat-phone {
  max-width: 420px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #6a0030);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.chat-name { display: block; font-size: 1rem; font-weight: 600; }
.chat-status { display: block; font-size: 0.72rem; color: #4ec97a; }

.chat-body {
  padding: 1.5rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.chat-bubble {
  max-width: 78%;
  padding: 0.8rem 1.1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.chat-bubble.visible { opacity: 1; transform: translateY(0); }

.chat-bubble.sent {
  background: linear-gradient(135deg, #2d1a2e, #3d1035);
  border: 1px solid rgba(232,121,138,0.15);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.bubble-time { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 0.3rem; text-align: right; }

/* ═══════════════════════════════════════════
   9. MAP OF MEMORIES
═══════════════════════════════════════════ */
#map-section { background: linear-gradient(180deg, #000 0%, #050010 100%); }

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
  text-align: left;
}

.map-place {
  padding: 2rem 1.5rem;
  border-radius: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.map-place:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(100,50,200,0.15);
  border-color: rgba(150,100,255,0.2);
}

.place-icon { font-size: 2.2rem; margin-bottom: 1rem; }

.map-place h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--white);
}

.map-place p { font-size: 0.85rem; color: var(--muted); line-height: 1.7; margin-bottom: 1rem; }

.place-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink);
  border: 1px solid rgba(232,121,138,0.25);
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
}

/* ═══════════════════════════════════════════
   10. FUTURE WITH YOU
═══════════════════════════════════════════ */
#future-section {
  background: radial-gradient(ellipse at 60% 50%, #15071a 0%, #000 65%);
}

.future-content {
  padding: 3rem;
  text-align: left;
  border-radius: 24px;
}

.future-content p {
  font-size: 1.05rem;
  line-height: 1.9;
  color: rgba(248,244,244,0.75);
  margin-bottom: 1.5rem;
}

.future-closing {
  color: var(--pink-soft) !important;
  font-family: var(--font-serif) !important;
  font-style: italic;
  font-size: 1.15rem !important;
}

/* ═══════════════════════════════════════════
   11. FINAL HIDDEN MESSAGE
═══════════════════════════════════════════ */
#final-section {
  background: linear-gradient(180deg, #000 0%, #0a0005 50%, #000 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
}

#reveal-btn {
  padding: 1.1rem 2.2rem;
  border-radius: 14px;
  border: 1px solid rgba(232,121,138,0.4);
  background: transparent;
  color: var(--pink-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  margin-bottom: 2.5rem;
}

#reveal-btn:hover {
  background: rgba(232,121,138,0.1);
  box-shadow: 0 0 40px var(--pink-glow);
  transform: scale(1.03);
}

.final-message { max-width: 700px; margin: 0 auto; }

.final-glass {
  padding: 3rem;
  text-align: center;
  animation: scaleIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.final-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-style: italic;
  color: var(--white);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.final-body {
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(248,244,244,0.75);
  margin: 2rem 0;
}

.final-sign {
  font-size: 1rem;
  color: var(--pink-soft);
  font-style: italic;
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
#site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #000;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════ */
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 0.5; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-120vh) scale(1.2) rotate(20deg); }
}
@keyframes scaleIn { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 600px) {
  .timer-display { padding: 1.5rem; gap: 0.3rem; }
  .timer-sep { font-size: 2rem; margin-bottom: 0.8rem; }
  .future-content { padding: 1.8rem; }
  .final-glass { padding: 2rem; }
  .letters-grid, .map-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  #music-btn { bottom: 1rem; right: 1rem; }
}
