:root {
  color-scheme: dark;
  --bg: #020307;
  --ink: #f4f0e7;
  --muted: #a9a79e;
  --panel: #000;
  --panel-2: #050607;
  --line: #282e38;
  --line-soft: #151a22;
  --blue: #1f75ff;
  --cyan: #87e8ff;
  --steel: #9fb0c4;
  --violet: #c8b7ff;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --mx: 48%;
  --my: 20%;
  --accent-gradient: linear-gradient(120deg, var(--cyan), var(--blue) 46%, var(--violet));
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Pixel Space";
  src: url("/fonts/PixelSpaceFreePersonalUseR-zrppw.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Wheaton Capitals";
  src: url("/fonts/wheaton-capitals.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Golden Girdle";
  src: url("/fonts/golden-girdle.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(49, 112, 171, 0.28), transparent 28rem),
    radial-gradient(circle at calc(100% - var(--mx)) calc(100% - var(--my)), rgba(194, 202, 219, 0.08), transparent 30rem),
    linear-gradient(132deg, #020309 0%, #07111e 31%, #010102 64%, #11151c 100%);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Apple Garamond", "Cormorant Garamond", "EB Garamond", "Baskerville Old Face", Georgia, serif;
  line-height: 1.5;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 17%, rgba(124, 149, 173, 0.045) 38%, transparent 63%);
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button,
a {
  border: 1px solid var(--line);
  background: #050506;
  color: var(--ink);
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 11px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
a:hover {
  border-color: #577091;
}

main {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 68px;
}

h1,
h2,
h3,
h4 {
  letter-spacing: 0;
  margin: 0;
  font-weight: 500;
}

h2,
h3 {
  font-family: "Wheaton Capitals", "Apple Garamond", "Cormorant Garamond", Georgia, serif;
}

h3,
h4 {
  margin-bottom: 12px;
}

.brand-title {
  position: relative;
  display: inline-block;
  font-family: "Pixel Space", Georgia, serif;
  font-size: clamp(45px, 8vw, 116px);
  line-height: 0.92;
  font-style: normal;
  margin-top: 8px;
  color: transparent;
  background:
    linear-gradient(96deg, #fffef8 0%, #7a8594 12%, #fdfefe 19%, #b8c4d4 28%, #3d4b5d 38%, #f8ffff 49%, #8da5c2 60%, #1a232e 72%, #eef5ff 84%, #7f8d9f 92%, #fff5e7 100%);
  background-size: 180% 100%;
  background-position: calc(50% + ((var(--mx) - 50%) * 0.25)) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 24px rgba(117, 158, 230, 0.22));
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 0 rgba(68, 78, 90, 0.78),
    0 6px 0 rgba(21, 26, 33, 0.78),
    0 18px 55px rgba(50, 75, 125, 0.42);
  animation: chromeShift 12s ease-in-out infinite alternate;
  cursor: pointer;
}

.brand-title.alt {
  font-family: "Golden Girdle", "Pixel Space", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-title::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 32%, rgba(0, 0, 0, 0.28) 78%, rgba(255, 255, 255, 0.18) 100%);
  opacity: 0.9;
  mix-blend-mode: overlay;
  transform: translateY(1px);
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-title::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(108deg, transparent 18%, rgba(255, 255, 255, 0.98) 31%, rgba(255, 255, 255, 0.52) 38%, transparent 49%),
    linear-gradient(270deg, transparent 56%, rgba(178, 221, 255, 0.24) 72%, transparent 82%);
  mix-blend-mode: screen;
  transform: translateX(calc((var(--mx) - 50%) * 0.22));
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes chromeShift {
  0% {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 18px rgba(117, 158, 230, 0.16));
  }
  100% {
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.78)) drop-shadow(0 0 26px rgba(148, 184, 246, 0.26));
  }
}

h2 {
  font-size: 34px;
  line-height: 1.02;
}

h3 {
  font-size: 27px;
  line-height: 1.06;
}

.hero {
  min-height: 40vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 22px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: transparent;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  text-transform: uppercase;
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.lede {
  max-width: 880px;
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0 0;
}

.hero-actions,
.status-key,
.tile-status,
.effects,
.chips,
.tag-block,
.signal-chain,
.review-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero {
  position: relative;
  grid-template-columns: 1fr;
}

.hero-actions {
  margin-top: 18px;
}

.legend,
.tile,
.pipeline article,
.review-item {
  border: 1px solid #1e232b;
  border-radius: 6px;
  background: #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.24);
}

.legend {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, calc(100% - 24px));
  padding: 10px;
  display: grid;
  gap: 9px;
  justify-items: end;
}

.legend.collapsed {
  width: 52px;
}

.legend-body {
  width: 100%;
  display: grid;
  gap: 9px;
}

.legend-toggle {
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.legend span,
.review-key span {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.review-key {
  margin-top: 12px;
}

abbr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 800;
  font-size: 10px;
  background: #030304;
}

.glyph-face {
  line-height: 1;
}

.paw-glyph {
  width: 13px;
  height: 13px;
  fill: currentColor;
  display: block;
}

.review-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-self: center;
  background: var(--amber);
  box-shadow: 0 0 0 5px #050505;
}

.review-dot.ok {
  background: var(--green);
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  margin: 18px 0;
}

.source-strip strong,
.source-strip span {
  background: rgba(5, 5, 5, 0.94);
  padding: 12px;
}

.source-strip strong {
  font-family: "Pixel Space", Georgia, serif;
  font-size: 30px;
}

.source-strip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.pipeline article {
  padding: 14px;
}

.pipeline p {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
  margin: 0 auto 4px;
  background: rgba(2, 3, 8, 0.9);
  backdrop-filter: blur(12px);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #343a45;
  border-radius: 12px;
  background: #050506;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 10px;
}

.toolbar input[data-search] {
  flex: 1 1 340px;
  min-width: min(340px, 100%);
}

.toolbar select {
  flex: 0 0 210px;
}

.toolbar,
.tiles {
  width: min(1200px, 100%);
}

.bibliography-button,
.toggle {
  flex: 0 0 auto;
}

.bibliography-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 12px;
}

.toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #050506;
}

