/* ════════════════════════════════════════════════════════════════════════
   INPHERIO TOKENS — the one source for colour, type, radius and depth, used by
   the website AND every dashboard (admin, operator, consumer, sign-in).
   Light by default; <html data-theme="dark"> (set pre-paint by theme-boot.js:
   System / Light / Dark) switches every token at once. Components never use a
   hex colour — only these names.
   ════════════════════════════════════════════════════════════════════════ */
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/InstrumentSans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  --bg: #ffffff;
  --paper: #f5f5f7;
  --cloud: #f5f5f7;
  --cloud-2: #e8e8ed;
  --ink: #1d1d1f;
  --ink-2: #1d1d1f;
  --body: #424245;
  --muted: #66666b;
  --line: #e8e8ed;
  --line-strong: #c4c4ca;
  --blue: #0066cc;
  --blue-deep: #0066cc;
  --blue-bright: #2997ff;
  --blue-tint: #e8f1fc;
  --violet: #7a35d6;
  --green: #1d7a3e;
  --green-bright: #30d158;
  --green-tint: #e7f6ec;
  --amber: #b25000;
  --amber-bright: #ff9f0a;
  --amber-tint: #fff4e5;
  --red: #d70015;
  --red-tint: #fdeceb;
  --void: #000000;
  --void-2: #1d1d1f;
  --void-3: #2d2d30;
  --navy: #000000;
  --navy-2: #1d1d1f;
  --navy-line: rgba(255, 255, 255, 0.12);
  --navy-text: #a1a1a6;
  --font-sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Instrument Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: var(--font-sys);
  --font-serif: var(--font-sys);
  --font-display: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, monospace;   /* old name: data & numbers */
  --font-mono: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, monospace;
  --r-sm: 10px;
  --radius: 12px;   /* old name, still in a few inline styles */
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 30px;
  --shadow-sm: none;
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-blue: none;
  --grad: linear-gradient(90deg, #0071e3, #8e44ec);
  --grad-soft: linear-gradient(115deg, #f5f5f7, #ffffff);
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);

  /* ── page width (2026-11-04): ONE content width for the site's header, every
     section, the footer and every dashboard view, so all edges line up as you
     scroll. It used to be 1080px for sections, 1200px for the header, 561/798px
     home tiles and 1240px panels — a thin column on a big screen. --measure caps
     running prose only (a readable line), never boxes, grids or tables. */
  --page-max: 1280px;   /* Russ 2026-11-04: 1080 was a skinny strip, 1600 too spread out */
  --panel-max: 1440px;  /* dashboards: a little wider, they are mostly tables */
  --page-gutter: clamp(1.25rem, 3.5vw, 3.5rem);
  --page-width: min(var(--page-max), 100% - 2 * var(--page-gutter));
  --measure: 74ch;   /* ≈ 90 real characters a line (testkit/ui_spacing.py holds ≤ ~95) */

  /* ── semantic roles (2026-11-04, dark mode). Components use THESE, never a hex:
     surface = raised card/box · hover = row/button hover · link = text links ·
     accent = filled blue (always white text) · on-ink = text on an --ink fill ·
     band = the always-dark sections (console, code, black tiles) · glass = the bars */
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --hover: #f2f3f6;
  --link: #0066cc;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --on-accent: #ffffff;
  --on-ink: #ffffff;
  --red-fill: #d70015;
  --green-fill: #1d7a3e;
  --link-on-dark: #2997ff;
  --muted-on-dark: #a1a1a6;
  --ink-soft: rgba(0, 0, 0, 0.8);
  --ink-hover: #2a2f3a;
  --violet-tint: #f3ecfd;
  --band: #000000;
  --band-line: transparent;
  --code-bg: #1d1d1f;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --ring: rgba(0, 125, 250, 0.6);
  --selection: #b3d7ff;
  --img-dim: none;
  color-scheme: light;
}

