@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;450;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* =====================================================================
   The Marvel Web: editorial dark theme
   One accent (gold), warm ink, hairlines. Data colors live in --d-*.
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #0c0c0e;
  --bg-raised: #131316;
  --bg-raised-2: #19191d;
  --bg-sunk: #08080a;
  --line: #24242a;
  --line-strong: #34343b;
  --border: var(--line);
  --text: #ecebe6;
  --text-dim: #a3a29b;
  --muted: #7a7973;
  --accent: #e0b85a;          /* gold: links, emphasis */
  --accent-soft: rgba(224, 184, 90, 0.12);
  --accent-2: #c9c6bd;        /* neutral highlight for borders / active states */
  --pow: #e0b85a;

  /* data colors (validated dark-mode slots) */
  --d-blue: #3987e5;
  --d-orange: #d95926;
  --d-aqua: #199e70;
  --d-grey: #6b6a64;

  /* legacy names used by weeks 1–5 */
  --stan: #e66767;
  --giant: #e0b85a;
  --morituri: #3987e5;
  --isolate: #199e70;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 720px;      /* reading column */
  --wide: 1120px;    /* figures that break out */
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* fine film grain over everything: keeps the black from looking flat */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(224, 184, 90, .3); color: #fff; }

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #f1d38e; }
article p a, article li a { border-bottom: 1px solid rgba(224, 184, 90, .35); }
article p a:hover, article li a:hover { border-bottom-color: currentColor; }

code {
  font-family: var(--mono);
  font-size: .84em;
  background: var(--bg-raised-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .08em .38em;
  color: #dcd9cf;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: var(--wide); }

/* ---------- top bar (all pages) ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 12, 14, .72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .inner {
  max-width: var(--wide); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-family: var(--serif); font-size: 1.32rem; letter-spacing: .005em; line-height: 1;
}
.wordmark:hover { color: var(--text); }
.wordmark .mark { width: 22px; height: 22px; flex: none; }
.wordmark em { font-style: italic; color: var(--accent); }
.topbar nav { display: flex; gap: 4px; font-size: .86rem; }
.topbar nav a {
  color: var(--text-dim); padding: 6px 12px; border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.topbar nav a.active { color: var(--text); }
.progress {
  position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: linear-gradient(90deg, transparent, var(--accent));
}
@media (max-width: 560px) {
  .topbar nav a.hide-sm { display: none; }
  .topbar nav a { padding: 6px 8px; }
}

/* legacy header (kept so nothing breaks if a page still uses it) */
header.site { display: none; }

/* ---------- index masthead ---------- */

.masthead {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 96px 0 72px;
}
.masthead canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 95% at 78% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 95% at 78% 45%, #000 20%, transparent 75%);
}
.masthead .inner { position: relative; max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.masthead h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.2rem, 9vw, 7rem); line-height: .95; letter-spacing: -.02em;
  margin: 22px 0 22px; max-width: 12ch;
}
.masthead h1 em { color: var(--accent); }
.masthead .lede { font-size: 1.12rem; color: var(--text-dim); max-width: 560px; margin: 0 0 32px; }
.crew { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; }
.crew .tag {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 13px; color: var(--text-dim);
  background: rgba(12,12,14,.6);
}
.crew a.tag:hover { color: var(--text); border-color: var(--accent-2); }
.mast-stats {
  display: flex; flex-wrap: wrap; gap: 40px; margin-top: 48px;
  font-size: .78rem; color: var(--muted);
}
.mast-stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 2.1rem; color: var(--text); line-height: 1.1; }

/* ---------- index: issue list ---------- */

