/* TreadPilot — The Lab article pages
   SPDX-License-Identifier: GPL-3.0-or-later
   Copyright (C) 2026 Backlog Fejlesztő Kft.

   Loads after /styles.css and turns the page into the Lab's Deep Space room:
   the research notes wear the app's own dark, while type stays the site's
   (Bricolage Grotesque display, Public Sans body, IBM Plex Mono for data). */

:root {
  --lab-bg: #050505; --lab-surface: #0B0B0E; --lab-surface2: #101014;
  --lab-line: #FAFAF71F; --lab-line2: #FAFAF733;
  --lab-ink: #FAFAF7; --lab-mid: #FAFAF7A6; --lab-faint: #FAFAF766;
  --lab-acc: #FFEB3B; --lab-blue: #4DA6F0; --lab-zone: #69C98F; --lab-alert: #E4685D;
}
body { background: var(--lab-bg); color: var(--lab-ink); }
:focus-visible { outline-color: var(--lab-acc); }

/* nav inherits .mark from styles.css; the links need paper ink here */
.nav a { color: var(--lab-ink); }
.nav .pill { background: var(--lab-ink); color: var(--lab-bg); }

/* ---------- article scaffold ---------- */
.art { max-width: 960px; margin: 0 auto; padding: 0 26px; }
.art-head { padding: 56px 0 12px; }
.eyebrow-mono {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--lab-faint);
}
.eyebrow-mono em { color: var(--lab-acc); font-style: normal; margin-right: 8px; }
.art h1 {
  font-size: clamp(32px, 5.2vw, 54px); font-weight: 800; line-height: 1.04;
  margin: 18px 0 0; max-width: 24ch; color: var(--lab-ink);
}
.standfirst { font-size: 18px; line-height: 1.6; color: var(--lab-mid); max-width: 62ch; margin-top: 20px; }
.art-meta {
  display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 24px;
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--lab-faint);
}
.art-meta b { color: var(--lab-mid); font-weight: 500; }

.art h2 {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--lab-acc);
  margin: 56px 0 18px; letter-spacing: .24em;
}
.art .prose { max-width: 68ch; }
.art .prose p { margin: 0 0 18px; line-height: 1.7; font-size: 16px; color: #FAFAF7E0; }
.art .prose strong { color: var(--lab-ink); }
.art .prose a { color: var(--lab-acc); }

/* ---------- figures & charts ---------- */
figure.chart { margin: 34px 0 0; border: 1px solid var(--lab-line); background: var(--lab-surface); }
.fig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 18px 0; flex-wrap: wrap; }
.fig-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 600; font-size: 16px; letter-spacing: 0; }
.fig-src { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--lab-faint); text-align: right; }
.fig-scroll { overflow-x: auto; padding: 6px 8px 4px; }
.fig-scroll svg { display: block; min-width: 620px; width: 100%; height: auto; }
figure.chart figcaption { padding: 12px 18px 16px; color: var(--lab-mid); font-size: 13.5px; line-height: 1.6; max-width: 78ch; }
figure.chart figcaption b, figure.chart figcaption strong { color: var(--lab-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 18px 2px; font-size: 12.5px; color: var(--lab-mid); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }

details.tbl { margin: 0 0 10px; border: 1px solid var(--lab-line); border-top: 0; background: var(--lab-surface2); }
details.tbl summary { cursor: pointer; padding: 10px 18px; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--lab-mid); }
details.tbl .tbl-scroll { overflow-x: auto; }
details.tbl table { border-collapse: collapse; font-size: 13px; margin: 4px 18px 16px; font-variant-numeric: tabular-nums; }
details.tbl th, details.tbl td { border: 1px solid var(--lab-line); padding: 5px 12px; text-align: right; color: var(--lab-mid); }
details.tbl th { color: var(--lab-ink); font-weight: 500; font-family: "IBM Plex Mono", monospace; font-size: 11.5px; }

