/* ==============================================
   VALENTINE'S DAY WEBSITE — styles.css
   ============================================== */

/* ---------- CUSTOM PROPERTIES ---------- */
:root {
  --pink-light: #ffe0ec;
  --pink: #ff6b9d;
  --pink-dark: #e84393;
  --red: #e74c6f;
  --purple: #a855f7;
  --purple-dark: #6b21a8;
  --white-alpha-20: rgba(255, 255, 255, 0.2);
  --white-alpha-40: rgba(255, 255, 255, 0.4);
  --white-alpha-60: rgba(255, 255, 255, 0.6);
  --white-alpha-80: rgba(255, 255, 255, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  --text-dark: #2d1b3d;
  --text-light: #ffffff;
  --card-radius: 20px;
  --transition-speed: 0.3s;

  /* Tweak these to adjust emoji density / speed */
  --float-heart-count: 15;
  --fall-rose-count: 10;
  --trail-max: 30;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(135deg, #fbc2eb 0%, #e74c6f 30%, #a855f7 70%, #6b21a8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- SPARKLE / GRAIN OVERLAY ---------- */
.sparkle-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Subtle noise grain via repeating radial gradient */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.10) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 100px 100px;
  animation: sparkle-shimmer 4s ease-in-out infinite alternate;
}

@keyframes sparkle-shimmer {
  0%   { opacity: 0.4; }
  100% { opacity: 0.8; }
}

/* ---------- ANIMATION LAYERS (containers) ---------- */
.animation-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

#confetti-layer {
  z-index: 1000;
}

/* ---------- SECTION BASE ---------- */
.section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.section-heading {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--text-light);
  text-align: center;
  margin-bottom: 40px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ---------- HERO ---------- */
.hero-section {
  text-align: center;
}

.hero-content {
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: var(--text-light);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
  animation: hero-fade-in 1.2s ease-out both;
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--white-alpha-80);
  margin-bottom: 48px;
  animation: hero-fade-in 1.2s 0.3s ease-out both;
}

@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scroll-cta {
  display: inline-block;
  text-decoration: none;
  animation: hero-fade-in 1.2s 0.6s ease-out both;
}

.scroll-arrow {
  display: inline-block;
  font-size: 2rem;
  color: var(--text-light);
  animation: bounce 2s ease-in-out infinite;
}

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

/* ---------- MESSAGE CARDS ---------- */
.messages-section {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 100px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  width: 100%;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 32px 28px;
  box-shadow: 0 8px 32px var(--glass-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  cursor: default;
}

.glass-card:hover,
.glass-card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.18);
  outline: none;
}

.card-emoji {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 12px;
}

.glass-card p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- REASONS CHIPS ---------- */
.reasons-section {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 100px;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 800px;
}

.chip {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.95rem;
  color: var(--text-light);
  transition: transform var(--transition-speed), background var(--transition-speed);
  cursor: default;
}

.chip:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.28);
}

/* ---------- SURPRISE SECTION ---------- */
.surprise-section {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 100px;
  gap: 24px;
}

.surprise-button {
  font-size: 1.3rem;
  padding: 16px 40px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--text-light);
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(231, 67, 147, 0.4);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  font-weight: 600;
}

.surprise-button:hover,
.surprise-button:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 10px 36px rgba(231, 67, 147, 0.55);
  outline: none;
}

.surprise-button:active {
  transform: scale(0.96);
}

.surprise-message {
  font-size: 1.2rem;
  color: var(--text-light);
  min-height: 2em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s;
}

.surprise-message.visible {
  opacity: 1;
}

/* Love Meter */
.love-meter-container {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.love-meter-label {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 600;
}

.love-meter-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--white-alpha-20);
  outline: none;
  cursor: pointer;
}

.love-meter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s;
}

.love-meter-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.love-meter-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  border: none;
}

.love-meter-bar-track {
  width: 100%;
  height: 14px;
  border-radius: 7px;
  background: var(--white-alpha-20);
  overflow: hidden;
}

.love-meter-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--pink) 0%, #ff4d6d 50%, var(--red) 100%);
  transition: width 0.25s ease-out;
}

.love-meter-text {
  font-size: 1rem;
  color: var(--white-alpha-80);
  text-align: center;
  min-height: 1.6em;
}

/* ---------- WISH WALL ---------- */
.wish-wall-section {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 100px;
}

.wish-wall-desc {
  color: var(--white-alpha-80);
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.05rem;
}

.wish-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
  width: 100%;
  margin-bottom: 32px;
}

.wish-input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-light);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-speed);
}

.wish-input::placeholder {
  color: var(--white-alpha-60);
}

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

