/* ═══════════════════════════════════════════════════════════════
   Continuis Labs — Shared Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:         #06091A;
  --surface:    #0C1128;
  --surface-2:  #111932;
  --border:     rgba(255,255,255,.07);
  --border-lit: rgba(99,102,241,.35);
  --blue:   #3B82F6;
  --indigo: #6366F1;
  --purple: #8B5CF6;
  --green:  #10B981;
  --amber:  #F59E0B;
  --pink:   #EC4899;
  --text:     #F1F5F9;
  --text-dim: #94A3B8;
  --text-muted: #4B5D7A;
  --radius:    12px;
  --radius-lg: 20px;
  --nav-h:     68px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a  { color: inherit; }

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 52px;
  background: rgba(6,9,26,.6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
.nav.scrolled { background: rgba(6,9,26,.94); }

.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0; margin-right: 40px;
}
.nav-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(99,102,241,.45);
}
.nav-mark svg { width: 22px; height: 22px; animation: tspin 24s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes tspin { to { transform: rotate(-360deg); } }
.nav-company { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.nav-sub     { font-size: 9px; color: var(--text-muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 1px; }

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  padding: 7px 15px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-dim);
  text-decoration: none; transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.06); }

.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-app-link {
  font-size: 13px; color: var(--text-dim); text-decoration: none;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color .2s, color .2s;
}
.nav-app-link:hover { border-color: rgba(255,255,255,.18); color: var(--text); }
.nav-cta {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  transition: filter .2s, box-shadow .2s;
}
.nav-cta:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(99,102,241,.55); }

.nav-ham { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-direction: column; gap: 5px; }
.nav-ham span { display: block; width: 22px; height: 2px; background: var(--text-dim); border-radius: 2px; transition: .3s; }

/* ── Page wrapper ────────────────────────────────────────────── */
.page { padding-top: var(--nav-h); }

/* ── Section base ────────────────────────────────────────────── */
section { padding: 96px 52px; }
.section-inner { max-width: 1160px; margin: 0 auto; }