.toggle input {
  width: 14px;
  min-height: 14px;
  margin: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid var(--cyan);
  outline-offset: 1px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 575px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  border-color: color-mix(in srgb, var(--type-color, #1e232b) 26%, #1e232b);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: auto 16px -30px 16px;
  height: 110px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(94, 161, 255, 0.24), rgba(21, 33, 49, 0.08) 55%, transparent 78%),
    radial-gradient(circle at 20% 50%, rgba(199, 221, 255, 0.12), transparent 45%);
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: -1;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 24%, rgba(130, 176, 245, 0.03) 58%, transparent 74%),
    radial-gradient(circle at 82% 16%, rgba(181, 209, 255, 0.08), transparent 18%);
  opacity: 0.55;
  pointer-events: none;
}

.tile:hover {
  border-color: #4f6e98;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 26px 54px rgba(0, 0, 0, 0.38),
    0 8px 22px rgba(68, 104, 153, 0.22);
}

.tile:hover::before,
.tile:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.tile header,
.article-head,
.related-panel header,
.agent-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.aliases,
.muted,
.empty,
.click-hint {
  color: var(--muted);
}

.aliases {
  margin: 8px 0 0;
  font-size: 12px;
}

.category-label,
.type-pill {
  color: var(--type-color, var(--steel));
}

.type-pill {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--type-color, var(--steel)) 35%, var(--line));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.name-display {
  font-family: "Wheaton Capitals", "Apple Garamond", "Cormorant Garamond", Georgia, serif;
}

.name-lower {
  font-family: "Apple Garamond", "Cormorant Garamond", "EB Garamond", Georgia, serif;
  text-transform: none;
}

.click-hint {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  font-size: 11px;
}

.verify {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--amber);
  box-shadow: 0 0 0 5px #050505;
}

.verify.ok {
  background: var(--green);
}

.tile-status span,
.status-pill,
.evidence-badge {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.evidence-badge.high {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--green);
}

.evidence-badge.human {
  border-color: rgba(135, 232, 255, 0.42);
  color: var(--cyan);
}

.evidence-badge.early {
  border-color: rgba(251, 191, 36, 0.44);
  color: var(--amber);
}

.evidence-badge.conflict {
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--red);
}

.mechanism {
  color: #e7e0d3;
  margin: 0;
  font-size: 13px;
}

