:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #5d6b82;
  --line: #dbe3ee;
  --accent: #1769aa;
  --accent-strong: #0f4d7a;
  --benchmark: #e8f4ff;
  --benchmark-text: #0f4d7a;
  --mitigation: #fff4df;
  --mitigation-text: #7a4a00;
  --shadow: 0 16px 44px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

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

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  font-size: 0.95rem;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  line-height: 1;
}

.hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.button-link.primary {
  background: var(--accent);
  color: #fff;
}

.button-link:hover {
  text-decoration: none;
  border-color: var(--accent-strong);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 1.25rem;
}

.stats div {
  min-height: 88px;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.quick-links button {
  width: auto;
  min-height: 38px;
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
  font-weight: 700;
}

.quick-links button:hover {
  color: #fff;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.94);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.search-box {
  display: block;
}

.search-box span,
.filters label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  padding: 0.6rem 0.7rem;
}

button {
  cursor: pointer;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

button:hover {
  background: var(--accent-strong);
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.results-meta p {
  margin: 0;
  color: var(--muted);
}

.results-meta button {
  width: auto;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.paper-card {
  display: flex;
  min-height: 312px;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.type-pill,
.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.type-pill.benchmark {
  background: var(--benchmark);
  color: var(--benchmark-text);
}

.type-pill.mitigation {
  background: var(--mitigation);
  color: var(--mitigation-text);
}

.date-pill {
  background: #eef1f5;
  color: var(--muted);
}

.paper-card h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.paper-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}

.paper-card dl div {
  min-width: 0;
}

.paper-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.paper-card dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.resource-links a,
.resource-links span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 0.86rem;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.copy-actions button {
  width: auto;
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  background: #f7f9fc;
  color: var(--ink);
  border-color: var(--line);
  font-size: 0.84rem;
}

.copy-actions button:hover {
  background: var(--ink);
  color: #fff;
}

.resource-links span {
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .stats,
  .filters,
  .paper-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 2rem;
  }

  .stats,
  .filters,
  .paper-grid,
  .paper-card dl {
    grid-template-columns: 1fr;
  }

  .toolbar {
    position: static;
  }
}
