:root {
  --ink: #17212d;
  --muted: #657382;
  --faint: #8d99a6;
  --line: #d9e1e8;
  --line-strong: #bdcad6;
  --paper: #ffffff;
  --wash: #f6f9fb;
  --blue: #123f63;
  --blue-2: #1d628f;
  --blue-soft: #e9f2f8;
  --gold: #9a6b19;
  --gold-soft: #fff7e7;
  --green: #277252;
  --green-soft: #eaf6f0;
  --red: #a13b3b;
  --shadow: 0 16px 44px rgba(27, 48, 65, 0.08);
  --content: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--blue); }
button, input, select { font: inherit; }
code { overflow-wrap: anywhere; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper);
  border: 2px solid var(--blue);
}
.skip-link:focus { top: 12px; }

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(28px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--blue);
  color: white;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .03em;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.pilot-badge, .status-pill, .kind-pill, .id-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}
.pilot-badge { background: var(--blue-soft); color: var(--blue); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  border-radius: 9px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--blue-soft); }

main { min-height: calc(100vh - 150px); }
.page { width: min(var(--content), calc(100% - 48px)); margin: 0 auto; padding: 64px 0 88px; }
.page.narrow { max-width: 960px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue-2);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(40px, 6vw, 70px); margin-bottom: 24px; }
h2 { font-size: clamp(27px, 3.5vw, 40px); margin-bottom: 18px; }
h3 { font-size: 21px; margin-bottom: 10px; }
p { margin-top: 0; }

.hero { max-width: 940px; margin-bottom: 46px; }
.hero p { max-width: 800px; color: var(--muted); font-size: clamp(18px, 2vw, 23px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  border: 1px solid var(--blue);
  border-radius: 9px;
  background: var(--blue);
  color: white;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}
.button:hover { color: white; background: #0b3454; }
.button.secondary { color: var(--blue); background: white; border-color: var(--line-strong); }
.button.secondary:hover { background: var(--blue-soft); }

.notice {
  display: flex;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid #e7d5ad;
  border-radius: 10px;
  color: #6b511d;
  background: var(--gold-soft);
  margin: 22px 0 36px;
}
.notice strong { color: #503b12; }
.notice-icon { font-weight: 900; }

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  margin: 0 0 44px;
  overflow: hidden;
}
.metric { padding: 22px 24px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-value { display: block; font-size: 30px; line-height: 1.1; font-weight: 760; letter-spacing: -.03em; }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 650; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 46px 0 18px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading p { margin: 0; color: var(--muted); }

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  margin-bottom: 18px;
}
.search-input, .filter-select {
  min-height: 46px;
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 13px;
  outline: none;
}
.search-input:focus, .filter-select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px var(--blue-soft); }

.view-tabs, .record-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab-button {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  padding: 12px 14px 10px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}
.tab-button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tab-count { margin-left: 5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.paper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.paper-card, .object-row, .content-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}
.paper-card { padding: 22px; display: flex; flex-direction: column; min-height: 300px; }
.paper-card:hover, .object-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.paper-card h3 { font-size: 22px; }
.paper-card .preview { color: var(--muted); font-size: 14px; flex: 1; }
.paper-meta, .object-meta, .meta-line { color: var(--muted); font-size: 13px; }
.card-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.count-chip { padding: 4px 8px; border-radius: 6px; background: var(--wash); color: var(--muted); font-size: 12px; font-weight: 650; }

.object-list { display: grid; gap: 8px; }
.object-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 15px 17px; }
.object-row h3 { margin: 3px 0 4px; font-size: 18px; letter-spacing: -.02em; }
.object-counts { text-align: right; color: var(--muted); font-size: 13px; }
.kind-pill { background: var(--blue-soft); color: var(--blue); text-transform: capitalize; }
.status-pill.candidate { color: #735319; background: var(--gold-soft); }
.status-pill.accepted { color: var(--green); background: var(--green-soft); }
.id-badge { color: var(--blue); background: var(--blue-soft); }

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 34px 0;
}
.pipeline-step { min-height: 94px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.pipeline-step strong { display: block; margin-bottom: 4px; }
.pipeline-step span { color: var(--muted); font-size: 13px; }
.pipeline-arrow { color: var(--faint); font-size: 20px; }

.paper-header { margin-bottom: 36px; }
.paper-header h1 { font-size: clamp(35px, 5vw, 58px); max-width: 1050px; }
.byline { max-width: 960px; color: var(--muted); font-size: 17px; }
.source-line { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }

.record-browser {
  display: grid;
  grid-template-columns: minmax(270px, .38fr) minmax(0, .62fr);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  overflow: hidden;
}
.record-list { max-height: 690px; overflow-y: auto; border-right: 1px solid var(--line); }
.record-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px;
  cursor: pointer;
}
.record-choice:hover { background: var(--wash); }
.record-choice[aria-selected="true"] { background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.record-number { color: var(--faint); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.record-choice-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.record-detail { padding: clamp(22px, 4vw, 42px); max-height: 690px; overflow-y: auto; }
.record-detail .statement-text { font-size: 21px; line-height: 1.5; }
.detail-section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 28px; }
.detail-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.evidence-block {
  margin: 10px 0 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--line-strong);
  background: var(--wash);
  color: #354352;
}
.evidence-block blockquote { margin: 0; }
.evidence-meta { margin-top: 9px; color: var(--muted); font-size: 12px; }
.reference-list { display: flex; flex-wrap: wrap; gap: 7px; }
.reference-link { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 13px; }
.support-list { padding-left: 22px; }
.support-list li { margin: 8px 0; }

