/* Dark Factory — Landing Page */

:root {
  --black: #000000;
  --bg-dark: #050505;
  --bg-card: #0a0a0a;
  --bg-elevated: #111111;
  --border: #1a1a1a;
  --border-light: #222222;
  --text: #fafafa;
  --text-secondary: #888888;
  --text-dim: #555555;
  --accent: #ff4f00;
  --accent-soft: rgba(255, 79, 0, 0.12);
  --green: #00d47b;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 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-body);
  background: var(--black);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ─── Grain overlay ─── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ─── Navigation ─── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-dot {
  color: var(--accent);
}

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

.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-github {
  display: flex;
  align-items: center;
  color: var(--text-dim);
}

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

/* ─── Hero ─── */

.hero {
  padding: 10rem 2rem 6rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-content {
  margin-bottom: 4rem;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 79, 0, 0.2);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--text);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.1);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 0.95rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s;
}

.btn-ghost:hover {
  color: var(--text);
}

/* ─── Hero Terminal ─── */

.hero-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 680px;
  box-shadow: 0 0 80px rgba(255, 79, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

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

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

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 2;
}

.term-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.term-line.typed {
  opacity: 1;
  transform: translateY(0);
}

.term-phase {
  color: var(--accent);
  min-width: 10ch;
  display: inline-block;
}

.term-dim {
  color: var(--text-dim);
}

.term-text {
  color: var(--text-secondary);
}

.term-check {
  color: var(--green);
  margin-left: 0.5rem;
}

.term-result {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.term-success {
  color: var(--green);
  font-weight: 500;
}

/* ─── Sections ─── */

.section {
  padding: 7rem 2rem;
}

.section-dark {
  background: var(--bg-dark);
}

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

.section-centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 4rem;
  font-weight: 300;
}

/* ─── Pipeline Visualization ─── */

.pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.node-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-light);
  border: 2px solid var(--text-dim);
  transition: all 0.3s;
}

.node-highlight .node-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 79, 0, 0.4);
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.node-highlight .node-label {
  color: var(--accent);
}

.pipeline-edge {
  flex: 1;
  min-width: 40px;
  height: 1px;
  background: var(--border-light);
  margin: 0 0.25rem;
  transform: translateY(-10px);
}

/* ─── Phase Cards ─── */

.phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.phase-card {
  background: var(--bg-card);
  padding: 1.75rem;
}

.phase-card:hover {
  background: var(--bg-elevated);
}

.phase-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.phase-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.phase-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  font-weight: 300;
}

/* ─── Features Grid ─── */

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

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

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

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.feature-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

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

/* ─── CLI Section ─── */

.cli-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.cli-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cli-card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cli-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
}

.cli-chrome {
  display: flex;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.cli-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
}

.cli-window pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.8;
}

.cli-window code {
  color: var(--text-secondary);
}

.c-prompt { color: var(--green); }
.c-cmd { color: var(--text); }
.c-flag { color: #6e9eff; }
.c-str { color: var(--accent); }
.c-dim { color: var(--text-dim); }
.c-out { color: var(--text-dim); font-style: italic; }

/* ─── Install Block ─── */

.install-block {
  max-width: 560px;
  width: 100%;
  margin-bottom: 3rem;
}

.install-block .cli-window {
  text-align: left;
}

.cta-final {
  margin-top: 0;
}

/* ─── Footer ─── */

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
}

.footer-sep {
  color: var(--border-light);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

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

/* ─── Scroll Reveal ─── */

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger phase cards */
.phases .reveal:nth-child(1) { transition-delay: 0ms; }
.phases .reveal:nth-child(2) { transition-delay: 60ms; }
.phases .reveal:nth-child(3) { transition-delay: 120ms; }
.phases .reveal:nth-child(4) { transition-delay: 180ms; }
.phases .reveal:nth-child(5) { transition-delay: 240ms; }
.phases .reveal:nth-child(6) { transition-delay: 300ms; }
.phases .reveal:nth-child(7) { transition-delay: 360ms; }
.phases .reveal:nth-child(8) { transition-delay: 420ms; }

/* Stagger feature cards */
.features-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.features-grid .reveal:nth-child(2) { transition-delay: 80ms; }
.features-grid .reveal:nth-child(3) { transition-delay: 160ms; }
.features-grid .reveal:nth-child(4) { transition-delay: 240ms; }
.features-grid .reveal:nth-child(5) { transition-delay: 320ms; }
.features-grid .reveal:nth-child(6) { transition-delay: 400ms; }

/* ─── Responsive ─── */

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

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

  .cli-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 8rem 1.5rem 4rem;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .section {
    padding: 5rem 1.5rem;
  }

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

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

  .pipeline {
    display: none;
  }

  .nav-right {
    gap: 1.25rem;
  }

  .nav-link:not(.nav-github) {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.25rem;
  }

  .footer-sep {
    display: none;
  }
}

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

  .hero-sub {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}
