/*
  The two self-hosted faces, loaded from `/fonts/` so `font-src 'self'` already permits them.

  **Self-hosted is not a preference, it is the only option that needs no infrastructure change.**
  `docs/infra/cloudfront/response-headers-policy.json:16` ships
  `default-src 'self'; … font-src 'self' data:`, CloudFront is hand-provisioned, and no
  font CDN is reachable from the deployed app. A Google Fonts link would need a CSP edit, a deploy
  and a re-verified operational gate before a single glyph rendered.

  **One variable file for the sans, three static weights for the mono.** Plex Sans' 100-700 range
  collapses its weights into 45.7 KB, and the type scale uses 560/580/620/640/650/660 — six weights
  a variable axis serves and six static files would not.

  **The mono needs 400, 500 and 600, and the claim that it needed only the first two was wrong from
  the day it was written** (0077 step 3). Figures are set at the weight their type token
  names, and those tokens reach 660 — `text-stat`, `text-statbig`, `text-statxl` and `text-price` are
  all 660, and step 0 shipped `font-mono text-statbig` in the same commit as this comment. With only
  400 and 500 present, Chromium selects the 500 face and **synthetically emboldens** it: measured as
  dark pixels in `888` at 28px, 400 gives 445, 500 gives 536, and 600, 620, 640, 660 and 700 all give
  **566** — one value, with the advance unchanged. Every weight distinction in the type scale
  collapsed the moment text was set in the mono, while the variable sans stayed distinct throughout.
  A real 600 master is selected for every 620-660 request, because CSS looks above the target first,
  finds nothing, and takes the nearest below. 88.8 KB total, latin only.

  **The latin subset carries U+2212.** That matters more than it looks: `signedPercent()` in the
  adapters is the one place the app decides a minus is U+2212 rather than a hyphen, so a subset
  without it would render every negative figure as a tofu box. U+2191/U+2193 are here for the same
  reason — direction arrows are text, not icons.

  `font-display: swap` — the system stack in `--sans` paints immediately and is replaced when Plex
  arrives. A report that is readable 200 ms early is worth a reflow.
*/

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url('/fonts/ibm-plex-sans-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/ibm-plex-mono-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/ibm-plex-mono-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   TOKENS — the design system's values, and the only place a hex appears.

   Copied from UI/0077-trading-desk/comp.html, palette A ("Trading desk"), the page approved
   2026-09-09. That file supersedes UI/final skeleton/, which these values came from until
   0077 step 0. Semantic, never literal: there is no --blue-500, there is --brand, --up, --crit,
   --ink-2. A component never sees a hex, which is why re-valuing the whole ladder is thirty
   lines rather than a rewrite.

   Two pairs are load-bearing and are not to be "fixed":
     - fill → --crit, text → --t-crit. The --t-* set is the same meaning lightened to pass
       contrast on --card. --crit as text on a dark card fails contrast; --t-crit as a fill
       looks washed out.
     - --up / --down are BLUE and RED, not green and red. Deliberate: green/red is the worst
       possible choice for red-green colour deficiency, and PRODUCT.md names it outright. The
       comp agrees (--up #2fa6d9, --dn #c4443f), so 0077 did not touch them.

   **One theme, since 0077 step 0.** There used to be a `[data-theme='light']` block. The comp
   defines Direction A in dark only — Direction B is a different *direction*, not Direction A in
   light — so there was no approved light palette to move to, and the one that shipped was
   unreachable from the app UI (index.html hardcodes data-theme="dark"; only #/_gallery switched
   it). It also carried a real defect: --card and --surface-hi were both #ffffff, so "elevated"
   was invisible. Deleting it was the owner's decision of 2026-09-20. The `[data-theme='dark']` selector is kept beside the bare :root so that
   index.html's attribute, and anything that still writes it, keeps resolving.

   **Two values are the comp's read for contrast, not the comp's.** `--ink-3` and `--muted` are
   `#8492a0` here where palette A says `#63727e`. Measured, the comp's value is 4.5:1 against its own
   page ground and **3.5:1 on a card** — and 45 files set `text-ink-3` at 10.5px, including the
   "nothing on this site is investment advice" line the footer is required to show. axe found 41
   failing nodes on one screen. `#8492a0` is the nearest value on the same hue that clears 4.5:1 on
   every surface in the ladder (6.08 plane / 5.51 card / 4.93 surface-hi). A mockup is not an
   accessibility audit, and `PRODUCT.md` says this product is read outdoors, one-handed, glancing.

   `--edge` is new and has no counterpart in the comp: the boundary colour for a control whose only
   affordance is its outline. `--line` is 1.53:1 on the page ground, which is right for a rule
   between panels and below WCAG 1.4.11's 3:1 for the edge of something you can press.

   **Surfaces are separated by rules, not by lightness.** Measured: plane→card is 1.104:1 in the
   comp against 1.076:1 before. That is deliberate on the comp's part — its evidence cells are the
   *plane* colour, delimited by 1px --line rules and 1px grid gaps showing the line colour
   through. Reach for a border before reaching for a lighter surface.
   ============================================================ */

/* The bare :root is the fallback; the attribute selector is what index.html ships. Both carry the
   same values — there is only one theme. */
:root,
:root[data-theme='dark'] {
  --plane: #0b0e11; --card: #141a20; --surface-hi: #1c242c; --field: #0b0e11; --rail: #0e1318;
  --veil: rgba(11, 14, 17, 0.94); --scrim: rgba(6, 8, 10, 0.72);
  --line: #2a343d; --line-2: #1b242b; --box: #43434c;
  --ink: #e7edf2; --ink-2: #8695a2; --ink-3: #8492a0; --marker: #e7edf2; --onstatus: #0b0e11;
  --brand: #3987e5; --accent: #f2a93b; --up: #2fa6d9; --down: #c4443f;
  --good: #3f9e5c; --warn: #f2a93b; --crit: #c4443f;
  --t-brand: #a6c8f2; --t-good: #7ed67e; --t-warn: #f5cf7d; --t-crit: #f0a3a3;
  --grid: #1b242b; --muted: #8492a0; --edge: #556575;
  --gauge: linear-gradient(90deg, #1f3a52, #2c3f52 33%, #5c4a1e 62%, #5e2626);
  --impgrad: linear-gradient(180deg, #1c242c, #141a20);
  --tkbg: #24303a; --tkink: #e7edf2; --hover: #1b242b; --btn: #e9e8e3; --btnink: #111;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
  /* The earnings calendar's sector stripes: identity, not meaning, and never alone — the card writes the
     sector too. 5.4-11.6 : 1 on --card; some pairs merge under colour-vision deficiency. */
  --sector-tech: #4f8ff7; --sector-comm: #a77bf3; --sector-disc: #f07fb6; --sector-stap: #8fbf5a; --sector-ener: #e8873a; --sector-fin: #2fb7a8;
  --sector-hlth: #63c7e6; --sector-ind: #9aa7b4; --sector-mat: #b5884f; --sector-re: #d9705f; --sector-util: #e6d36a;
}

/* Theme-independent. --r is the card radius the whole design system uses; --sans and --mono are
   the two self-hosted families, declared in ./fonts.css and mapped into Tailwind by app.css.
   The system stacks behind them are what paints during `font-display: swap`. */
:root {
  --r: 14px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* The one glyph contrast correction, and the only class selectors in this file. StatusGlyph emits
   class="glyph g-good" (etc.); the TONE table's `fill` class alone does not carry this. The `:root`
   prefix went with the light theme — it existed to scope the rule to one of two themes, and with
   one theme it was pure dead specificity. */
.glyph.g-good,
.glyph.g-crit {
  color: #fff;
}

/* The blog's layout. Colours and faces are the app's tokens above. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--plane); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 17px; line-height: 1.65; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
header.site, main, footer.site { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
header.site .logo img { display: block; height: 32px; width: auto; }
header.site nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; }
header.site nav a { text-decoration: none; color: var(--ink-2); }
header.site nav a:hover { color: var(--ink); }
header.site nav a.cta { color: var(--onstatus); background: var(--accent); padding: 6px 12px; border-radius: 8px; font-weight: 600; }
header.site nav a.cta:hover { color: var(--onstatus); filter: brightness(1.1); }
main { flex: 1; padding-top: 24px; padding-bottom: 56px; }
h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.15; letter-spacing: -0.01em; margin: 8px 0 16px; font-weight: 640; }
h2 { font-size: 23px; line-height: 1.3; margin: 40px 0 8px; font-weight: 620; }
.kicker { margin: 0; color: var(--ink-3); font-size: 14px; }
.standfirst { margin: 0 0 28px; color: var(--ink-2); font-size: 20px; line-height: 1.5; }
.body p { margin: 0 0 18px; }
.body ul, .body ol { padding-left: 22px; margin: 0 0 18px; }
.body img { max-width: 100%; height: auto; border-radius: 8px; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 32px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.back { margin-top: 40px; }
.posts { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
.card a { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-decoration: none; }
.card a:hover { border-color: var(--accent); color: var(--ink); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
.card h2 { margin: 4px 0 6px; font-size: 21px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.card .kicker { color: var(--ink-3); font-size: 13px; }
.empty { color: var(--ink-2); }
footer.site { padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 13px; }
@media (min-width: 640px) {
  .card a { grid-template-columns: 220px 1fr; align-items: start; }
}
