:root {
  color-scheme: light;
  --bg: #eef5f6;
  --surface: #f8fbfa;
  --surface-strong: #ffffff;
  --ink: #12303a;
  --ink-soft: #294b55;
  --muted: #3a555d;
  --faint: #3f5a62;
  --line: #c3d7da;
  --line-strong: #8daeb3;
  --coral: #8e2b28;
  --coral-soft: #f8dfdc;
  --teal: #00524d;
  --teal-soft: #d7efeb;
  --gold: #986407;
  --gold-soft: #f6e8bd;
  --violet: #62539c;
  --violet-soft: #e9e4fb;
  --shadow: 0 18px 48px rgba(19, 48, 58, 0.08);
  --radius: 12px;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1d24;
  --surface: #122b34;
  --surface-strong: #163640;
  --ink: #e5f1ee;
  --ink-soft: #c9dfdb;
  --muted: #b4ccca;
  --faint: #b4ccca;
  --line: #2b4e57;
  --line-strong: #4c7780;
  --coral: #ffab9f;
  --coral-soft: #4b292c;
  --teal: #72dccd;
  --teal-soft: #153d3c;
  --gold: #f3c568;
  --gold-soft: #443719;
  --violet: #bdb0ff;
  --violet-soft: #302e50;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.5; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal); text-underline-offset: 0.16em; }
a:hover { color: var(--coral); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.page-width { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 20; transform: translateY(-160%); padding: 10px 14px; border-radius: 6px; background: var(--ink); color: var(--bg); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }

.topbar { width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.brand-mark { display: inline-flex; width: 28px; height: 28px; align-items: end; gap: 3px; padding: 4px; border: 1px solid var(--ink); border-radius: 50%; transform: rotate(-26deg); }
.brand-mark i { display: block; flex: 1; border-radius: 4px 4px 1px 1px; background: var(--coral); }
.brand-mark i:nth-child(1) { height: 60%; background: var(--teal); }
.brand-mark i:nth-child(2) { height: 90%; }
.brand-mark i:nth-child(3) { height: 43%; background: var(--gold); }
.top-actions { display: flex; align-items: center; gap: 18px; }
.language-link { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.icon-button, .quiet-button, .tool-button, .chip, .segment { border: 0; cursor: pointer; }
.icon-button { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--muted); padding: 7px 0; font-size: 0.78rem; font-weight: 700; }
.theme-icon { color: var(--coral); font-size: 1.15rem; line-height: 1; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); gap: 70px; padding-top: 90px; padding-bottom: 64px; align-items: center; }
.eyebrow { margin: 0 0 16px; color: var(--coral); font: 800 0.68rem/1.2 var(--mono); letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { max-width: 650px; margin-bottom: 22px; font: 400 clamp(3.3rem, 7vw, 6.4rem)/0.91 var(--display); letter-spacing: -0.055em; }
.hero-lead { max-width: 590px; margin-bottom: 26px; color: var(--ink-soft); font-size: clamp(1.02rem, 1.6vw, 1.22rem); line-height: 1.55; }
.hero-note { display: flex; align-items: center; gap: 9px; max-width: 460px; color: var(--muted); font-size: 0.83rem; }
.note-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px var(--teal-soft); flex: 0 0 auto; }
.hero-specimen { min-height: 340px; padding: 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.specimen-topline, .specimen-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--faint); font: 0.62rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.specimen-network { position: relative; min-height: 270px; margin-block: 6px; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 32px 32px; }
.specimen-network::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 45% 49%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 36%); pointer-events: none; }
.specimen-node { position: absolute; z-index: 2; display: inline-flex; align-items: center; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-strong); box-shadow: 4px 5px 0 color-mix(in srgb, var(--line) 62%, transparent); color: var(--ink); font: 700 0.66rem/1 var(--mono); text-transform: uppercase; }
.node-main { top: 42%; left: 38%; border-color: var(--coral); color: var(--coral); }
.node-author { top: 19%; left: 12%; }
.node-place { right: 10%; top: 27%; border-color: var(--teal); color: var(--teal); }
.node-topic { left: 9%; bottom: 18%; border-color: var(--gold); color: var(--gold); }
.node-open { right: 19%; bottom: 15%; border-color: var(--violet); color: var(--violet); }
.specimen-line { position: absolute; z-index: 1; height: 1px; transform-origin: left center; background: var(--line-strong); }
.line-a { width: 180px; top: 39%; left: 25%; transform: rotate(19deg); }
.line-b { width: 200px; top: 44%; left: 48%; transform: rotate(-20deg); }
.line-c { width: 190px; top: 58%; left: 40%; transform: rotate(31deg); }
.line-d { width: 180px; top: 57%; left: 26%; transform: rotate(-35deg); }
.live-mark { color: var(--teal); }