.wish-submit {
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: var(--pink-dark);
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-speed), background var(--transition-speed);
  white-space: nowrap;
}

.wish-submit:hover,
.wish-submit:focus-visible {
  transform: scale(1.05);
  background: var(--pink);
  outline: none;
}

.wish-notes-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 800px;
  width: 100%;
}

.wish-note {
  background: rgba(255, 255, 200, 0.85);
  color: #3d2b1f;
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  max-width: 220px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
  transform: rotate(var(--rotate, -2deg));
  transition: transform var(--transition-speed);
  position: relative;
  line-height: 1.5;
}

.wish-note::before {
  content: "📌";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
}

.wish-note:hover {
  transform: rotate(0deg) scale(1.05);
}

.wish-note .wish-delete {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #999;
  padding: 2px 4px;
  line-height: 1;
}

.wish-note .wish-delete:hover {
  color: #e74c6f;
}

/* ---------- FINAL SECTION ---------- */
.final-section {
  text-align: center;
}

.final-content {
  max-width: 600px;
}

.final-heart {
  font-size: 5rem;
  display: block;
  margin-bottom: 20px;
  animation: pulse-heart 1.5s ease-in-out infinite;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.final-heading {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--text-light);
  margin-bottom: 20px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.final-text {
  font-size: 1.1rem;
  color: var(--white-alpha-80);
  margin-bottom: 24px;
  line-height: 1.8;
}

.final-sign-off {
  font-size: 1.2rem;
  color: var(--text-light);
  font-weight: 600;
  font-style: italic;
}

/* ==============================================
   FLOATING HEARTS — CSS Animation (Layer 1)
   ============================================== */
.floating-heart {
  position: absolute;
  bottom: -60px;
  animation: float-up var(--dur, 8s) linear infinite;
  animation-delay: var(--delay, 0s);
  font-size: var(--size, 1.6rem);
  opacity: var(--opacity, 0.7);
  will-change: transform;
}

@keyframes float-up {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: var(--opacity, 0.7);
  }
  25% {
    transform: translateY(-25vh) translateX(20px) rotate(15deg);
  }
  50% {
    transform: translateY(-50vh) translateX(-15px) rotate(-10deg);
  }
  75% {
    transform: translateY(-75vh) translateX(10px) rotate(20deg);
  }
  100% {
    transform: translateY(-110vh) translateX(-10px) rotate(-5deg);
    opacity: 0;
  }
}

/* ==============================================
   FALLING ROSES — CSS Animation (Layer 2)
   ============================================== */
.falling-rose {
  position: absolute;
  top: -60px;
  animation: fall-down var(--dur, 10s) linear infinite;
  animation-delay: var(--delay, 0s);
  font-size: var(--size, 1.8rem);
  opacity: var(--opacity, 0.6);
  will-change: transform;
}

@keyframes fall-down {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: var(--opacity, 0.6);
  }
  25% {
    transform: translateY(25vh) translateX(-30px) rotate(90deg);
  }
  50% {
    transform: translateY(50vh) translateX(20px) rotate(200deg);
  }
  75% {
    transform: translateY(75vh) translateX(-15px) rotate(300deg);
  }
  100% {
    transform: translateY(115vh) translateX(10px) rotate(400deg);
    opacity: 0;
  }
}

/* ==============================================
   MOUSE TRAIL — CSS fade / float (Layer 3)
   ============================================== */
.trail-emoji {
  position: absolute;
  pointer-events: none;
  animation: trail-fade 1s ease-out forwards;
  font-size: 1.6rem;
  will-change: transform, opacity;
}

@keyframes trail-fade {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.4) translateY(-60px);
  }
}

/* ==============================================
   CONFETTI BURST
   ============================================== */
.confetti-piece {
  position: absolute;
  font-size: 1.8rem;
  animation: confetti-fly var(--dur, 1.5s) ease-out forwards;
  will-change: transform, opacity;
}

@keyframes confetti-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--rot, 360deg)) scale(0.3);
  }
}

/* ==============================================
   REDUCED MOTION
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animation-layer {
    display: none !important;
  }

  .sparkle-overlay {
    animation: none;
    opacity: 0.5;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 600px) {
  .section {
    padding: 60px 16px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .glass-card {
    padding: 24px 20px;
  }

  .wish-form {
    flex-direction: column;
  }

  .wish-input,
  .wish-submit {
    width: 100%;
  }

  .chips-container {
    gap: 10px;
  }

  .chip {
    font-size: 0.85rem;
    padding: 8px 16px;
  }

  .surprise-button {
    font-size: 1.1rem;
    padding: 14px 32px;
  }
}

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 16px;
  color: var(--white-alpha-60);
  font-size: 0.85rem;
}
