/* ============================================
   DeepCode Site — Styles
   ============================================ */

:root {
  --bg-primary: #08090d;
  --bg-secondary: #0f1118;
  --bg-card: #141722;
  --bg-card-hover: #191d2a;
  --border: #282e3f;
  --border-strong: #394158;
  --text-primary: #f2f4fb;
  --text-secondary: #b4bdd1;
  --text-muted: #788299;
  --accent: #9f55ff;
  --accent-dim: #7d38d8;
  --accent-soft: rgba(159, 85, 255, 0.16);
  --green: #3ddc97;
  --yellow: #f0c86a;
  --red: #ff6676;
  --blue: #66b4ff;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 200ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
}

.brand-word {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.logo:hover .brand-word {
  color: #ffffff;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  min-height: 42px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 28px var(--accent-soft);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.hero {
  padding: 132px 0 74px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--bg-primary);
  background-size: 44px 44px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 72px 0 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 82%);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
}

.terminal-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(20, 23, 34, 0.9);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.hero-logo-img {
  max-width: 620px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.45));
}

.hero-subtitle {
  font-size: 1.32rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 16px;
}

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

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 18px;
}

.hero-install {
  max-width: 440px;
  margin: 0 auto 34px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.24);
}

.hero-terminal {
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  text-align: left;
  background: rgba(9, 11, 17, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: var(--red);
}

.dot-yellow {
  background: var(--yellow);
}

.dot-green {
  background: var(--green);
}

.terminal-title {
  margin-left: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.hero-terminal pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.hero-terminal code {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.8;
  white-space: pre;
}

.log-muted {
  color: var(--text-muted);
}

.log-ok {
  color: var(--green);
}

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

.section {
  padding: 92px 0;
}

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

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

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

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: all var(--transition);
  min-width: 0;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 46px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(159, 85, 255, 0.3);
  border-radius: 6px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ============================================
   Providers
   ============================================ */

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all var(--transition);
  min-width: 0;
}

.provider-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.provider-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.provider-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.provider-models {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   Commands
   ============================================ */

.commands-list {
  max-width: 700px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
  min-width: 0;
}

.command-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.command-line {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: normal;
  overflow-wrap: anywhere;
  flex-shrink: 0;
  max-width: 100%;
}

.command-line .prompt {
  color: var(--accent);
  margin-right: 8px;
}

.command-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 0;
}

/* ============================================
   Safety
   ============================================ */

.safety-grid {
  max-width: 700px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.safety-item {
  display: flex;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all var(--transition);
  min-width: 0;
}

.safety-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.safety-icon {
  width: 42px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.26);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
}

.safety-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.safety-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.safety-content code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ============================================
   Install
   ============================================ */

.install-steps {
  max-width: 700px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.install-step {
  display: flex;
  gap: 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content {
  min-width: 0;
  width: 100%;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.step-content .or {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 12px 0;
}

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  gap: 16px;
  min-width: 0;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.5;
  min-width: 0;
}

.copy-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.footer-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.footer-word {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

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

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

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

@media (max-width: 768px) {
  .navbar .btn {
    padding: 9px 12px;
  }

  .nav-links {
    display: none;
  }

  .hero-logo-img {
    max-width: 100%;
  }

  .hero {
    padding: 98px 0 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
  }

  .hero-actions .btn {
    width: min(100%, 280px);
    justify-content: center;
  }

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

  .command-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .command-line {
    white-space: normal;
  }

  .install-step {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 44px 0;
  }

  .code-block {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    align-self: flex-end;
  }

  .terminal-badge {
    margin-bottom: 12px;
  }

  .hero-logo {
    margin-bottom: 8px;
  }

  .hero-description {
    margin-bottom: 28px;
  }

  .hero-install {
    margin-bottom: 22px;
  }

  .hero-terminal pre {
    padding: 14px 16px;
  }

  .hero-terminal code {
    font-size: 0.72rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .hero-logo-img {
    max-width: 100%;
  }

  .container {
    padding: 0 16px;
  }

  .brand-word {
    display: none;
  }

  .btn-ghost svg {
    width: 18px;
    height: 18px;
  }

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

  .terminal-title {
    display: none;
  }

  .hero-terminal pre {
    padding: 16px;
  }
}