.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.figure-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; }
.figure-card img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: white; }
.figure-card figcaption { padding: 15px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.object-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: start; margin-bottom: 38px; }
.object-header h1 { margin-bottom: 14px; }
.object-summary { text-align: right; color: var(--muted); }
.object-summary strong { display: block; color: var(--ink); font-size: 26px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.content-card { min-width: 0; padding: 22px; }
.appearance-list, .simple-list { list-style: none; margin: 0; padding: 0; }
.appearance-list li, .simple-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.appearance-list li:last-child, .simple-list li:last-child { border-bottom: 0; }

.metrics-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 38px; align-items: end; margin-bottom: 42px; }
.metrics-hero h1 { margin-bottom: 16px; }
.gate-card { min-width: 220px; padding: 20px; border: 1px solid #bbdacb; border-radius: 13px; background: var(--green-soft); }
.gate-card strong { display: block; color: var(--green); font-size: 34px; }
.gate-card span { color: #416b58; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.metric-card strong { display: block; margin: 4px 0; font-size: 29px; letter-spacing: -.03em; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card .metric-context { margin-top: 7px; color: var(--faint); font-size: 12px; }

.chart { display: grid; gap: 15px; margin: 22px 0; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 74px; gap: 12px; align-items: center; }
.bar-label { font-size: 13px; color: var(--muted); }
.bar-track { height: 12px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--blue-2); }
.bar-value { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.data-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); }
.data-table th, .data-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; border-radius: 11px; }

.code-block { position: relative; margin: 15px 0; padding: 18px; overflow-x: auto; border-radius: 10px; background: #14202b; color: #eaf2f7; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.schema-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.schema-record { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.schema-record strong { display: block; margin-bottom: 4px; }
.schema-record span { color: var(--muted); font-size: 13px; }

.empty-state, .loading-state, .error-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.loading-state { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 50vh; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .paper-grid, .metric-grid { grid-template-columns: 1fr; }
  .metrics-strip { grid-template-columns: repeat(2,1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-arrow { transform: rotate(90deg); text-align: center; }
  .metrics-hero, .object-header { grid-template-columns: 1fr; }
  .object-summary { text-align: left; }
  .schema-grid { grid-template-columns: repeat(2,1fr); }
  .record-browser { grid-template-columns: 1fr; }
  .record-list { max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .record-detail { max-height: none; }
}

@media (max-width: 720px) {
  .site-header { align-items: flex-start; padding: 12px 18px; }
  .brand-name, .pilot-badge { display: none; }
  .site-nav a { padding: 10px 9px; font-size: 14px; }
  .page { width: min(100% - 28px, var(--content)); padding-top: 42px; }
  .search-panel { grid-template-columns: 1fr; }
  .figure-grid, .two-column { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 65px; }
  .schema-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
