/* kraft — shared base of both modes: fonts, tokens (light and dark themes), mode switch, icons, document viewer.
   Beeons "look beyond" language: pure black and white surfaces, hairlines, the brand colours (blue, violet, yellow)
   only as faint light. No inline styles anywhere (strict CSP): bar widths are classes (.w-0 … .w-100).
   console.css styles the console mode, gui.css the design mode; html[data-mode] shows one (js/mode.js). */
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --beeons-blue: #0A65E7; --beeons-violet: #8A2AE3; --beeons-yellow: #FFD600;
  --radius: 16px; --radius-sm: 10px;
  --head: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --body: "Jost", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", Menlo, monospace;
}
:root, [data-theme="dark"] {
  --ink: #000; --panel: #0A0A0A; --panel-2: #111111; --panel-3: #1A1A1A;
  --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .18);
  --text: #F1F7FE; --muted: #A1A4A5; --faint: #8A8D90;
  --fg: #FFFFFF; --on-fg: #000000; --fg-hover: #E8E8E8; --tint: 255, 255, 255;
  --header-bg: rgba(0, 0, 0, .66); --tile-top: #1A1A1A; --tile-bottom: #050505; --heading-end: rgba(255, 255, 255, .58);
  /* Meaning colours: text ≥ 4.5:1 on every surface of the theme */
  --ok: #4ADE80; --ko: #FF8A7A; --warn: #FFC34D; --info: #7FB0FF; --review: #C9A0FF;
  --glow-a: rgba(138, 42, 227, .22); --glow-b: rgba(10, 101, 231, .22); --glow-c: rgba(255, 214, 0, .07);
  --bar-glow: rgba(10, 101, 231, .6); --pride-glow: rgba(138, 42, 227, .7);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
  --scrim: rgba(0, 0, 0, .6); --nav-glow: .24;
  /* Console: a dark glass terminal */
  --term-page: #000; --term-bg: rgba(10, 10, 12, .82); --term-bar: rgba(255, 255, 255, .03);
  --term-text: #E9EEF5; --term-user: #7FB0FF; --term-path: #C9A0FF; --term-acc: #FFD54D;
  --term-cursor: #F1F7FE; --term-track: rgba(255, 255, 255, .12); --term-select: rgba(127, 176, 255, .3);
  color-scheme: dark;
}
[data-theme="light"] {
  --ink: #FFFFFF; --panel: #F7F8F9; --panel-2: #F0F1F3; --panel-3: #E7E9EC;
  --line: rgba(0, 0, 0, .09); --line-strong: rgba(0, 0, 0, .16);
  --text: #0F0B0A; --muted: #5B6168; --faint: #6B7178;
  --fg: #000000; --on-fg: #FFFFFF; --fg-hover: #222222; --tint: 0, 0, 0;
  --header-bg: rgba(255, 255, 255, .76); --tile-top: #FFFFFF; --tile-bottom: #ECEDEF; --heading-end: rgba(15, 11, 10, .62);
  --ok: #157F3D; --ko: #C2332B; --warn: #8F6200; --info: #0A58CC; --review: #7A22CC;
  --glow-a: rgba(138, 42, 227, .10); --glow-b: rgba(10, 101, 231, .10); --glow-c: rgba(255, 214, 0, .14);
  --bar-glow: rgba(10, 101, 231, .35); --pride-glow: rgba(138, 42, 227, .4);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .28);
  --scrim: rgba(15, 11, 10, .35); --nav-glow: .1;
  /* Console: a paper terminal (warm white, black ink) */
  --term-page: #ECEBE6; --term-bg: rgba(252, 251, 248, .9); --term-bar: rgba(0, 0, 0, .025);
  --term-text: #14110F; --term-user: #0A58CC; --term-path: #7A22CC; --term-acc: #8F6200;
  --term-cursor: #14110F; --term-track: rgba(0, 0, 0, .1); --term-select: rgba(10, 88, 204, .2);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 .9375rem/1.5 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: clip; }
html:not([data-mode="gui"]) body { background: var(--term-page); }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: rgba(var(--tint), .35); }
a:hover { color: var(--fg); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 6px; }
p { margin: 0 0 .75em; }
img, svg { max-width: 100%; }
button { font: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.ico { display: block; width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .theme-icon-moon, [data-theme="light"] .theme-icon-sun { display: none; }

/* ---------- One mode at a time ---------- */
html:not([data-mode="gui"]) .mode-gui, html[data-mode="gui"] .mode-console { display: none !important; }  /* no script: console */

/* ---------- Bar widths (CSP: no style="") ---------- */
.w-0 { --w: 0%; } .w-5 { --w: 5%; } .w-10 { --w: 10%; } .w-15 { --w: 15%; } .w-20 { --w: 20%; } .w-25 { --w: 25%; } .w-30 { --w: 30%; }
.w-35 { --w: 35%; } .w-40 { --w: 40%; } .w-45 { --w: 45%; } .w-50 { --w: 50%; } .w-55 { --w: 55%; } .w-60 { --w: 60%; } .w-65 { --w: 65%; }
.w-70 { --w: 70%; } .w-75 { --w: 75%; } .w-80 { --w: 80%; } .w-85 { --w: 85%; } .w-90 { --w: 90%; } .w-95 { --w: 95%; } .w-100 { --w: 100%; }

/* ---------- Viewer of an original HTML document (sandboxed iframe) ---------- */
body.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 100; display: grid; background: var(--ink); }
.viewer iframe { width: 100%; height: 100%; border: 0; background: #FFF; min-height: 0; }
.viewer-console { grid-template-rows: minmax(0, 1fr) auto; }
.viewer-gui { grid-template-rows: auto minmax(0, 1fr); }
.viewer-bar { display: flex; align-items: center; gap: 1ch; padding: 8px 14px; background: var(--term-bg); border-top: 1px solid var(--line-strong);
  font: 400 .875rem/1.5 var(--mono); color: var(--term-text); min-width: 0; }
.viewer-bar .prompt { white-space: nowrap; flex-shrink: 0; }
.viewer-bar input { flex: 1; min-width: 6ch; background: transparent; border: 0; outline: 0; color: var(--term-text); font: inherit; caret-color: var(--term-cursor); padding: 0; }
.viewer-bar input::placeholder { color: var(--muted); }
.viewer-bar:focus-within { box-shadow: inset 0 1px 0 rgba(var(--tint), .08); }
.viewer-note { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; min-width: 0; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-width: 0; background: var(--header-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); }
.viewer-title { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 .95rem/1.3 var(--head); color: var(--fg); }
.viewer-hint { font: 500 .66rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 479.98px) { .viewer-hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
