@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Modern Color Palette */
  --bg: #0a0b0d;
  --bg-gradient: linear-gradient(135deg, #0f1419 0%, #1a1f2e 25%, #151922 50%, #0a0b0d 100%);
  --bg-accent: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  --panel: rgba(17, 24, 39, 0.8);
  --panel-elev: rgba(31, 41, 55, 0.9);
  --panel-border: rgba(156, 163, 175, 0.1);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  /* Typography */
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  /* Brand Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  
  /* Effects */
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.3), 0 0 40px rgba(99, 102, 241, 0.1);
  --glow-secondary: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  
  /* Layout */
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --spacing: 1rem;
  --section-padding: 4rem 2rem;
  --max-width: 1200px;
}

/* Reset and Base Styles */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--panel);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient), var(--bg-accent);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  /* Mobile optimizations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

::-webkit-scrollbar-track {
  background: var(--panel);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light), var(--secondary));
}

/* Canvas Background Effect */
#space-dust-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: auto;
  opacity: 0.6;
  transition: opacity 0.6s ease;
  cursor: crosshair;
  /* Mobile touch optimizations */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Game Mode Styles */
body.game-mode #space-dust-canvas {
  opacity: 1;
  z-index: 1;
  cursor: pointer;
}

body.game-mode .website-content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.game-mode .mode-toggle {
  z-index: 100;
}

/* Game Mode - prevent scrolling on ALL devices */
body.game-mode {
  overflow: hidden !important;
  height: 100vh !important;
  position: fixed !important;
  width: 100% !important;
  top: 0;
  left: 0;
}

body.game-mode #space-dust-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1 !important;
  overflow: hidden;
  touch-action: none; /* Changed from manipulation to none for better touch handling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  pointer-events: auto; /* Ensure touch events work */
}

/* Mobile Game Mode - prevent scrolling, fix to viewport */
@media (max-width: 768px) {
  /* Mobile-specific toggle positioning */
  body.game-mode .mode-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 4001;
  }

  /* Content mode - restore normal scrolling */
  body:not(.game-mode) {
    overflow: auto;
    height: auto;
    position: static;
    width: auto;
  }

  body:not(.game-mode) #space-dust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
  }
}

/* Mode Toggle Switch - Minimal visibility and size */
.mode-toggle {
  position: fixed !important;
  bottom: 1rem !important;
  right: 1rem !important;
  z-index: 4000 !important;
  transition: all 0.3s ease;
  opacity: 0.1; /* Very subtle visibility */
  animation: subtle-pulse 6s ease-in-out infinite; /* Slower, more subtle pulse */
  pointer-events: auto; /* Ensure it's clickable */
  transform: scale(0.7); /* Make it smaller */
}

.mode-toggle:hover {
  opacity: 0.6; /* Only show moderately on hover */
  transform: scale(0.8); /* Slightly larger on hover but still small */
  animation: none; /* Stop pulsing on hover */
}

