/* ============================================
   Tenax - Developer Tool Aesthetic
   Electric violet with fluid dynamics
   ============================================ */

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Theme Variables */
:root {
  /* Light Theme */
  --bg-primary: #FAFAFA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F4F4F5;
  --text-primary: #18181B;
  --text-secondary: #52525B;
  --text-tertiary: #A1A1AA;
  --border: rgba(24, 24, 27, 0.08);
  --border-strong: rgba(24, 24, 27, 0.15);

  /* Teal Accent - Modern and developer-friendly */
  --accent: #0D9488;
  --accent-light: #2DD4BF;
  --accent-dark: #0F766E;
  --accent-glow: rgba(13, 148, 136, 0.2);
  --accent-subtle: rgba(13, 148, 136, 0.08);

  /* Code blocks */
  --code-bg: #1E1B2E;
  --code-text: #E4E4E7;
  --code-comment: #71717A;
  --code-keyword: #2DD4BF;
  --code-string: #34D399;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 4px 12px rgba(24, 24, 27, 0.08);
  --shadow-lg: 0 12px 40px rgba(24, 24, 27, 0.12);
  --shadow-glow: 0 0 60px var(--accent-glow);

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.5rem;
  --text-5xl: 4.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-theme: 500ms ease;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

/* Dark Theme - The default, developer-focused */
[data-theme="dark"] {
  --bg-primary: #09090B;
  --bg-secondary: #18181B;
  --bg-tertiary: #27272A;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --border: rgba(250, 250, 250, 0.06);
  --border-strong: rgba(250, 250, 250, 0.12);
  --accent-glow: rgba(13, 148, 136, 0.35);
  --accent-subtle: rgba(13, 148, 136, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Base styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

/* Global overflow fix for mobile */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: transparent;
  transition: all var(--transition-base);
}

.nav.scrolled {
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav.scrolled {
  background: rgba(250, 250, 250, 0.85);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.nav__logo:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.nav__logo-mark {
  width: 36px;
  height: 36px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.nav__logo:hover .nav__logo-mark {
  transform: rotate(45deg);
}

.nav__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav__logo-title {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Nav Links */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__social-link {
    display: none;
  }
}

/* Mobile Navigation */
.nav__social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.nav__social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.nav__menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  position: relative;
}

@media (max-width: 768px) {
  .nav__menu-toggle {
    display: flex;
  }
}

.nav__menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav__menu-icon {
  width: 22px;
  height: 22px;
  position: absolute;
  transition: all 0.3s ease;
}

.nav__menu-icon--close {
  opacity: 0;
  transform: rotate(-90deg);
}

.nav__menu-toggle[aria-expanded="true"] .nav__menu-icon--open {
  opacity: 0;
  transform: rotate(90deg);
}

.nav__menu-toggle[aria-expanded="true"] .nav__menu-icon--close {
  opacity: 1;
  transform: rotate(0);
}

/* Mobile Menu Overlay - Hidden on desktop */
.nav__mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .nav__mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 99;
    padding-top: 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav__mobile-menu:not([hidden]) {
    opacity: 1;
    visibility: visible;
  }
}

.nav__mobile-menu-inner {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  gap: var(--space-xs);
}

.nav__mobile-link {
  display: flex;
  align-items: center;
  padding: var(--space-lg) var(--space-md);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav__mobile-link:hover,
.nav__mobile-link:focus {
  background: var(--bg-secondary);
  color: var(--accent);
}

.nav__mobile-link svg {
  flex-shrink: 0;
}

.nav__link {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  overflow: hidden;
}

/* Animated underline effect */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: var(--space-md);
  right: var(--space-md);
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link--github {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  margin-left: var(--space-sm);
  border-left: 1px solid var(--border);
  padding-left: var(--space-lg);
  border-radius: 0;
  background: transparent;
}

.nav__link--github:hover {
  color: var(--accent);
  background: transparent;
}

.nav__link--github svg {
  width: 20px;
  height: 20px;
}

/* Nav Actions */
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Theme Toggle - Enhanced with morph animation */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.theme-toggle:hover::before {
  opacity: 1;
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
}

.theme-toggle:hover svg {
  color: var(--accent);
}

.theme-toggle__sun {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

.theme-toggle__moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Dark theme - show sun, hide moon */
[data-theme="dark"] .theme-toggle__sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle__moon {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

/* Animation on click */
.theme-toggle.animating svg {
  animation: iconPop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes iconPop {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

/* ============================================
   Hero Section - Modern Split Layout
   ============================================ */
.hero--modern {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--space-5xl) + 60px) 0 var(--space-5xl);
}

/* Ambient background */
.hero__ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  will-change: transform;
}

.hero__glow--1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -20%;
  left: -10%;
  animation: glowPulse 8s ease-in-out infinite;
}

.hero__glow--2 {
  width: 500px;
  height: 500px;
  background: var(--accent-light);
  bottom: -20%;
  right: -5%;
  animation: glowPulse 10s ease-in-out infinite reverse;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

/* Noise texture overlay */
.hero__noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Split layout */
.hero__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

@media (max-width: 1024px) {
  .hero__split {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
    text-align: center;
  }
}

/* Hero content (left side) */
.hero__content {
  animation: heroContentIn 1s ease both;
}

@keyframes heroContentIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1024px) {
  .hero__content {
    animation-name: heroContentInMobile;
  }
  @keyframes heroContentInMobile {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Headline */
.hero__headline {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xl);
}

.hero__headline-line {
  display: block;
}

.hero__headline-line:last-child {
  color: var(--accent);
}

/* Morphing word container */
.hero__morph-container {
  display: inline-grid;
  vertical-align: bottom;
  perspective: 500px;
}

/* Stack all words in the same grid cell */
.hero__morph-word {
  grid-area: 1 / 1;
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.95) translateY(4px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__morph-word.active {
  opacity: 1;
  filter: blur(0);
  transform: scale(1) translateY(0);
}

.hero__morph-word.exit {
  opacity: 0;
  filter: blur(8px);
  transform: scale(1.02) translateY(-4px);
}

/* Description */
.hero__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  max-width: 480px;
}

@media (max-width: 1024px) {
  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero__description-highlight {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: var(--space-sm);
}

/* CTA Group */
.hero__cta-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

@media (max-width: 1024px) {
  .hero__cta-group {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero__cta-group {
    flex-direction: column;
    width: 100%;
  }
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.hero__cta--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.hero__cta--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: white;
}

.hero__cta--primary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.hero__cta--primary:hover svg {
  transform: translateX(4px);
}

.hero__cta--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.hero__cta--ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.hero__cta--ghost svg {
  width: 18px;
  height: 18px;
}

/* Stats row */
.hero__stats {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .hero__stats {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero__stats {
    flex-direction: column;
    gap: var(--space-lg);
  }
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.hero__stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--text-primary);
}

.hero__stat-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.hero__stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-strong);
}

@media (max-width: 480px) {
  .hero__stat-divider {
    width: 40px;
    height: 1px;
  }
}

/* Visual side (right) */
.hero__visual {
  position: relative;
  animation: heroVisualIn 1s ease 0.3s both;
}

@keyframes heroVisualIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1024px) {
  .hero__visual {
    animation-name: heroVisualInMobile;
    max-width: 500px;
    margin: 0 auto;
  }
  @keyframes heroVisualInMobile {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.hero__visual-container {
  position: relative;
  aspect-ratio: 1;
}

/* Knowledge flow SVG */
.hero__flow {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.hero__flow-hub {
  animation: hubPulse 4s ease-in-out infinite;
}

@keyframes hubPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.hero__flow-node {
  animation: nodeFloat 6s ease-in-out infinite;
}

.hero__flow-node--1 { animation-delay: 0s; }
.hero__flow-node--2 { animation-delay: 1.5s; }
.hero__flow-node--3 { animation-delay: 3s; }
.hero__flow-node--4 { animation-delay: 4.5s; }

@keyframes nodeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero__flow-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: pathDraw 2s ease forwards;
}

@keyframes pathDraw {
  to { stroke-dashoffset: 0; }
}

.hero__flow-particle {
  filter: blur(1px);
}

/* Floating cards */
.hero__card {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: cardFloat 8s ease-in-out infinite;
  backdrop-filter: blur(10px);
}

.hero__card--decision {
  top: 45%;
  left: -18%;
  animation-delay: 0s;
}

.hero__card--pattern {
  top: 35%;
  right: -18%;
  animation-delay: 2s;
}

.hero__card--insight {
  top: 85%;
  right: 10%;
  left: auto;
  animation-delay: 4s;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(1deg); }
  75% { transform: translateY(5px) rotate(-1deg); }
}

@media (max-width: 768px) {
  .hero__card {
    display: none;
  }

  .hero__visual-container {
    max-width: 300px;
    margin: 0 auto;
  }

  .hero__flow {
    transform: scale(0.8);
  }
}

/* Fix morphing words on mobile */
@media (max-width: 640px) {
  .hero__morph-container {
    display: block;
  }

  .hero__morph-word {
    display: block;
  }

  .hero__headline {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .hero--modern {
    padding: calc(var(--space-3xl) + 60px) 0 var(--space-3xl);
    min-height: auto;
  }

  .hero__description {
    font-size: var(--text-base);
  }

  .hero__cta {
    width: 100%;
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
  }
}

.hero__card-icon {
  font-size: 1.2rem;
}

.hero__card-content {
  display: flex;
  flex-direction: column;
}

.hero__card-type {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero__card-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-family: ui-monospace, "SF Mono", monospace;
}

/* Legacy fadeInUp for other sections */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons with ripple effect */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

/* Ripple effect container */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
  color: white;
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn--secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.btn--secondary .ripple {
  background: var(--accent-subtle);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Hero CTA buttons ripple */
.hero__cta {
  position: relative;
  overflow: hidden;
}

.hero__cta .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out forwards;
  pointer-events: none;
}

.hero__cta--ghost .ripple {
  background: var(--accent-subtle);
}

/* CTA section buttons ripple */
.cta__btn {
  position: relative;
  overflow: hidden;
}

.cta__btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out forwards;
  pointer-events: none;
}

.cta__btn--secondary .ripple {
  background: var(--accent-subtle);
}

/* ============================================
   Features Section
   ============================================ */
.features {
  padding: var(--space-5xl) 0;
  position: relative;
}

.section__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-4xl);
}

.section__label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.section__title {
  margin-bottom: var(--space-md);
}

.section__subtitle {
  font-size: var(--text-lg);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .features__grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  padding: var(--space-2xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.feature-card__icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.feature-card__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.feature-card__description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   How It Works Section
   ============================================ */
.how-it-works {
  padding: var(--space-5xl) 0;
  background: var(--bg-secondary);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  position: relative;
}

.steps::before {
  content: "";
  position: absolute;
  top: 40px;
  left: calc(16.666% + 40px);
  right: calc(16.666% + 40px);
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  opacity: 0.3;
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  .steps::before {
    display: none;
  }
}

.step {
  text-align: center;
  position: relative;
}

.step__number {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-xl);
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.step__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.step__description {
  color: var(--text-secondary);
  max-width: 280px;
  margin: 0 auto;
}

/* ============================================
   Quick Start Section
   ============================================ */
.quickstart {
  padding: var(--space-5xl) 0;
}

.quickstart__content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-4xl);
  align-items: center;
}

@media (max-width: 900px) {
  .quickstart__content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

.quickstart__text h2 {
  margin-bottom: var(--space-lg);
}

.quickstart__text p {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xl);
}

/* Code Block */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block__dots {
  display: flex;
  gap: var(--space-sm);
}

.code-block__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-block__dot--red { background: #FF5F57; }
.code-block__dot--yellow { background: #FFBD2E; }
.code-block__dot--green { background: #28CA42; }

.code-block__title {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

.code-block__copy {
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-block__copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.code-block__copy.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.code-block__content {
  padding: var(--space-xl);
  overflow-x: auto;
}

.code-block__content pre {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.code-block__content code {
  color: var(--code-text);
}

.code-comment { color: var(--code-comment); }
.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--space-4xl) 0 var(--space-2xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer__content {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-3xl);
}

@media (max-width: 900px) {
  .footer__content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 600px) {
  .footer__content {
    grid-template-columns: 1fr;
  }
}

.footer__brand {
  max-width: 300px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.footer__logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-sm);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.footer__version {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

.footer__column h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.footer__links {
  list-style: none;
}

.footer__links li {
  margin-bottom: var(--space-sm);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__bottom {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

@media (max-width: 600px) {
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__social a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.footer__social a:hover {
  color: var(--accent);
}

.footer__social svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--stagger-delay, 0ms);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay utilities (set via JS or inline) */
.fade-in[data-stagger="1"] { --stagger-delay: 100ms; }
.fade-in[data-stagger="2"] { --stagger-delay: 200ms; }
.fade-in[data-stagger="3"] { --stagger-delay: 300ms; }
.fade-in[data-stagger="4"] { --stagger-delay: 400ms; }
.fade-in[data-stagger="5"] { --stagger-delay: 500ms; }
.fade-in[data-stagger="6"] { --stagger-delay: 600ms; }

/* Scale up variant for cards */
.fade-in--scale {
  transform: translateY(30px) scale(0.95);
}

.fade-in--scale.visible {
  transform: translateY(0) scale(1);
}

/* Slide in from sides */
.fade-in--left {
  transform: translateX(-30px);
}

.fade-in--left.visible {
  transform: translateX(0);
}

.fade-in--right {
  transform: translateX(30px);
}

.fade-in--right.visible {
  transform: translateX(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Selection styling */
::selection {
  background: var(--accent);
  color: white;
}

/* ============================================
   Documentation Pages (shared styles)
   ============================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 80px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

.docs-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: var(--space-xl);
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
}

@media (max-width: 900px) {
  .docs-sidebar {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    z-index: 90;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .docs-sidebar.open {
    display: block;
  }
}

/* Mobile Docs Sidebar Toggle */
.docs-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  z-index: 91;
  box-shadow: 0 4px 20px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

@media (max-width: 900px) {
  .docs-sidebar-toggle {
    display: flex;
  }
}

.docs-sidebar-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px var(--accent-glow), 0 12px 40px rgba(0,0,0,0.3);
}

.docs-sidebar-toggle:active {
  transform: scale(0.95);
}

.docs-sidebar-toggle svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.docs-sidebar-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.docs-sidebar__section {
  margin-bottom: var(--space-xl);
}

.docs-sidebar__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.docs-sidebar__links {
  list-style: none;
}

.docs-sidebar__links li {
  margin-bottom: var(--space-xs);
}

.docs-sidebar__links a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.docs-sidebar__links a:hover,
.docs-sidebar__links a.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.docs-content {
  padding: var(--space-3xl) var(--space-4xl);
  max-width: 900px;
}

@media (max-width: 600px) {
  .docs-content {
    padding: var(--space-xl);
  }
}

.docs-content h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
}

.docs-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.docs-content h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.docs-content p {
  margin-bottom: var(--space-lg);
}

.docs-content ul, .docs-content ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.docs-content li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.docs-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.docs-content pre {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.docs-content pre code {
  display: block;
  padding: var(--space-lg);
  background: var(--code-bg);
  color: var(--code-text);
  overflow-x: auto;
}

/* Command cards for docs */
.command-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.command-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.command-card__name {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
}

.command-card__body {
  padding: var(--space-lg);
}

.command-card__description {
  margin-bottom: var(--space-md);
}

.command-card__usage {
  background: var(--code-bg);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: var(--text-sm);
  color: var(--code-text);
}

/* Search input */
.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-wrapper {
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-secondary);
}

td code {
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
}

.badge--amber {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.badge--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

.badge--green {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.badge--purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8B5CF6;
}

.badge--gray {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}

/* ============================================
   Animated Terminal Component
   ============================================ */
.terminal {
  background: #0D0D0F;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Monaco, monospace;
  min-width: 500px;
  max-width: 600px;
}

@media (max-width: 640px) {
  .terminal {
    min-width: 100%;
    max-width: 100%;
  }

  .terminal__body {
    padding: var(--space-md);
    font-size: var(--text-xs);
    overflow-x: auto;
  }

  .terminal__line {
    white-space: nowrap;
  }
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red { background: #FF5F57; }
.terminal__dot--yellow { background: #FFBD2E; }
.terminal__dot--green { background: #28CA42; }

.terminal__title {
  flex: 1;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-right: 36px; /* Balance the dots on left */
}

.terminal__body {
  padding: var(--space-xl);
  min-height: 280px;
}

.terminal__line {
  margin-bottom: var(--space-md);
  line-height: 1.8;
  opacity: 0;
  transform: translateY(10px);
  animation: terminalLineIn 0.4s ease forwards;
}

.terminal__line:last-child {
  margin-bottom: 0;
}

@keyframes terminalLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal__prompt {
  color: var(--accent-light);
  margin-right: var(--space-sm);
  user-select: none;
}

.terminal__command {
  color: #E4E4E7;
}

.terminal__output {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  padding-left: var(--space-lg);
  border-left: 2px solid rgba(13, 148, 136, 0.3);
  margin-left: var(--space-sm);
}

.terminal__output--success {
  color: #34D399;
  border-left-color: rgba(52, 211, 153, 0.3);
}

.terminal__output--highlight {
  color: var(--accent-light);
}

.terminal__cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  background: var(--accent-light);
  margin-left: 2px;
  animation: cursorBlink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Terminal typing animation */
.terminal__typing {
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
}

/* Result badges in terminal */
.terminal__badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-right: var(--space-xs);
}

.terminal__badge--decision {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
}

.terminal__badge--pattern {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

.terminal__badge--insight {
  background: rgba(13, 148, 136, 0.2);
  color: #2DD4BF;
}

/* Hero with terminal layout */
.hero--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: center;
  text-align: left;
}

@media (max-width: 1024px) {
  .hero--split {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero--split .hero__content {
    order: 1;
  }

  .hero--split .hero__terminal {
    order: 2;
    justify-self: center;
  }
}

.hero__terminal {
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* Word morph effect - see primary styles at line ~486 */
