:root {
  /* Color Palette */
  --primary-color: #3b82f6; /* Blue */
  --primary-hover: #2563eb;
  --secondary-color: #8b5cf6; /* Purple */
  
  /* Light Mode (Default) */
  --bg-color: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  /* Dark Mode */
  --bg-color: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --border-color: #334155;
  --card-bg: #1e293b;
  --header-bg: rgba(15, 23, 42, 0.85);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
}

/* Hero Section */
.hero {
  padding: 12rem 0 8rem;
  text-align: center;
  background: radial-gradient(circle at top center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1.25rem;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Footer */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--text-secondary);
}

.footer-col ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .nav-links {
    display: none; /* simple mobile setup, could add hamburger */
  }
  
  .hero {
    padding: 8rem 0 4rem;
  }
}

/* Mega Menu Styles */
.nav-links {
  position: relative;
}

.dropdown {
  position: relative;
  display: inline-block;
  padding: 1.5rem 0;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  width: max-content;
  max-width: 90vw;
  z-index: 1001;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  pointer-events: none;
}

/* Fix left overflow for the first item */
.nav-links .dropdown:first-child .mega-menu {
  left: 0;
  transform: translateX(0) translateY(10px);
}
.nav-links .dropdown:first-child:hover .mega-menu {
  transform: translateX(0) translateY(0);
}

.dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mega-col h4 {
  color: var(--primary-color);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.mega-col ul {
  list-style: none;
  min-width: 200px;
}

.mega-col ul li {
  margin-bottom: 0.75rem;
}

.mega-col ul li a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  padding: 0.25rem 0;
}

.mega-col ul li a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

/* AI Discovery Animation */
.ai-animation-container {
  position: relative;
  height: 250px;
  width: 100%;
  max-width: 600px;
  margin: 3rem auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ai-node {
  width: 60px;
  height: 60px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  position: absolute;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  animation: float 4s ease-in-out infinite;
  z-index: 2;
}
.ai-center {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  font-size: 2.5rem;
  z-index: 10;
  animation: pulse 2s infinite;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}
.node-1 { transform: translate(-160px, -60px); animation-delay: 0s; }
.node-2 { transform: translate(160px, -60px); animation-delay: 1s; }
.node-3 { transform: translate(-120px, 90px); animation-delay: 2s; }
.node-4 { transform: translate(120px, 90px); animation-delay: 0.5s; }

/* Connecting lines */
.ai-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  height: 2px;
  width: 120px;
  opacity: 0.5;
  z-index: 1;
}
.line-1 { transform: translate(-80px, -30px) rotate(20deg); }
.line-2 { transform: translate(80px, -30px) rotate(-20deg); }
.line-3 { transform: translate(-60px, 45px) rotate(-35deg); }
.line-4 { transform: translate(60px, 45px) rotate(35deg); }

@keyframes float {
  0% { margin-top: 0; }
  50% { margin-top: -15px; }
  100% { margin-top: 0; }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
