/* WEFT Research — shared stylesheet for the long-form analytics series.
   One layout, three themes (data-theme on <html>): terra, powerlines, landscape — the same palette
   families as the live dashboard looks. Reading text is Space Grotesk; HUD furniture is mono. */

@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("/landscape/fonts/share-tech-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000;
  --plate: #050506;
  --ink: #eceae6;
  --ink-2: #b8b4ad;
  --muted: #8b877f;
  --faint: #5f5b55;
  --rule: #2b2926;
  --rule-2: #1a1917;
  --accent: #b4e03a;          /* signature hue: HUD, highlights, the one-series emphasis */
  --accent-ink: #d7f27a;      /* accent used as text (brighter, for contrast) */
  --accent-2: #7fcfff;        /* second hue: wireframes, secondary emphasis */
  --accent-3: #c9864a;        /* third hue: rare contrast marks */
  --hud: "Share Tech Mono", "JetBrains Mono", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  /* five regions, validated on #000 and #0c0b0a (adjacent order NSW, QLD, SA, TAS, VIC) */
  --r-nsw: #3d8fe0; --r-qld: #c98500; --r-sa: #1fa37a; --r-tas: #9a7cf0; --r-vic: #d9568a;
  --measure: 66ch;
}
:root[data-theme="terra"] { --accent: #b4e03a; --accent-ink: #d2ef7c; --accent-2: #7fcfff; --accent-3: #c9864a; }
:root[data-theme="powerlines"] {
  --bg: #0c0b0a; --plate: #11100e; --ink: #efe8dc; --ink-2: #c2b9aa; --muted: #938a7c; --faint: #645d53;
  --rule: #2f2b27; --rule-2: #1b1917;
  --accent: #e2b566; --accent-ink: #f0cf8e; --accent-2: #9ad6ff; --accent-3: #cdbb9e;
}
:root[data-theme="landscape"] { --accent: #ff6a2b; --accent-ink: #ff9a6b; --accent-2: #8f89ff; --accent-3: #f2f0ee; }
/* hypo: the Hypomnemata header palette (mint readouts, vermilion planet); validated series pair #22a676 / #d9542e */
:root[data-theme="hypo"] { --accent: #3fd49a; --accent-ink: #84e9c2; --accent-2: #e2552a; --accent-3: #ff8a3d; }
/* holo: noir with electric blue reserved for flows; validated series pair #2f8fd6 / #b28d45 */
:root[data-theme="holo"] {
  --bg: #060607; --plate: #0b0b0d; --ink: #f5f3ee; --ink-2: #c3c6cb; --muted: #8b9097; --faint: #5b5f65;
  --rule: #26282c; --rule-2: #16171a;
  --accent: #36b8ff; --accent-ink: #92d6ff; --accent-2: #c9ccd1; --accent-3: #b28d45;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17.5px/1.66 var(--sans); font-feature-settings: "ss01", "tnum" 0;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { border-bottom-color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; }

/* faint star chart behind everything (generated by page.js; decoration only) */
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .9; }
.page { position: relative; z-index: 1; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 44px;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  font: 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
}
.topbar .brand { color: var(--ink); letter-spacing: .28em; border: 0; }
.topbar .brand .br { color: var(--accent); }
.topbar .brand .sl { color: var(--faint); }
.topbar .crumb { color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar a { color: var(--muted); border: 0; }
.topbar a:hover, .topbar a[aria-current] { color: var(--ink); }
/* the call to action, last in the bar: a call with Polymorphic AI (Calendly, new tab) */
.topbar a.cta { color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); padding: 7px 10px 6px; margin-left: 4px; }
.topbar a.cta:hover, .topbar a.cta:focus-visible { color: #fff; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 31; background: var(--accent); }

/* ------------------------------------------------------------ hero plate */
.hero { position: relative; height: min(100svh, 980px); min-height: 620px; overflow: hidden; }
.hero canvas.plate { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .hud { position: absolute; inset: 0; pointer-events: none; }
.hud-tag {
  position: absolute; font: 12px/1.35 var(--hud); letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); white-space: nowrap; transform-origin: 0 0; top: 0; left: 0;
  text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
}
.hud-tag .big { display: block; font-size: 30px; letter-spacing: .12em; line-height: 1.05; color: var(--accent); }
.hud-tag .kv { display: block; color: var(--ink-2); }
.hud-tag .kv b { color: var(--ink); font-weight: 400; }
.hud-tag.bracket { padding: 6px 10px 6px 12px; }
.hud-tag.bracket::before, .hud-tag.bracket::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 7px; border: 1px solid var(--accent); }
.hud-tag.bracket::before { left: 0; border-right: 0; }
.hud-tag.bracket::after { right: 0; border-left: 0; }
.hud-tag.dim { color: var(--muted); }
.hud-tag.dim .big { color: var(--ink-2); }
.hero-title {
  position: absolute; left: clamp(18px, 4vw, 64px); bottom: clamp(26px, 6vh, 64px); right: 18px;
  max-width: 900px; pointer-events: none;
}
.kicker { font: 12px/1.3 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 14px; }
.kicker .br { color: var(--accent); }
.kicker .sl { color: var(--faint); margin: 0 .4em; }
h1.title {
  font: 600 clamp(40px, 5.3vw, 80px)/.98 var(--sans); letter-spacing: -.035em; margin: 0;
  color: #fff; text-wrap: balance;
}
.dek { font: 400 clamp(18px, 1.9vw, 23px)/1.42 var(--sans); color: var(--ink-2); margin: 18px 0 0; max-width: 40ch; text-wrap: pretty; }
.byline { margin-top: 18px; font: 12px/1.6 var(--mono); color: var(--muted); letter-spacing: .02em; }
.byline span + span::before { content: "·"; margin: 0 .6em; color: var(--faint); }
.plate-caption {
  position: absolute; right: clamp(18px, 3vw, 44px); bottom: clamp(26px, 6vh, 64px); width: min(300px, 34vw);
  font: 11.5px/1.55 var(--mono); color: var(--muted); pointer-events: auto;
}
.plate-caption b { color: var(--ink-2); font-weight: 500; }
.plate-caption .label { display: block; font: 11px/1 var(--hud); letter-spacing: .2em; color: var(--accent-ink); margin-bottom: 8px; }
.scroll-cue { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 11px var(--hud); letter-spacing: .3em; color: var(--faint); }

/* ------------------------------------------------------------ article */
article { position: relative; padding: 40px 0 0; }
.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; position: relative; }
.prose { max-width: var(--measure); margin-left: clamp(0px, 8vw, 120px); }
.prose p { margin: 0 0 1.15em; text-wrap: pretty; }
.prose p.lede { font-size: 21px; line-height: 1.55; color: var(--ink); }
.prose p.lede::first-letter { font-weight: 600; color: var(--accent-ink); }
.prose strong { color: #fff; font-weight: 600; }
.prose em { color: var(--ink); }
.prose .num { font-family: var(--mono); font-size: .92em; color: #fff; white-space: nowrap; }
.prose ul { padding-left: 1.1em; margin: 0 0 1.15em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }

section.chapter { margin: 80px 0 0; position: relative; }
.sec-head { max-width: var(--measure); margin: 0 0 22px clamp(0px, 8vw, 120px); }
.sec-head .no { font: 12px/1 var(--hud); letter-spacing: .24em; color: var(--accent-ink); text-transform: uppercase; }
.sec-head .no .br { color: var(--accent); }
.sec-head h2 { font: 600 clamp(28px, 3.2vw, 40px)/1.08 var(--sans); letter-spacing: -.02em; margin: 12px 0 0; color: #fff; text-wrap: balance; }

/* margin notes: a side column beside their paragraphs on wide screens, inline cards on narrow ones */
.with-aside { display: grid; grid-template-columns: minmax(0, var(--measure)) 250px; column-gap: 64px; max-width: none; }
.with-aside > .body > p:last-child { margin-bottom: 1.15em; }
.aside {
  align-self: start; font: 12px/1.55 var(--mono); color: var(--muted);
  padding: 12px 14px 12px 16px; border-left: 1px solid var(--rule); margin-top: 4px;
}
.aside .label { display: block; font: 11px/1 var(--hud); letter-spacing: .2em; color: var(--accent-ink); text-transform: uppercase; margin-bottom: 8px; }
.aside b { color: var(--ink-2); font-weight: 500; }
@media (max-width: 1180px) {
  .with-aside { grid-template-columns: minmax(0, var(--measure)); }
  .aside { margin: 0 0 1.4em; }
}

/* LED stat: a dot-matrix number with a mono caption */
.stat-row { display: flex; flex-wrap: wrap; gap: 26px 40px; margin: 34px 0 34px clamp(0px, 8vw, 120px); max-width: 980px; }
.stat { min-width: 180px; flex: 1 1 200px; }
.stat canvas { display: block; height: 46px; }
.stat .cap { font: 12px/1.5 var(--mono); color: var(--muted); margin-top: 10px; max-width: 30ch; }
.stat .cap b { color: var(--ink-2); font-weight: 500; }

/* ------------------------------------------------------------ figures */
.fig {
  position: relative; margin: 46px 0; padding: 22px 24px 18px; background: color-mix(in srgb, var(--plate) 78%, transparent);
}
.fig.wide { margin-left: 0; margin-right: 0; }
.fig.narrow { max-width: calc(var(--measure) + 48px); margin-left: calc(clamp(0px, 8vw, 120px) - 24px); }
.fig::before, .fig::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--accent); pointer-events: none;
}
.fig::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.fig::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.fig-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: baseline; margin-bottom: 12px; }
.fig-no { font: 11px/1 var(--hud); letter-spacing: .22em; color: var(--accent-ink); text-transform: uppercase; grid-row: 1 / span 2; padding-top: 4px; }
.fig-title { font: 600 19px/1.25 var(--sans); color: #fff; margin: 0; letter-spacing: -.01em; }
.fig-finding { font: 400 15px/1.45 var(--sans); color: var(--ink-2); margin: 0; max-width: 72ch; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; font: 12px/1.3 var(--mono); color: var(--ink-2); }
.legend .chip { display: inline-flex; align-items: center; gap: 7px; cursor: default; }
.legend button.chip { background: none; border: 0; padding: 2px 0; color: inherit; font: inherit; cursor: pointer; }
.legend button.chip[aria-pressed="false"] { opacity: .38; }
.legend .sw { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .sw.dot { width: 9px; height: 9px; border-radius: 50%; }
.legend .sw.box { width: 11px; height: 11px; border-radius: 2px; }
.legend .sw.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 2px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--mono); }
.fig-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; margin-top: 12px; }
.howto { flex: 1 1 380px; font: 12.5px/1.6 var(--mono); color: var(--muted); margin: 0; }
.howto .label { font: 11px/1 var(--hud); letter-spacing: .2em; color: var(--ink-2); margin-right: 8px; }
.fig-tools { display: flex; gap: 8px; }
.fig-tools button {
  font: 11px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
  background: transparent; border: 1px solid var(--rule); padding: 7px 10px; cursor: pointer;
}
.fig-tools button:hover, .fig-tools button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); }
.fig-table, .fig-method { display: none; margin-top: 12px; overflow-x: auto; }
.fig-table.open, .fig-method.open { display: block; }
.fig-table table { border-collapse: collapse; font: 12px/1.4 var(--mono); color: var(--ink-2); min-width: 100%; }
.fig-table th, .fig-table td { padding: 5px 10px; border-bottom: 1px solid var(--rule-2); text-align: right; white-space: nowrap; }
.fig-table th:first-child, .fig-table td:first-child { text-align: left; }
.fig-table th { color: var(--muted); font-weight: 400; }
.fig-method { font: 12px/1.6 var(--mono); color: var(--muted); max-width: 90ch; }
.fig-method b { color: var(--ink-2); font-weight: 500; }