main { padding: 56px 0 100px; }
.index-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 14px; margin-bottom: 0;
}
.index-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 0; }
.index-head span { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a {
  display: grid; grid-template-columns: 110px 1fr 28px; gap: 28px; align-items: start;
  padding: 36px 0; color: inherit;
}
.post-list .no {
  font-family: var(--serif); font-size: 3.6rem; line-height: .9; color: var(--muted);
  transition: color .35s var(--ease);
}
.post-list .meta {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.post-list h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.12; margin: 0 0 12px; letter-spacing: -.005em; color: var(--text);
}
.post-list p { margin: 0; color: var(--text-dim); font-size: .97rem; max-width: 64ch; }
.post-list .arrow {
  margin-top: 10px; color: var(--muted); font-size: 1.2rem;
  transition: transform .35s var(--ease), color .35s var(--ease);
}
.post-list a:hover .no, .post-list a:hover .arrow { color: var(--accent); }
.post-list a:hover .arrow { transform: translateX(4px); }
.post-list li.featured .no { color: var(--accent); }
.post-list .new {
  display: inline-block; margin-left: 10px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid rgba(224,184,90,.5); color: var(--accent); font-size: .6rem; vertical-align: 1px;
}
@media (max-width: 640px) {
  .post-list a { grid-template-columns: 1fr; gap: 6px; padding: 28px 0; }
  .post-list .no { font-size: 2.2rem; }
  .post-list .arrow { display: none; }
}

/* ---------- article ---------- */

article { position: relative; }
.article-head { padding: 72px 0 8px; }
.kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px;
}
article h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.5rem, 6.2vw, 4.4rem); line-height: 1.02; letter-spacing: -.018em;
  margin: 64px 0 18px; text-shadow: none;
}
.article-head h1 { margin-top: 0; }
article h1 em { color: var(--accent); }
.dek { font-size: 1.22rem; line-height: 1.55; color: var(--text-dim); margin: 0 0 30px; max-width: 60ch; }
article .meta, .byline {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  font-size: .8rem; color: var(--muted); margin-bottom: 40px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0;
}
.byline b { color: var(--text-dim); font-weight: 500; }