/* Subtle pulsing animation */
@keyframes subtle-pulse {
  0%, 100% { 
    opacity: 0.3; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.2; 
    transform: scale(0.75);
  }
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  background: rgba(10, 11, 13, 0.6);
  backdrop-filter: blur(15px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50px; /* More rounded for subtle look */
  color: var(--text);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  min-width: auto; /* Allow it to be smaller */
}

.toggle-btn:hover {
  background: rgba(17, 24, 39, 0.9);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.toggle-btn:active {
  transform: translateY(0);
}

.toggle-icon {
  position: relative;
  width: 16px;
  height: 16px;
  overflow: hidden;
}

.toggle-icon svg {
  position: absolute;
  inset: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 16px;
  height: 16px;
}

.content-icon {
  opacity: 1;
  transform: translateY(0);
}

.game-icon {
  opacity: 0;
  transform: translateY(20px);
}

body.game-mode .content-icon {
  opacity: 0;
  transform: translateY(-20px);
}

body.game-mode .game-icon {
  opacity: 1;
  transform: translateY(0);
}

.toggle-text {
  transition: all 0.3s ease;
  font-size: 0.75rem;
  opacity: 0.8;
}

.toggle-text::after {
  content: '🎮';
}

body.game-mode .toggle-text::after {
  content: '📄';
}

/* Game Mode Overlay */
.game-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.game-mode .game-mode-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.game-instructions {
  text-align: center;
  max-width: 500px;
  padding: 3rem 2rem;
  background: rgba(10, 11, 13, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  transform: translateY(30px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.game-mode .game-instructions {
  transform: translateY(0) scale(1);
}

.game-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.game-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.game-description {
  font-size: 1rem;
  color: var(--text-subtle);
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 600px;
  text-align: center;
}

.game-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-controls p {
  font-size: 1rem;
  color: var(--text-subtle);
  padding: 0.5rem 1rem;
  background: rgba(31, 41, 55, 0.5);
  border-radius: var(--border-radius);
  border: 1px solid var(--panel-border);
}

/* Website Content Container */
.website-content {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Styles */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(10, 11, 13, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 3000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent content from overlaying header area during scroll; ensures clicks go to nav */
body {
  padding-top: env(safe-area-inset-top, 0);
}

/* Anchor targets account for sticky header height */
.hero-section,
.media-gallery-section,
.highlights-section,
.features-section,
.gallery-section {
  scroll-margin-top: 80px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  position: relative;
  z-index: 3001;
}

.logo {
  height: 32px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.nav-links a:hover::before {
  left: 100%;
}

.nav-links a:hover {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: all 0.3s ease;
  transform: translateX(-50%);
  pointer-events: none;
}

.nav-links a:hover::after {
  width: 80%;
}

/* Mobile Menu Button (hidden by default) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 3002;
}

.mobile-menu-btn:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Hamburger Lines */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Hamburger Animation when active */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Styles */
@media (max-width: 768px) {
  nav {
    padding: 1rem;
    position: relative;
  }

  /* Show mobile menu button */
  .mobile-menu-btn {
    display: block;
    min-width: 44px;
    min-height: 44px;
  }

  /* Mode toggle adjustments for mobile - always fixed bottom-right, no shifting */
  .mode-toggle,
  body.game-mode .mode-toggle {
    position: fixed !important;
    bottom: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    top: auto !important;
    z-index: 4001 !important;
    opacity: 0.5;
    transform: scale(0.95);
    pointer-events: auto;
    transition: opacity 0.3s, transform 0.3s;
  }

  .toggle-btn {
    padding: 0.2rem;
    gap: 0.1rem;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
  }

  .toggle-text {
    display: none; /* Hide text on mobile to save space */
  }

  .toggle-icon {
    width: 18px;
    height: 18px;
  }

  .toggle-icon svg {
    width: 12px;
    height: 12px;
  }

  /* Hide desktop nav links by default */
  .nav-links {
    position: fixed;
    top: 80px; /* Height of header */
    left: 0;
    right: 0;
    background: rgba(10, 11, 13, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2999;
  }

  /* Show nav links when menu is active */
  .nav-links.active {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  }

  .nav-links a:hover,
  .nav-links a:focus {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    transform: translateX(5px);
    outline: none;
  }

  .nav-links a:active {
    background: rgba(99, 102, 241, 0.25);
  }

  .nav-links a::before,
  .nav-links a::after {
    display: none;
  }

  /* Remove border from last item */
  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Adjust logo size for mobile */
  .logo {
    height: 28px;
  }

  /* Prevent scrolling when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* Add overlay when menu is open */
  .nav-links.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  nav {
    padding: 0.75rem;
  }

  .nav-links {
    top: 70px; /* Smaller header on very small screens */
  }

  .nav-links a {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .logo {
    height: 24px;
  }

  /* Remove duplicate/extra small screen mode-toggle rules to avoid conflicts */

  .toggle-btn {
    padding: 0.4rem;
    min-width: 40px;
    min-height: 40px;
  }

  .toggle-icon {
    width: 10px;
    height: 10px;
  }

  .toggle-icon svg {
    width: 10px;
    height: 10px;
  }

  .mobile-menu-btn {
    padding: 6px;
  }

  .hamburger-line {
    width: 20px;
    height: 2px;
  }

  /* Already handled above for all mobile sizes */
}

/* Main Content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Base Styles */
.section {
  padding: var(--section-padding);
  margin-bottom: 2rem;
  border-radius: var(--border-radius-lg);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  text-align: center;
  background: transparent;
  border: none;
  backdrop-filter: none;
  padding-top: 2rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  position: relative;
}

.hero-title::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.hero-subtitle {
  display: inline-block;
  font-size: 0.875rem;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-left: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  top: -0.5rem;
}

.hero-image {
  width: min(900px, 90vw);
  aspect-ratio: 16/9;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  margin-bottom: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
  border: 1px solid var(--glass-border);
}

.hero-image:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--glow-primary), var(--shadow-xl);
}

/* Section Content Styles */
.features-section,
.gallery-section,
.highlights-section,
.media-gallery-section {
  padding: var(--section-padding);
  margin: 4rem auto;
  border-radius: var(--border-radius-lg);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: clip;
}

/* Unified section sizing and vertical centering */
.hero-section,
.media-gallery-section,
.highlights-section,
.features-section,
.gallery-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .hero-section,
  .media-gallery-section,
  .highlights-section,
  .features-section,
  .gallery-section {
    min-height: unset;
    display: block;
    box-sizing: border-box;
  }
}

.features-section::before,
.gallery-section::before,
.highlights-section::before,
.media-gallery-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Features Grid */
.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 0;
}

.feature {
  padding: 2rem;
  background: rgba(31, 41, 55, 0.6);
  border-radius: var(--border-radius);
  border: 1px solid var(--panel-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: left 0.6s ease;
}

.feature:hover::before {
  left: 100%;
}

.feature:hover {
  transform: translateY(-4px);
  background: rgba(31, 41, 55, 0.8);
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.feature h3 {
  font-size: 1.25rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
  font-weight: 600;
}

.feature p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 0;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--border-radius);
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

.gallery-grid img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--glow-primary);
}

/* Animation Effects */

/* Animation Effects */
.hero-section,
.features-section, 
.gallery-section,
.highlights-section,
.media-gallery-section {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-section.in-view,
.features-section.in-view, 
.gallery-section.in-view,
.highlights-section.in-view,
.media-gallery-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.feature,
.highlight-item {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature.in-view,
.highlight-item.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Shimmer effect for cards */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.feature.in-view::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s ease-out 0.5s;
  pointer-events: none;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  object-fit: contain;
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}
.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 18px;
  box-shadow: 0 8px 48px 0 #000a;
  background: #0c1117;
  object-fit: contain;
  transition: box-shadow 0.3s;
}

/* Highlights Section */
.highlights-section {
  text-align: center;
}

.highlights-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 0;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  background: rgba(31, 41, 55, 0.6);
  border-radius: var(--border-radius);
  border: 1px solid var(--panel-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.highlight-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.highlight-item:hover::before {
  transform: scaleX(1);
}

.highlight-item:hover {
  transform: translateY(-4px);
  background: rgba(31, 41, 55, 0.8);
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.highlight-item img {
  width: 100%;
  max-width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
}

.highlight-item:hover img {
  transform: scale(1.05);
}

.highlight-caption {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

/* Hero Image Section */
.highlights-hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  margin-bottom: 3rem;
  text-align: center;
}

.highlights-hero-image-wrapper {
  position: relative;
  width: min(800px, 96vw);
  aspect-ratio: 16/9;
  margin: 0 auto 2rem auto;
}

.highlights-hero-image {
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
  object-fit: cover;
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.highlights-hero-image:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--glow-primary);
}

.highlights-hero-caption {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1rem;
  transition: all 0.3s ease;
}

/* Interactive Buttons */
.play-btn,
.zoom-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.play-btn:hover,
.zoom-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: var(--glow-primary);
}

/* Navigation Controls */
.dotnav {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--glass-border);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dotnav-items {
  display: flex;
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dotnav-count {
  margin-left: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  opacity: 0.85;
}

.dotnav-link {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-subtle);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
  display: inline-block;
}

.dotnav-link.current,
.dotnav-link:hover {
  background: var(--primary);
  transform: scale(1.2);
  opacity: 1;
  box-shadow: 0 0 10px var(--primary);
}

.paddlenav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.paddlenav-arrow:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--glow-primary);
}

.paddlenav-arrow-previous {
  left: 1rem;
}

.paddlenav-arrow-next {
  right: 1rem;
}

.paddlenav-arrow svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
  transition: fill 0.3s ease;
}

.paddlenav-arrow:hover svg {
  fill: white;
}

/* Lightbox Specific Styles */
#highlightLightbox[style*="display:none"] {
  display: none !important;
}

/* Utility Classes */
.visuallyhidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Fade Transitions */
.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
  :root {
    --section-padding: 3rem 1.5rem;
  }
  
  .features-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .highlights-row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 2rem 1rem;
    --spacing: 0.75rem;
  }
  
  /* Better mobile navigation */
  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }
  
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-links a {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    min-height: 44px; /* Better touch target */
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
  }
  
  /* Hero section mobile optimizations */
  .hero-content {
    padding: 1.5rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 0.75rem;
    margin-left: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.4rem 0.8rem;
    top: -0.3rem;
  }
  
  .hero-image {
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: cover;
    border-radius: 12px;
  }
  
  /* Mobile grid layouts */
  .features-list,
  .highlights-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0;
  }
  
  .feature,
  .highlight-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .feature h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .feature p {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  /* Gallery mobile improvements */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .flip-card {
    min-height: 200px;
    max-width: 100%;
  }
  
  .flip-card-front,
  .flip-card-back {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .gallery-float-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
  }
  
  /* Media gallery mobile */
  .media-gallery-section {
    padding: 2rem 1rem;
  }
  
  .highlights-hero-image-wrapper {
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel);
  }
  
  .highlights-hero-image {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }
  
  /* Navigation arrows mobile - make them bigger and more visible */
  .paddlenav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10;
  }
  
  .paddlenav-arrow-previous {
    left: 1rem;
  }
  
  .paddlenav-arrow-next {
    right: 1rem;
  }
  
  /* Dot navigation mobile - make it more prominent */
  .dotnav {
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .dotnav-link {
    width: 12px;
    height: 12px;
    margin: 0 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
  }
  
  .dotnav-link.current {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
  }
  
  /* Navigation arrows mobile */
  .paddlenav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
  
  .paddlenav-arrow-previous {
    left: 0.5rem;
  }
  
  .paddlenav-arrow-next {
    right: 0.5rem;
  }
  
  /* Dot navigation mobile */
  .dotnav {
    bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.8);
  }
  
  .dotnav-link {
    width: 12px;
    height: 12px;
    margin: 0 6px;
  }
  
  /* Mobile lightbox */
  .lightbox-img {
    max-width: 95vw;
    max-height: 80vh;
    object-fit: contain;
  }
  
  /* Mode toggle mobile - always fixed bottom-right, no shifting */
  .mode-toggle {
    position: fixed !important;
    bottom: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    top: auto !important;
    z-index: 4001 !important;
    opacity: 0.5;
    transform: scale(0.95);
    pointer-events: auto;
    transition: opacity 0.3s, transform 0.3s;
  }
  
  .toggle-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
    border-radius: 12px;
  }
  
  /* Game mode mobile */
  .game-instructions {
    padding: 2rem 1.5rem;
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    border-radius: 16px;
  }
  
  .game-title {
    font-size: clamp(1.8rem, 6vw, 2.2rem);
    margin-bottom: 1rem;
  }
  
  .game-subtitle {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
  }
  
  .game-controls p {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
  }
  
  /* Section titles mobile */
  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 2rem;
    text-align: center;
    padding: 0 1rem;
  }
  
  /* Better mobile spacing */
  section {
    padding: 2rem 1rem;
    margin-bottom: 1rem;
  }
  
  /* Mobile typography improvements */
  body {
    font-size: 16px; /* Prevent zoom on iOS */
    line-height: 1.5;
  }
  
  p {
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  /* Ensure touch targets are at least 44px */
  button, 
  .toggle-btn, 
  .nav-links a, 
  .paddlenav-arrow {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Extra small mobile devices (phones in portrait) */
@media (max-width: 480px) {
  :root {
    --section-padding: 1.5rem 0.75rem;
    --spacing: 0.5rem;
  }
  
  /* Compact navigation for small screens */
  nav {
    padding: 0.75rem;
  }
  
  .nav-links {
    gap: 0.75rem;
  }
  
  .nav-links a {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
  
  /* Hero adjustments for small screens */
  .hero-content {
    padding: 1rem;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    margin-bottom: 0.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.3rem 0.6rem;
  }
  
  .hero-image {
    max-height: 40vh;
    border-radius: 8px;
  }
  
  /* Compact sections */
  section {
    padding: 1.5rem 0.75rem;
  }
  
  .section-title {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    margin-bottom: 1.5rem;
  }
  
  /* Features and highlights compact */
  .feature,
  .highlight-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .feature h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .feature p {
    font-size: 0.9rem;
  }
  
  /* Gallery compact */
  .gallery-grid {
    gap: 1rem;
    padding: 0.5rem;
  }
  
  .flip-card {
    min-height: 180px;
  }
  
  .flip-card-front,
  .flip-card-back {
    padding: 1rem;
    font-size: 0.85rem;
  }
  
  /* Media gallery compact */
  .media-gallery-section {
    padding: 1.5rem 0.5rem;
  }
  
  .highlights-hero-image-wrapper {
    margin: 0 auto 1rem auto;
    width: calc(100% - 1rem);
    aspect-ratio: 4/3;
    border-radius: 8px;
  }
  
  .highlights-hero-image {
    max-height: 250px;
    border-radius: 8px;
  }
  
  /* Make navigation more accessible on small screens */
  .paddlenav-arrow {
    width: 40px;
    height: 40px;
  }
  
  .paddlenav-arrow-previous {
    left: 0.5rem;
  }
  
  .paddlenav-arrow-next {
    right: 0.5rem;
  }
  
  .dotnav {
    bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  .dotnav-link {
    width: 10px;
    height: 10px;
    margin: 0 4px;
  }
  
  /* Mode toggle compact */
  .mode-toggle {
    top: 0.75rem;
    right: 0.75rem;
  }
  
  .toggle-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
  
  /* Game mode compact */
  .game-instructions {
    padding: 1.5rem 1rem;
    margin: 0.75rem;
    border-radius: 12px;
  }
  
  .game-title {
    font-size: clamp(1.5rem, 7vw, 1.8rem);
    margin-bottom: 0.75rem;
  }
  
  .game-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .game-controls p {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    margin: 0.4rem 0;
  }
  
  /* Logo adjustments */
  .logo {
    max-height: 24px;
    width: auto;
  }
}

/* Landscape mobile devices */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .hero-content {
    padding: 1rem;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 0.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.65rem;
    margin-left: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
  }
  
  .hero-image {
    max-height: 30vh;
  }
  
  .game-instructions {
    padding: 1rem;
    margin: 0.5rem;
  }
  
  .game-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .game-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }
  
  .game-controls p {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
  }
  
  section {
    padding: 1rem 0.75rem;
  }
}

/* Special Section Styles */
.media-gallery-section .highlights-hero-image {
  max-width: min(900px, 90vw);
  aspect-ratio: 16/9;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-gallery-section .highlights-hero-image:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--glow-primary);
}

.media-gallery-section .highlights-hero-caption {
  color: var(--primary-light) !important;
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  margin: 2rem 0 0 0 !important;
  text-align: center !important;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}

/* Gallery Effects */
.gallery-float-wrapper {
  width: 100%;
  aspect-ratio: 3/2;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.gallery-float-img {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: var(--border-radius);
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--glass-border);
}

.gallery-float-img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--glow-primary);
}

