:root {
  --bg: #081120;
  --panel: rgba(14, 25, 43, 0.9);
  --panel-2: rgba(11, 20, 36, 0.82);
  --text: #eef2ff;
  --muted: #b5c2e0;
  --line: rgba(255,255,255,0.08);
  --brand: #8b5cf6;
  --brand-2: #22c55e;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139,92,246,.28), transparent 28%),
    radial-gradient(circle at top right, rgba(34,197,94,.18), transparent 25%),
    linear-gradient(180deg, #081120, #091424 45%, #07111d 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.shell--narrow { width: min(980px, calc(100% - 32px)); }

.topbar,
.hero,
.toolbar,
.paper-card,
.guide-card,
.footer,
.page-hero,
.paper-page,
.tag-toolbar,
.paper-section,
.paper-meta-grid div {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-radius: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  font-weight: 800;
}
.brand small, .topbar nav a, .eyebrow, .paper-date, .paper-authors, .footer, .breadcrumbs, .muted { color: var(--muted); }
.topbar nav { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }

.hero {
  margin-top: 18px;
  padding: 38px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: 1.6fr .9fr;
  gap: 24px;
}
.page-hero,
.paper-page {
  margin-top: 18px;
  padding: 28px;
  border-radius: 24px;
}
.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 18px;
  font-size: 13px;
}
.hero h1,
.page-hero h1,
.paper-page h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 0 0 18px;
}
.hero p, .page-hero p, .paper-page p { font-size: 1.05rem; line-height: 1.8; max-width: 760px; color: #dbe6ff; }
.hero-actions, .paper-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
}
.button.primary { background: linear-gradient(135deg, var(--brand), #4f46e5); }
.button.secondary { background: transparent; border-color: var(--line); }
.hero-card {
  display: grid;
  gap: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}
.hero-card div {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.hero-card span, .paper-meta-grid span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.hero-card strong, .paper-meta-grid strong { font-size: 1.1rem; line-height: 1.5; }

.toolbar {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.search-box { flex: 1; }
.search-box input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 15px;
}
.toolbar-meta { white-space: nowrap; color: var(--muted); font-size: 14px; }

.tag-toolbar {
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.paper-list {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}
.paper-card {
  border-radius: 20px;
  padding: 22px;
}
.paper-title { margin: 8px 0 0; font-size: 1.35rem; }
.paper-title a:hover { text-decoration: underline; }
.paper-authors { margin: 12px 0 8px; }
.paper-summary { margin: 0; color: #dbe6ff; line-height: 1.8; }
.paper-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139,92,246,.12);
  color: #d9c9ff;
  border: 1px solid rgba(139,92,246,.28);
  font-size: 13px;
}
.filter-tag.is-active {
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.35);
  color: #d7ffe6;
}
.tag.is-hidden,
.paper-card.is-hidden { display: none; }

.empty-state {
  border-radius: 24px;
  padding: 42px 24px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.12);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}
.empty-state strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 8px; }

.empty-guide {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.guide-card {
  padding: 24px;
  border-radius: 20px;
}
.guide-card h2, .paper-section h2 { margin-top: 0; }
.guide-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
  color: #dbe6ff;
}
.guide-card pre {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  overflow: auto;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line);
  color: #d6e2ff;
}

.footer {
  margin-top: 24px;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.breadcrumbs {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}
.paper-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.paper-meta-grid div,
.paper-section {
  padding: 18px;
  border-radius: 18px;
}
.lead { font-size: 1.1rem; }

@media (max-width: 920px) {
  .hero, .empty-guide, .paper-meta-grid { grid-template-columns: 1fr; }
  .topbar, .toolbar, .footer { flex-direction: column; align-items: stretch; }
}