article h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.3rem);
  line-height: 1.15; letter-spacing: -.01em;
  margin: 76px 0 18px; padding: 0; border: 0;
  scroll-margin-top: 80px;
}
article h2 .sec {
  display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
article h3 { font-size: 1.02rem; font-weight: 600; margin: 36px 0 8px; letter-spacing: -.005em; }
article p, article li { color: #d9d7d0; }
article p { margin: 0 0 1.15em; }
article ul, article ol { padding-left: 1.2em; }
article li { margin-bottom: .55em; }
article li::marker { color: var(--muted); }
article strong { color: var(--text); font-weight: 600; }

article figure { margin: 36px 0; text-align: center; }
article figure img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
article figcaption { color: var(--text-dim); font-size: .86rem; margin-top: 12px; }

.lead-p::first-letter {
  font-family: var(--serif); float: left; font-size: 4.7rem; line-height: .8; padding: 8px 12px 0 0; color: var(--accent);
}

/* break-out figure, wider than the text column */
.bleed {
  --bw: min(var(--wide), calc(100vw - 32px));
  width: var(--bw);
  margin-left: calc((100% - var(--bw)) / 2);
  margin-right: calc((100% - var(--bw)) / 2);
}

/* ---------- figure card ---------- */

.fig { margin-top: 48px; margin-bottom: 40px; }
.fig-head { margin-bottom: 14px; }
.fig-no { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.fig-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; margin: 6px 0 0; color: var(--text); font-weight: 400; }
.fig-body {
  position: relative;
  background: linear-gradient(180deg, var(--bg-raised), #111114);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 30px 60px -30px rgba(0,0,0,.6);
}
.fig-cap { font-size: .84rem; color: var(--text-dim); margin-top: 14px; line-height: 1.6; max-width: 86ch; }
.fig-cap b { color: var(--text); font-weight: 600; }
.how {
  display: flex; gap: 10px; align-items: baseline; font-size: .8rem; color: var(--text-dim); margin: 0 0 16px; line-height: 1.55;
}
.how::before {
  content: "How to read"; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line-strong); padding: 1px 8px; border-radius: 999px; flex: none; white-space: nowrap;
}

/* ---------- tables ---------- */

table.stats { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: .9rem; }
table.stats th, table.stats td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.stats th {
  color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  border-bottom-color: var(--line-strong);
}
table.stats td.num, table.stats th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.stats tbody tr { transition: background .2s var(--ease); }
table.stats tbody tr:hover { background: rgba(255,255,255,.025); }
table.stats tr.hot td { color: var(--accent); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- stat cards ---------- */

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0; margin: 34px 0;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line);
}
.stat-card {
  padding: 22px 18px 20px; text-align: left; border-right: 1px solid var(--line);
  background: none; border-radius: 0;
}
.stat-card:last-child { border-right: 0; }
.stat-card .num {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.05;
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap;
}
.stat-card .num em { color: var(--accent); font-style: normal; }
.stat-card .label { color: var(--text-dim); font-size: .8rem; margin-top: 8px; line-height: 1.45; }
@media (max-width: 640px) {
  .stat-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat-card:last-child { border-bottom: 0; }
}

/* ---------- callouts / quotes ---------- */

.callout {
  position: relative; margin: 34px 0; padding: 22px 24px 22px 26px;
  background: linear-gradient(180deg, rgba(224,184,90,.06), rgba(224,184,90,.02));
  border: 1px solid rgba(224,184,90,.18); border-radius: var(--radius);
  color: #dedbd2; font-size: .96rem;
}
.callout::before {
  content: ""; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 2px; background: var(--accent); border-radius: 2px;
}
.callout > strong:first-child { color: var(--accent); }
.note {
  margin: 30px 0; padding: 18px 22px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--line); font-size: .92rem; color: var(--text-dim);
}
.note p { color: var(--text-dim); }
.note p:last-child { margin-bottom: 0; }
.note .tag-l { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }
.pull {
  font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.22; color: var(--text);
  margin: 56px 0; padding-left: 26px; border-left: 1px solid var(--accent);
}
.pull em { color: var(--accent); }
.quote { font-size: .93rem; color: #d6d3ca; border-left: 2px solid var(--line-strong); padding: 4px 0 4px 16px; margin: 14px 0; font-style: italic; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* small, refined label (was the comic "POW") */
.pow {
  display: inline-block; font-family: var(--mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(224,184,90,.45); border-radius: 999px;
  padding: 2px 10px; vertical-align: 2px; background: none; box-shadow: none; transform: none;
}
.comic-font { font-family: var(--serif); letter-spacing: 0; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding: 44px 0 70px; color: var(--muted); font-size: .82rem; }
footer .inner { max-width: var(--wide); margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }
footer .wrap { max-width: var(--wide); }
footer .fm { font-family: var(--serif); font-size: 1.2rem; color: var(--text-dim); margin-bottom: 4px; }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--text); }
footer .links { display: flex; gap: 22px; align-items: flex-start; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 80px 0 0; }
.post-nav a {
  display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--text);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.post-nav a:hover { border-color: var(--line-strong); background: var(--bg-raised); color: var(--text); }
.post-nav small { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.post-nav span { font-family: var(--serif); font-size: 1.2rem; line-height: 1.25; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }

/* ---------- table of contents (wide screens) ---------- */

.toc {
  position: fixed; top: 130px; left: max(24px, calc(50% - var(--max) / 2 - 260px)); width: 200px;
  font-size: .76rem; line-height: 1.45; opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.toc.on { opacity: 1; pointer-events: auto; }
.toc .t { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; color: var(--muted); padding: 5px 0 5px 12px; border-left: 1px solid var(--line); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--text-dim); }
.toc a.cur { color: var(--text); border-left-color: var(--accent); }
@media (max-width: 1300px) { .toc { display: none; } }

/* ---------- buttons, inputs, chips ---------- */

.btn {
  font-family: var(--sans); font-weight: 500; font-size: .84rem;
  background: var(--text); color: #111;
  border: 1px solid var(--text); border-radius: 999px; padding: 8px 16px;
  cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  box-shadow: none;
}
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: transparent; color: var(--text-dim); border-color: var(--line-strong); }
.btn.secondary:hover { color: var(--text); border-color: var(--accent-2); background: rgba(255,255,255,.03); }
.btn.dice::before { content: "↻  "; }

