/* ============================================
   River AI — Design System & Styles
   ============================================ */

:root {
  --color-bg: #0a0a0b;
  --color-surface: #111113;
  --color-surface-2: #18181b;
  --color-border: #27272a;
  --color-border-subtle: #1e1e21;
  --color-text: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-accent: #6ee7b7;
  --color-accent-2: #34d399;
  --color-accent-dim: rgba(110, 231, 183, 0.1);
  --color-accent-glow: rgba(110, 231, 183, 0.15);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  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");
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  transition: all 0.3s var(--ease-out);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 24px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu a {
  font-size: 1rem;
  color: var(--color-text-secondary);
  padding: 8px 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--color-accent-2);
  border-color: var(--color-accent-2);
  box-shadow: 0 0 24px var(--color-accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-accent-dim);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid rgba(110, 231, 183, 0.2);
  border-radius: 100px;
  margin-bottom: 32px;
  background: var(--color-accent-dim);
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-accent) 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero visual */
.hero-visual {
  margin-top: 80px;
  position: relative;
}

.flow-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 200px;
  margin: 0 auto;
}

.flow-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.flow-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 8 8;
}

.flow-1 {
  stroke: var(--color-accent);
  opacity: 0.6;
  animation: flowDash 3s linear infinite;
}

.flow-2 {
  stroke: #a78bfa;
  opacity: 0.3;
  animation: flowDash 4s linear infinite reverse;
}

.flow-3 {
  stroke: #f472b6;
  opacity: 0.3;
  animation: flowDash 5s linear infinite;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: -48;
  }
}

.flow-nodes {
  position: absolute;
  inset: 0;
}

.flow-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
}

.node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 16px var(--color-accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

.flow-node:nth-child(2) .node-dot {
  animation-delay: 0.5s;
}

.flow-node:nth-child(3) .node-dot {
  animation-delay: 1s;
}

.flow-node:nth-child(4) .node-dot {
  animation-delay: 1.5s;
}

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

.flow-node span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 120px 0;
}

.section-dark {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 64px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ============================================
   Features Grid
   ============================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.feature-card {
  padding: 40px 32px;
  background: var(--color-bg);
  transition: background 0.3s ease;
}

.feature-card:hover {
  background: var(--color-surface);
}

.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  color: var(--color-accent);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   Stats
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  text-align: center;
}

.stat-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================
   Solutions
   ============================================ */

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

.solution-card {
  padding: 40px 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.solution-card:hover {
  border-color: var(--color-border);
  transform: translateY(-2px);
}

.solution-number {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin-bottom: 20px;
  font-weight: 500;
}

.solution-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.solution-card p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.solution-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.solution-tags li {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  font-weight: 500;
}

/* ============================================
   Code Section
   ============================================ */

.code-section {
  border-top: 1px solid var(--color-border-subtle);
}

.code-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.code-text h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.code-text p {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-list li {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  padding-left: 28px;
  position: relative;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent-dim);
  border: 1.5px solid var(--color-accent);
}

.check-list li::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 8px;
  height: 4px;
  border-left: 1.5px solid var(--color-accent);
  border-bottom: 1.5px solid var(--color-accent);
  transform: rotate(-45deg);
}

.code-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface-2);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.code-block pre {
  padding: 24px;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.kw { color: #c084fc; }
.mod { color: var(--color-accent); }
.str { color: #fbbf24; }
.param { color: #93c5fd; }
.val { color: #f472b6; }

/* ============================================
   About
   ============================================ */

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 24px;
}

.about-text p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 16px;
}

.value h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.value p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   CTA
   ============================================ */

.cta-section {
  padding: 120px 0;
}

.cta-card {
  text-align: center;
  padding: 80px 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.cta-card h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.cta-card > p {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.cta-form {
  max-width: 440px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 8px;
}

.form-row input {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-row input::placeholder {
  color: var(--color-text-muted);
}

.form-row input:focus {
  border-color: var(--color-accent);
}

.form-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ============================================
   Animations
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

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

  .solutions-grid .solution-card:last-child {
    grid-column: span 2;
  }
}

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

  .nav-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .section {
    padding: 80px 0;
  }

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

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }

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

  .solutions-grid .solution-card:last-child {
    grid-column: auto;
  }

  .code-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .form-row {
    flex-direction: column;
  }

  .cta-card {
    padding: 48px 24px;
  }

  .flow-container {
    height: 160px;
  }

  .flow-node span {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .footer-brand {
    grid-column: auto;
  }
}
