:root {
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #172026;
  --muted: #64727d;
  --line: #d9e2df;
  --accent: #0f6f78;
  --accent-dark: #0a4d55;
  --accent-soft: #e6f3f2;
  --blue: #355c8c;
  --gold: #a86e16;
  --rose: #9e4b62;
  --shadow: 0 22px 60px rgba(22, 36, 42, 0.13);
  --radius: 8px;
  --page-x: 32px;
  --section-gap: 28px;
  --panel-pad: 24px;
  --card-pad: 20px;
  --footer-height: 86px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: calc(var(--footer-height) + 24px);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(15, 111, 120, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(168, 110, 22, 0.14), transparent 24rem),
    linear-gradient(180deg, #f6f8f6 0, var(--bg) 34rem);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(217, 226, 223, 0.86);
  background: rgba(248, 250, 249, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: 0 10px 24px rgba(15, 111, 120, 0.24);
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.nav a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 42px var(--page-x) 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
  gap: var(--section-gap);
  align-items: center;
  min-height: 390px;
}

.hero-copy {
  padding-bottom: 12px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 20px;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 690px;
  margin-bottom: 22px;
  color: #4f6069;
  font-size: 18px;
  line-height: 1.75;
}

.hero-badges,
.tags,
.external-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badges span {
  padding: 8px 11px;
  border: 1px solid rgba(15, 111, 120, 0.22);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 750;
}

.search-panel,
.side-panel,
.results-wrap,
.stats,
.topic-showcase {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.search-panel {
  padding: var(--panel-pad);
  box-shadow: var(--shadow);
}

.search-label,
.filters span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select,
button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(15, 111, 120, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 111, 120, 0.1);
}

button {
  padding: 0 18px;
  color: white;
  border-color: var(--accent);
  background: var(--accent);
  cursor: pointer;
  font-weight: 780;
}

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

.external-actions {
  margin-top: 12px;
}

.external-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(53, 92, 140, 0.22);
  border-radius: 8px;
  color: var(--blue);
  background: rgba(53, 92, 140, 0.08);
  font-size: 13px;
  font-weight: 760;
}

.external-actions a:hover {
  border-color: var(--blue);
  background: rgba(53, 92, 140, 0.13);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 17px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: var(--section-gap) 0;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(22, 36, 42, 0.07);
}

.stats div {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 20px var(--panel-pad);
  background: rgba(255, 255, 255, 0.9);
}

.stats strong {
  display: block;
  margin-bottom: 5px;
  font-size: 28px;
  letter-spacing: 0;
}

.stats span {
  color: var(--muted);
  line-height: 1.45;
}

.topic-showcase {
  margin-bottom: var(--section-gap);
  padding: var(--panel-pad);
  box-shadow: 0 14px 40px rgba(22, 36, 42, 0.08);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: var(--card-pad);
  margin-bottom: var(--card-pad);
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 25px;
}

.section-head p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.topic-card {
  display: grid;
  justify-items: start;
  min-height: 168px;
  padding: var(--card-pad);
  color: var(--ink);
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(230, 243, 242, 0.76));
  text-align: left;
}

.topic-card:hover {
  color: var(--ink);
  border-color: rgba(15, 111, 120, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(222, 238, 247, 0.9));
}

.topic-card-field,
.paper-kicker {
  color: var(--rose);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topic-card strong {
  align-self: end;
  font-size: 18px;
  line-height: 1.25;
}

.topic-card span:not(.topic-card-field),
.topic-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 290px;
  gap: var(--section-gap);
  align-items: start;
}

.side-panel,
.results-wrap {
  padding: var(--panel-pad);
  box-shadow: none;
}

.side-panel {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.side-panel h2,
.results-head h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.topic-list,
.saved-list {
  display: grid;
  gap: 8px;
}

.topic-list {
  gap: 14px;
}

.topic-group {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.topic-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.topic-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.topic-group-head h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}

.topic-group-head small {
  color: var(--rose);
  font-size: 11px;
  font-weight: 820;
}

.topic-cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.topic {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 680;
  text-align: left;
}

.topic span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.topic small {
  color: var(--muted);
  font-weight: 760;
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: var(--card-pad);
  margin-bottom: var(--card-pad);
}

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

.ghost {
  color: var(--accent);
  background: transparent;
}

.ghost:hover {
  color: white;
}

.results {
  display: grid;
  gap: 14px;
}

.show-more {
  justify-self: center;
  min-width: 210px;
  margin-top: 6px;
  color: var(--accent);
  background: var(--surface);
}

.show-more:hover {
  color: white;
}

.paper {
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.paper:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 111, 120, 0.32);
  box-shadow: 0 12px 30px rgba(22, 36, 42, 0.08);
}

.paper-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.paper h3 {
  margin: 5px 0 8px;
  font-size: 20px;
  line-height: 1.34;
}

.paper-link {
  color: inherit;
  text-decoration: none;
}

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

.paper-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.abstract {
  margin-bottom: 14px;
  color: #33434c;
  line-height: 1.68;
}