input[type="text"], input[type="search"], select {
  font-family: var(--sans);
  background: var(--bg-sunk); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 999px; padding: 8px 15px; font-size: .86rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input[type="text"]:focus, input[type="search"]:focus, select:focus {
  outline: none; border-color: rgba(224,184,90,.6); box-shadow: 0 0 0 3px rgba(224,184,90,.12);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a3a29b' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input[type="range"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid rgba(224,184,90,.7); outline-offset: 2px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--bg-sunk); border: 1px solid var(--line-strong);
}
.seg button {
  font-family: var(--sans); font-size: .79rem; font-weight: 500; color: var(--text-dim);
  background: none; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--text); color: #111; }

/* ---------- interactive network (weeks 1, 4, 5) ---------- */

.net-app, .chart-app {
  background: linear-gradient(180deg, var(--bg-raised), #111114);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 36px 0;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
.net-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.net-controls input[type="text"] { min-width: 200px; flex: 1 1 200px; }

.chip-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-sunk); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 13px; font-size: .8rem; color: var(--text-dim); cursor: pointer; user-select: none;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chip-toggle input { accent-color: var(--accent); }
.chip-toggle.on { color: var(--text); border-color: rgba(224,184,90,.5); }

.net-stage {
  position: relative; width: 100%; height: 560px;
  background: radial-gradient(ellipse at 50% 40%, #121216 0%, var(--bg-sunk) 70%);
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: grab;
}
.net-stage:active { cursor: grabbing; }
.net-stage svg { width: 100%; height: 100%; display: block; }

.net-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: .78rem; color: var(--text-dim); align-items: center; }
.net-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.net-tooltip, .tip {
  position: absolute; pointer-events: none;
  background: rgba(16,16,19,.97); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 12px; font-size: .8rem; line-height: 1.45;
  max-width: 290px; color: var(--text);
  box-shadow: 0 16px 40px -8px rgba(0,0,0,.7);
  z-index: 20; opacity: 0; transition: opacity .12s ease;
}
.net-tooltip strong, .tip strong { color: var(--text); font-weight: 600; }
.net-tooltip .td, .tip .td { color: var(--text-dim); font-size: .74rem; margin-top: 3px; }

.hero-panel {
  margin-top: 16px; background: var(--bg-raised-2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 18px 20px;
}
.hero-panel .hp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-panel h3 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; }
.hero-panel .hp-meta { font-size: .78rem; color: var(--text-dim); margin-bottom: 8px; }
.hero-panel .hp-desc { font-size: .9rem; color: #d6d3ca; margin-bottom: 10px; }
.hero-panel .hp-close { background: none; border: none; color: var(--text-dim); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.hero-panel .hp-close:hover { color: var(--accent); }
.hero-panel .hp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hero-panel .hp-chip {
  background: var(--bg-sunk); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 11px; font-size: .76rem; color: var(--text); cursor: pointer; transition: border-color .2s;
}
.hero-panel .hp-chip:hover { border-color: var(--accent); }
.hero-panel .hp-section-label { font-family: var(--mono); font-size: .62rem; color: var(--muted); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .12em; }

/* ---------- chart panels ---------- */

.chart-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chart-tabs button {
  background: var(--bg-sunk); border: 1px solid var(--line-strong); color: var(--text-dim);
  border-radius: 999px; padding: 6px 14px; font-size: .8rem; cursor: pointer; font-weight: 500; font-family: var(--sans);
  transition: all .2s var(--ease);
}
.chart-tabs button:hover { color: var(--text); }
.chart-tabs button.active { color: #111; border-color: var(--text); background: var(--text); }
.chart-plot { width: 100%; min-height: 420px; }
.chart-note { font-size: .8rem; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.chart-note code { font-size: .78rem; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .net-stage { height: 440px; }
  .fig-body, .net-app, .chart-app { padding: 14px; }
  .masthead { padding: 64px 0 48px; }
  .article-head { padding-top: 48px; }
}

/* ---------- entrance motion ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 700px) { .masthead canvas { opacity: .35; } }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; }
