/* ==========================================================================
   Cortrix.ai - Styles
   Font & logo are placeholder — swap via CSS variables below.
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  /* Colors */
  --c-bg:         #0a0e17;
  --c-bg-alt:     #0f1420;
  --c-surface:    #151b2b;
  --c-surface-2:  #1c2438;
  --c-border:     #1e2a3f;
  --c-text:       #e2e8f0;
  --c-text-muted: #8892a6;
  --c-primary:    #3b82f6;
  --c-primary-h:  #60a5fa;
  --c-accent:     #06d6a0;
  --c-accent-h:   #34efc4;
  --c-code-bg:    #0d1117;

  /* Typography — replace these to rebrand */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Layout */
  --max-w: 1200px;
  --nav-h: 64px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary-h); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-accent); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Utility --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-h); border-color: var(--c-primary-h); color: #fff; }
.btn-outline {
  background: transparent; color: var(--c-text); border-color: var(--c-border);
}
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary-h); }
.btn-ghost {
  background: transparent; color: var(--c-text-muted); border-color: transparent;
}
.btn-ghost:hover { color: var(--c-text); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 14, 23, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  height: var(--nav-h);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
}
.nav-logo { display: flex; align-items: center; gap: 8px; }
.logo-text {
  font-size: 22px; font-weight: 700; color: var(--c-text);
  letter-spacing: -.5px;
  /* Replace with logo image when ready */
}
.nav-links {
  display: flex; gap: 32px;
}
.nav-links a {
  color: var(--c-text-muted); font-size: 14px; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--c-text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--c-text);
  margin: 4px 0; transition: .3s;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg canvas {
  width: 100%; height: 100%; opacity: .3;
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 800px;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px; border-radius: 100px;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .25);
  color: var(--c-primary-h);
  font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: .5px;
}
.hero-slogan {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--c-accent);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(32px, 4.5vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-primary-h) 50%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 18px;
  color: var(--c-text-muted);
  max-width: 600px; margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-sub strong { color: var(--c-text); }
.hero-actions {
  display: flex; gap: 16px; justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value {
  display: block; font-size: 22px; font-weight: 700;
  color: var(--c-text);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.stat-label {
  font-size: 12px; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-top: 4px;
}

/* --- Sections --- */
.section {
  padding: 100px 0;
}
.section-dark {
  background: var(--c-bg-alt);
}
.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700; text-align: center;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}
.section-sub {
  text-align: center; color: var(--c-text-muted);
  max-width: 640px; margin: 0 auto 56px;
  font-size: 16px;
}

/* --- Problem Cards --- */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.problem-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color .2s, transform .2s;
}
.problem-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.problem-icon {
  color: var(--c-primary-h);
  margin-bottom: 16px;
}
.problem-card h3 {
  font-size: 18px; font-weight: 600; margin-bottom: 8px;
}
.problem-card p {
  color: var(--c-text-muted); font-size: 14px; line-height: 1.6;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}
.feature-card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.feature-icon {
  color: var(--c-accent);
  margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 8px;
}
.feature-card p {
  color: var(--c-text-muted); font-size: 14px; line-height: 1.6;
}
.feature-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  background: rgba(6, 214, 160, .1);
  color: var(--c-accent);
}

/* --- Architecture --- */
.arch-diagram {
  margin-bottom: 48px;
  overflow-x: auto;
}
.arch-diagram img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}
.arch-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.arch-item h4 {
  font-size: 16px; font-weight: 600; margin-bottom: 6px;
  color: var(--c-text);
}
.arch-item p {
  color: var(--c-text-muted); font-size: 14px;
}

/* --- Quick Start --- */
.quickstart-steps {
  max-width: 720px; margin: 0 auto 48px;
  display: flex; flex-direction: column; gap: 32px;
}
.step {
  display: flex; gap: 20px; align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary);
  color: #fff; font-weight: 700; font-size: 16px;
  border-radius: 50%;
}
.step-content { flex: 1; }
.step-content h3 {
  font-size: 18px; font-weight: 600; margin-bottom: 12px;
}
.code-block {
  background: var(--c-code-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--c-border);
  font-size: 12px; color: var(--c-text-muted);
}
.copy-btn {
  background: none; border: 1px solid var(--c-border);
  color: var(--c-text-muted); padding: 4px 10px;
  border-radius: 4px; font-size: 11px; cursor: pointer;
  transition: all .2s;
}
.copy-btn:hover { border-color: var(--c-primary); color: var(--c-primary-h); }
.code-block pre {
  padding: 16px; overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px; line-height: 1.6;
  color: var(--c-text);
}
.quickstart-more {
  max-width: 720px; margin: 0 auto;
}
.quickstart-more > p {
  color: var(--c-text-muted); font-size: 14px;
  margin-bottom: 12px;
}

/* --- Use Cases --- */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.usecase-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color .2s, transform .2s;
}
.usecase-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}
.usecase-card h3 {
  font-size: 18px; font-weight: 600; margin-bottom: 8px;
}
.usecase-card p {
  color: var(--c-text-muted); font-size: 14px; line-height: 1.6;
}

/* --- Comparison Table --- */
.table-wrapper {
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
}
.compare-table thead th {
  font-weight: 600;
  color: var(--c-text);
  background: var(--c-surface);
  position: sticky; top: var(--nav-h);
}
.compare-table thead th:nth-child(2) {
  color: var(--c-accent);
}
.compare-table tbody td { color: var(--c-text-muted); }
.compare-table tbody td.check {
  color: var(--c-accent); font-weight: 500;
}
.compare-table tbody tr:hover { background: rgba(59, 130, 246, .04); }

/* --- CTA --- */
.section-cta {
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-alt) 100%);
  text-align: center;
  padding: 120px 0;
}
.cta-actions {
  display: flex; gap: 16px; justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cta-links {
  display: flex; gap: 24px; justify-content: center;
  flex-wrap: wrap;
}
.cta-links a {
  color: var(--c-text-muted); font-size: 14px;
  transition: color .2s;
}
.cta-links a:hover { color: var(--c-primary-h); }

/* --- Footer --- */
.footer {
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
  padding: 64px 0 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-links {
  display: flex;
  gap: 64px;
}
.footer-brand .logo-text {
  display: block; margin-bottom: 12px;
}
.footer-brand p { color: var(--c-text-muted); font-size: 14px; }
.footer-col h4 {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--c-text);
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: var(--c-text-muted); font-size: 14px;
  transition: color .2s;
}
.footer-col a:hover { color: var(--c-text); }
.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 24px 0;
}
.footer-bottom p {
  font-size: 13px; color: var(--c-text-muted); text-align: center;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: block; }

  .nav.open .nav-links,
  .nav.open .nav-actions {
    display: flex;
  }
  .nav.open .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    padding: 16px 24px; gap: 16px;
  }
  .nav.open .nav-actions {
    position: absolute; top: calc(var(--nav-h) + 200px); left: 0; right: 0;
    justify-content: center;
    background: var(--c-bg);
    padding: 0 24px 16px;
    border-bottom: 1px solid var(--c-border);
  }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 60px); padding-bottom: 60px; }
  .hero-stats { gap: 24px; }
  .stat-value { font-size: 22px; }

  .section { padding: 64px 0; }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }
  .footer-links {
    flex-direction: column;
    gap: 32px;
  }
  .step { flex-direction: column; }
  .step-num { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 16px; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
  .features-grid { grid-template-columns: 1fr; }
}
