/* HiDRA project site */

:root {
  /* behavior categories, sampled from the paper's figures (Fig 2E) */
  --c-investigative: #213f7a;
  --c-aggressive: #f074ab;
  --c-appetitive: #4682c4;
  --c-reproductive: #5fc08a;
  --c-defensive: #f89a41;
  --c-nonsocial: #94519f;
  --c-object: #626366;

  /* site palette built from the categories: investigative navy base, aggressive pink accent */
  --navy: #213f7a;
  --navy-deep: #111f3d;
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --surface: #ffffff;
  --text: #18202f;
  --muted: #586276;
  --line: #e2e6ee;
  --accent: #f074ab;          /* fills */
  --accent-ink: #b83a78;      /* the same pink, dark enough for text on white */
  --accent-soft: #fdedf4;
  --link: #2f63a3;            /* appetitive blue, darkened for text contrast */
  --code-bg: #111f3d;
  --code-text: #e6ebf5;
  --figure-bg: #ffffff;
  --shadow: 0 1px 2px rgba(17, 31, 61, .06), 0 8px 24px rgba(17, 31, 61, .06);
  --stripe: linear-gradient(90deg,
    var(--c-investigative) 0 14.28%, var(--c-aggressive) 0 28.57%, var(--c-appetitive) 0 42.85%,
    var(--c-reproductive) 0 57.14%, var(--c-defensive) 0 71.42%, var(--c-nonsocial) 0 85.71%, var(--c-object) 0 100%);

  --radius: 10px;
  --max: 1080px;
  --text-max: 720px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1424;
    --bg-alt: #121b2e;
    --surface: #152036;
    --text: #e4e8f0;
    --muted: #9aa5b8;
    --line: #26324a;
    --accent-ink: #f074ab;
    --accent-soft: #3a1d2d;
    --link: #8fb4f0;
    --code-bg: #0a1120;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --c-investigative: #6f8fd0;
    --c-object: #a0a0a0;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1424;
  --bg-alt: #121b2e;
  --surface: #152036;
  --text: #e4e8f0;
  --muted: #9aa5b8;
  --line: #26324a;
  --accent-ink: #f074ab;
  --accent-soft: #3a1d2d;
  --link: #8fb4f0;
  --code-bg: #0a1120;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --c-investigative: #6f8fd0;
  --c-object: #a0a0a0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 650; }
h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; container-type: inline-size; }
.wrap > * { --gutter: max(0px, (100cqw - var(--text-max)) / 2); }
.prose { max-width: var(--text-max); margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--navy-deep) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.nav-brand { flex: none; display: inline-flex; align-items: center; gap: 9px; color: #fff; font: 700 18px/1 var(--display); letter-spacing: -.01em; text-decoration: none; }
.nav-brand img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(240, 116, 171, .24), transparent 60%),
    radial-gradient(900px 420px at 50% 115%, rgba(148, 81, 159, .28), transparent 65%),
    radial-gradient(900px 500px at 0% 0%, rgba(70, 130, 196, .28), transparent 60%),
    var(--navy-deep);
  color: #fff;
  padding: 72px 0 0;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
.hero .wrap { position: relative; }
/* title block left, logo medallion right */
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.hero-logo {
  width: clamp(200px, 26vw, 290px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .06), 0 0 0 16px rgba(255, 255, 255, .03), 0 24px 60px rgba(0, 0, 0, .35);
}
.hero-logo img { width: 104%; height: 104%; object-fit: contain; margin-top: 4%; }
.hero h1 { font-size: clamp(56px, 11vw, 112px); font-weight: 750; letter-spacing: -.045em; line-height: .95; }
.hero h1 .expand { display: block; font-size: clamp(20px, 3vw, 30px); font-weight: 500; letter-spacing: -.01em; color: rgba(255, 255, 255, .78); margin-top: 14px; }
.lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.55; color: rgba(255, 255, 255, .88); max-width: 760px; margin: 28px 0 32px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  font: 600 15px/1 var(--sans); text-decoration: none;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); transform: translateY(-1px); }
.btn.primary { background: var(--c-aggressive); border-color: var(--c-aggressive); color: var(--navy-deep); }
.btn.primary:hover { background: #f58dbb; border-color: #f58dbb; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }

.paper { margin-top: 44px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); }
.paper-title { font: 500 17px/1.45 var(--sans); color: rgba(255, 255, 255, .92); margin-bottom: 10px; }
.authors { font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, .8); }
.authors sup { font-size: 10px; color: rgba(255, 255, 255, .55); margin-left: 1px; }
.affils { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .55); margin-top: 8px; }

