/* ============================================
   EpiChicken - Epigenomics of Chicken
   Design System & Global Styles
   ============================================ */

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

/* CSS Variables */
:root {
  /* Primary palette - Deep Purple / Indigo */
  --primary-50: #f3e8ff;
  --primary-100: #e9d5ff;
  --primary-200: #d8b4fe;
  --primary-300: #c084fc;
  --primary-400: #a855f7;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-800: #5b21b6;
  --primary-900: #4c1d95;

  /* Accent - Amber/Gold */
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  /* Semantic colors */
  --success: #10b981;
  --info: #3b82f6;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Neutral palette */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 70px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.3);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--neutral-800);
  background: var(--neutral-50);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ============================================
   Navigation Bar
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: all var(--transition-normal);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--primary-700);
}

.nav-brand img {
  height: 40px;
  width: 40px;
  border-radius: var(--radius-sm);
}

.nav-brand span {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--neutral-600);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

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

.nav-links a.active {
  color: var(--primary-700);
  background: var(--primary-50);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown .dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform var(--transition-fast);
}

.nav-dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--neutral-600);
}

.dropdown-menu a:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

/* Mobile Menu Button */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--neutral-700);
  margin: 5px 0;
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 25%, #4c1d95 50%, #6d28d9 75%, #7c3aed 100%);
  overflow: hidden;
  padding-top: var(--nav-height);
}

/* Animated background particles */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 60% 40%, rgba(255, 255, 255, 0.15), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(3px 3px at 10% 80%, rgba(139, 92, 246, 0.4), transparent),
    radial-gradient(3px 3px at 90% 20%, rgba(167, 139, 250, 0.3), transparent);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* DNA double helix animated decoration */
.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(5deg); }
  66% { transform: translate(-20px, 20px) rotate(-3deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text {
  color: white;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-200);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-400), #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  line-height: 1.5;
}

.hero-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.btn-primary {
  background: white;
  color: var(--primary-700);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: hero-img-float 6s ease-in-out infinite;
}

@keyframes hero-img-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-image-wrapper img {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  font-family: 'JetBrains Mono', monospace;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Features Section
   ============================================ */
.features {
  padding: 100px 24px;
  background: white;
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--neutral-500);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 36px 30px;
  border-radius: var(--radius-lg);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-100);
  transition: all var(--transition-normal);
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.feature-icon.purple {
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
  color: var(--primary-600);
}

.feature-icon.blue {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #2563eb;
}

.feature-icon.green {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  color: #059669;
}

.feature-icon.amber {
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  color: #d97706;
}

.feature-icon.rose {
  background: linear-gradient(135deg, #fce7f3, #fdf2f8);
  color: #e11d48;
}

.feature-icon.cyan {
  background: linear-gradient(135deg, #cffafe, #ecfeff);
  color: #0891b2;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--neutral-500);
  line-height: 1.65;
}

.feature-card .learn-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-600);
  transition: gap var(--transition-fast);
}

.feature-card:hover .learn-more {
  gap: 10px;
}

/* ============================================
   Data Overview Section
   ============================================ */
.data-overview {
  padding: 100px 24px;
  background: linear-gradient(180deg, var(--neutral-50) 0%, white 100%);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.data-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--neutral-100);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.data-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-300));
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.data-card:hover::before {
  transform: scaleX(1);
}

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

.data-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.data-label {
  font-size: 0.85rem;
  color: var(--neutral-500);
  font-weight: 500;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--neutral-900);
  color: white;
  padding: 60px 24px 30px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 40px;
}

.footer-brand {
  max-width: 360px;
}

.footer-brand .nav-brand {
  margin-bottom: 16px;
}

.footer-brand .nav-brand span {
  background: linear-gradient(135deg, var(--primary-300), var(--primary-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  transition: all var(--transition-fast);
}

.footer-col a:hover {
  color: var(--primary-300);
  padding-left: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.4);
  transition: color var(--transition-fast);
}

.footer-bottom a:hover {
  color: var(--primary-300);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-description {
    margin: 0 auto 36px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-image-wrapper img {
    max-width: 380px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: block;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-stats {
    gap: 24px;
    flex-wrap: wrap;
  }

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

  .data-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-top {
    flex-direction: column;
  }

  .footer-links {
    gap: 40px;
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

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

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .hero-stat {
    text-align: center;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Utility: Scroll animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* Staggered animation delay */
.fade-in:nth-child(1) { transition-delay: 0ms; }
.fade-in:nth-child(2) { transition-delay: 100ms; }
.fade-in:nth-child(3) { transition-delay: 200ms; }
.fade-in:nth-child(4) { transition-delay: 300ms; }
.fade-in:nth-child(5) { transition-delay: 400ms; }
.fade-in:nth-child(6) { transition-delay: 500ms; }
