/* ASTRA Discoverability — quiet editorial design.
   Paper background, ink text, serif headings, one restrained accent. */
:root {
  --paper: #faf9f6;
  --ink: #17191e;
  --muted: #5d6470;
  --faint: #8a909b;
  --line: #e5e2da;
  --panel: #f1efe8;
  --accent: #23479f;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-mark {
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}

.header-nav a {
  display: inline-flex;
  color: var(--muted);
}

.header-nav a:hover { color: var(--accent); }

/* ---------- layout ---------- */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

/* ---------- intro ---------- */

.intro { margin-bottom: 40px; }

.intro h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.intro-sub {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

#search {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
}

#search::placeholder { color: var(--faint); }

#search:focus { border-color: var(--accent); }

.controls-right {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.sorts { display: flex; gap: 14px; }

.sort {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--faint);
  cursor: pointer;
}

.sort:hover { color: var(--ink); }

.sort.active {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.count {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- rows ---------- */

.rows { list-style: none; margin: 0; padding: 0; }

.entry { border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: baseline;
  width: 100%;
  padding: 18px 4px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.row:hover .row-name { color: var(--accent); }

.row-rank {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}

.row-main { min-width: 0; }

.row-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.row-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  transition: color 0.12s ease;
}

.row-repo {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

.row-desc {
  margin: 4px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.entry.open .row-desc { display: none; }

.row-stat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- detail (expanded) ---------- */

.detail {
  margin: 0 4px 20px 62px;
  padding: 18px 20px;
  background: var(--panel);
  border-radius: 8px;
}

.detail-desc {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink);
  max-width: 60ch;
}

.detail-section { margin-bottom: 16px; }

.detail-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.outputs { list-style: none; margin: 0; padding: 0; }

.outputs li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  max-width: 480px;
}

.outputs li:last-child { border-bottom: 0; }

.output-type {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.datafiles li { max-width: 560px; }

.file-link { color: var(--accent); font-weight: 500; }

.file-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.datafiles .dataset-hash { margin-left: 8px; }

.file-side { display: inline-flex; align-items: center; gap: 10px; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
}

.tag:hover { border-color: var(--accent); color: var(--accent); }

.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.detail-meta {
  font-size: 13px;
  color: var(--faint);
}

.repo-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
}

.repo-link:hover { background: #1b3a85; }

.empty {
  padding: 48px 0;
  text-align: center;
  font-size: 14px;
  color: var(--faint);
}

.verified-mark {
  font-size: 12px;
  font-weight: 500;
  color: #2e7d4f;
  white-space: nowrap;
}

.verify-note {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.verify-errors {
  margin: 0;
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.verify-errors li { padding: 1px 0; }

.row-finding {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--accent);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.findings { list-style: none; margin: 0; padding: 0; max-width: 62ch; }

.findings li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.findings li:last-child { border-bottom: 0; }

.finding-label {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
}

.finding-claim {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
}

.siblings { font-size: 14px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
}

.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.sep { color: var(--faint); margin: 0 8px; }

.badge-embed {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-embed img { display: block; }

.badge-embed code {
  font-size: 11.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-badge {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.copy-badge:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- lineage ---------- */

.lineage { margin-top: 64px; }

.lineage-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
}

.lineage-sub {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--muted);
  max-width: 60ch;
}

.dataset-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.dataset-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.dataset-name {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.dataset-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.dataset-hash {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  background: var(--panel);
  border-radius: 3px;
  padding: 1px 6px;
}

/* ---------- dataset page ---------- */

.crumb { margin: 0 0 24px; font-size: 14px; }

.crumb a { color: var(--muted); }

.crumb a:hover { color: var(--accent); }

.dataset-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 26px;
  overflow-wrap: anywhere;
}

.hash-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}

.hash {
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
  border-radius: 4px;
  padding: 3px 8px;
  overflow-wrap: anywhere;
}

.occ-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.occ-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 10px 12px 10px 0;
  border-bottom: 2px solid var(--ink);
}

.occ-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.occ-repo {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.occ-path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.role {
  font-family: var(--mono);
  font-size: 11.5px;
  border-radius: 3px;
  padding: 2px 8px;
}

.role-input { color: var(--accent); background: #e8edf8; }

.role-output { color: #2e7d4f; background: #e7f0e9; }

.source-from {
  display: inline-block;
  margin: 0 8px 0 0;
  font-size: 12.5px;
  color: var(--accent);
  white-space: nowrap;
}

td .source-from { display: block; margin: 4px 0 0; }

a.source-from:hover { text-decoration: underline; text-underline-offset: 3px; }

.sources li { display: flex; flex-direction: column; gap: 3px; }

.source-where {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.raw-link {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.raw-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.dataset-count {
  font-size: 13px;
  color: var(--faint);
}

.dataset-uses { margin-top: 4px; font-size: 14px; }

.lineage-empty { font-size: 14px; color: var(--faint); }

/* ---------- repo page ---------- */

.repo-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.25;
}

.repo-body { margin: 0 0 40px; }

a.occ-repo:hover { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 20px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--faint);
}

.footer-inner a { color: var(--muted); }

.footer-inner a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .intro h1 { font-size: 30px; }
  .row { grid-template-columns: 30px 1fr auto; gap: 10px; }
  .detail { margin-left: 4px; }
}