/* chart text */
.tick { font: 11px "Public Sans", sans-serif; fill: var(--lab-faint); }
.axis-lab { font: 10px "IBM Plex Mono", monospace; letter-spacing: .12em; fill: var(--lab-faint); text-transform: uppercase; }
.anno { font: 12px "Public Sans", sans-serif; fill: var(--lab-mid); }
.anno-strong { font: 600 12px "Public Sans", sans-serif; fill: var(--lab-ink); }
.gridline { stroke: var(--lab-line); stroke-width: 1; }

.tooltip {
  position: fixed; pointer-events: none; z-index: 9; display: none;
  background: #17171C; border: 1px solid var(--lab-line2); color: var(--lab-ink);
  font: 12.5px "Public Sans", sans-serif; padding: 8px 11px; border-radius: 3px;
  white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 6px 24px #00000080;
}
.tooltip .tt-h { color: var(--lab-faint); font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.tooltip .row { display: flex; gap: 14px; justify-content: space-between; }
.tooltip .row i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- explainer cards, notes, numbers ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--lab-line); border: 1px solid var(--lab-line); margin: 26px 0; }
.step { background: var(--lab-surface); padding: 20px; }
.step .k { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--lab-acc); margin-bottom: 10px; }
.step p { color: var(--lab-mid); font-size: 14px; margin: 0; line-height: 1.6; }
.step p strong { color: var(--lab-ink); }

.hero-num { display: flex; flex-wrap: wrap; gap: 1px; background: var(--lab-line); border: 1px solid var(--lab-line); margin: 36px 0 0; }
.hero-num > div { flex: 1 1 200px; background: var(--lab-surface); padding: 22px 22px 18px; }
.hero-num .n { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: clamp(30px, 4vw, 40px); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.hero-num .n.acc { color: var(--lab-acc); }
.hero-num .l { color: var(--lab-mid); font-size: 13.5px; margin-top: 8px; }

.note { border: 1px solid var(--lab-line); border-left: 3px solid var(--lab-acc); background: var(--lab-surface); padding: 18px 22px; margin: 30px 0; max-width: 72ch; }
.note .nl { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--lab-acc); margin-bottom: 8px; }
.note p { color: var(--lab-mid); font-size: 14.5px; margin: 0; line-height: 1.65; }
.note p strong { color: var(--lab-ink); }

/* ---------- the Lab archive (lab/index.html) ---------- */
.lablist { margin-top: 28px; border-top: 1px solid var(--lab-line); }
.labrow {
  display: block; padding: 30px 4px 32px; border-bottom: 1px solid var(--lab-line);
  text-decoration: none; color: var(--lab-ink);
}
a.labrow:hover { background: var(--lab-surface); }
.labrow-meta {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--lab-faint);
}
.labrow h2 {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 26px;
  letter-spacing: -.015em; line-height: 1.2; text-transform: none;
  color: var(--lab-ink); margin: 12px 0 0;
}
.labrow p { color: var(--lab-mid); font-size: 15px; line-height: 1.65; margin: 12px 0 0; max-width: 70ch; }
.labrow .more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--lab-acc); }
.labrow.teaser h2 { color: var(--lab-faint); }
.labrow.teaser p { color: var(--lab-faint); }

.art-foot { border-top: 1px solid var(--lab-line); margin-top: 56px; padding: 26px 0 10px; color: var(--lab-faint); font-size: 13.5px; max-width: 78ch; line-height: 1.7; }
.art-foot b { color: var(--lab-mid); font-weight: 500; }
.art-foot a { color: var(--lab-acc); }
.backrow { margin: 40px 0 0; }
.backrow a { color: var(--lab-acc); text-decoration: none; font-weight: 600; font-size: 14px; }
.backrow a:hover { text-decoration: underline; }

/* the site footer inherits from styles.css and already lives on ink — keep the
   hairline between the Lab black and the footer ink */
footer { border-top: 1px solid var(--lab-line); }
