:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #edf2ef;
  --text: #172026;
  --muted: #66727d;
  --line: #d9e0df;
  --accent: #126b5d;
  --accent-2: #9a5b21;
  --shadow: 0 10px 30px rgba(23, 32, 38, 0.08);
}

* { box-sizing: border-box; }

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

a { color: inherit; }

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 44px;
  max-width: min(260px, 52vw);
  object-fit: contain;
}

nav {
  display: flex;
  gap: 6px;
}

nav a,
.section-head a,
.sublinks a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}


.hero-copy {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.hero-logo {
  width: min(180px, 42vw);
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.hero,
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 52px 0 26px;
}

.home-summary {
  padding: 34px 0 26px;
}

.home-summary__table {
  width: 100%;
  border-collapse: collapse;
  border: 0;
}

.home-summary__table td {
  border: 0;
  padding: 0;
  vertical-align: middle;
}

.home-summary__logo-cell {
  width: 390px;
}

.home-summary__stats-cell {
  padding-left: 30px !important;
}

.home-logo {
  width: min(360px, 42vw);
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.home-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.home-title-row h1 {
  margin: 0;
}

.social-links {
  align-items: center;
  gap: 8px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--accent);
}

.social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.project-links {
  margin-top: 18px;
}

.project-links h2 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-links ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-links li {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.project-links a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.project-links span {
  color: var(--muted);
  font-size: 0.92rem;
}

.topic-tree {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.topic-tree__topic {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.topic-tree__topic summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.topic-tree__topic summary span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.topic-tree__categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.topic-tree__categories button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.topic-tree__categories button span:last-child {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  min-width: 28px;
  padding: 2px 7px;
  text-align: center;
  font-size: 0.78rem;
}

.topic-tree__categories button.is-active {
  border-color: var(--accent);
  background: #eef7f3;
}

.home-selected-links {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}

.home-news__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow,
.meta,
.news-item__meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.3rem, 7vw, 5.6rem);
  line-height: 0.95;
}

h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { margin-bottom: 6px; font-size: 1rem; }

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
  min-width: min(100%, 390px);
}

.stats div,
.count {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.stats strong,
.stats span {
  display: block;
}

.stats span,
.count {
  color: var(--muted);
  font-size: 0.84rem;
}

.band,
.digest-day,
.prose {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}

.section-head,
.digest-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}


.link-directory {
  display: grid;
  gap: 26px;
}

.topic-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.topic-section > header {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.topic-section > header p:last-child {
  color: var(--muted);
  margin-bottom: 8px;
}

.category-section {
  margin-top: 18px;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.category-head h3 {
  margin-bottom: 0;
}

.compact-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.link-card__top {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.link-card img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-2);
}

.link-card h2 {
  margin: 0;
  font-size: 1.02rem;
}

.link-card__top p,
.description,
.news-item p,
.empty,
.prose {
  color: var(--muted);
}

.description {
  min-height: 48px;
  margin: 12px 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips span {
  border-radius: 999px;
  background: var(--surface-2);
  color: #38464f;
  padding: 3px 8px;
  font-size: 0.78rem;
}

.sublinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.filters {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(246, 247, 245, 0.94);
  backdrop-filter: blur(10px);
}

.filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
}

.news-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(246, 247, 245, 0.94);
  backdrop-filter: blur(10px);
}

.news-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.news-controls__categories {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.news-controls__categories button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.news-controls__categories button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.news-category {
  margin-top: 16px;
}

.digest-preview {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 18px;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.news-item > img {
  width: 96px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.news-item:not(:has(> img)) {
  grid-template-columns: 1fr;
}

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

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer > div {
  display: grid;
  gap: 4px;
}

.legal-nav {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}


.legal-copy {
  max-width: 860px;
}

.legal-copy h2 {
  margin-top: 22px;
  margin-bottom: 8px;
}

.legal-copy a {
  color: var(--accent);
  font-weight: 700;
}

code {
  border-radius: 6px;
  background: var(--surface-2);
  padding: 2px 5px;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .hero,
  .page-head,
  .section-head,
  .digest-day header {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    overflow-x: auto;
  }

  .brand img {
    height: 38px;
    max-width: 100%;
  }

  .legal-nav {
    justify-content: flex-start;
  }

  .filters,
  .news-controls,
  .digest-preview,
  .topic-section > header {
    grid-template-columns: 1fr;
    position: static;
  }

  .home-summary__table,
  .home-summary__table tbody,
  .home-summary__table tr,
  .home-summary__table td {
    display: block;
    width: 100%;
  }

  .home-summary__stats-cell {
    padding-left: 0 !important;
    padding-top: 18px !important;
  }

  .home-logo {
    width: min(360px, 100%);
  }

  .home-news__head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .project-links li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .news-item > img {
    width: 100%;
  }
}
