body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background-color: #111827; /* Darker Gray */
  color: #E5E7EB; /* Lighter Gray for text */
  overflow-x: hidden;
  line-height: 1.6;
}
.gradient-text {
  background-image: linear-gradient(to right, #8B5CF6, #3B82F6); /* Purple to Blue */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-py { padding-top: 3rem; padding-bottom: 3rem; } /* 80px */
.section-py-lg { padding-top: 8rem; padding-bottom: 8rem; } /* 128px */
.container { width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; text-decoration: none; transition: background-color 0.3s ease, transform 0.2s ease; }
.btn-primary { background-color: #3B82F6; color: white; }
.btn-primary:hover { background-color: #2563EB; transform: translateY(-2px); }
.btn-secondary { border: 1px solid #3B82F6; color: #3B82F6; }
.btn-secondary:hover { background-color: rgba(59, 130, 246, 0.1); transform: translateY(-2px); }
.feature-card { background-color: rgba(31, 41, 55, 0.5); border: 1px solid rgba(55, 65, 81, 0.7); border-radius: 0.75rem; padding: 2rem; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.code-block { background-color: #1F2937; padding: 1.5rem; border-radius: 0.5rem; overflow-x: auto; }
.code-block pre { margin: 0; }
.code-block code { font-family: 'Fira Code', 'Courier New', monospace; font-size: 0.9em; }
.copy-btn:hover { background: rgba(59, 130, 246, 0.4) !important; transform: scale(1.05); }
.inline-copy-link:hover { background: rgba(59, 130, 246, 0.1); border-radius: 0.25rem; }
.copy-feedback { z-index: 1000; }

/* Slide-up animation setup */
.slide-up { 
  opacity: 0; 
  transform: translateY(50px); 
}

/* Navigation starts above screen and slides down */
nav {
  transform: translateY(-100%);
  transition: transform 0.8s ease-out;
}

nav.nav-slide-down {
  transform: translateY(0);
}

/* Responsive Navigation Styles */
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-toggle { display: none; background: none; border: none; color: #E5E7EB; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
  .nav-links {
      display: none; /* Hidden by default on mobile */
      flex-direction: column;
      position: absolute;
      top: 100%; /* Position below the nav bar */
      left: 0;
      right: 0;
      background-color: rgba(17, 24, 39, 0.95); /* Slightly more opaque for dropdown */
      padding: 1rem;
      border-top: 1px solid rgba(55, 65, 81, 0.5);
      gap: 1rem;
  }
  .nav-links.active { display: flex; } /* Show when active */
  .nav-toggle { display: block; }
}

/* Hero Animation Keyframes */
@keyframes heroReveal {
  from {
      opacity: 0;
      transform: translateY(30px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* Hero Text Transition Animations */
@keyframes slideOutUp {
  from {
      opacity: 1;
      transform: translateY(0);
  }
  to {
      opacity: 0;
      transform: translateY(-30px);
  }
}

@keyframes slideInUp {
  from {
      opacity: 0;
      transform: translateY(30px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* Hero text lines positioning */
.hero-text-line {
  transition: all 0.6s ease-out;
}

.hero-text-line.slide-out {
  animation: slideOutUp 0.6s ease-out forwards;
}

.hero-text-line.slide-in {
  animation: slideInUp 0.6s ease-out forwards;
}

@keyframes playgroundSlideIn {
  from {
      opacity: 0;
      transform: translateY(40px) scale(0.95);
  }
  to {
      opacity: 1;
      transform: translateY(0) scale(1);
  }
}

@keyframes buttonSlideIn {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
  }
  40% {
      transform: translateY(-8px);
  }
  60% {
      transform: translateY(-4px);
  }
}

@keyframes textPulse {
  0%, 100% {
      opacity: 1;
  }
  50% {
      opacity: 0.7;
  }
}

/* Responsive algorithm cards */
@media (max-width: 768px) {
  .algorithm-cards {
      grid-template-columns: 1fr !important;
  }
}

/* Responsive playground controls */
@media (max-width: 768px) {
  #resolution-playground .playground-header {
      flex-direction: column !important;
      gap: 1rem !important;
      align-items: stretch !important;
  }
  
  #resolution-playground .playground-controls {
      flex-wrap: wrap !important;
      justify-content: center !important;
  }
  
  #resolution-playground .playground-controls > * {
      flex: 1 1 auto !important;
      min-width: 120px !important;
  }
}

/* Responsive resolution playground layout */
@media (min-width: 768px) {
  .resolution-layout {
      flex-direction: row !important;
      align-items: flex-start !important;
  }
  
  .graph-area {
      flex: 1 1 60% !important;
  }
  
  .order-area {
      flex: 1 1 40% !important;
  }
  
  #graph-container {
      max-width: none !important;
      width: 100% !important;
  }
}