/* Flip Card Effect */
.flip-card {
  width: 100%;
  aspect-ratio: 3/2;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.9s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.flip-card-front {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.10)),
              linear-gradient(135deg, var(--panel) 0%, var(--panel-elev) 100%);
  color: var(--text);
  text-align: center;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}

.flip-card-back {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-elev) 100%);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem;
  transform: rotateY(180deg);
  border: 1px solid var(--primary);
}

/* Compact adjustments for short viewports */
@media (max-height: 800px) {
  :root { --section-padding: 2rem 1rem; }
  .feature { padding: 1.25rem; }
  .features-list { gap: 1rem; }
  .highlights-row { gap: 1rem; }
  .highlights-hero-image-wrapper { max-width: 680px; }
  .gallery-grid { gap: 1rem; }
  .gallery-float-wrapper { transform: scale(0.95); }
}
@media (max-height: 650px) {
  .gallery-float-wrapper { transform: scale(0.9); }
  .highlights-hero-image-wrapper { max-width: 600px; }
}

/* Lazy Loading Styles */
.lazy-image {
  transition: opacity 0.3s ease-in-out;
  background: var(--panel);
  min-height: 200px;
  display: block;
}

.lazy-image.loading {
  opacity: 0.6;
  background: linear-gradient(90deg, var(--panel) 25%, rgba(255,255,255,0.1) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

.lazy-image.loaded {
  opacity: 1;
  min-height: auto;
}

.lazy-image.error {
  opacity: 0.5;
  background-color: var(--panel);
  position: relative;
  min-height: 200px;
}

.lazy-image.error::before {
  content: "⚠️ Image failed to load";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* Special mobile image handling */
@media (max-width: 768px) {
  .lazy-image {
    min-height: 150px;
  }
  
  .highlights-hero-image.lazy-image {
    min-height: 200px;
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 480px) {
  .lazy-image {
    min-height: 120px;
  }
  
  .highlights-hero-image.lazy-image {
    min-height: 180px;
  }
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}