/* =========================================================================
   Theme tokens
   ========================================================================= */

:root {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --text: #111111;
  --muted: #555555;
  --accent: #2f6f4f;
  --accent-strong: #009423;
  --button: #2d6cdf;
  --border: #d8d8d0;
  --shadow: rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
  --bg: #111111;
  --surface: #181818;
  --text: #f5f5f0;
  --muted: #bbbbbb;
  --accent: #7fd6a3;
  --accent-strong: #7fd6a3;
  --button: #6fa0ff;
  --border: #2a2a2a;
  --shadow: rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Reset / global
   ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

body {
  min-height: 100vh;
}

a {
  color: var(--text);
}

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

span.dan-highlight {
  color: var(--accent-strong);
}

/* ==========================================================================
   Site chrome
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.site-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.site-brand,
.nav-links a {
  color: var(--text);
  text-decoration: none;
}

.site-brand {
  font-weight: 700;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-brand:hover,
.nav-links a:hover {
  text-decoration: underline;
}

.site-main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
}

/* ==========================================================================
   Buttons / links
   ========================================================================== */

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.report-link,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  transition:
    opacity 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.report-link {
  min-width: 9rem;
  line-height: 1.6;
  margin-top: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--button);
  color: #ffffff;
}

.action-button {
  min-width: 140px;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #ffffff;
  letter-spacing: 0.01em;
}

.report-link:hover,
.action-button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #ffffff;
}

.action-button:hover {
  box-shadow: 0 8px 24px rgba(0, 148, 35, 0.25);
}

.action-button:active {
  transform: translateY(0);
}

/* ==========================================================================
   Generic hero / landing pages
   ========================================================================== */

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero p {
  color: var(--muted);
}

.hero-blurb {
  max-width: 760px;
  margin: 0 auto 2rem;
  font-size: 1.15rem;
  line-height: 1.7;
}

/* ==========================================================================
   Featured report / landing cards
   ========================================================================== */

.featured-report {
  width: 100%;
  margin: 2rem auto 0;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 30px var(--shadow);
}

.eyebrow {
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  opacity: 0.7;
}

.featured-report h2 {
  margin: 1.5rem 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.featured-report p {
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-infographic {
  width: 100%;
  max-width: 720px;
  margin: 1.5rem auto;
}

.hero-infographic img {
  display: block;
  width: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 18px;
}

.lane-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 2rem 0 1rem;
}

.lane-strip span {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
}

.report-flow {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

/* ==========================================================================
   Feed / table
   ========================================================================== */

.feed-hero {
  margin-bottom: 2rem;
}

.feed-panel {
  text-align: left;
}

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.filter-button {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.reports-table th,
.reports-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  min-width: 8rem;
  line-height: 1.6;
}

.reports-table th {
  color: var(--muted);
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reports-table code {
  color: var(--accent);
}

.reports-table tbody tr {
  transition: background-color 0.2s ease;
}

.reports-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.reports-table tbody tr.links-2 {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.reports-table tbody tr.links-3 {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.reports-table tbody tr.links-4 {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

html[data-theme="dark"] .reports-table tbody tr.links-2 {
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

html[data-theme="dark"] .reports-table tbody tr.links-3 {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

html[data-theme="dark"] .reports-table tbody tr.links-4 {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

/* ==========================================================================
   Lab report pages
   ========================================================================== */

.lab-report {
  display: grid;
  gap: 2rem;
}

.lab-card,
.lab-hero,
.lab-note {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 30px var(--shadow);
}

.lab-hero {
  padding: 3rem;
}

.lab-card,
.lab-note {
  padding: 2rem;
}

.lab-kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 800;
}

.lab-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lab-subtitle,
.lab-meta,
.lab-caption {
  color: var(--muted);
}

.lab-subtitle {
  max-width: 800px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.lab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.lab-links a {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

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

.lab-figure {
  margin: 0;
}

.lab-figure img {
  display: block;
  width: 100%;
  object-fit: contain;
  border-radius: 18px;
  height: auto;
}
.lab-card.lab-figure-card {
  padding: 0;
}

.lab-caption {
  margin-top: 1rem;
  font-size: 0.75rem;
  padding: 0 30px;
  color: var(--muted);
  line-height: 1.5;
}

.lab-claim {
  font-size: 1.2rem;
  line-height: 1.7;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.lab-item {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.lab-item.featured {
  grid-column: 1 / -1;
}

.lab-item h2,
.lab-note h2 {
  margin-top: 0;
}

.lab-math {
  font-size: 1.2rem;
  font-weight: 700;
}

.lab-report ol,
.lab-report ul {
  padding-left: 1.25rem;
}

.lab-report li + li {
  margin-top: 0.4rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer,
footer {
  margin-top: 48px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-item {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.footer-item h3 {
  margin: 0 0 0.75rem;
}

.footer-item p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 820px) {
  .site-nav {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .site-main {
    padding-top: 10rem;
  }

  .lab-hero,
  .lab-card,
  .lab-note {
    padding: 1.5rem;
  }

  .lab-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .lab-item.featured {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .site-main {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .featured-report {
    padding: 1.25rem;
  }

  .hero-blurb,
  .featured-report p {
    font-size: 1rem;
  }

  .lane-strip {
    gap: 0.45rem;
  }

  .lane-strip span {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
  }
}
.repo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.repo-figure {
  margin: 0;
}

.repo-figure img {
  width: 100%;
  border-radius: 0.75rem;
  display: block;
}

.repo-table {
  min-width: 0;
}

.repo-table .report-table {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .repo-layout {
    grid-template-columns: 1fr;
  }
}