.stats-strip { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { min-height: 108px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border-right: 1px solid var(--line); padding: 18px 20px; }
.stat:first-child { border-left: 1px solid var(--line); }
.stat strong { font: 400 2rem/1 var(--display); letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 0.75rem; }
.stat-status strong { color: var(--teal); }

.explorer, .method, .coverage { padding-top: 112px; }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 28px; }
.section-heading h2 { max-width: 670px; margin-bottom: 0; font: 400 clamp(2rem, 4vw, 3.4rem)/1 var(--display); letter-spacing: -0.04em; }
.section-heading.compact { align-items: start; }
.section-description { max-width: 360px; margin-bottom: 4px; color: var(--muted); font-size: 0.9rem; }
.explorer-grid { display: grid; grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.control-panel { min-width: 0; padding: 26px; border-right: 1px solid var(--line); }
.search-label, .filter-label { display: block; margin-bottom: 9px; color: var(--ink); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.search-wrap { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-strong); }
.search-symbol { color: var(--coral); font-size: 1.45rem; line-height: 1; }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 0.88rem; }
.search-wrap input::placeholder { color: var(--faint); }
kbd { padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--faint); font: 0.66rem var(--mono); }
.examples { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 26px; }
.chip { padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 0.7rem; }
.chip:hover { border-color: var(--coral); color: var(--coral); }
.filter-block { margin-bottom: 18px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--line) 22%, transparent); }
.segment { min-height: 34px; border-radius: 4px; background: transparent; color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.segment.is-active { background: var(--surface-strong); color: var(--coral); box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 10%, transparent); }
.filter-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.filter-row label { color: var(--muted); font-size: 0.78rem; }
.filter-row select { width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-strong); color: var(--ink); font-size: 0.78rem; }
.panel-note { margin: 20px 0; padding: 12px 13px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: var(--ink-soft); font-size: 0.75rem; }
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font: 0.66rem var(--mono); letter-spacing: 0.03em; text-transform: uppercase; }
.quiet-button { padding: 4px 0; background: transparent; color: var(--teal); font-size: 0.72rem; font-weight: 800; }
.quiet-button:hover { color: var(--coral); }
.results-list { display: grid; gap: 6px; max-height: 540px; margin: 0 -7px; padding: 0 7px; overflow: auto; list-style: none; }
.result-item button { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: start; padding: 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.result-item button:hover, .result-item button.is-active { border-color: var(--line-strong); background: var(--surface-strong); }
.result-marker { width: 8px; height: 8px; margin-top: 5px; border-radius: 2px; background: var(--teal); }
.result-marker.work, .legend-dot.work, .node-visual.work { background: var(--coral); }
.result-marker.author, .legend-dot.author, .node-visual.author { background: var(--teal); }
.result-marker.institution, .legend-dot.institution, .node-visual.institution { background: var(--gold); }
.result-marker.topic, .legend-dot.topic, .node-visual.topic { background: var(--violet); }
.result-marker.project, .legend-dot.project, .node-visual.project { background: var(--coral); }
.result-marker.funder, .legend-dot.funder, .node-visual.funder { background: var(--gold); }
.result-marker.resource, .legend-dot.resource, .node-visual.resource { background: var(--violet); }
.result-name { display: block; overflow: hidden; font-size: 0.78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.result-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 0.68rem; }
.result-type { color: var(--faint); font: 0.58rem var(--mono); text-transform: uppercase; }
.empty-result { padding: 22px 10px; color: var(--muted); font-size: 0.8rem; }

.graph-panel { min-width: 0; padding: 26px; }
.graph-toolbar { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.graph-toolbar .eyebrow { margin-bottom: 7px; }
.graph-toolbar h3 { max-width: 530px; margin-bottom: 0; font: 400 clamp(1.5rem, 3vw, 2.25rem)/1.03 var(--display); letter-spacing: -0.035em; }
.toolbar-actions { display: flex; gap: 7px; }
.tool-button { min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-size: 0.68rem; font-weight: 800; }
.tool-button:hover, .tool-button[aria-pressed="true"] { border-color: var(--coral); color: var(--coral); }
.graph-stage { position: relative; min-height: 470px; margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background-image: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0); background-size: 24px 24px; }
#graph-svg { display: block; width: 100%; height: 470px; overflow: visible; }
.graph-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 5px; padding: 30px; color: var(--muted); text-align: center; }
.graph-empty strong { color: var(--ink); font-size: 0.9rem; }
.graph-empty span:last-child { max-width: 260px; font-size: 0.75rem; }
.empty-glyph { color: var(--coral); font: 3rem/1 var(--display); }
.graph-node { cursor: pointer; }
.graph-node rect { stroke-width: 1.5; fill: var(--surface-strong); }
.graph-node text { fill: var(--ink); font-family: var(--body); font-size: 11px; font-weight: 800; pointer-events: none; }
.graph-node .node-kind { fill: var(--muted); font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.graph-node.work rect { stroke: var(--coral); }
.graph-node.author rect { stroke: var(--teal); }
.graph-node.institution rect { stroke: var(--gold); }
.graph-node.topic rect { stroke: var(--violet); }
.graph-node.project rect { stroke: var(--coral); }
.graph-node.funder rect { stroke: var(--gold); }
.graph-node.resource rect { stroke: var(--violet); }
.graph-node.selected rect { stroke-width: 3; }
.graph-edge { stroke: var(--line-strong); stroke-width: 1.2; opacity: 0.75; }
.graph-edge.derived { stroke-dasharray: 4 4; }
.graph-edge-label { fill: var(--faint); font: 8px var(--mono); }
.graph-legend { display: flex; flex-wrap: wrap; gap: 13px; padding: 12px 0 5px; color: var(--muted); font-size: 0.68rem; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.detail-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-strong); }
.detail-empty { color: var(--muted); font-size: 0.78rem; }
.detail-kicker { margin-bottom: 7px; color: var(--coral); font: 0.63rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.detail-title { margin-bottom: 8px; font: 400 clamp(1.35rem, 3vw, 2rem)/1.05 var(--display); letter-spacing: -0.03em; }
.detail-description { margin-bottom: 14px; color: var(--muted); font-size: 0.8rem; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.detail-fact { padding: 8px; border-top: 2px solid var(--line); }
.detail-fact dt { color: var(--faint); font: 0.58rem var(--mono); text-transform: uppercase; }
.detail-fact dd { margin: 3px 0 0; color: var(--ink); font-size: 0.75rem; font-weight: 800; }
.detail-links, .detail-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.detail-links a, .source-tag { padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; font-size: 0.68rem; text-decoration: none; }
.source-tag { color: var(--muted); }
.connection-list { display: grid; gap: 5px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; }
.connection-list button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 0.75rem; text-align: left; cursor: pointer; }
.connection-list button:hover { color: var(--coral); }
.connection-list small { flex: 0 0 auto; color: var(--faint); font: 0.6rem var(--mono); text-transform: uppercase; }
.export-row { display: flex; justify-content: end; align-items: center; gap: 12px; padding-top: 12px; color: var(--muted); font-size: 0.68rem; }
.accessible-list { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-strong); }
.accessible-list table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.accessible-list th, .accessible-list td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.accessible-list th { color: var(--muted); font: 0.62rem var(--mono); text-transform: uppercase; }
.accessible-list button { border: 0; background: transparent; color: var(--teal); cursor: pointer; text-align: left; }

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-card { min-height: 220px; padding: 24px 24px 28px; border-right: 1px solid var(--line); }
.method-card:last-child { border-right: 0; }
.card-index { display: block; margin-bottom: 30px; color: var(--coral); font: 0.66rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.method-card h3 { max-width: 260px; margin-bottom: 10px; font: 400 1.5rem/1.02 var(--display); }
.method-card p { max-width: 300px; margin-bottom: 0; color: var(--muted); font-size: 0.8rem; }
.method-card b { color: var(--ink); }
.coverage-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coverage-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 0.82rem; }
.coverage-table th, .coverage-table td { padding: 17px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.coverage-table thead th { color: var(--muted); font: 0.64rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.coverage-table tbody tr:last-child th, .coverage-table tbody tr:last-child td { border-bottom: 0; }
.coverage-table tbody th { width: 20%; font-weight: 800; }
.status-pill { display: inline-flex; padding: 3px 7px; border-radius: 999px; font: 0.62rem var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.status-pill.good { background: var(--teal-soft); color: var(--teal); }
.status-pill.pending { background: var(--gold-soft); color: var(--gold); }
.coverage-note { max-width: 700px; margin: 16px 0 0; color: var(--muted); font-size: 0.76rem; }
.site-footer { display: flex; justify-content: space-between; gap: 22px; padding-top: 100px; padding-bottom: 34px; color: var(--muted); font-size: 0.7rem; }
.site-footer a { color: inherit; }
.error-page { min-height: 70vh; display: grid; align-content: center; justify-items: start; }
.error-page h1 { font-size: clamp(3rem, 8vw, 6rem); }
.error-page p { color: var(--muted); }
.primary-button { display: inline-flex; padding: 11px 15px; border-radius: 5px; background: var(--coral); color: var(--surface-strong); font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.primary-button:hover { color: var(--surface-strong); background: var(--teal); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 64px; }
  .hero-specimen { max-width: 620px; width: 100%; justify-self: end; }
  .explorer-grid { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .results-list { max-height: 270px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-card:last-child { border-bottom: 0; }
}

@media (max-width: 650px) {
  .page-width, .topbar { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 64px; }
  .brand { font-size: 0.66rem; letter-spacing: 0.08em; }
  .theme-label { display: none; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
  h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .hero-specimen { min-height: 300px; transform: none; }
  .specimen-network { min-height: 230px; }
  .line-a { width: 140px; }
  .line-b { width: 150px; }
  .line-c { width: 140px; }
  .line-d { width: 140px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { min-height: 86px; padding: 14px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { border-left: 1px solid var(--line); }
  .stat:last-child { grid-column: span 2; border-right: 0; }
  .stat strong { font-size: 1.65rem; }
  .explorer, .method, .coverage { padding-top: 76px; }
  .section-heading { display: block; margin-bottom: 22px; }
  .section-heading h2 { margin-bottom: 15px; font-size: 2.5rem; }
  .graph-panel, .control-panel { padding: 18px; }
  .graph-toolbar { display: block; }
  .toolbar-actions { margin-top: 16px; }
  .graph-stage, #graph-svg { min-height: 360px; height: 360px; }
  .graph-stage { margin-top: 18px; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .export-row { justify-content: start; flex-wrap: wrap; }
  .site-footer { display: block; padding-top: 76px; }
  .site-footer span { display: block; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
