/* ═══════════════════════════════════════════════════════════
   FairMind DNA — Site Theme
   Based on JiffySync dark UI pattern
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom Scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }

:root {
  --bg: #0a0a0c;
  --surface: #111116;
  --surface2: #1a1a20;
  --surface3: #222228;
  --border: #2a2a32;
  --border-light: #3a3a44;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --gold: #f59e0b;
  --gold-dim: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --purple: #a855f7;
  --purple-dim: rgba(168, 85, 247, 0.15);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Montserrat', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; }

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .dna { color: var(--accent); }
.nav-logo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--surface2);
}

/* ── Hero ── */
.hero {
  padding: 100px 24px 72px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(59,130,246,0.08) 0%, transparent 70%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(59,130,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 20px;
  position: relative;
}

.hero h1 .accent {
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 40px;
  line-height: 1.6;
  font-weight: 400;
}

.hero .stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  font-family: var(--mono);
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
  font-weight: 600;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Section Headers ── */
.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03);
  transform: translateY(-1px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.card .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag-physics { background: var(--cyan-dim); color: var(--cyan); }
.tag-cognition { background: var(--purple-dim); color: var(--purple); }
.tag-value { background: var(--gold-dim); color: var(--gold); }
.tag-rights { background: var(--green-dim); color: var(--green); }
.tag-evidence { background: var(--red-dim); color: var(--red); }
.tag-ai { background: var(--accent-glow); color: var(--accent); }
.tag-author { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Benchmark Table ── */
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.bench-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 56px;
  z-index: 10;
}

.bench-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.bench-table tr:hover td {
  background: var(--surface2);
}

.bench-table .model-name {
  font-weight: 700;
  color: var(--text);
}

.bench-table .score {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
}

.bench-table .total {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 16px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 14px;
  font-family: var(--mono);
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}

.grade-A { background: var(--green-dim); color: var(--green); box-shadow: 0 0 16px rgba(34,197,94,0.15); }
.grade-B { background: var(--gold-dim); color: var(--gold); box-shadow: 0 0 16px rgba(245,158,11,0.15); }
.grade-C { background: var(--red-dim); color: var(--red); }
.grade-D { background: var(--red-dim); color: var(--red); }
.grade-F { background: rgba(239,68,68,0.25); color: var(--red); }

/* ── Score Bar ── */
.score-bar {
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.fill-green { background: var(--green); }
.fill-gold { background: var(--gold); }
.fill-red { background: var(--red); }
.fill-accent { background: var(--accent); }

/* ── Markdown Content ── */
.md-content {
  font-size: 15px;
  line-height: 1.7;
}

.md-content h1 { font-size: 28px; font-weight: 800; margin: 40px 0 16px; letter-spacing: -0.03em; }
.md-content h2 { font-size: 22px; font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.02em; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.md-content h3 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.md-content p { margin-bottom: 12px; color: var(--text); }
.md-content ul, .md-content ol { margin: 0 0 12px 24px; }
.md-content li { margin-bottom: 4px; }
.md-content strong { color: var(--text); font-weight: 700; }

.md-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

.md-content pre {
  background: #0d0d10;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.md-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.md-content th, .md-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.md-content th {
  background: var(--surface);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.md-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--accent-glow);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-style: italic;
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Downloads ── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.file-item:hover { border-color: var(--border-light); }

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 14px; }
.file-desc { font-size: 12px; color: var(--text-muted); }
.file-size { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 12px rgba(59,130,246,0.25);
}

.btn-primary:hover { background: linear-gradient(135deg, #60a5fa, #3b82f6); opacity: 1; box-shadow: 0 4px 20px rgba(59,130,246,0.35); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: var(--border-light); }

/* ── Footer ── */
.footer {
  border-top: 1px solid rgba(255,255,255,0.03);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── KaTeX overrides ── */
.katex { font-size: 1.05em; }
.md-content .katex { color: var(--cyan); }

/* Hide scrollbar UI but allow content to render */
.katex-display {
  margin: 16px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.katex-display::-webkit-scrollbar { display: none; }

.eq-card { scrollbar-width: none; -ms-overflow-style: none; }
.eq-card::-webkit-scrollbar { display: none; }
.eq-card .katex-display { scrollbar-width: none; -ms-overflow-style: none; }
.eq-card .katex-display::-webkit-scrollbar { display: none; }
.eq-latex, .eq-chain { scrollbar-width: none; -ms-overflow-style: none; }
.eq-latex::-webkit-scrollbar, .eq-chain::-webkit-scrollbar { display: none; }

/* ── Equation Cards ── */
.eq-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all 0.25s ease;
}

.eq-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03);
}

.eq-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(59,130,246,0.1);
}

.eq-body {
  flex: 1;
  min-width: 0;
}

.eq-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.eq-name code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface3);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--cyan);
}

.eq-latex {
  margin: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.eq-latex .katex-display {
  margin: 0;
}

.eq-latex .katex,
.eq-chain .katex {
  color: var(--text) !important;
  font-size: 1.4em;
}

.eq-chain {
  margin: 4px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.eq-chain .katex-display {
  margin: 0;
}

.eq-chain .katex {
  font-size: 1em;
  color: var(--text-muted) !important;
}

.eq-result {
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .eq-card { flex-direction: column; padding: 20px; }
  .eq-num { width: 32px; height: 32px; font-size: 14px; }
}

.footer a { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 10px; font-size: 12px; }
  .hero { padding: 48px 16px 40px; }
  .container { padding: 32px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .bench-table { font-size: 12px; }
  .bench-table th, .bench-table td { padding: 8px; }
}

/* ── Rank Badge ── */
.rank {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dim);
}

.rank-1 { color: var(--gold); }
.rank-2 { color: var(--text-muted); }
.rank-3 { color: #cd7f32; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Radar Chart Canvas ── */
.chart-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}
