/* Birthday Site Styles - Romantic Dark Theme */

:root {
  /* Color Palette - Soft Romantic Dark Theme */
  --bg-primary: #1a1625;
  --bg-secondary: #2d2438;
  --bg-card: rgba(45, 36, 56, 0.8);
  --bg-card-elevated: rgba(60, 48, 75, 0.9);

  --text-primary: #f8f4ff;
  --text-secondary: #d1c7dd;
  --text-muted: #a494b8;
  --text-accent: #e8d5ff;

  --accent-primary: #c084fc;
  --accent-secondary: #f0abfc;
  --accent-warm: #fbbf24;
  --accent-rose: #fb7185;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-soft: linear-gradient(
    135deg,
    rgba(196, 132, 252, 0.1) 0%,
    rgba(240, 171, 252, 0.1) 100%
  );

  /* Shadows */
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-large: 0 20px 40px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(196, 132, 252, 0.2);

  /* Typography */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;
  --font-size-5xl: 48px;
  --font-size-6xl: 64px;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Borders */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --border-radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  /* Enhanced smooth scrolling */
  scroll-padding-top: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Optimize scrolling performance */
  -webkit-overflow-scrolling: touch;
}

/* Fixed Confetti Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Fixed Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 1000;
  transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  box-shadow: var(--shadow-glow);
  /* Enhanced visual feedback */
  will-change: width;
  transform: translateZ(0); /* Hardware acceleration */
}

/* Scroll Container */
.scroll-container {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

/* Section Base Styles */
.snap {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
}

/* Typography System */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--font-size-5xl);
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

h2 {
  font-size: var(--font-size-4xl);
  color: var(--text-primary);
}

h3 {
  font-size: var(--font-size-3xl);
  color: var(--text-secondary);
}

p {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* Hero Section */
.hero {
  background: var(--gradient-primary);
  color: var(--text-primary);
  text-align: center;
}

.hero-content h1 {
  font-size: var(--font-size-6xl);
  margin-bottom: var(--space-4);
  animation: fadeInUp 1.2s ease;
  color: white;
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: var(--shadow-medium);
}

.hero-content .date {
  font-size: var(--font-size-2xl);
  font-weight: 500;
  margin-bottom: var(--space-4);
  opacity: 0.9;
  color: var(--text-accent);
}

.hero-content .subtitle {
  font-size: var(--font-size-xl);
  font-weight: 400;
  margin-bottom: var(--space-12);
  opacity: 0.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  flex-wrap: wrap;
}

/* Modern Button System */
.btn {
  padding: var(--space-4) var(--space-8);
  border: none;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn.primary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    var(--shadow-medium),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.primary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow:
    var(--shadow-large),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn.primary:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-subtle);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn.secondary:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Letter Section */
.letter {
  background: radial-gradient(ellipse at top, var(--bg-secondary) 0%, var(--bg-primary) 70%);
  position: relative;
}

.letter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-soft);
  pointer-events: none;
}

.section-content {
  max-width: 900px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

.section-content h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-12);
  color: var(--text-primary);
  position: relative;
}

.section-content h2::after {
  content: '';
  position: absolute;
  bottom: -var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-full);
}

.paper {
  background: var(--bg-card-elevated);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-large), var(--shadow-glow);
  padding: 0;
  margin: 0 auto;
  max-width: 700px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(196, 132, 252, 0.1);
  /* Improve readability and comfort */
  line-height: var(--line-height-relaxed);
}

.paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-12);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-rose), var(--accent-warm));
  opacity: 0.4;
}

.paper::after {
  content: '';
  position: absolute;
  top: var(--space-8);
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 132, 252, 0.2), transparent);
}

.paper-content {
  padding: var(--space-12) var(--space-8) var(--space-12) var(--space-16);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  text-align: left;
  color: var(--text-secondary);
  /* Ensure long paragraphs wrap nicely */
  word-wrap: break-word;
  hyphens: auto;
}

.paper-content p {
  margin-bottom: var(--space-6);
  color: var(--text-secondary);
  /* Improve readability for long paragraphs */
  text-align: justify;
}

.paper-content p:first-child {
  color: var(--accent-secondary);
  font-weight: 600;
}

.signature {
  text-align: right;
  font-style: italic;
  margin-top: var(--space-8);
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

/* Videos Section */
.videos {
  background: radial-gradient(
    ellipse at bottom right,
    var(--bg-secondary) 0%,
    var(--bg-primary) 70%
  );
  position: relative;
}

.videos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  pointer-events: none;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
  max-width: 900px;
}

.mem-vid {
  width: 100%;
  height: 220px;
  border-radius: var(--border-radius-lg);
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid rgba(196, 132, 252, 0.1);
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mem-vid:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-large), var(--shadow-glow);
  border-color: rgba(196, 132, 252, 0.3);
}

.video-placeholder {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(196, 132, 252, 0.1);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.video-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-placeholder:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-large), var(--shadow-glow);
  border-color: rgba(196, 132, 252, 0.3);
}

.video-placeholder:hover::before {
  opacity: 1;
}

