/* =========================================================
   ANNIVERSARY SITE — STYLESHEET
   Palette: blush pink, cream, white, lavender, gold
   ========================================================= */

:root {
  --blush: #f7c9d3;
  --blush-dark: #e8a1b3;
  --cream: #fdf6f0;
  --white: #ffffff;
  --lavender: #e3d7f4;
  --lavender-dark: #c9b6e8;
  --gold: #d4af37;
  --gold-soft: #f0d98c;
  --text-dark: #4a3b45;
  --text-soft: #7a6a74;
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-soft: 0 8px 32px rgba(180, 120, 150, 0.25);
  --font-serif: 'Playfair Display', serif;
  --font-body: 'Quicksand', sans-serif;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--cream) 0%, var(--blush) 45%, var(--lavender) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  cursor: none; /* replaced by custom cursor on non-touch devices */
}

@media (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
}

.hidden { display: none !important; }

/* ================= CUSTOM CURSOR ================= */
#cursor-dot, #cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
#cursor-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  transition: transform 0.05s linear;
}
#cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid var(--blush-dark);
  transition: transform 0.12s ease-out, width 0.2s, height 0.2s, border-color 0.2s;
}
#cursor-ring.hover-active {
  width: 46px; height: 46px;
  border-color: var(--gold);
}

/* ================= LOADING SCREEN ================= */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--cream), var(--blush));
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-heart {
  font-size: 3rem;
  color: var(--blush-dark);
  animation: heartbeat 1.1s ease-in-out infinite;
}
#loading-screen p {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-soft);
  letter-spacing: 0.5px;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  40% { transform: scale(0.95); }
  60% { transform: scale(1.15); }
}

/* ================= AMBIENT LAYER (floating hearts/particles) ================= */
#ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.floating-heart {
  position: absolute;
  bottom: -10%;
  font-size: 1.4rem;
  color: var(--blush-dark);
  opacity: 0.7;
  animation: floatUp linear forwards;
  will-change: transform;
}
.glow-particle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  opacity: 0.8;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 20px)) rotate(360deg); opacity: 0; }
}

/* ================= PROGRESS TRACKER ================= */
#progress-tracker {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 8px 16px;
  box-shadow: var(--shadow-soft);
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-soft);
  opacity: 0.6;
  transition: opacity 0.4s, color 0.4s;
}
.progress-step .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--text-soft);
  transition: background 0.4s, box-shadow 0.4s, transform 0.4s;
}
.progress-step.active {
  opacity: 1;
  color: var(--text-dark);
  font-weight: 600;
}
.progress-step.active .dot {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  transform: scale(1.3);
}
.progress-step.done .dot {
  background: var(--blush-dark);
}
.progress-line {
  width: 20px;
  height: 1px;
  background: var(--text-soft);
  opacity: 0.4;
}
.progress-step .label { display: none; }
@media (min-width: 640px) {
  .progress-step .label { display: inline; }
}

/* ================= LAYOUT / SECTIONS ================= */
.app-section {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
  position: relative;
  z-index: 2;
  animation: sectionFadeIn 0.9s ease;
}
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= GLASSMORPHISM CARD ================= */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 48px 36px;
  max-width: 620px;
  width: 100%;
  text-align: center;
  position: relative;
}

/* ================= HERO ================= */
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.heart-pulse { display: inline-block; animation: heartbeat 1.4s ease-in-out infinite; }
.hero-subtitle {
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-soft);
  margin-bottom: 2.2rem;
}

/* ================= BUTTONS ================= */
.glow-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 36px;
  border: none;
  border-radius: 40px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blush-dark), var(--gold));
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.glow-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.7);
}
.glow-btn:active { transform: translateY(0) scale(0.98); }
.glow-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* sparkle on hover */
.glow-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,0.5);
  transform: rotate(25deg);
  transition: left 0.6s ease;
}
.glow-btn:hover::after { left: 130%; }

