:root {
  --bg: #fff7fb;
  --fg: #2b2b2b;
  --accent: #ff6fa9;
  --card: #ffffff80;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(var(--tilt, 0deg));
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 111, 169, 0.3), 0 10px 30px #00000014;
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 111, 169, 0.6), 0 15px 40px #00000020;
  }
}

* {
  box-sizing: border-box;
}

/* Custom text selection */
::selection {
  background: rgba(255, 111, 169, 0.3);
  color: #2b2b2b;
  text-shadow: none;
}

::-moz-selection {
  background: rgba(255, 111, 169, 0.3);
  color: #2b2b2b;
  text-shadow: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 247, 251, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6fa9, #ff8fc7);
  border-radius: 10px;
  border: 2px solid rgba(255, 247, 251, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff8fc7, #ffa6d5);
}

body {
  margin: 0;
  font-family: "Quicksand", system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: radial-gradient(1200px 600px at 10% 0%, #ffe6f3 0, transparent 60%),
    radial-gradient(800px 400px at 90% 10%, #e9f5ff 0, transparent 60%),
    linear-gradient(135deg, #fff7fb 0%, #ffeef8 50%, #f0f9ff 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%;
  animation: gradient-shift 15s ease infinite;
  min-height: 100vh;
  overflow-x: hidden;
  will-change: background-position;
}

.site {
  text-align: center;
  padding: 3rem 1rem 1rem;
}

.site h1 {
  font-size: clamp(1.8rem, 2.8vw, 3rem);
  margin: 0;
  display: inline-block;
}

.accent {
  background: linear-gradient(135deg, #ff6fa9, #ff8fc7, #ffa6d5, #ff6fa9);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
  font-weight: 600;
  will-change: background-position;
}

.tag {
  opacity: 0.8;
  margin-top: 0.25rem;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.4)
  );
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(255, 111, 169, 0.15),
    0 15px 50px rgba(0, 0, 0, 0.1), inset 0 0 40px rgba(255, 255, 255, 0.5);
  animation: pulse-glow 4s ease-in-out infinite;
  will-change: box-shadow;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  padding: 1rem;
  align-items: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  object-position: center top;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(255, 111, 169, 0.3);
}

.hero-copy {
  padding: 0.5rem 1rem;
}

.hero-copy h2 {
  margin: 0.2rem 0 0.6rem;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(255, 111, 169, 0.3);
}

.hero-copy ul {
  padding-left: 1rem;
  margin: 0;
}

.hero-copy li {
  margin: 0.5rem 0;
  transition: transform 0.2s ease;
}

.hero-copy li:hover {
  transform: translateX(5px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 3rem;
}

.polaroid {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 250, 255, 0.9)
  );
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 0.6rem 0.6rem 1rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15),
    0 5px 15px rgba(255, 111, 169, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: rotate(var(--tilt, -1.5deg));
  animation: float 6s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  will-change: transform;
}

.polaroid:hover,
.polaroid:focus {
  transform: rotate(0deg) translateY(-15px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2),
    0 10px 25px rgba(255, 111, 169, 0.3), inset 0 1px 0 rgba(255, 255, 255, 1);
  animation-play-state: paused;
  outline: none;
}

.polaroid:nth-child(1) {
  --tilt: -1.5deg;
  animation-delay: 0s;
}

.polaroid:nth-child(2) {
  --tilt: 1.6deg;
  animation-delay: 2s;
}

.polaroid:nth-child(3) {
  --tilt: -0.6deg;
  animation-delay: 4s;
}

.polaroid img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.4s ease;
}

.polaroid:hover img,
.polaroid:focus img {
  transform: scale(1.02);
}

.polaroid figcaption {
  margin-top: 0.6rem;
  opacity: 0.8;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #ff6fa9, #ff8fc7, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.foot {
  text-align: center;
  padding: 2rem 0 4rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.foot:hover {
  opacity: 1;
}


/* Keyboard navigation focus states */
.keyboard-nav *:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.keyboard-nav .polaroid:focus {
  transform: rotate(0deg) translateY(-10px) scale(1.03);
  outline-offset: 5px;
}

/* Interactive elements */
a,
button {
  cursor: pointer;
}

a:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Fun emoji interactions */
.accent {
  display: inline-block;
  transition: transform 0.3s ease;
}

.accent:hover {
  transform: scale(1.1) rotate(-5deg);
}

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

  body {
    animation: none;
  }

  .card {
    animation: none;
  }

  .polaroid {
    animation: none;
  }

  .accent {
    animation: none;
  }
}

/* ============================================
   NEW FEATURES STYLING
   WHY: All new interactive features need styles
   ============================================ */

/* Mobile Touch Optimizations */
/* WHY: touch-action prevents double-tap zoom on interactive elements */
.feature-btn,
.polaroid,
button,
.accent {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Feature Toggle Buttons */
/* WHY: Fixed positioning keeps controls accessible, emoji buttons are touch-friendly */
.feature-buttons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
}

.feature-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 255, 0.8));
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(255, 111, 169, 0.3);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(255, 111, 169, 0.2);
}

