/* ============================================================
   QuantAimLabs — Design System
   ============================================================ */

:root {
  --bg: #07090d;
  --bg-elev: #0d1117;
  --bg-soft: #11161f;
  --surface: #141a24;
  --line: #1f2733;
  --line-strong: #2a3445;
  --text: #e6edf3;
  --text-dim: #9aa7b8;
  --text-mute: #6b7689;
  --brand: #5cf2c9;
  --brand-2: #7c8cff;
  --brand-3: #c084fc;
  --warn: #ffb86b;
  --danger: #ff6b8b;
  --good: #5cf2c9;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 0 rgba(255,255,255,0.04), 0 4px 12px rgba(0,0,0,0.25);
  --shadow: 0 1px 0 rgba(255,255,255,0.05), 0 12px 40px rgba(0,0,0,0.45);
  --shadow-lg: 0 1px 0 rgba(255,255,255,0.06), 0 30px 80px rgba(0,0,0,0.55);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: "Inter", system-ui, sans-serif;

  --container: 1200px;
  --container-narrow: 880px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1200px 600px at 80% -200px, rgba(124,140,255,0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(92,242,201,0.08), transparent 60%);
  background-attachment: fixed;
}

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--text); }

::selection { background: rgba(92,242,201,0.25); color: var(--text); }

/* --------- Typography --------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); letter-spacing: -0.028em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; color: var(--text-dim); }
p strong, li strong { color: var(--text); font-weight: 600; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 6px 10px;
  border: 1px solid rgba(92,242,201,0.25);
  border-radius: 999px;
  background: rgba(92,242,201,0.06);
}
.eyebrow.violet {
  color: var(--brand-3);
  border-color: rgba(192,132,252,0.3);
  background: rgba(192,132,252,0.06);
}
.eyebrow.indigo {
  color: var(--brand-2);
  border-color: rgba(124,140,255,0.3);
  background: rgba(124,140,255,0.06);
}

.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 65ch; }

code, kbd, pre, samp { font-family: var(--font-mono); }
code:not(pre code) {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--text);
}
pre {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* --------- Layout --------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

section { padding: 96px 0; }
section.tight { padding: 64px 0; }
section.loose { padding: 128px 0; }

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; gap: 16px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

/* --------- Navigation --------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7,9,13,0.7);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, var(--brand) 0%, transparent 55%),
    radial-gradient(circle at 70% 70%, var(--brand-2) 0%, transparent 55%),
    var(--bg-elev);
  border: 1px solid var(--line-strong);
  display: inline-block;
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 6px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.93rem;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); }
.nav-cta-group { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav-cta-group .btn-ghost { display: none; }
}

/* --------- Buttons --------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: #06231b;
  border-color: var(--brand);
}
.btn-primary:hover { background: #7df8d6; color: #06231b; }
.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: #3a4658; color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-lg { padding: 15px 24px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

.arrow::after { content: "→"; transition: transform 0.18s ease; }
.arrow:hover::after { transform: translateX(3px); }

/* --------- Cards --------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }
.card-link:hover .card-title { color: var(--brand); }

.card-title { font-size: 1.15rem; margin-bottom: 8px; }
.card-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.feature-card {
  position: relative;
  overflow: hidden;
}
.feature-card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(92,242,201,0.08);
  border: 1px solid rgba(92,242,201,0.18);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
}
.feature-card.violet .icon { color: var(--brand-3); background: rgba(192,132,252,0.08); border-color: rgba(192,132,252,0.2); }
.feature-card.indigo .icon { color: var(--brand-2); background: rgba(124,140,255,0.08); border-color: rgba(124,140,255,0.2); }

/* --------- Hero --------- */
.hero {
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255,255,255,0.04) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.04) 95%);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-content { position: relative; }
.hero h1 {
  background: linear-gradient(180deg, #ffffff 0%, #c8d4e3 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: 1.2rem; max-width: 640px; margin-top: 12px; }
.hero .actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 36px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}
.hero-meta span::before { content: "▸ "; color: var(--brand); margin-right: 4px; }

/* --------- Marquee / logos --------- */
.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* --------- Footer --------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  margin-top: 96px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: var(--text-dim); font-size: 0.93rem; }
.footer ul a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* --------- Stats --------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------- Forms --------- */
input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  background: var(--bg-elev);
}
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}
.form-row { margin-bottom: 18px; }
.form-help { font-size: 0.82rem; color: var(--text-mute); margin-top: 6px; }

/* --------- Quiz / Tool widgets --------- */
.tool-shell {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow);
}
@media (max-width: 700px) { .tool-shell { padding: 24px; } }

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 10px;
}
.option:hover { border-color: var(--brand); }
.option input { width: auto; margin-top: 4px; accent-color: var(--brand); }
.option.selected { border-color: var(--brand); background: rgba(92,242,201,0.06); }
.option-text { flex: 1; }
.option-text strong { display: block; color: var(--text); }
.option-text span { color: var(--text-dim); font-size: 0.88rem; }

.progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  width: 0%;
  transition: width 0.35s ease;
}

.score-ring {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--score) * 1%), rgba(255,255,255,0.06) 0);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}
.score-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--bg-elev);
}
.score-ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}
.score-num {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text);
}
.score-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* --------- Result tiers --------- */
.tier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier.low { background: rgba(255,107,139,0.1); color: var(--danger); border: 1px solid rgba(255,107,139,0.3); }
.tier.mid { background: rgba(255,184,107,0.1); color: var(--warn); border: 1px solid rgba(255,184,107,0.3); }
.tier.high { background: rgba(92,242,201,0.1); color: var(--good); border: 1px solid rgba(92,242,201,0.3); }

/* --------- Article / blog --------- */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.article h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 18px; }
.article h2 { font-size: 1.5rem; margin: 48px 0 16px; }
.article h3 { font-size: 1.2rem; margin: 32px 0 12px; }
.article p, .article li { font-size: 1.05rem; line-height: 1.75; color: var(--text-dim); }
.article p strong, .article li strong { color: var(--text); }
.article ul, .article ol { padding-left: 1.5em; }
.article li { margin-bottom: 8px; }
.article blockquote {
  border-left: 3px solid var(--brand);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  color: var(--text);
  font-style: italic;
}
.article hr { border: none; border-top: 1px solid var(--line); margin: 48px 0; }

.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 32px;
}
.article-meta span + span::before { content: "·"; margin-right: 16px; color: var(--line-strong); }

/* --------- Util --------- */
.divider { height: 1px; background: var(--line); margin: 48px 0; }
.text-center { text-align: center; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }

.gradient-text {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 60%, var(--brand-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--text);
}

.banner {
  background: linear-gradient(120deg, rgba(92,242,201,0.08), rgba(124,140,255,0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* fade in on scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
