:root {
  color-scheme: light;
  --ink: #202225;
  --muted: #62666c;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --surface-strong: #f0e8db;
  --line: #d9d0c2;
  --research: #1f6f64;
  --research-soft: #d8ebe6;
  --tool: #b15528;
  --tool-soft: #f5dfd0;
  --blue: #245f9b;
  --yellow: #d59a1b;
  --shadow: 0 18px 48px rgba(32, 34, 37, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(36, 95, 155, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(177, 85, 40, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 88px 88px;
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.93);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-nav a {
  min-width: 78px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.72fr);
  gap: 38px;
  align-items: stretch;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 32px;
}

.intro-copy {
  align-self: center;
  padding: 20px 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 760px;
  font-size: 3.25rem;
}

h2 {
  font-size: 1.65rem;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.2;
}

.intro {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 26px 0 0;
}

.stats-grid div {
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-grid dd {
  margin: 8px 0 0;
  font-size: 2rem;
  font-weight: 800;
}

.signal-panel {
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.9), rgba(240, 232, 219, 0.74)),
    var(--surface);
  box-shadow: var(--shadow);
}

#signalMap {
  display: block;
  width: 100%;
  height: 100%;
}

.filters {
  position: sticky;
  top: 73px;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  border-block: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.95);
  backdrop-filter: blur(14px);
}

.search-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#searchInput {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

#searchInput:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 95, 155, 0.18);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment,
.sort-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.segment + .segment {
  border-left: 1px solid var(--line);
}

.segment.is-active,
.sort-button[aria-pressed="true"],
.sort-button:hover,
.segment:hover {
  background: var(--ink);
  color: var(--paper);
}

.sort-button {
  min-width: 132px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 28px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 14px;
}

.timeline-list::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25px;
  width: 2px;
  background: var(--line);
  content: "";
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
}

.post-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.post-dot.research {
  background: var(--research);
}

.post-dot.tool {
  background: var(--tool);
}

.post-body {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
}

.post-body:hover {
  border-color: rgba(32, 34, 37, 0.42);
  box-shadow: 0 12px 28px rgba(32, 34, 37, 0.09);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.research {
  background: var(--research-soft);
  color: var(--research);
}

.badge.tool {
  background: var(--tool-soft);
  color: var(--tool);
}

.post-body p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.open-post,
.source-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.open-post {
  padding: 0 14px;
}

.source-link {
  max-width: 100%;
  padding: 0 12px;
}

.open-post:hover,
.open-post:focus-visible,
.source-link:hover,
.source-link:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.reader-panel {
  position: sticky;
  top: 150px;
}

.reader-inner {
  max-height: calc(100vh - 174px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reader-content {
  margin-top: 16px;
}

.reader-content h3 {
  margin-top: 20px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.reader-content p {
  color: var(--muted);
  line-height: 1.65;
}

.reader-content ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
}

.reader-content li {
  color: var(--muted);
  line-height: 1.55;
}

.reader-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  margin: 0;
}

.source-band {
  padding: 48px max(24px, calc((100vw - 1180px) / 2)) 58px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.54);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.source-domain {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.source-domain strong {
  display: block;
  overflow-wrap: anywhere;
}

.source-domain span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.site-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.no-results {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 980px) {
  .control-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .signal-panel {
    min-height: 320px;
  }

  .reader-panel {
    position: static;
  }

  .reader-inner {
    max-height: none;
  }

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

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

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 1;
  }

  h1 {
    font-size: 2.25rem;
  }

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

  .filters {
    position: static;
  }

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

  .timeline-list::before {
    left: 18px;
  }

  .post-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .post-dot {
    width: 38px;
    height: 38px;
    font-size: 0.7rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