.tag {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 760;
}

.save {
  flex: 0 0 auto;
  width: 42px;
  min-height: 38px;
  padding: 0;
  color: var(--gold);
  border-color: rgba(168, 110, 22, 0.35);
  background: #fff8eb;
  font-size: 22px;
  line-height: 1;
}

.save.is-saved {
  color: white;
  border-color: var(--gold);
  background: var(--gold);
}

.saved-item,
.sync-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.saved-item strong,
.sync-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.35;
}

.saved-item span,
.sync-note span,
.empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sync-note {
  margin-top: 14px;
  border-color: rgba(168, 110, 22, 0.28);
  background: #fff8eb;
}

.empty {
  margin: 0;
}

.site-footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: center;
  width: min(1480px, calc(100% - 40px));
  min-height: var(--footer-height);
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(22, 36, 42, 0.16);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.site-footer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.site-footer span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(53, 92, 140, 0.22);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(53, 92, 140, 0.08);
  font-size: 12px;
  font-weight: 760;
}

.site-footer a:hover {
  border-color: var(--blue);
  background: rgba(53, 92, 140, 0.13);
}

.page-shell {
  width: min(1280px, 100%);
}

.page-hero {
  min-height: 300px;
  padding: 46px 0 30px;
}

.page-hero.compact {
  min-height: 230px;
}

.page-hero h1 {
  max-width: 980px;
  font-size: clamp(40px, 6vw, 66px);
}

.topic-directory,
.insight-grid,
.library-board,
.feature-grid,
.contact-grid {
  display: grid;
  gap: var(--section-gap);
}

.topic-directory {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--section-gap);
}

.topic-directory article,
.insight-grid article,
.library-board article,
.feature-grid article,
.contact-form,
.contact-note,
.wide-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(22, 36, 42, 0.07);
}

.topic-directory article,
.insight-grid article,
.library-board article,
.feature-grid article,
.contact-note {
  display: grid;
  align-content: start;
  min-height: 210px;
  padding: var(--card-pad);
}

.topic-directory article,
.insight-grid article,
.library-board article,
.feature-grid article {
  display: grid;
  align-content: start;
  min-height: 210px;
  padding: var(--card-pad);
}

.topic-directory span,
.source-table .head,
.status-dot + h2,
.contact-form span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-directory h2,
.library-board h2,
.feature-grid h2,
.contact-note h2 {
  margin: 10px 0;
  font-size: 22px;
}

.topic-directory p,
.insight-grid p,
.library-board p,
.feature-grid p,
.contact-note p,
.wide-panel p,
.timeline p {
  color: var(--muted);
  line-height: 1.68;
}

.wide-panel {
  margin-bottom: var(--section-gap);
  padding: var(--panel-pad);
}

.pill-cloud,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-cloud a,
.check-grid span,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(15, 111, 120, 0.22);
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 760;
}

.insight-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: var(--section-gap);
}

.insight-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 36px;
}

.insight-grid span {
  display: block;
  margin-bottom: 10px;
  font-weight: 820;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 54px 1fr;
  column-gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.timeline span {
  grid-row: span 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 850;
}

.timeline h3 {
  margin-bottom: 6px;
}

.source-table {
  display: grid;
  margin-bottom: var(--section-gap);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(22, 36, 42, 0.07);
}

.table-row {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 1fr;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 16px var(--card-pad);
  border-top: 1px solid var(--line);
}

.table-row:first-child {
  border-top: 0;
  background: var(--surface-soft);
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.library-board {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--section-gap);
}

.library-board strong {
  color: var(--accent-dark);
}

.status-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
}

.status-dot.amber {
  background: var(--gold);
}

.status-dot.rose {
  background: var(--rose);
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.contact-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: var(--panel-pad);
}

.contact-form label {
  display: grid;
  gap: 8px;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font: inherit;
  outline: none;
}

textarea:focus {
  border-color: rgba(15, 111, 120, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 111, 120, 0.1);
}

@media (max-width: 1180px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topic-directory,
  .insight-grid,
  .library-board,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --page-x: 16px;
    --section-gap: 20px;
    --panel-pad: 18px;
    --card-pad: 16px;
    --footer-height: 138px;
  }

  .topbar {
    padding: 0 18px;
  }

  .nav {
    display: none;
  }

  main {
    padding: 30px var(--page-x) 42px;
  }

  .hero {
    gap: 22px;
    min-height: auto;
  }

  h1 {
    font-size: 42px;
  }

  .search-row,
  .filters,
  .stats,
  .topic-grid,
  .topic-directory,
  .insight-grid,
  .library-board,
  .feature-grid,
  .contact-grid,
  .split-panel,
  .table-row {
    grid-template-columns: 1fr;
  }

  .section-head,
  .results-head,
  .paper-top {
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(100% - 24px, 1480px);
    padding: 12px;
  }

  .site-footer nav {
    justify-content: flex-start;
    max-height: 74px;
    overflow: auto;
  }

  .site-footer a {
    min-height: 32px;
  }

  .save {
    width: 100%;
  }
}
