/* ═══════════════════════════════════════════════════════════
   BioAnalysis.ca Documentation — Stylesheet
   Aesthetic: Scientific editorial — clean, authoritative, readable
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aaa;
  --accent: #0d9488;
  --accent-soft: #0d948815;
  --accent2: #7c3aed;
  --accent2-soft: #7c3aed12;
  --border: #e8e8e0;
  --border-strong: #d0d0c8;
  --code-bg: #f4f3ef;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 10px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 980px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Typography ═══ */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.2rem; margin-bottom: 10px; }
h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
p { color: var(--text-secondary); margin-bottom: 16px; }
strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--code-bg); padding: 2px 7px; border-radius: 4px; color: var(--accent2); }
.note { font-size: 0.9rem; color: var(--text-muted); border-left: 3px solid var(--accent); padding-left: 14px; margin-top: 16px; }

/* ═══ Top Bar ═══ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.88); backdrop-filter: blur(16px) saturate(1.8);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.logo {
  font-family: var(--font-display); font-size: 1.3rem; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.logo span { color: var(--accent); }
.topnav { display: flex; gap: 4px; }
.topnav a {
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none; transition: all 0.2s;
}
.topnav a:hover { background: var(--accent-soft); color: var(--accent); }
.topnav a.active { background: var(--accent); color: white; }

/* ═══ Hero ═══ */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0f4c4c 100%);
  padding: 80px 32px 64px; color: white;
}
.hero-inner { max-width: var(--max-w); margin: 0 auto; }
.hero-badge {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 20px;
}
.hero h1 { color: white; margin-bottom: 20px; }
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,0.65); max-width: 680px; line-height: 1.7; }
.hero-stats {
  display: flex; gap: 40px; margin-top: 40px; padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats .num { font-family: var(--font-display); font-size: 2rem; color: var(--accent); line-height: 1; }
.hero-stats .label { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; font-weight: 600; letter-spacing: 0.04em; }

/* ═══ Content ═══ */
.content {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 32px 80px;
}
.content > section { margin-bottom: 64px; }

/* ═══ TOC Grid ═══ */
.toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.toc-card {
  display: block; padding: 28px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; transition: all 0.25s;
  box-shadow: var(--shadow-sm);
}
.toc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); text-decoration: none; }
.toc-icon { font-size: 28px; margin-bottom: 12px; }
.toc-card h3 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 8px; }
.toc-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.55; }
.toc-link { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ═══ Why Grid ═══ */
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.why-card {
  padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.why-card h4 { color: var(--accent); margin-bottom: 8px; }
.why-card p { font-size: 0.9rem; margin-bottom: 0; }

/* ═══ Tables ═══ */
.doc-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.doc-table th { text-align: left; padding: 14px 18px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--code-bg); border-bottom: 2px solid var(--border); }
.doc-table td { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 0.92rem; color: var(--text-secondary); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: var(--accent-soft); }

/* ═══ Pipeline Flow ═══ */
.pipeline-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pipe-step { padding: 10px 16px; background: var(--accent-soft); border: 1px solid #0d948830; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.pipe-arrow { color: var(--text-muted); font-size: 16px; }

/* ═══ Info Box ═══ */
.info-box { padding: 20px 24px; border-radius: var(--radius); margin: 24px 0; }
.info-box.teal { background: #0d948808; border: 1px solid #0d948825; }
.info-box.violet { background: #7c3aed08; border: 1px solid #7c3aed20; }
.info-box.amber { background: #d9770608; border: 1px solid #d9770620; }
.info-box h4 { margin-bottom: 8px; }
.info-box p { font-size: 0.9rem; margin-bottom: 0; }
.info-box ul { margin: 8px 0 0 20px; font-size: 0.9rem; color: var(--text-secondary); }
.info-box li { margin-bottom: 4px; }

/* ═══ Spec Grid ═══ */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.spec-card { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.spec-card .val { font-family: var(--font-display); font-size: 1.8rem; color: var(--accent); line-height: 1; }
.spec-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-weight: 600; }

/* ═══ Footer ═══ */
.doc-footer { background: var(--text); padding: 40px 32px; text-align: center; }
.doc-footer .footer-inner { max-width: var(--max-w); margin: 0 auto; }
.doc-footer p { color: rgba(255,255,255,0.5); font-size: 13px; margin-bottom: 4px; }
.doc-footer .footer-sub { font-size: 11px; color: rgba(255,255,255,0.3); }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .topnav { display: none; }
  .hero { padding: 48px 20px 40px; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
  .content { padding: 32px 20px 60px; }
  .toc-grid, .why-grid { grid-template-columns: 1fr; }
  .pipeline-flow { flex-direction: column; }
  .pipe-arrow { transform: rotate(90deg); }
}

/* ═══ Print ═══ */
@media print {
  .topbar { display: none; }
  .hero { background: #1a1a2e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 11pt; }
  .content { max-width: 100%; padding: 20px; }
  .toc-card, .why-card { break-inside: avoid; }
}
