:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --fg: #1a1a1a;
  --fg-muted: #666666;
  --border: #e0e0e0;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #ca8a04;
  --yellow-bg: #fef9c3;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --bg-alt: #1a1a1a;
    --fg: #e5e5e5;
    --fg-muted: #999999;
    --border: #333333;
    --accent: #60a5fa;
    --accent-light: #1e3a5f;
    --green: #4ade80;
    --green-bg: #14532d;
    --yellow: #facc15;
    --yellow-bg: #422006;
    --red: #f87171;
    --red-bg: #450a0a;
    --card-bg: #1e1e1e;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 1rem; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }

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

p { margin-bottom: 1rem; }

.subtitle { color: var(--fg-muted); font-size: 1.1rem; margin-bottom: 1.5rem; }

.links { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.links a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.links a:hover { background: var(--bg-alt); text-decoration: none; }

/* Key metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.metric .value { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.metric .label { font-size: 0.85rem; color: var(--fg-muted); }

/* Voice cards */
.voice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.voice-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}
.voice-card .name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.voice-card .desc { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.voice-card .wer { font-size: 0.85rem; margin-bottom: 0.75rem; }
.voice-card audio { width: 100%; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
th { background: var(--bg-alt); font-weight: 600; }
tr:hover { background: var(--bg-alt); }

/* WER color coding */
.wer-good { background: var(--green-bg); color: var(--green); font-weight: 600; }
.wer-ok { background: var(--yellow-bg); color: var(--yellow); font-weight: 600; }
.wer-bad { background: var(--red-bg); color: var(--red); font-weight: 600; }

/* Details/summary for collapsible sections */
details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: var(--card-bg);
}
details summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
details summary:hover { background: var(--bg-alt); border-radius: 8px; }
details[open] summary { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; }
details .content { padding: 1rem; overflow-x: auto; }

/* Audio in tables */
td audio { width: 200px; height: 32px; }

/* Method section */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) { .method-grid { grid-template-columns: 1fr; } }

.method-card {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 1rem;
}
.method-card h4 { margin-bottom: 0.5rem; }

code {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.85rem;
}
footer a { color: var(--fg-muted); }