.feature-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 111, 169, 0.5);
}

.feature-btn:active {
  transform: scale(0.95);
}

.feature-btn.active {
  background: linear-gradient(135deg, #ff6fa9, #ff8fc7);
  box-shadow: 0 6px 25px rgba(255, 111, 169, 0.6);
  animation: pulse-active 2s ease infinite;
}

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

/* Rainbow Trail Canvas */
/* WHY: Full-screen canvas, hidden by default */
.rainbow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9996;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rainbow-canvas.active {
  opacity: 1;
}

/* Greeting Overlay */
/* WHY: Slide-in animation from top, auto-dismisses */
.greeting-overlay {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 251, 0.9));
  backdrop-filter: blur(15px);
  padding: 1rem 2rem;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 10px 40px rgba(255, 111, 169, 0.3);
  z-index: 10001;
  transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.greeting-overlay.active {
  top: 100px;
}


/* Particle Burst Styling */
/* WHY: Lightweight divs with GPU-accelerated transforms */
.particle-burst {
  will-change: transform, opacity;
  user-select: none;
}

/* Bubble Game Styling */
/* WHY: Fixed positioning for free-floating bubbles, smooth animations */
.bubble {
  will-change: transform, opacity;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.bubble:hover {
  transform: scale(1.1);
}

.bubble:active {
  transform: scale(0.9);
}


/* Close button styling for camera */
.close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* AR Camera */
/* WHY: Full-screen camera interface, video and canvas overlay */
.ar-camera {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  z-index: 10006;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ar-camera.active {
  opacity: 1;
  pointer-events: auto;
}

.camera-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
  z-index: 2;
}

.filter-selector {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  padding: 0 1rem;
}

.filter-btn {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 111, 169, 0.8);
  transform: scale(1.1);
}

.camera-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.camera-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent);
  z-index: 2;
}

.capture-btn {
  width: 70px;
  height: 70px;
  border: 4px solid white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.capture-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.5);
}

.capture-btn:active {
  transform: scale(0.95);
}

.switch-btn {
  width: 50px;
  height: 50px;
  border: 2px solid white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.switch-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

/* Cursor Friends (Desktop Only) */
/* WHY: Desktop-only cute followers, hidden on mobile */
.cursor-friend {
  transition: opacity 0.3s ease;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Disco Mode */
/* WHY: Konami code easter egg, rainbow animations everywhere */
/* NO body animations - just animate child elements to prevent resize */

.disco-mode .card,
.disco-mode .polaroid {
  animation: disco-rotate 1s linear infinite, pulse-glow 0.5s ease-in-out infinite !important;
}

.disco-mode .accent {
  animation: disco-text 1s linear infinite !important;
}

.disco-mode .hero-img,
.disco-mode .polaroid img {
  animation: disco-hue 2s linear infinite;
}

@keyframes disco-rotate {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes disco-text {
  0% { filter: hue-rotate(0deg) saturate(200%); }
  100% { filter: hue-rotate(360deg) saturate(200%); }
}

@keyframes disco-hue {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Birthday Mode */
/* WHY: Special styling for Ruby's birthday */
/* NO body animations - just style changes to prevent resize */

.birthday-mode .card {
  border-color: gold;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 15px 50px rgba(0, 0, 0, 0.1);
  animation: birthday-glow 2s ease-in-out infinite;
}

@keyframes birthday-glow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 15px 50px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.9), 0 20px 60px rgba(0, 0, 0, 0.15);
  }
}

/* Mobile optimizations */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-img {
    height: 260px;
  }

  .polaroid {
    animation: none;
  }

  body {
    cursor: auto;
  }

  /* WHY: Stack feature buttons vertically on mobile for thumb reach */
  .feature-buttons {
    top: auto;
    bottom: 20px;
    right: 20px;
    flex-direction: row;
  }

  .feature-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  /* WHY: Larger touch targets for mobile */
  .close-btn {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
  }

  /* WHY: Hide cursor friends on mobile (not needed for touch) */
  .cursor-friend {
    display: none;
  }

}

/* Landscape mobile optimization */
@media (max-width: 800px) and (orientation: landscape) {
  .greeting-overlay.active {
    top: 20px;
  }
}
