/*
 * Standalone stylesheet for the tier-3 landing page. No build step, no
 * framework, no external font/CDN request — approximates the dark
 * zinc/amber tokens used by the cruciam dashboard
 * (packages/cruciam-shared-ui/src/tokens/index.css in cruciam-jpy-demo,
 * read-only reference) in plain CSS, scoped to this page only.
 */

:root {
  --bg: #09090b;
  --surface: #0d0d10;
  --surface-2: #111114;
  --surface-3: #18181b;
  --border: #1f1f23;
  --border-strong: #27272a;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #d97706;
  --accent-text: #fbbf24;
  --success: #22c55e;
  --error: #ef4444;
  --radius-md: 6px;
  --radius-lg: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.loading,
.error-state {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

@media (max-width: 800px) {
  main {
    padding: 2rem 1rem 3rem;
  }
}

/* ---------- Site nav ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.site-nav-brand {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.site-nav-link {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--accent-text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.85rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- Hero ---------- */

header.hero {
  margin-bottom: 2.75rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

h1.title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 650;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.hero-line {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text);
  margin: 0 0 0.6rem;
  max-width: 62ch;
}

.sub-line {
  font-size: 0.98rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
  max-width: 68ch;
}

.corpus-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table.benchmark {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table.benchmark caption {
  text-align: left;
  padding: 0.9rem 1rem 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

table.benchmark th,
table.benchmark td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.benchmark thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

table.benchmark tbody tr.data-row:hover {
  background: var(--surface-2);
}

table.benchmark tbody tr.data-row:last-of-type td,
table.benchmark tbody tr.detail-row:last-of-type td {
  border-bottom: none;
}

.class-cell {
  white-space: nowrap;
}

.class-id {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-right: 0.4rem;
}

.class-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: normal;
  max-width: 16ch;
}

.arm-cell {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.verdict-cell {
  font-size: 0.85rem;
}

.verdict-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.verdict-badge.win {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.verdict-badge.bar-not-met {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.verdict-badge.neutral {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent-text);
  border: 1px solid rgba(217, 119, 6, 0.28);
}

.verdict-note {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.expand-toggle {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.expand-toggle:hover {
  background: #202024;
  color: var(--text);
}

.expand-toggle:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.expand-toggle .chevron {
  display: inline-block;
  transition: transform 0.15s ease;
  margin-left: 0.35rem;
}

.expand-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

tr.detail-row[hidden] {
  display: none;
}

tr.detail-row td {
  background: var(--surface-2);
  padding: 1.25rem 1.25rem 1.5rem;
}

/* ---------- Detail panel ---------- */

.detail-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0 0 1rem;
  max-width: 74ch;
}

.detail-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0 0 1rem;
  max-width: 74ch;
  font-style: italic;
}

.rep-question {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.rep-question .q-id {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.rep-question .q-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.rep-question .q-rule {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.arm-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 800px) {
  .arm-cards {
    grid-template-columns: 1fr;
  }
}

.arm-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.85rem 0.9rem;
}

.arm-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
}

.arm-card .score {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.arm-card .excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-wrap;
}

.arm-card details {
  margin-top: 0.5rem;
}

.arm-card summary {
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--accent-text);
}

.arm-card details[open] summary {
  margin-bottom: 0.4rem;
}

.arm-card .full-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin: 0;
}

.arm-card .meta {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.rerun-block {
  margin-bottom: 1rem;
}

.rerun-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
}

.rerun-list {
  display: grid;
  gap: 0.5rem;
}

.rerun-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ---------- Thesis / methodology / footer ---------- */

.thesis {
  margin: 2.5rem 0 1.5rem;
  padding: 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-size: 1.02rem;
  color: var(--text);
  max-width: 74ch;
}

footer.methodology {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}

footer.methodology p {
  margin: 0;
  max-width: 60ch;
}

footer.methodology a {
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}

footer.methodology a:hover {
  text-decoration: underline;
}