/* ── Type scale ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: var(--indigo); letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 18px; padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.2);
}
.section-heading {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800; line-height: 1.08; letter-spacing: -.035em;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 17px; color: var(--text-dim);
  line-height: 1.7; max-width: 580px; margin-bottom: 56px;
}

/* ── Gradient text ───────────────────────────────────────────── */
.grad {
  background: linear-gradient(120deg, #60A5FA 0%, #818CF8 45%, #C084FC 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.grad-warm {
  background: linear-gradient(120deg, #FBBF24, #F59E0B, #EF4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.grad-green {
  background: linear-gradient(120deg, #34D399, #3B82F6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: var(--border-lit); box-shadow: 0 8px 40px rgba(99,102,241,.1); }

/* ── Feature grid ────────────────────────────────────────────── */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.feat-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feat-body  { font-size: 14px; color: var(--text-dim); line-height: 1.65; }

/* ── Stat band ───────────────────────────────────────────────── */
.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-cell  { background: var(--surface); padding: 28px 24px; text-align: center; }
.stat-val   { font-size: 38px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-lbl   { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 18px rgba(99,102,241,.45);
  transition: filter .2s, box-shadow .2s, transform .1s;
}
.btn-primary:hover  { filter: brightness(1.1); box-shadow: 0 6px 26px rgba(99,102,241,.6); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.2); color: var(--text); background: rgba(255,255,255,.05); }

/* ── Chip labels ─────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  font-size: 12px; color: var(--text-dim);
  letter-spacing: .02em;
}

/* ── Two-column split ────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.flip { direction: rtl; }
.split.flip > * { direction: ltr; }

/* ── Code block ──────────────────────────────────────────────── */
.code-block {
  background: #030712; border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); padding: 24px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; line-height: 1.7; color: #94A3B8;
  overflow-x: auto;
}
.code-block .kw { color: #818CF8; }
.code-block .str { color: #34D399; }
.code-block .cm { color: #475569; }
.code-block .num { color: #F59E0B; }
.code-block .fn { color: #60A5FA; }

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s, transform .65s; }
.reveal.visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }
.reveal:nth-child(5) { transition-delay: .32s; }
.reveal:nth-child(6) { transition-delay: .40s; }

/* ── Divider ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 64px 52px 44px;
}
.footer-inner { max-width: 1160px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 52px;
}
.footer-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.footer-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.footer-mark svg { width: 18px; height: 18px; }
.footer-brand { font-size: 15px; font-weight: 800; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; max-width: 260px; margin-bottom: 20px; }
.footer-badge {
  display: inline-block; padding: 4px 10px;
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 6px; font-size: 10px;
  color: var(--indigo); letter-spacing: .08em; text-transform: uppercase;
}
.footer-col h4 {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px;
}
.footer-col a {
  display: block; font-size: 14px; color: var(--text-muted);
  text-decoration: none; margin-bottom: 11px; transition: color .15s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { font-size: 12px; color: var(--text-muted); }
.footer-bottom .legal { display: flex; gap: 24px; }
.footer-bottom .legal a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.footer-bottom .legal a:hover { color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid > *:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-links, .nav-right { display: none; }
  .nav-ham { display: flex; margin-left: auto; }
  section { padding: 72px 20px; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split.flip { direction: ltr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid > *:first-child { grid-column: 1 / -1; }
  footer { padding: 48px 20px 36px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

/* ── Mobile nav open state ───────────────────────────────────── */
@media (max-width: 768px) {
  .nav.open .nav-links {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: rgba(6,9,26,.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 12px 16px 100px;
    overflow-y: auto;
    z-index: 190;
    gap: 2px;
  }
  .nav.open .nav-links li { width: 100%; }
  .nav.open .nav-links li a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-radius: 10px;
    font-size: 15px; font-weight: 500; color: var(--text-dim);
    text-decoration: none; transition: background .15s, color .15s;
  }
  .nav.open .nav-links li a:hover,
  .nav.open .nav-links li a:active { background: rgba(255,255,255,.06); color: var(--text); }
  /* Mobile dropdown: accordion */
  .nav.open .nav-has-dropdown .nav-dropdown {
    position: static !important;
    transform: none !important;
    opacity: 0; visibility: hidden; height: 0;
    overflow: hidden;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    box-shadow: none;
    min-width: 0; padding: 0;
    margin: 0 0 4px 12px;
    width: calc(100% - 12px);
    display: block; /* always in flow, toggled by opacity/height */
    transition: opacity .2s, height .2s;
  }
  .nav.open .nav-has-dropdown.open .nav-dropdown {
    opacity: 1; visibility: visible; height: auto; padding: 8px;
  }
  .nav.open .nav-has-dropdown.open > a .nav-chevron { transform: rotate(180deg); }
  /* Mobile nav-right: fixed at bottom */
  .nav.open ~ .page { pointer-events: none; } /* prevent page scroll when nav open */
  /* Show nav-right actions at bottom of mobile panel */
  .nav.open .nav-right {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(6,9,26,.98);
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 14px 20px;
    z-index: 191;
    gap: 8px;
  }
  .nav.open .nav-right .nav-app-link,
  .nav.open .nav-right .nav-cta { text-align: center; padding: 11px 20px; border-radius: 10px; }
  .nav.open .nav-right .nav-cta { display: block; }
  /* Hamburger → X animation */
  .nav.open .nav-ham span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-ham span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav.open .nav-ham span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-ham span { transition: transform .25s, opacity .25s; }
}

/* ── Dropdown nav ────────────────────────────────────────────── */
.nav-has-dropdown { position: relative; }
.nav-has-dropdown > a { display: flex; align-items: center; gap: 4px; }
.nav-chevron { width: 12px; height: 12px; transition: transform .2s; flex-shrink: 0; }
.nav-has-dropdown:hover .nav-chevron,
.nav-has-dropdown.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: 100%; left: 50%;
  min-width: 240px; background: rgba(10,14,38,.97);
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  /* padding-top bridges the gap so hover isn't lost crossing from link to panel */
  padding: 10px 8px 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
  transform: translateX(-50%) translateY(4px);
  backdrop-filter: blur(20px); z-index: 300;
}
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown.open .nav-dropdown {
  opacity: 1; pointer-events: auto; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
/* Suppress desktop hover dropdown when mobile nav is open */
@media (max-width: 768px) {
  .nav-has-dropdown:hover .nav-dropdown { opacity: 0; pointer-events: none; visibility: hidden; }
}
.nav-dd-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.nav-dd-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav-dd-item strong { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.nav-dd-item small  { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.nav-dd-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
  color: var(--text-dim);
}
.nav-dd-icon svg { flex-shrink: 0; }
.nav-dd-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ── Search overlay ──────────────────────────────────────────── */
.nav-search-btn {
  background: none; border: none; cursor: pointer; padding: 7px;
  border-radius: 8px; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.nav-search-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }

.search-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,9,26,.85); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: center; padding-top: 120px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.search-overlay.open { opacity: 1; pointer-events: auto; visibility: visible; }
.search-box {
  width: 100%; max-width: 640px; padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.search-input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border-lit);
  border-radius: 12px; padding: 14px 20px; font-size: 16px;
  color: var(--text); font-family: inherit; outline: none;
  transition: border-color .2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--indigo); }
.search-close {
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; color: var(--text-dim);
  font-size: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.search-close:hover { background: rgba(255,255,255,.14); color: var(--text); }
.search-results {
  width: 100%; max-width: 640px; padding: 16px 20px 0; display: flex;
  flex-direction: column; gap: 6px;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: var(--text-dim);
  transition: border-color .15s, background .15s;
}
.search-result-item:hover { border-color: var(--border-lit); background: var(--surface-2); color: var(--text); }
.sr-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(99,102,241,.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--indigo); }
.sr-icon svg { flex-shrink: 0; }
.sr-title { font-size: 14px; font-weight: 700; color: var(--text); }
.sr-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.search-empty { text-align:center; padding:32px; color:var(--text-muted); font-size:14px; }

/* ── Architecture stack diagram ──────────────────────────────── */
.arch-stack {
  display: flex; flex-direction: column; gap: 0;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  max-width: 760px; margin: 0 auto;
}
.arch-layer {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: background .2s;
}
.arch-layer:last-child { border-bottom: none; }
.arch-layer:hover { background: rgba(255,255,255,.03); }
.arch-layer-glow {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.arch-layer-num { font-size: 10px; font-weight: 800; color: var(--text-muted); letter-spacing: .12em; width: 24px; flex-shrink: 0; }
.arch-layer-icon { flex-shrink: 0; width: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-dim); }
.arch-layer-body { flex: 1; }
.arch-layer-name { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.arch-layer-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.arch-layer-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.arch-tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid; font-weight: 600; letter-spacing: .04em; }

/* ── Data flow diagram ───────────────────────────────────────── */
.flow-diagram {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: nowrap; overflow-x: auto; padding: 8px 0;
}
.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px; min-width: 100px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); flex-shrink: 0;
  transition: border-color .2s;
}
.flow-node:hover { border-color: var(--border-lit); }
.flow-node-icon { font-size: 28px; }
.flow-node-name { font-size: 12px; font-weight: 700; }
.flow-node-sub  { font-size: 10px; color: var(--text-muted); }
.flow-arrow { display: flex; align-items: center; padding: 0 4px; flex-shrink: 0; }
.flow-arrow svg { color: var(--indigo); opacity: .7; }

/* ── Flywheel grid ───────────────────────────────────────────── */
.flywheel-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.flywheel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  position: relative; overflow: hidden;
}
.flywheel-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.flywheel-num { font-size: 48px; font-weight: 900; letter-spacing: -.05em; opacity: .15; line-height: 1; margin-bottom: 12px; }
.flywheel-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.flywheel-text  { font-size: 13px; color: var(--text-dim); line-height: 1.7; }

/* ── Shared nav & footer JS helpers ─────────────────────────── */
