:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --game-dark: #0f172a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-800: #1f2937;
  --white: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#themeToggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
  margin-right: 1rem;
}

#themeToggle:hover {
  background: var(--gray-100);
  transform: rotate(15deg);
}

.logo a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--game-dark) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.5px;
}

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

.menu a {
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.menu a:hover,
.menu a.active {
  color: var(--primary);
}

.menu a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.menu a:hover::after,
.menu a.active::after {
  width: 100%;
}

.btn-login {
  padding: 0.6rem 1.25rem;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  /* Pill shape */
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* HERO */

/* PAGE BACKGROUND (Shared) */
.page-background {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

.page-background::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: var(--primary-light);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  animation: blobFloat 8s infinite ease-in-out alternate;
}

.page-background::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -50px;
  width: 250px;
  height: 250px;
  background: #bfdbfe;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: blobFloat 10s infinite ease-in-out alternate-reverse;
}

@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, -30px) scale(1.1);
  }
}

/* HERO (Inherits or uses specific styles, here we keep it simple for index) */
.hero {
  padding: 8rem 2rem 6rem;
  text-align: center;
  /* background handled by parent or specific override if needed, 
     but for now let's keep hero specific if it differs, or make hero use page-background */
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  color: var(--gray-800);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  position: relative;
  z-index: 1;
  letter-spacing: -1.5px;
  color: var(--game-dark);
}

.hero p {
  font-size: 1.25rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* FEATURES */
.features {
  padding: 4rem 5%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ANIMATIONS */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* NAVBAR SCROLL STATE */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  padding: 0.75rem 5%;
  box-shadow: var(--shadow-md);
}

body.dark .navbar.scrolled {
  background: rgba(31, 41, 55, 0.95);
  border-bottom-color: var(--gray-800);
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
  .hero {
    padding: 6rem 1rem 4rem !important;
  }

  .hero h1 {
    font-size: 2.2rem !important;
  }

  .hero p {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .features {
    padding: 3rem 1rem;
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.75rem;
  }
}