/* ── Dark: designed for the site, not inverted. Near-black page, graphite
   surfaces one step up, Apple's dark accents. Every text/surface pair here is
   held to WCAG AA by testkit/ui_contrast.py (normal text ≥ 4.5:1, large ≥ 3:1). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --paper: #0e0e10;
  --cloud: #262629;
  --cloud-2: #323236;
  --surface: #1c1c1e;
  --surface-2: #232326;
  --hover: #2a2a2d;
  --ink: #f5f5f7;
  --ink-2: #e8e8ed;
  --body: #c7c7cc;
  --muted: #9a9aa0;
  --line: #2c2c2e;
  --line-strong: #48484a;
  --link: #4aa6ff;
  --blue: #4aa6ff;
  --blue-deep: #4aa6ff;
  --blue-bright: #64b5ff;
  --blue-tint: rgba(41, 151, 255, 0.13);
  --accent: #0071e3;
  --accent-hover: #0a84ff;
  --violet: #d09cff;
  --violet-tint: rgba(191, 90, 242, 0.16);
  --green: #30d158;
  --green-bright: #30d158;
  --green-tint: rgba(48, 209, 88, 0.15);
  --amber: #ff9f0a;
  --amber-bright: #ffb340;
  --amber-tint: rgba(255, 159, 10, 0.15);
  --red: #ff6961;
  --red-tint: rgba(255, 69, 58, 0.16);
  --on-ink: #000000;
  --red-fill: #c8261c;
  --green-fill: #248a3d;
  --ink-soft: rgba(245, 245, 247, 0.82);
  --ink-hover: #d1d1d6;
  --void: #000000;
  --void-2: #161618;
  --navy-text: #a1a1a6;
  --band: #161618;
  --band-line: rgba(255, 255, 255, 0.09);
  --code-bg: #161618;
  --glass: rgba(22, 22, 23, 0.72);
  --glass-strong: rgba(22, 22, 23, 0.96);
  --ring: rgba(41, 151, 255, 0.7);
  --selection: rgba(41, 151, 255, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.7);
  --grad-soft: linear-gradient(115deg, #0e0e10, #000000);
  --img-dim: brightness(0.92);
}

/* ── shared controls ─────────────────────────────────────────────────── */
/* the theme switch (System / Light / Dark), rendered by theme-boot.js */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 980px; background: var(--cloud-2); }
.theme-switch button { display: inline-grid; place-items: center; min-width: 44px; min-height: 32px; padding: 0 .7rem; border: 0; border-radius: 980px;
  background: transparent; color: var(--muted); font: 500 .78rem/1 var(--font-sys); cursor: pointer; transition: background .2s, color .2s; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: #48484a; box-shadow: none; }
.theme-switch svg { width: 15px; height: 15px; }
.footer-theme { display: flex; align-items: center; gap: .8rem; margin: 0; font-size: .78rem; color: var(--muted); }
/* the switch sits on the footer's bottom line: © left · Beta · switch right, all centred on one axis */
.site-footer .footer-base { align-items: center; padding-block: 1.25rem 0.5rem; }
.site-footer .footer-base > span:first-child { margin-right: auto; }
@media (max-width: 560px) { .site-footer .footer-base .footer-theme { flex-basis: 100%; } }

/* ── inline SVG diagrams (network page): presentation attributes yield to CSS ── */
:root[data-theme="dark"] svg circle[fill="#fff"] { fill: var(--surface); stroke: var(--line-strong); }
:root[data-theme="dark"] svg [stroke="#d3d9e8"] { stroke: var(--line-strong); }

/* Always-dark components (console, code, black tiles/bands, dark receipts) carry
   on-dark text tokens in BOTH themes, so a caption or link inside them is never
   the page's light-theme grey/blue on black. */
:is(.tile--black, .way--dark, .band-dark, .band-signal, .bento .card--ink, .x-door:nth-child(2), .console, .code, .xs, .sys, .receipt.dark, .x-code-inline, .way-code, .mini-node) {
  --ink: #f5f5f7; --ink-2: #e8e8ed; --body: #c7c7cc; --muted: #a1a1a6; --link: #2997ff; --blue: #2997ff; --blue-deep: #2997ff; --line: rgba(255, 255, 255, 0.1);
}