.hero-media { margin: 56px 0 0; position: relative; }
.hero-media img {
  width: 100%; border-radius: 14px 14px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
}
.hero-media figcaption {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  font-size: 13px; color: rgba(255, 255, 255, .92);
}
.hero-media figcaption span { background: rgba(17, 31, 61, .8); padding: 6px 10px; border-radius: 6px; display: inline-block; backdrop-filter: blur(4px); }

/* ---------- stats ---------- */
.stats { background: var(--navy); color: #fff; }
.stats .wrap { display: grid; grid-template-columns: repeat(5, 1fr); }
.stat { padding: 28px 12px; text-align: center; border-left: 1px solid rgba(255, 255, 255, .1); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font: 700 clamp(28px, 4vw, 40px)/1 var(--display); letter-spacing: -.03em; }
.stat b::after { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; margin: 12px auto 0; background: var(--k); }
.stat:nth-child(1) { --k: var(--c-aggressive); }
.stat:nth-child(2) { --k: var(--c-appetitive); }
.stat:nth-child(3) { --k: var(--c-reproductive); }
.stat:nth-child(4) { --k: var(--c-defensive); }
.stat:nth-child(5) { --k: var(--c-nonsocial); }
.stats { position: relative; }
.stats::after, footer::before { content: ""; position: absolute; left: 0; right: 0; height: 5px; background: var(--stripe); }
.stats::after { bottom: -9px; }
.stats + section { padding-top: 105px; }
footer::before { top: 0; }
.stat span { display: block; margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, .7); line-height: 1.35; }

/* ---------- sections ---------- */
section { padding: 96px 0; }
section.alt { background: var(--bg-alt); }
.section-head h2::before { content: ""; display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--k, var(--accent)); margin-bottom: 20px; }
.section-head { max-width: var(--text-max); margin: 0 auto 36px; }
.section-head p { margin-top: 16px; font-size: 18px; color: var(--muted); max-width: var(--text-max); }

/* ---------- figures ---------- */
.fig { margin: 32px 0 0; }
.fig-frame {
  background: var(--figure-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(10px, 2vw, 22px); box-shadow: var(--shadow);
  cursor: zoom-in; position: relative;
}
.fig-frame img { margin: 0 auto; width: 100%; height: auto; }
.fig-frame.narrow img { max-width: 620px; }
.fig figcaption { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 12px auto 0; max-width: var(--text-max); }
.fig figcaption b { color: var(--text); font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.split.rev > :first-child { order: 2; }
.split .fig { margin-top: 0; }
.split .prose, .split figcaption { margin-left: 0; margin-right: 0; }
.split { padding-left: var(--gutter); }
.split.rev { padding-left: 0; padding-right: var(--gutter); }

/* figure floated inside running text */
.wrapfig { display: flow-root; max-width: var(--text-max); margin: 0 auto; }
.fig.float-fig { float: right; width: calc(40% + var(--gutter)); margin: 6px calc(-1 * var(--gutter)) 20px 32px; }
.float-fig .fig-frame { padding: 12px; }
.float-fig figcaption { font-size: 13.5px; }

.result { padding: 56px 0; border-top: 1px solid var(--line); }
.result:first-of-type { border-top: 0; padding-top: 8px; }
.result h3 { font-size: clamp(22px, 2.8vw, 28px); font-weight: 650; letter-spacing: -.02em; margin-bottom: 14px; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }
.fig-row .fig { margin-top: 0; }

/* ---------- comparison table ---------- */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 8px; font-size: 15.5px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.compare thead th { font: 650 17px/1.3 var(--display); letter-spacing: -.01em; color: var(--muted); border-bottom: 2px solid var(--line); }
.compare thead th.hidra { color: var(--accent-ink); }
.compare tbody th { font-weight: 600; width: 18%; color: var(--text); }
.compare td.old { color: var(--muted); width: 36%; }
.compare td.hidra { background: var(--accent-soft); color: var(--text); }
.compare thead th.hidra { background: var(--accent-soft); border-radius: 10px 10px 0 0; }
.compare tbody tr:last-child td.hidra { border-radius: 0 0 10px 10px; }
.compare-note { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ---------- architecture steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; padding-top: 24px; }
.step::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--step-c); }
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 0; }
/* stage colors follow the architecture diagram (Fig 2A) */
.step:nth-child(1) { --step-c: var(--c-object); }
.step:nth-child(2) { --step-c: var(--c-investigative); }
.step:nth-child(3) { --step-c: linear-gradient(90deg, var(--c-reproductive) 50%, var(--c-defensive) 50%); }
.step:nth-child(4) { --step-c: var(--c-aggressive); }