.video-icon {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.video-placeholder p {
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* Gallery Section */
.gallery {
  background: radial-gradient(ellipse at top left, var(--bg-secondary) 0%, var(--bg-primary) 70%);
  position: relative;
}

.gallery::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(225deg, rgba(240, 171, 252, 0.05) 0%, rgba(251, 113, 133, 0.05) 100%);
  pointer-events: none;
}

.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 100px;
  grid-auto-flow: row dense;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  max-width: 1200px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card);
  border: 1px solid rgba(196, 132, 252, 0.1);
  backdrop-filter: blur(20px);
  aspect-ratio: 1/1; /* Square aspect ratio for consistent sizing */
}

.photo-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-large), var(--shadow-glow);
  border-color: rgba(196, 132, 252, 0.3);
  z-index: 2;
}

.photo-item:hover::before {
  opacity: 1;
}

/* Actual images in the gallery */
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* Photo item sizes for variety */
.photo-item:nth-child(3n + 1) {
  grid-row-end: span 2;
}

.photo-item:nth-child(5n + 2) {
  grid-row-end: span 3;
}

.photo-item:nth-child(7n + 3) {
  grid-row-end: span 1;
}

.photo-item:nth-child(4n + 4) {
  grid-row-end: span 2;
}

.photo-item:nth-child(6n + 5) {
  grid-row-end: span 3;
}

.photo-item:nth-child(8n) {
  grid-row-end: span 1;
}

/* Outro Section */
.outro {
  background: var(--gradient-primary);
  color: var(--text-primary);
  text-align: center;
  position: relative;
}

.outro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.outro-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.outro-content h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-6);
  color: white;
  text-shadow: var(--shadow-medium);
}

.outro-content p {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--line-height-relaxed);
  color: var(--text-accent);
}

.outro-emoji {
  font-size: var(--font-size-5xl);
  margin: var(--space-8) 0;
  filter: drop-shadow(var(--shadow-subtle));
}

/* Section Notes */
.section-note {
  margin-top: var(--space-8);
  font-size: var(--font-size-sm);
  opacity: 0.6;
  font-style: italic;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: var(--shadow-large);
  }
  50% {
    box-shadow: var(--shadow-large), var(--shadow-glow);
  }
}

/* Enhanced Animations */
.hero-content {
  animation: fadeInUp 1.2s ease-out;
}

.paper {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.video-placeholder {
  animation: fadeInUp 0.6s ease-out both;
}

.video-placeholder:nth-child(1) {
  animation-delay: 0.1s;
}
.video-placeholder:nth-child(2) {
  animation-delay: 0.2s;
}
.video-placeholder:nth-child(3) {
  animation-delay: 0.3s;
}
.video-placeholder:nth-child(4) {
  animation-delay: 0.4s;
}

.photo-placeholder {
  animation: fadeIn 0.6s ease-out both;
}

.photo-placeholder:nth-child(1) {
  animation-delay: 0.1s;
}
.photo-placeholder:nth-child(2) {
  animation-delay: 0.15s;
}
.photo-placeholder:nth-child(3) {
  animation-delay: 0.2s;
}
.photo-placeholder:nth-child(4) {
  animation-delay: 0.25s;
}
.photo-placeholder:nth-child(5) {
  animation-delay: 0.3s;
}
.photo-placeholder:nth-child(6) {
  animation-delay: 0.35s;
}

/* Focus and Accessibility */
.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .snap {
    padding: var(--space-6);
  }

  .section-content {
    max-width: 90%;
  }

  .videos-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
  }

  .photo-mosaic {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-6xl: 48px;
    --font-size-5xl: 40px;
    --font-size-4xl: 32px;
    --font-size-3xl: 28px;
    --font-size-2xl: 22px;
    --font-size-xl: 18px;
    --font-size-lg: 16px;
  }

  .snap {
    padding: var(--space-4);
  }

  .hero-content h1 {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-3);
  }

  .hero-content .date {
    font-size: var(--font-size-xl);
  }

  .hero-content .subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-8);
  }

  .section-content h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-8);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  .btn {
    width: 100%;
    max-width: 320px;
    min-width: auto;
  }

  .videos-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .photo-mosaic {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 80px;
    gap: var(--space-3);
  }

  .paper-content {
    padding: var(--space-8) var(--space-6) var(--space-8) var(--space-12);
    font-size: var(--font-size-base);
  }

  .paper::before {
    left: var(--space-8);
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-6xl: 40px;
    --font-size-5xl: 32px;
    --font-size-4xl: 28px;
    --font-size-3xl: 24px;
  }

  .snap {
    padding: var(--space-3);
  }

  .hero-content h1 {
    font-size: var(--font-size-4xl);
  }

  .photo-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
  }

  .paper-content {
    padding: var(--space-6) var(--space-4) var(--space-6) var(--space-8);
  }

  .paper::before {
    left: var(--space-6);
  }

  .video-placeholder,
  .photo-placeholder {
    min-height: 160px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #cccccc;
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-card-elevated: rgba(255, 255, 255, 0.15);
  }

  .btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress-bar {
    transition: none;
  }
}

/* Print styles */
@media print {
  .progress-bar {
    display: none;
  }

  .snap {
    page-break-inside: avoid;
    min-height: auto;
  }

  body {
    background: white;
    color: black;
  }
}