.quick {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quick div {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

dt {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  margin-bottom: 3px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

dd {
  margin: 0;
  font-size: 12px;
}

dd span {
  color: var(--muted);
}

.tag {
  min-height: 0;
  border-radius: 99px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-effect {
  border-color: rgba(135, 232, 255, 0.34);
}

.tag-gene {
  border-color: rgba(196, 181, 253, 0.34);
}

.tag-protein {
  border-color: rgba(74, 222, 128, 0.26);
}

.tag-cytokine {
  border-color: rgba(248, 113, 113, 0.3);
}

.tag-channel {
  border-color: rgba(251, 191, 36, 0.34);
}

.symbols {
  display: inline-flex;
  gap: 3px;
}

.tag abbr,
.symbols abbr {
  min-width: 18px;
  min-height: 18px;
  font-size: 9px;
}

.section-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.organ-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.organ-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--organ-color, var(--steel));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 12px;
  background: #050506;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 10px;
  background: #0b0e13;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.01);
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  padding: 14px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(9px);
}

.detail {
  width: min(1180px, 100%);
  max-height: calc(100vh - 28px);
  margin: 0 auto;
  border: 1px solid #323845;
  border-radius: 6px;
  background: #050506;
  color: var(--ink);
  overflow: auto;
}

.article-shell {
  padding: 20px;
}

.article-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #050506;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.article-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.bibliography-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(8px);
}

.bibliography-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid #323845;
  border-radius: 10px;
  background: #050506;
  padding: 18px;
}

.icon {
  width: 40px;
  padding: 0;
}

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

.article-section h3 {
  margin-bottom: 18px;
}

.article-section h4 {
  margin: 16px 0 8px;
  color: #d7e5f8;
}

.article-section.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
}

.article-section p,
.article-section li {
  color: #dfd9cc;
  font-size: 13px;
}

.article-section aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.signal-grid {
  display: grid;
  gap: 10px;
}

.signal-chain {
  align-items: center;
  border: 1px solid #273444;
  background: linear-gradient(135deg, rgba(12, 19, 27, 0.95), rgba(0, 0, 0, 0.95));
  border-radius: 6px;
  padding: 10px;
}

.signal-node {
  border: 1px solid #3b5066;
  background: #050607;
  border-radius: 18px;
  padding: 7px 10px;
  color: #e8eef8;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 360px);
}

.signal-step-index {
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  color: var(--cyan);
  border: 1px solid rgba(135, 232, 255, 0.4);
  background: rgba(135, 232, 255, 0.08);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.signal-arrow {
  color: var(--cyan);
  font-weight: 800;
}

.tag-block {
  align-items: center;
  margin: 8px 0;
}

.tag-block h4 {
  min-width: 150px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: normal;
  font-size: 11px;
  text-transform: uppercase;
  margin: 0;
}

.related-panel {
  border: 1px solid #31475a;
  border-radius: 6px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(8, 20, 32, 0.95), rgba(3, 3, 3, 0.95));
  margin: 4px 0 18px;
}

.related-panel.global-related {
  margin: 16px 0 6px;
}

.inline-link {
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--cyan);
  background: transparent;
}

.table-link,
.study-link,
.vendor-link {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--cyan);
}

.citation {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-inline: 2px;
}

.citation a {
  min-height: 0;
  padding: 1px 4px;
  border-color: rgba(135, 232, 255, 0.35);
  color: var(--cyan);
  font-size: 10px;
}

.citation-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 300px;
  max-width: 420px;
  padding: 10px;
  border: 1px solid #3c4e5f;
  border-radius: 4px;
  background: #030507;
  color: var(--ink);
  font-size: 11px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 30;
}

.citation:hover .citation-popover,
.citation:focus-within .citation-popover {
  opacity: 1;
  transform: translateY(0);
}

.citation-popover span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.citations-section a {
  border: 0;
  padding: 0;
  color: var(--cyan);
  background: transparent;
}

@media (max-width: 820px) {
  main {
    width: min(100% - 20px, 1320px);
  }

  .hero,
  .article-section.intro {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar select,
  .bibliography-button,
  .toggle {
    flex: 1 1 100%;
  }

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

  .tile {
    min-height: 0;
  }

  .detail-backdrop {
    padding: 8px;
  }

  .detail {
    max-height: calc(100vh - 16px);
  }
}
