:root {
  --ink: #191b1f;
  --muted: #5f6873;
  --paper: #f4f5f3;
  --surface: #ffffff;
  --line: #d9ded6;
  --green: #2c6b55;
  --red: #a33b36;
  --amber: #9b6a20;
  --blue: #315f86;
  --shadow: 0 12px 36px rgba(25, 27, 31, 0.09);
  --site-header-height: 60px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-height) + 16px);
}

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

a { color: var(--blue); }
h1, h2, h3, p, a, small, dd { overflow-wrap: anywhere; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--site-header-height);
  padding: 10px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  font-size: 0.94rem;
  font-weight: 780;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
}

.top-nav a[aria-current="page"],
.top-nav a:hover { color: var(--green); }

.feed-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: clamp(20px, 5vw, 56px);
  align-items: end;
  padding: clamp(28px, 6vw, 62px) clamp(16px, 5vw, 64px) clamp(22px, 4vw, 40px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.feed-intro > * {
  min-width: 0;
}

.intro-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.feed-visual {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  overflow: hidden;
}

.feed-visual img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.feed-visual figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  width: min(820px, 100%);
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.lede {
  width: min(760px, 100%);
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  font-weight: 620;
}

.feed-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fafbf9;
}

.feed-stats div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.feed-stats div:last-child { border-right: 0; }
.feed-stats dt, .category-metrics dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.feed-stats dd, .category-metrics dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 850;
  line-height: 1.1;
}

.safety-band {
  padding: 14px clamp(16px, 5vw, 64px);
  color: #24352f;
  background: #e9f1ed;
  border-bottom: 1px solid #cbdcd3;
  font-weight: 680;
}

.safety-band p { max-width: 100%; margin: 0; }

.category-shell {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 38px) clamp(14px, 4vw, 44px) clamp(34px, 6vw, 76px);
}

.category-rail {
  position: sticky;
  top: calc(var(--site-header-height) + 16px);
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding-right: 3px;
}

.category-nav-item, .source-row {
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  text-decoration: none;
}

.category-nav-item:hover, .source-row:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(44, 107, 85, 0.12);
}

.category-nav-item span, .source-row span { font-weight: 800; }
.category-nav-item small, .source-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.category-board {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.category-section {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding-top: clamp(18px, 3vw, 28px);
  border-top: 1px solid var(--line);
}

.category-section__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 380px);
  gap: 18px;
  align-items: start;
}

.category-section__header p {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.category-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.category-metrics div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.category-metrics div:last-child { border-right: 0; }

.category-feed {
  display: grid;
  gap: 12px;
}

.feed-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feed-item__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.category-label {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.source-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.feed-item time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.post-text {
  margin: 0;
  color: #30343a;
  font-weight: 520;
}

.feed-item__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.feed-item__footer span,
.item-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbf9;
  text-decoration: none;
}

.item-link--muted { color: var(--muted); }

.empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 650;
}

.source-directory {
  padding: clamp(26px, 5vw, 58px) clamp(14px, 4vw, 44px);
  background: #fff;
  border-top: 1px solid var(--line);
}

.source-directory__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, 100%);
  margin-top: 18px;
}

.source-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.source-row--muted:hover {
  border-color: var(--line);
  box-shadow: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(16px, 5vw, 64px);
  color: var(--muted);
  background: #eef0ed;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 650;
}

.site-footer p { max-width: 760px; margin: 0; }
.site-footer a { font-weight: 800; text-decoration: none; }

@media (max-width: 920px) {
  .feed-intro,
  .category-shell,
  .category-section__header {
    grid-template-columns: 1fr;
  }

  .category-rail {
    position: relative;
    top: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .source-directory__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .feed-stats,
  .category-metrics,
  .category-rail {
    grid-template-columns: 1fr;
  }

  .feed-intro {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 20px;
    padding-left: 20px;
  }

  .feed-visual {
    display: none;
  }

  h1,
  .lede,
  .intro-panel,
  .feed-stats,
  .safety-band p {
    width: min(100%, 320px);
    max-width: 82vw;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.1;
  }

  .lede,
  .safety-band p {
    font-size: 0.95rem;
  }

  .feed-stats div,
  .category-metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feed-stats div:last-child,
  .category-metrics div:last-child {
    border-bottom: 0;
  }

  .feed-item__header {
    display: grid;
  }
}
