/* Light, minimal, Apple-inspired. System (SF) typography, generous whitespace,
   hairline dividers, restrained color. No gradients or glows. */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;      /* Apple section gray */
  --card: #ffffff;
  --card-2: #fbfbfd;
  --line: #d2d2d7;         /* Apple hairline */
  --line-soft: #e8e8ed;
  --text: #1d1d1f;         /* near-black */
  --muted: #6e6e73;        /* secondary label */
  --accent: #0071e3;       /* Apple blue */
  --accent-soft: #eef4ff;
  --link: #0066cc;
  --good: #1d8a45;
  --bad: #c9302c;
  --warn: #a15c00;
  --perceptual: #00808c;
  --inferential: #0071e3;
  --affective: #8944ab;
  --contextual: #b35a1a;
  --radius: 18px;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.47;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 600; letter-spacing: -.022em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { padding-top: 20px; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  font-size: 22px; line-height: 1; color: var(--text);
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  background: var(--bg-soft); border-radius: 9px;
}
.brand h1 { font-size: 21px; font-weight: 600; }
.tagline { margin: 3px 0 0; color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }

.tabs { display: flex; gap: 4px; margin-top: 18px; }
.tab {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  font: 500 14px/1 inherit; font-family: inherit;
  padding: 12px 4px; margin-right: 20px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* Panels */
main.wrap { padding-top: 44px; padding-bottom: 80px; }
.panel { display: none; animation: fade .3s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-intro { margin-bottom: 34px; max-width: 720px; }
.section-intro h2 { font-size: 40px; font-weight: 600; letter-spacing: -.03em; }
.section-intro p { color: var(--muted); margin: 14px 0 0; font-size: 17px; }
.section-intro strong { color: var(--text); font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 48px 0 16px; }

/* Overview cards */
.ov-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ov-card {
  background: var(--bg-soft);
  border: 0; border-radius: var(--radius);
  padding: 26px;
}
.ov-card h3 { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.ov-card .model-dot { width: 9px; height: 9px; border-radius: 50%; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; margin-top: 22px; }
.metric .val { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.metric .lab { font-size: 13px; color: var(--muted); margin-top: 4px; }
.metric.gap .val { color: var(--warn); }
.metric.halluc .val { color: var(--bad); }
.bar { height: 6px; border-radius: 4px; background: rgba(0,0,0,.08); margin-top: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.data-table thead th { background: var(--bg-soft); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--card-2); }
.data-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.data-table .cat-cell { font-weight: 600; }
.group-head td { background: var(--bg-soft); font-weight: 600; color: var(--text); }

/* Pills / badges */
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; letter-spacing: 0; }
.pill.perceptual { color: var(--perceptual); background: rgba(0,128,140,.10); border-color: rgba(0,128,140,.22); }
.pill.inferential { color: var(--inferential); background: rgba(0,113,227,.10); border-color: rgba(0,113,227,.22); }
.pill.affective { color: var(--affective); background: rgba(137,68,171,.10); border-color: rgba(137,68,171,.22); }
.pill.contextual { color: var(--contextual); background: rgba(179,90,26,.10); border-color: rgba(179,90,26,.22); }
.legend { color: var(--muted); font-size: 14px; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 26px; }
.controls label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.controls input[type=search], .controls select, #model-select {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 13px; font: 400 15px inherit; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.controls input[type=search]:focus, .controls select:focus, #model-select:focus {
  outline: none; background: var(--card); border-color: var(--accent);
}
.controls input[type=search] { flex: 1; min-width: 220px; align-self: stretch; margin-top: 17px; }
.controls select { cursor: pointer; }
.count { margin-left: auto; color: var(--muted); font-size: 14px; align-self: end; }

/* Question cards */
.cards { display: grid; gap: 18px; }
.qcard {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.qcard-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.qcard .qtext { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.02em; }
.qmeta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 16px; align-items: center; }
.qmeta .tag { font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 0; padding: 3px 9px; border-radius: 7px; }
.qid { font-size: 11px; color: var(--muted); font-family: "SF Mono", ui-monospace, monospace; }

audio { width: 100%; height: 36px; margin: 6px 0 14px; }
.no-audio { font-size: 13px; color: var(--muted); font-style: italic; margin: 6px 0 14px; }

.answer-block { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.ref { font-size: 15px; margin: 0 0 12px; }
.ref b { color: var(--muted); font-weight: 600; }
.model-picker { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; }
.model-picker select { background: var(--bg-soft); color: var(--text); border: 1px solid transparent; border-radius: 9px; padding: 7px 11px; font: 600 13px inherit; cursor: pointer; }

.ans-grid { display: grid; grid-template-columns: 84px 1fr; gap: 10px 16px; align-items: start; font-size: 15px; }
.ans-grid .k { color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 2px; }
.ans-grid .v { margin: 0; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.ok { color: var(--good); } .no { color: var(--bad); }
.halluc-flag { color: var(--bad); font-size: 13px; font-weight: 600; }
.rationale { color: var(--muted); font-size: 14px; font-style: italic; margin: 8px 0 0; }
.score-chip { font-variant-numeric: tabular-nums; font-weight: 600; padding: 2px 9px; border-radius: 7px; font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 72px 0; font-size: 17px; }

/* Prompts */
.prompts { display: grid; gap: 14px; }
.prompt-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.prompt-head { padding: 20px 24px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.prompt-head:hover { background: var(--card-2); }
.prompt-head h3 { font-size: 17px; font-weight: 600; }
.prompt-head .purpose { color: var(--muted); font-size: 14px; margin: 6px 0 0; font-weight: 400; letter-spacing: 0; }
.prompt-head .chev { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.prompt-card.open .chev { transform: rotate(90deg); }
.prompt-body { display: none; border-top: 1px solid var(--line-soft); }
.prompt-card.open .prompt-body { display: block; }
.prompt-body pre { margin: 0; padding: 22px 24px; overflow-x: auto; font-family: "SF Mono", ui-monospace, monospace; font-size: 13px; color: #333336; background: var(--bg-soft); white-space: pre-wrap; word-break: break-word; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 56px; padding: 28px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }

@media (max-width: 620px) {
  .section-intro h2 { font-size: 30px; }
  .brand h1 { font-size: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .ans-grid { grid-template-columns: 1fr; gap: 3px; }
  .ans-grid .k { padding-top: 10px; }
  .count { width: 100%; margin-left: 0; }
}
