/* ═══════════════════════════════════════════════
   MILLIGRAM — COMPOUND PAGE STYLES
   Shared across all /compounds/[name]/ pages.
   Dark theme: #0A0A0F bg, #00FF88 green accent.
   ═══════════════════════════════════════════════ */

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

:root {
  --bg: #0A0A0F;
  --surface: #111118;
  --elevated: #1A1A26;
  --border: rgba(255,255,255,0.06);
  --green: #00FF88;
  --green-dim: rgba(0,255,136,0.08);
  --green-glow: rgba(0,255,136,0.15);
  --green-subtle: rgba(0,255,136,0.04);
  --blue: #60A5FA;
  --purple: #A78BFA;
  --orange: #FB923C;
  --red: #F87171;
  --text: #F0F0F8;
  --text-secondary: #A0A0BC;
  --muted: #5C5C78;
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── NAV (styles in /css/nav.css) ─── */

/* ─── LAYOUT ─── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── BREADCRUMBS ─── */
.breadcrumbs {
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs span { margin: 0 6px; }

/* ─── HERO ─── */
.compound-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.compound-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-dim);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.compound-hero h1 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 12px;
}

.compound-hero .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 600px;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 32px 0 48px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ─── SECTIONS ─── */
.content-section {
  margin-bottom: 48px;
}

.content-section h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.content-section h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 24px 0 12px;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.75;
}

.content-section ul, .content-section ol {
  color: var(--text-secondary);
  margin: 0 0 16px 20px;
  line-height: 1.75;
}

.content-section li { margin-bottom: 6px; }

/* ─── INFO CARDS ─── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.info-card h4 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.info-card.green-accent {
  border-left: 3px solid var(--green);
}

.info-card.blue-accent {
  border-left: 3px solid var(--blue);
}

.info-card.orange-accent {
  border-left: 3px solid var(--orange);
}

/* ─── DATA TABLE ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.data-table .highlight { color: var(--green); font-weight: 600; }

/* ─── DOSING PROTOCOL ─── */
.protocol-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.protocol-header {
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

.protocol-body {
  padding: 20px;
}

.protocol-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.protocol-row:last-child { border-bottom: none; }

.protocol-label { color: var(--muted); }
.protocol-value { color: var(--text); font-weight: 500; }

/* ─── RECONSTITUTION STEPS ─── */
.recon-steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recon-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.recon-step:last-child { border-bottom: none; }

.step-number {
  counter-increment: step;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--green-dim);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ─── FAQ ─── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-answer {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

/* ─── CTA BANNER ─── */
.cta-banner {
  background: linear-gradient(135deg, rgba(0,255,136,0.08), rgba(0,255,136,0.02));
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin: 56px 0 48px;
}

.cta-banner h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  border: none;
  padding: 0;
}

.cta-banner p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(0,255,136,0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-button:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 32px rgba(0,255,136,0.25);
  text-decoration: none;
}

.cta-button svg { width: 16px; height: 16px; fill: #000; }

/* ─── RELATED COMPOUNDS ─── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.related-card:hover {
  border-color: rgba(0,255,136,0.2);
  background: var(--elevated);
  text-decoration: none;
}

.related-card h4 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.related-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ─── FOOTER (styles in /css/nav.css) ─── */

/* ─── EVIDENCE BADGE ─── */
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.evidence-strong {
  color: var(--green);
  background: var(--green-dim);
}

.evidence-moderate {
  color: var(--blue);
  background: rgba(96,165,250,0.1);
}

.evidence-emerging {
  color: var(--orange);
  background: rgba(251,146,60,0.1);
}

/* ─── SCROLL REVEAL ─── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .compound-hero h1 { font-size: 32px; }
  .cta-banner { padding: 32px 20px; }
  .cta-banner h2 { font-size: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .protocol-row { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
}
