/* Triangle V2 — verdict-first layout, auto dark mode */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #1a4d3e;
  --border: #e0e0e0;
  --blockquote-bg: #f4f1e8;
  --warning: #8b2525;
  --table-header-bg: #f0f0f0;
  --verdict-zero-bg: #1a1a1a;
  --verdict-zero-text: #e8e8e8;
  --verdict-zero-bar: #555;
  --verdict-low-bg: #3d0f0f;
  --verdict-low-text: #f0c0c0;
  --verdict-low-bar: #c0392b;
  --verdict-moderate-bg: #3d2c00;
  --verdict-moderate-text: #f5d97a;
  --verdict-moderate-bar: #d4a017;
  --verdict-high-bg: #0f2d1a;
  --verdict-high-text: #a8e6bc;
  --verdict-high-bar: #27ae60;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a1a;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --accent: #7fb894;
    --border: #333;
    --blockquote-bg: #232323;
    --warning: #d15a5a;
    --table-header-bg: #252525;
  }
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  line-height: 1.65;
  margin: 0;
  padding: 0;
}
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Nav */
nav { margin-bottom: 1.5rem; }
nav a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
nav a:hover { text-decoration: underline; }

/* Site header (index) */
.site-header { margin-bottom: 2.5rem; }
.site-header h1 { font-size: 2.5rem; margin: 0 0 0.4rem; letter-spacing: -0.03em; }
.tagline { font-size: 1.15rem; color: var(--muted); margin: 0 0 0.75rem; }
.methodology-note { font-size: 0.9rem; color: var(--muted); border-left: 3px solid var(--border); padding-left: 1rem; margin: 0; }
.meth-link { color: var(--accent); text-decoration: none; }
.meth-link:hover { text-decoration: underline; }

/* Thesis page header */
.thesis-header h1 { font-size: 2.25rem; line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.claim-summary { font-size: 1rem; color: var(--muted); margin: 0 0 0.5rem; }

/* h2/h3 */
h2 { font-size: 1.45rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-top: 1.75rem; margin-bottom: 0.5rem; }
p { margin: 0 0 1rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── VERDICT BADGE ── */
.verdict-badge {
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.verdict-zero     { background: var(--verdict-zero-bg);     color: var(--verdict-zero-text); }
.verdict-low      { background: var(--verdict-low-bg);      color: var(--verdict-low-text); }
.verdict-moderate { background: var(--verdict-moderate-bg); color: var(--verdict-moderate-text); }
.verdict-high     { background: var(--verdict-high-bg);     color: var(--verdict-high-text); }

.verdict-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.verdict-label { font-weight: 700; font-size: 1rem; letter-spacing: 0.04em; }
.verdict-score { font-size: 1.25rem; font-weight: 700; }

.verdict-meter { display: flex; gap: 3px; margin-bottom: 0.75rem; }
.verdict-meter .bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
}
.verdict-zero .bar.filled     { background: var(--verdict-zero-bar); }
.verdict-low .bar.filled      { background: var(--verdict-low-bar); }
.verdict-moderate .bar.filled { background: var(--verdict-moderate-bar); }
.verdict-high .bar.filled     { background: var(--verdict-high-bar); }

.verdict-answer { font-size: 1rem; line-height: 1.5; margin: 0 0 0.75rem; font-style: italic; }
.verdict-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.verdict-tags .tag, .card-tags .tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  letter-spacing: 0.02em;
}
.thesis-card .tag { background: rgba(0,0,0,0.08); color: var(--muted); }

/* ── AUDIO PLAYER ── */
.audio-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.audio-label { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.5rem; }
.audio-tabs { display: flex; gap: 8px; margin-bottom: 0.5rem; }
.audio-tab {
  font-size: 0.8rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.audio-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.audio-player .meta { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }

/* ── INDEX FILTERS ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
  align-items: center;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-label { font-size: 0.8rem; color: var(--muted); margin-right: 2px; }
.filter-btn {
  font-size: 0.8rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.reset-btn { color: var(--muted); }

/* ── SEARCH ── */
.search-wrap { margin-bottom: 1.5rem; }
#search {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
#search:focus { border-color: var(--accent); }

/* ── THESIS GRID (index) ── */
.thesis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.thesis-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
  border: 1px solid transparent;
}
.thesis-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.thesis-card.verdict-zero     { background: #1f1f1f; color: #e0e0e0; }
.thesis-card.verdict-low      { background: #2d1010; color: #f0c0c0; }
.thesis-card.verdict-moderate { background: #2a1e00; color: #f5d97a; }
.thesis-card.verdict-high     { background: #0d2215; color: #a8e6bc; }

@media (prefers-color-scheme: light) {
  .thesis-card.verdict-zero     { background: #f0f0f0; color: #1a1a1a; }
  .thesis-card.verdict-low      { background: #fdf0f0; color: #5a1a1a; }
  .thesis-card.verdict-moderate { background: #fdf8e8; color: #4a3300; }
  .thesis-card.verdict-high     { background: #edf8f0; color: #0d3a1f; }
}

.card-verdict { display: flex; justify-content: space-between; align-items: center; }
.card-verdict-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; }
.card-score { font-size: 1rem; font-weight: 700; }
.card-meter { display: flex; gap: 2px; }
.card-meter .bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.1); }
.verdict-zero .card-meter .bar.filled, .thesis-card.verdict-zero .bar.filled     { background: #666; }
.verdict-low .card-meter .bar.filled, .thesis-card.verdict-low .bar.filled       { background: #c0392b; }
.verdict-moderate .card-meter .bar.filled, .thesis-card.verdict-moderate .bar.filled { background: #d4a017; }
.verdict-high .card-meter .bar.filled, .thesis-card.verdict-high .bar.filled     { background: #27ae60; }

.card-title { font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.card-answer { font-size: 0.85rem; opacity: 0.85; margin: 0; line-height: 1.45; font-style: italic; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.25rem; }

.no-results { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ── THESIS BODY ── */
.thesis-body { margin-top: 0.5rem; }
.thesis-body ul, .thesis-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.thesis-body li { margin-bottom: 0.3rem; }

blockquote {
  background: var(--blockquote-bg);
  border-left: 4px solid var(--accent);
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}
blockquote p { margin: 0; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
th { background: var(--table-header-bg); text-align: left; padding: 0.5rem 0.75rem; border: 1px solid var(--border); }
td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); vertical-align: top; }

/* ── META / FOOTER ── */
.meta { font-size: 0.82rem; color: var(--muted); margin: 0 0 1rem; }
footer { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.disclaimer { font-size: 0.82rem; color: var(--muted); }
a { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  html { font-size: 16px; }
  .thesis-grid { grid-template-columns: 1fr; }
}
