:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #17191c;
  --muted: #666d76;
  --line: #e2e4e7;
  --accent: #4157d9;
  --accent-soft: #eef0ff;
  --shadow: 0 12px 38px rgba(20, 25, 35, .06);
  --radius: 18px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0d10;
  --panel: #111419;
  --text: #edf0f5;
  --muted: #9aa2ad;
  --line: #242a33;
  --accent: #8c9cff;
  --accent-soft: #1a2144;
  --shadow: 0 14px 48px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 31rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 13px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; line-height: 1.1; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.hero {
  padding: 76px 0 50px;
  max-width: 820px;
}

.eyebrow, .section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .13em;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 700;
}

.lede {
  max-width: 700px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 21px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
}

.search {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search svg {
  width: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search input::placeholder { color: var(--muted); }

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

.filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: 160ms ease;
}

.filter:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--text);
}

.filter.active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.results-status {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.citation-section { margin: 0 0 54px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(21px, 3vw, 29px);
  letter-spacing: -.025em;
}

.section-kicker { margin-bottom: 4px; }

.section-count {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.entry {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.entry-index {
  color: var(--muted);
  font: 500 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
  padding-top: 5px;
}

.citation {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.66;
}

.citation .self-author { font-weight: 800; }
.citation .work-title { font-style: italic; font-weight: 400; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}

.entry-meta a,
.copy-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.entry-meta a:hover,
.copy-btn:hover { color: var(--accent); }

.status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}

.status.review { background: color-mix(in srgb, #c48620 14%, transparent); color: #a4690c; }
.status.preprint { background: color-mix(in srgb, #6246c7 13%, transparent); color: #5740ad; }
.status.prep { background: color-mix(in srgb, #7d6bff 13%, transparent); color: #6756e8; }
.status.conference { background: color-mix(in srgb, #0a9e77 13%, transparent); color: #087e60; }
.status.software { background: color-mix(in srgb, #1281d9 13%, transparent); color: #0e6fb9; }
.status.dataset { background: color-mix(in srgb, #c34a77 13%, transparent); color: #aa3d68; }

html[data-theme="dark"] .status.review { color: #e9b968; }
html[data-theme="dark"] .status.preprint { color: #b8a6ff; }
html[data-theme="dark"] .status.prep { color: #b2a7ff; }
html[data-theme="dark"] .status.conference { color: #6ed9b9; }
html[data-theme="dark"] .status.software { color: #74baf0; }
html[data-theme="dark"] .status.dataset { color: #ef91b7; }

.note {
  margin: 14px 0 0 70px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 60px 20px 100px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text); font-size: 18px; }
.empty-state span { margin-top: 5px; font-size: 13px; }

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}
.footer-inner a:hover { color: var(--text); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 12px;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.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; }

@media (max-width: 640px) {
  .wrap { width: min(100% - 28px, 1080px); }
  .hero { padding-top: 52px; }
  h1 { font-size: clamp(38px, 12vw, 54px); }
  .entry { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .note { margin-left: 44px; }
  .footer-inner { min-height: 82px; }
}