/* chart furniture (SVG classes) */
.ax line, .ax path { stroke: var(--rule); }
.ax text { fill: var(--muted); font-size: 11px; }
.ax .ttl { fill: var(--ink-2); font-size: 11px; letter-spacing: .04em; }
.grid line { stroke: var(--rule-2); stroke-dasharray: 2 4; }
.ref line { stroke: var(--faint); stroke-dasharray: 4 4; }
.ref text { fill: var(--muted); font-size: 11px; }
.dlabel { font-size: 11.5px; fill: var(--ink-2); }
.dlabel.hot { fill: var(--ink); }
.annot { font-size: 11.5px; fill: var(--ink-2); }
.annot.hud { font-family: var(--hud); letter-spacing: .12em; fill: var(--accent-ink); }
.crosshair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 9px 11px; background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1px solid var(--rule);
  font: 12px/1.5 var(--mono); color: var(--ink-2); opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip .t { color: #fff; margin-bottom: 4px; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; }
.tip .row b { color: var(--ink); font-weight: 500; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ------------------------------------------------------------ closing */
.takeaways { margin: 40px 0 0 clamp(0px, 8vw, 120px); max-width: 880px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .takeaways { grid-template-columns: 1fr; } }
.take { position: relative; padding: 16px 18px; border: 1px solid var(--rule); }
.take .label { font: 11px/1 var(--hud); letter-spacing: .2em; color: var(--accent-ink); text-transform: uppercase; display: block; margin-bottom: 10px; }
.take p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.take p b { color: #fff; font-weight: 600; }
.notes-foot { margin: 90px 0 0; padding: 36px 0 60px; border-top: 1px solid var(--rule); }
.notes-foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px 40px; }
.notes-foot h3 { font: 11px/1 var(--hud); letter-spacing: .22em; color: var(--accent-ink); text-transform: uppercase; margin: 0 0 12px; font-weight: 400; }
.notes-foot p, .notes-foot li { font: 12.5px/1.65 var(--mono); color: var(--muted); margin: 0 0 8px; }
.notes-foot ul { margin: 0; padding-left: 1em; }
.series-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 36px; }
.series-nav a { display: block; padding: 14px 16px; border: 1px solid var(--rule); color: var(--ink); }
.series-nav a:hover { border-color: var(--accent); }
.series-nav .k { display: block; font: 11px/1.45 var(--hud); letter-spacing: .2em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.series-nav .t { font: 600 17px/1.25 var(--sans); }
.series-nav a[aria-current="page"] { border-color: var(--accent); }
.sig { margin-top: 26px; font: 11px/1.6 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.sig a, .byline a { color: var(--ink-2); border-bottom-color: color-mix(in srgb, var(--ink-2) 35%, transparent); }
.sig a:hover, .byline a:hover { color: var(--ink); }
/* Sources: data sources first, then journal references; hanging indent, no bullets */
.notes-foot .refs { list-style: none; padding: 0; }
.notes-foot .refs li { padding-left: 1.4em; text-indent: -1.4em; }
.notes-foot .refs .k { color: var(--ink-2); }
.notes-foot .refs a { overflow-wrap: anywhere; }
.notes-foot .refs i { font-style: italic; }
/* journal references fold away under a toggle; the data sources above it stay visible */
.notes-foot details.refs-more { margin-top: 6px; }
.notes-foot details.refs-more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 9px;
  font: 11px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--rule); padding: 8px 11px; }
.notes-foot details.refs-more summary::-webkit-details-marker { display: none; }
.notes-foot details.refs-more summary::before { content: "+"; color: var(--accent-ink); font-size: 13px; }
.notes-foot details.refs-more[open] summary::before { content: "−"; }
.notes-foot details.refs-more summary:hover, .notes-foot details.refs-more summary:focus-visible { border-color: var(--accent); color: var(--accent-ink); outline: none; }
.notes-foot details.refs-more[open] summary { margin-bottom: 14px; }

/* small screens */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .crumb, .topbar .long, .topbar .cta { display: none; }
  .hero { min-height: 640px; height: 92svh; }
  .plate-caption { position: static; width: auto; margin: 16px 0 0; display: none; }
  .hud-tag .big { font-size: 20px; }
  .hud-tag { font-size: 10.5px; }
  .hud-tag.optional { display: none; }
  .wrap { width: min(1180px, 100% - 32px); }
  .fig { padding: 18px 14px 14px; margin: 36px -2px; }
  .fig.narrow { margin-left: -2px; }
  .fig-head { grid-template-columns: 1fr; }
  .fig-no { grid-row: auto; }
  .prose, .sec-head, .stat-row, .takeaways { margin-left: 0; }
  .prose p.lede { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