/* ================= QUIZ ================= */
.quiz-card h2, .puzzle2-card h2, .secret-card h2 {
  font-family: var(--font-serif);
  margin-bottom: 1.6rem;
  font-size: clamp(1.4rem, 4vw, 2rem);
}
.quiz-question { margin-bottom: 1.8rem; text-align: left; }
.quiz-question p.q-text {
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  padding: 12px 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(200,150,170,0.4);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  text-align: left;
  transition: background 0.25s, border-color 0.25s, transform 0.15s;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.quiz-option:hover { background: rgba(255,255,255,0.7); transform: translateX(3px); }
.quiz-option.selected { border-color: var(--gold); background: rgba(240,217,140,0.35); }
.quiz-option.correct { border-color: #7bbf8a; background: rgba(123,191,138,0.3); }
.quiz-option.incorrect { border-color: #d97d7d; background: rgba(217,125,125,0.25); }

.quiz-text-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(200,150,170,0.4);
  background: rgba(255,255,255,0.5);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.quiz-submit-row { margin-top: 1.2rem; text-align: center; }

.success-panel { text-align: center; }
.success-heart {
  font-size: 2.6rem;
  color: var(--blush-dark);
  animation: heartbeat 1.2s infinite;
  margin-bottom: 0.5rem;
}

/* ================= SLIDING PUZZLE ================= */
.puzzle-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}
#sliding-puzzle-grid {
  position: relative;
  width: min(340px, 78vw);
  height: min(340px, 78vw);
  margin: 0 auto 1.6rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255,255,255,0.6);
}
.puzzle-tile {
  position: absolute;
  top: 0; left: 0;
  background-image: url('photo.jpg');
  background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,0.5);
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.puzzle-tile.blank {
  background: transparent;
  cursor: default;
  box-shadow: none;
  border: none;
}
.puzzle-tile.solved-glow {
  animation: tileGlow 1s ease;
}
@keyframes tileGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 20px var(--gold); }
}

/* ================= SECRET DOOR ================= */
.secret-card { max-width: 560px; }
.clues { text-align: left; margin-bottom: 1.6rem; }
.clue { margin-bottom: 0.7rem; font-size: 0.95rem; color: var(--text-dark); }
.clue-hint { font-size: 0.85rem; font-style: italic; color: var(--text-soft); }
.secret-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
#secret-input {
  flex: 1;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 30px;
  border: 1.5px solid rgba(200,150,170,0.4);
  background: rgba(255,255,255,0.5);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
#secret-error {
  margin-top: 0.9rem;
  color: #b9524f;
  font-size: 0.9rem;
}

/* Door opening overlay */
#door-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  pointer-events: none;
}
#door-overlay.active { display: block; }
.door {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background: linear-gradient(135deg, var(--lavender-dark), var(--blush-dark));
  transition: transform 1.4s cubic-bezier(.77,0,.18,1);
}
.door-left { left: 0; transform-origin: left; }
.door-right { right: 0; transform-origin: right; }
#door-overlay.opening .door-left { transform: translateX(-100%); }
#door-overlay.opening .door-right { transform: translateX(100%); }

/* ================= FINAL PAGE ================= */
#final-section {
  background: radial-gradient(ellipse at center, #2b1e3a 0%, #17111f 80%);
  position: relative;
  overflow: hidden;
}
#final-section .glass-card {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--cream);
}
.letter-heading { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 1.2rem; color: var(--gold-soft); }
.typewriter {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.7;
  min-height: 140px;
  text-align: left;
  white-space: pre-wrap;
}
.typewriter::after {
  content: '|';
  animation: blink 0.8s infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.final-love {
  font-family: var(--font-serif);
  margin-top: 1.8rem;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--blush);
  animation: heartbeat 2s infinite;
}
#read-again-btn { margin-top: 1.6rem; }

#stars-container {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

#mute-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 400;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--cream);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* ================= CONFETTI CANVAS ================= */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5000;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
  .glass-card { padding: 32px 20px; border-radius: 22px; }
  #progress-tracker { padding: 6px 10px; gap: 4px; }
  .progress-line { width: 12px; }
  .secret-input-row { flex-direction: column; }
  #secret-input { width: 100%; }
}
