/* ============================================
   MAIN — Base styles, variables, typography
   ============================================ */

:root {
  /* Romantic palette */
  --pink-neon: #ff6b9d;
  --pink-soft: #ff8fab;
  --red-glow: #ff3366;
  --rose-deep: #c9184a;
  --purple-deep: #1a0a12;
  --purple-mid: #2d1b2e;
  --purple-light: #4a2c4a;
  --gold-warm: #ffd6e0;
  --white-soft: rgba(255, 255, 255, 0.92);
  --white-muted: rgba(255, 255, 255, 0.65);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: 24px;

  /* Shadows & glow */
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glow-pink: 0 0 40px rgba(255, 107, 157, 0.45);
  --glow-red: 0 0 60px rgba(255, 51, 102, 0.35);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;

  /* Spacing */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Motion */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.35s;
  --duration-normal: 0.6s;
  --duration-slow: 1.2s;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--white-soft);
  background: var(--purple-deep);
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Fullscreen immersive feel */
body.immersive {
  overscroll-behavior: none;
}

/* Background layers */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 51, 102, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 107, 157, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 70%, rgba(201, 24, 74, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #1a0a12 0%, #2d1b2e 50%, #1a0a12 100%);
  animation: gradientShift 20s ease-in-out infinite alternate;
}

.bg-orbs {
  overflow: hidden;
}

.bg-orbs::before,
.bg-orbs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 25s var(--ease-smooth) infinite alternate;
}

.bg-orbs::before {
  width: 40vmin;
  height: 40vmin;
  background: var(--pink-neon);
  top: 10%;
  left: -10%;
}

.bg-orbs::after {
  width: 35vmin;
  height: 35vmin;
  background: var(--red-glow);
  bottom: 5%;
  right: -5%;
  animation-delay: -12s;
}

#starfield {
  opacity: 0.7;
}

#floating-hearts {
  z-index: 1;
}

#heart-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Main app container */
#app {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* Screen base */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(2rem + var(--safe-top)) 1.5rem calc(5rem + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo),
    visibility var(--duration-slow);
  will-change: opacity, transform;
}

.screen--active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.screen--exit {
  opacity: 0;
  transform: translateY(-16px) scale(1.01);
}

.screen-inner {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

/* Glass card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Typography */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pink-soft);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

.title-xl {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.title-lg {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--white-muted);
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

.subtitle.small {
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

.accent {
  background: linear-gradient(135deg, var(--pink-neon), var(--red-glow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.4));
}

.glow-text {
  text-shadow: var(--glow-pink);
}

.hint {
  position: absolute;
  bottom: calc(6rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--white-muted);
  opacity: 0.7;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-neon), var(--red-glow));
  color: white;
  box-shadow: var(--glow-pink), var(--shadow-soft);
}

.btn-primary:hover {
  box-shadow: 0 0 50px rgba(255, 107, 157, 0.6), var(--shadow-soft);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--white-soft);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  border-color: rgba(255, 107, 157, 0.4);
  box-shadow: var(--glow-pink);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-100%);
  animation: btnShimmer 3s ease-in-out infinite;
}

/* Legacy dots hidden — using progress bar instead */
.progress-dots { display: none; }

/* Navigation controls */
.nav-controls {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 100;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--white-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-smooth);
  box-shadow: var(--shadow-soft);
}

.nav-btn svg {
  width: 22px;
  height: 22px;
}

.nav-btn:hover:not(:disabled) {
  border-color: rgba(255, 107, 157, 0.5);
  box-shadow: var(--glow-pink);
  transform: scale(1.05);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(6rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.875rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--white-soft);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out-expo);
  z-index: 10000;
  box-shadow: var(--glow-pink), var(--shadow-soft);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Heart trail particles */
.trail-heart {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  animation: trailFade 1s var(--ease-out-expo) forwards;
  filter: drop-shadow(0 0 6px rgba(255, 107, 157, 0.8));
  will-change: transform, opacity;
}

/* Floating background hearts */
.float-heart {
  position: absolute;
  font-size: var(--size, 16px);
  opacity: var(--opacity, 0.3);
  animation: floatHeart var(--duration, 15s) linear infinite;
  animation-delay: var(--delay, 0s);
  filter: drop-shadow(0 0 8px rgba(255, 107, 157, 0.4));
  will-change: transform;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .glass-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .screen {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .progress-dots {
    gap: 4px;
    padding: 6px 10px;
  }

  .dot.active {
    width: 16px;
  }
}