/* ---------- video ---------- */
.media { margin: 0; }
.media-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy-deep); aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.media-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.media-placeholder {
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  color: rgba(255, 255, 255, .85);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px),
    linear-gradient(135deg, var(--navy), var(--navy-deep));
}
.media-placeholder div { max-width: 460px; }
.media-placeholder svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .7; }
.media-placeholder strong { display: block; font: 600 16px/1.4 var(--sans); margin-bottom: 6px; }
.media-placeholder small { font-size: 13px; color: rgba(255, 255, 255, .6); }
.media-placeholder code { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.media.missing video { display: none; }
.media.missing .media-placeholder { display: flex; }
.media figcaption { font-size: 14.5px; color: var(--muted); margin: 12px auto 0; max-width: var(--text-max); }

/* ---------- code ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.tab { font: 600 13px/1 var(--sans); padding: 10px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--code-bg); color: #fff; }
pre {
  margin: 0; position: relative;
  background: var(--code-bg); color: var(--code-text);
  font: 400 13.5px/1.7 var(--mono);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 18px 20px; overflow-x: auto;
}
pre.solo { border-radius: var(--radius); }
pre:has(> .copy) { padding-right: 80px; }
pre .c { color: #8b93a6; }
pre .k { color: var(--c-aggressive); }
pre .s { color: var(--c-reproductive); }
.copy {
  position: absolute; top: 10px; right: 10px;
  font: 600 12px/1 var(--sans); color: rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px; padding: 6px 9px; cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.reqs { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.reqs li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.reqs li:first-child { padding-top: 0; }
.reqs b { display: block; font-weight: 600; margin-bottom: 2px; }
.reqs span { color: var(--muted); }

.routes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 48px; }
.route { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color .15s, transform .15s; }
.route:hover { border-color: var(--k); transform: translateY(-2px); }
.route { border-top: 5px solid var(--k); }
.route:nth-child(1) { --k: var(--c-appetitive); }
.route:nth-child(2) { --k: var(--c-reproductive); }
.route:nth-child(3) { --k: var(--c-aggressive); }
.route:nth-child(4) { --k: var(--c-nonsocial); }
.route h3 { font-size: 17px; margin: 0 0 8px; }
.route p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0; }

/* ---------- limitations ---------- */
.limits { columns: 2; column-gap: 40px; padding-left: 1.1em; margin: 0; }
.limits li { break-inside: avoid; margin-bottom: 12px; font-size: 15.5px; }

/* ---------- citation ---------- */
.cite-wrap { position: relative; }

/* ---------- footer ---------- */
footer { position: relative; background: var(--navy-deep); color: rgba(255, 255, 255, .72); padding: 36px 0; font-size: 14px; }
footer a { color: #fff; }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

/* ---------- consortium (dark band) ---------- */
section.dark {
  position: relative; color: rgba(255, 255, 255, .86);
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(240, 116, 171, .16), transparent 60%),
    radial-gradient(800px 420px at 0% 100%, rgba(70, 130, 196, .2), transparent 60%),
    var(--navy-deep);
}
section.dark::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--stripe); }
section.dark h2, section.dark h3 { color: #fff; }
.consortium-intro p { font-size: 18px; line-height: 1.65; }
.consortium-lists { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 48px; margin-top: 44px; padding-top: 36px; border-top: 1px solid rgba(255, 255, 255, .12); }
.consortium-lists h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: rgba(255, 255, 255, .6); }
.names { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 32px; font-size: 15.5px; line-height: 1.9; color: #fff; }
.consortium-lists > div:last-child .names { columns: 1; }
.kaggle-thanks { margin-top: 24px; font-size: 13.5px; line-height: 1.55; color: rgba(255, 255, 255, .55); }

/* ---------- lightbox ---------- */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(8, 14, 28, .86); }
dialog.lightbox img { max-width: 96vw; max-height: 90vh; width: auto; background: #fff; border-radius: 8px; padding: 12px; }
dialog.lightbox button { position: fixed; top: 16px; right: 20px; font-size: 28px; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .split, .start-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .split.rev > :first-child { order: 0; }
  .split, .split.rev { padding: 0; }
  .split .prose { margin: 0 auto; }
  .steps, .routes { grid-template-columns: repeat(2, 1fr); }
  .stats .wrap { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .consortium-lists { grid-template-columns: 1fr; gap: 32px; }
  .names { columns: 2; }
  .consortium-lists > div:last-child .names { columns: 2; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  section { padding: 64px 0; }
  .hero { padding-top: 48px; }
  .hero-top { grid-template-columns: 1fr; gap: 24px; }
  .hero-logo { order: -1; width: 128px; }
  .nav-links { gap: 16px; }
  .steps, .routes { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:last-child { grid-column: 1 / -1; }
  .hero-media figcaption { position: static; margin: 10px 0 16px; }
  .hero-media figcaption span { background: none; padding: 0; color: rgba(255, 255, 255, .7); }
  .limits { columns: 1; }
  .fig.float-fig { float: none; width: auto; margin: 0 0 24px; }
  .compare, .compare tbody, .compare tr, .compare td, .compare th { display: block; width: auto !important; }
  .compare thead { display: none; }
  .compare tbody tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
  .compare tbody th { padding: 12px 14px 4px; border: 0; }
  .compare td { border: 0; padding: 6px 14px 12px; }
  .compare td::before { content: attr(data-label); display: block; font: 600 13px/1.4 var(--sans); color: var(--muted); margin-bottom: 2px; }
  .compare td.hidra { border-radius: 0 !important; padding-top: 10px; }
  .compare td.hidra::before { color: var(--accent-ink); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .simmap-dim, .simmap-label { transition: none; }
  .btn, .route { transition: none; }
}

/* ---------- interactive similarity matrix (Supp Fig 4) ---------- */
.simmap { position: relative; cursor: default; max-width: 960px; margin: 0 auto; }
.simmap-legend { display: grid; grid-template-columns: auto minmax(120px, 280px); gap: 4px 12px; align-items: center; justify-content: end; font-size: 12.5px; color: #3c4456; margin-bottom: 10px; }
.simmap-bar { height: 10px; border-radius: 2px; }
.simmap-ticks { grid-column: 2; display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); color: #586276; }
.simmap-ticks i { font-style: normal; }
.simmap-svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.simmap-label { font: 600 7.4px/1 var(--sans); dominant-baseline: central; cursor: pointer; }
.simmap-label.end { text-anchor: end; }
.simmap-svg.focus .simmap-label:not(.on) { opacity: .35; }
.simmap-label.on { font-weight: 800; text-decoration: underline; }
.simmap-svg.focus .simmap-label.on { text-decoration: none; }
.simmap-branch { fill: none; stroke: #2b2f3a; stroke-width: 1; }
.simmap-branch.on { stroke: var(--c-aggressive); stroke-width: 2.2; }
.simmap-branch-hit { fill: none; stroke: transparent; stroke-width: 7; cursor: pointer; pointer-events: stroke; }
.simmap-dim { fill: #111f3d; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.simmap-svg.focus .simmap-dim { opacity: .55; }
.simmap-block { fill: none; stroke: #fff; stroke-width: 1.5; pointer-events: none; }
.simmap-label { transition: opacity .25s ease; }
.simmap-band { fill: none; stroke: #fff; stroke-width: 1; pointer-events: none; }
.simmap-cell { fill: none; stroke: var(--c-aggressive); stroke-width: 2; pointer-events: none; }
.simmap-tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 300px;
  background: var(--navy-deep); color: #fff; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.simmap-tip b { font-weight: 650; }
.simmap-tip span { color: rgba(255, 255, 255, .7); display: block; margin-bottom: 4px; }
.simmap-tip .v { margin-top: 4px; color: rgba(255, 255, 255, .85); }
.simmap-tip .v b { color: var(--c-aggressive); }
.simmap-tip .row { display: flex; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 12px; }
.simmap-tip .row span { display: inline; margin: 0; color: #fff; }
.simmap-tip .list { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, .75); }
@media (max-width: 640px) {
  .simmap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .simmap-svg { min-width: 680px; }
  .simmap-legend { position: sticky; left: 0; justify-content: start; }
}

/* ---------- DooM dataset explorer ---------- */
.doom { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.doom-tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.doom-tab { font: 600 14px/1 var(--sans); padding: 11px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.doom-tab[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--line); }
.doom-body { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 560px; }
.doom-nav { border-right: 1px solid var(--line); padding: 10px; max-height: 720px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.doom-nav button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  font: 500 14px/1.25 var(--sans); color: var(--text); background: none; border: 0; border-radius: 7px; padding: 8px 10px;
}
.doom-nav button small { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.doom-nav button i { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.doom-nav button:hover { background: var(--bg-alt); }
.doom-nav button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.doom-nav button[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }
.doom-panel { padding: 24px 28px 28px; min-width: 0; }
.doom-lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.doom-frame { position: relative; margin: 0; background: #0b1020; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.doom-frame img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; }
.doom-frame img[src$="/LyricalHare.jpg"] { height: 200%; }  /* top cage only, as in its thumbnail */
.doom-lab h3 { font-size: 22px; margin-bottom: 12px; }
.doom-stats { margin: 0; display: grid; grid-template-columns: 1fr; font-size: 14px; }
.doom-stats div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doom-stats dt { color: var(--muted); }
.doom-stats dd { margin: 0; }
.doom-sub { font: 650 16px/1.3 var(--display); margin: 28px 0 10px; }
.doom-sub span, .doom-bh span { font: 400 13.5px/1.4 var(--sans); color: var(--muted); margin-left: 8px; }
.doom-rows { display: grid; gap: 0; }
.doom-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.doom-chip { display: inline-flex; align-items: center; gap: 7px; font: 600 13.5px/1.2 var(--sans); align-self: start; }
.doom-chip::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.doom-def { margin: 0; padding-left: 1.1em; line-height: 1.55; }
.doom-def li + li { margin-top: 4px; }
.doom-more summary { cursor: pointer; color: var(--link); font-size: 13.5px; margin-top: 6px; }
.doom-more[open] summary { margin-bottom: 4px; }
.doom-none { margin: 0; color: var(--muted); font-style: italic; font-size: 14px; }
.doom-bh { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 22px; margin-bottom: 18px; }
.doom-bh .doom-chip { font-size: 22px; font-family: var(--display); }
.doom-bh .doom-chip::before { width: 14px; height: 14px; border-radius: 4px; }
.doom-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doom-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 14px; background: var(--bg); }
.doom-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
/* thumbnail: whole frame scaled to fill the box, trimmed equally from both sides of the longer dimension */
.doom-thumb { flex: none; width: 64px; height: 48px; border-radius: 5px; overflow: hidden; background: #0b1020; }
.doom-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
/* LyricalHare's frame stacks two cages; its thumbnail shows only the upper half (the top cage) */
.doom-thumb img[src$="/LyricalHare.jpg"] { height: 200%; }
.doom-card header b { display: block; font-size: 15px; }
.doom-card header small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 760px) {
  .doom-body { grid-template-columns: 1fr; min-height: 0; }
  .doom-nav { flex-direction: row; overflow-x: auto; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .doom-nav button { width: auto; flex: none; }
  .doom-nav button small { margin-left: 6px; }
  .doom-panel { padding: 18px 16px 22px; }
  .doom-lab { grid-template-columns: 1fr; gap: 16px; }
  .doom-row { grid-template-columns: 1fr; gap: 6px; }
  .doom-stats div { grid-template-columns: 110px minmax(0, 1fr); }
}
