:root {
  --bg: #faf8f4;
  --panel: #fffdfa;
  --ink: #1a1714;
  --muted: #7a6e63;
  --line: #e6ded2;
  --amber: #b06a16;
  --accent: #2a8f8f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1080px; margin: 0 auto; padding: 0 24px 80px; }

/* ── hero ─────────────────────────────────────────── */
.hero { padding: 72px 0 32px; max-width: 780px; }
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 14px;
}
h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; margin: 0 0 18px; font-weight: 700; letter-spacing: -.02em; }
.lede { font-size: 19px; color: #443e38; margin: 0; }
.lede em { font-style: italic; color: var(--ink); }

/* ── stat cards ───────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 52px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px;
}
.stat .num { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat .num small { font-size: 22px; color: var(--muted); font-weight: 600; }
.stat .lbl { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ── chart blocks ─────────────────────────────────── */
.block { margin-bottom: 56px; }
.block-head { max-width: 720px; margin-bottom: 18px; }
.block-head h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.01em; }
.block-head .sub { margin: 0; font-size: 15.5px; color: var(--muted); }
.block-head .sub em { font-style: normal; color: #443e38; font-weight: 500; }

.chart-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px 18px; position: relative;
}
.chart-wrap.narrow { max-width: 760px; }
.caption {
  font-size: 13.5px; color: var(--muted); margin: 10px 4px 0;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.caption strong { color: var(--amber); font-weight: 600; }

svg { display: block; width: 100%; }
#chord { height: 540px; }
#matrix { height: 460px; }
#insularity { height: 300px; }
#temporal { height: 380px; }
#smallworld { height: 110px; }
#centrality { height: 460px; }
#sunburst { height: 560px; }
#robustness { height: 360px; }
.series-label { font-size: 12px; font-weight: 600; font-family: "JetBrains Mono", monospace; }

/* ── in-page tabs ─────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 44px; flex-wrap: wrap; }
.tab-btn {
  font-family: "Space Grotesk", sans-serif; font-size: 15px; font-weight: 600;
  color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent;
  padding: 12px 18px; margin-bottom: -1px; cursor: pointer; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }
.tab-pane[hidden] { display: none; }

/* ── part dividers ────────────────────────────────── */
.part { margin: 24px 0 26px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); display: flex; align-items: baseline; gap: 14px; }
.part-no { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.part-title { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.block-head h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.01em; }

/* annotations on the temporal chart */
.anno { font-size: 12px; font-weight: 600; fill: var(--amber); font-family: "JetBrains Mono", monospace; }

/* small-world stat row + distribution */
.sw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 6px; }
.swc { border-left: 3px solid var(--amber); padding-left: 14px; }
.swc .n { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.swc .l { font-size: 13px; color: var(--muted); margin-top: 6px; }
.seg-label { font-size: 13px; font-weight: 700; }
.seg-cap { font-size: 11px; fill: var(--muted); font-family: "JetBrains Mono", monospace; }

/* connector */
.connector { padding: 4px 2px; }
.conn-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.conn-controls label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.conn-controls select {
  font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); max-width: 220px;
}
.conn-arrow { color: var(--amber); font-weight: 700; font-size: 18px; }
.conn-msg { font-size: 15px; color: #443e38; margin: 0 0 14px; }
.conn-msg strong { color: var(--amber); font-size: 17px; }
.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  border: 1.5px solid; font-size: 14px; font-weight: 600;
}
.chip-dot { width: 9px; height: 9px; border-radius: 50%; }
.chain-link { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* centrality scatter */
.scatter-label { font-size: 12px; font-weight: 600; fill: var(--ink); pointer-events: none; }

/* sunburst */
.sun-label { font-size: 11px; font-weight: 600; fill: #2c2620; pointer-events: none; paint-order: stroke; stroke: rgba(255,253,250,.7); stroke-width: 2.5px; }
.sun-label-inner { font-size: 12px; font-weight: 700; fill: #fff; pointer-events: none; font-family: "JetBrains Mono", monospace; }
.tooltip .t-mem { font-size: 11.5px; opacity: .85; margin-top: 5px; line-height: 1.4; }

/* shared chart text */
.axis-label { font-size: 12.5px; fill: var(--muted); font-family: "JetBrains Mono", monospace; }
.val-label { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.tick line { stroke: var(--line); }
.tick text { fill: var(--muted); font-size: 11.5px; }
.domain { display: none; }

/* chord */
.chord-ribbon { mix-blend-mode: multiply; transition: opacity .15s; }
.chord-arc { cursor: pointer; }
.chord-arc-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.dim { opacity: .08 !important; }

/* matrix */
.cell-label { font-size: 12px; font-weight: 600; }
.matrix-diag { stroke: var(--ink); stroke-width: 1.5px; }

/* bars */
.bar { transition: opacity .15s; }
.bar-track { fill: #efe7da; }

/* tooltip (shared) */
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; opacity: 0;
  background: var(--ink); color: #f6efe5; padding: 9px 12px; border-radius: 9px;
  font-size: 13px; max-width: 240px; box-shadow: 0 6px 22px rgba(0,0,0,.22);
  transform: translate(-50%, calc(-100% - 12px)); transition: opacity .12s;
}
.tooltip b { color: #fff; }
.tooltip .t-sub { font-family: "JetBrains Mono", monospace; font-size: 11px; opacity: .8; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 3px; }

/* ── findings ─────────────────────────────────────── */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 8px 0 44px; }
.findings article { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.findings h3 { font-size: 16px; margin: 0 0 8px; }
.findings p { font-size: 14.5px; color: #443e38; margin: 0; }
.findings strong { color: var(--amber); }

footer { border-top: 1px solid var(--line); padding-top: 20px; color: var(--muted); font-size: 13.5px; }
footer code { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: #443e38; }

@media (max-width: 760px) {
  .stats, .findings { grid-template-columns: 1fr; }
  #chord { height: 420px; }
}

/* ════════ HUB: tile grid of explorations ════════ */
.back-link {
  display: inline-block; margin: 28px 0 -8px;
  font-family: "JetBrains Mono", monospace; font-size: 13px; letter-spacing: .04em;
  color: var(--muted); text-decoration: none; transition: color .15s;
}
.back-link:hover { color: var(--amber); }

.hub-hero { padding: 72px 0 8px; max-width: 820px; }

.hub-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
  margin: 40px 0 56px;
}
.tile {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 0; overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(26,23,20,.10);
  border-color: #d8cdbb;
}
.tile.soon { opacity: .72; }

.tile-thumb {
  height: 150px; background: var(--bg); border-bottom: 1px solid var(--line);
  display: block; position: relative;
}
.tile-thumb svg { width: 100%; height: 100%; }

.tile-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.tile-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.tile-no { color: var(--amber); font-weight: 500; }
.chip-status {
  margin-left: auto; padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
}
.chip-status.live { background: rgba(42,143,143,.14); color: #1f6e6e; }
.chip-status.soon { background: #efe7da; color: var(--muted); }
.tile h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.01em; }
.tile p { font-size: 14.5px; color: #443e38; margin: 0; }
.tile-cta {
  margin-top: 16px; font-family: "JetBrains Mono", monospace; font-size: 12.5px;
  font-weight: 500; color: var(--amber);
}
.tile.soon .tile-cta { color: var(--muted); }

@media (max-width: 760px) {
  .hub-grid { grid-template-columns: 1fr; }
}
