/* Shared structure. Each style sets the tokens and its own personality on top. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--body); font: var(--fs-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; }
html[data-lang="en"] .it, html[data-lang="it"] .en { display: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
code, pre { font-family: var(--font-mono); }
h1, h2, h3 { color: var(--ink); font-family: var(--font-display); margin: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.mark { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.links a:hover { color: var(--accent-ink); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang button { background: none; border: 0; color: var(--muted); font: 600 12px var(--font-mono); cursor: pointer; padding: 6px 4px; }
html[data-lang="en"] [data-set-lang="en"], html[data-lang="it"] [data-set-lang="it"] { color: var(--accent-ink); }
.lang .sep { color: var(--muted); opacity: .5; font-size: 11px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--body);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn svg { width: 18px; height: 18px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; font-weight: 600; font-size: 15px;
  border-radius: var(--radius-btn); border: 1px solid transparent; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }

.eyebrow { font: 600 12.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 14px; }
.hero { padding: 88px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: var(--tracking-h); font-weight: var(--w-h1); }
.hero h1 em { font-style: var(--em-style); color: var(--accent-ink); }
.lede { font-size: 19px; margin: 22px 0 28px; max-width: 34em; }
.lede b { color: var(--ink); }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.install { margin: 28px 0 0; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 16px 18px;
  font-size: 13.5px; line-height: 1.7; overflow-x: auto; border: 1px solid var(--line); }
.prompt { color: var(--accent-soft); }

.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line);
  font: 12px var(--font-mono); color: var(--muted); }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.shot-bar span { margin-left: 8px; }

section h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: var(--tracking-h); font-weight: var(--w-h2); max-width: 20em; }
.band, .feature { padding: 96px 0; }
.band { background: var(--band); border-block: 1px solid var(--line); }
.feature.alt { background: var(--band-alt); }
.sub { font-size: 18px; margin: 12px 0 0; }
.cards.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h3 { font-size: 20px; margin: 10px 0 8px; }
.card p { margin: 0; font-size: 16px; }
.num { font: 600 13px var(--font-mono); color: var(--accent-ink); }

.feature-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.feature-grid.reverse > :first-child { order: 2; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.ticks li { padding-left: 30px; position: relative; font-size: 16.5px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-wash); box-shadow: inset 0 0 0 5px var(--accent); }
.ticks b { color: var(--ink); }
.stack { display: grid; gap: 18px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metrics div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; }
.metrics .k { font-size: 13px; color: var(--muted); }
.metrics .v { font: 700 22px var(--font-display); color: var(--ink); }

.diagram { margin: 40px 0 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.diagram svg { width: 100%; height: auto; display: block; }
.d-node { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.d-primary { fill: var(--accent-wash); stroke: var(--accent); }
.d-accent { fill: var(--accent-wash); stroke: var(--accent); }
.d-zone { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 6 6; opacity: .7; }
.d-zone-label { font: 600 12px var(--font-mono); fill: var(--accent-ink); }
.d-title { font: 600 15px var(--font-body); fill: var(--ink); text-anchor: middle; }
.d-cap { font: 12px var(--font-mono); fill: var(--muted); text-anchor: middle; }
.d-edge path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.d-edge.dashed path { stroke-dasharray: 4 5; }
.d-arrowhead { fill: var(--muted); }
.arrow { color: var(--accent-ink); font-weight: 600; }

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.steps li { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps .n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; }
.steps h3 { font-size: 18px; margin: 4px 0 6px; }
.steps p { margin: 0 0 12px; font-size: 15px; }
.steps pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; overflow-x: auto; }
p code { background: var(--accent-wash); color: var(--ink); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; }
.foot-inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: space-between; font-size: 14px; }
.muted { color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid, .feature-grid, .cards.three, .steps { grid-template-columns: minmax(0, 1fr); }
  .feature-grid.reverse > :first-child { order: 0; }
  .links { display: none; }
  .hero { padding-top: 48px; }
  .band, .feature { padding: 64px 0; }
}
/* C · Bogoware Blog (Quantum): the MrBogomips blog's system. Violet key, Manrope + IBM Plex Mono, dot grid and halo. */
:root {
  --font-display: "Manrope", system-ui, sans-serif; --font-body: "Manrope", system-ui, sans-serif; --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --fs-body: 17px; --fs-h1: clamp(42px, 5.4vw, 70px); --fs-h2: clamp(30px, 3.4vw, 46px); --w-h1: 800; --w-h2: 800; --tracking-h: -0.02em; --em-style: normal;
  --maxw: 1180px; --radius: 18px; --radius-btn: 999px;
  --bg: #F6F5FC; --surface: #FFFFFF; --band: #EEEBFA; --band-alt: #F6F5FC; --ink: #191436; --body: #4E4A6B; --muted: #6E6A86;
  --line: rgba(109,40,217,.16); --line-strong: rgba(109,40,217,.30); --accent: #6D28D9; --accent-ink: #6D28D9; --accent-soft: #A78BFA; --accent-wash: #F0EAFE; --on-accent: #FFFFFF;
  --cyan: #0EA5E9; --code-bg: #14112B; --code-ink: #E6E7FB; --dot: rgba(109,40,217,.16);
  --shadow: 0 16px 40px rgba(60,40,120,.12);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #090A18; --surface: #141838; --band: #0E1126; --band-alt: #090A18; --ink: #ECEAFB; --body: #A6ABD4; --muted: #8A8FBA;
  --line: rgba(139,92,246,.18); --line-strong: rgba(139,92,246,.36); --accent: #8B5CF6; --accent-ink: #A78BFA; --accent-wash: #1A1F47;
  --cyan: #38BDF8; --code-bg: #0B0E20; --code-ink: #D6D8F5; --dot: rgba(167,139,250,.18); --shadow: 0 16px 44px rgba(4,6,20,.55); } }
:root[data-theme="dark"] {
  --bg: #090A18; --surface: #141838; --band: #0E1126; --band-alt: #090A18; --ink: #ECEAFB; --body: #A6ABD4; --muted: #8A8FBA;
  --line: rgba(139,92,246,.18); --line-strong: rgba(139,92,246,.36); --accent: #8B5CF6; --accent-ink: #A78BFA; --accent-wash: #1A1F47;
  --cyan: #38BDF8; --code-bg: #0B0E20; --code-ink: #D6D8F5; --dot: rgba(167,139,250,.18); --shadow: 0 16px 44px rgba(4,6,20,.55); }
body { position: relative; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.6px); background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); }
body::after { content: ""; position: absolute; top: -260px; left: 50%; transform: translateX(-50%); width: min(1100px, 100%); height: 760px;
  pointer-events: none; z-index: 0; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
body > * { position: relative; z-index: 1; }
.band { background: color-mix(in srgb, var(--band) 70%, transparent); }
.feature.alt { background: transparent; }
.hero h1 em { background: linear-gradient(120deg, var(--accent-ink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mark { background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--accent)); box-shadow: 0 0 0 4px var(--accent-wash), 0 0 14px var(--accent); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.btn-primary { background: linear-gradient(120deg, #8B5CF6, #6366F1); color: #fff; box-shadow: 0 10px 26px rgba(139,92,246,.34); }
.card:hover, .steps li:hover { box-shadow: 0 0 0 1px var(--accent), 0 18px 48px color-mix(in srgb, var(--accent) 22%, transparent); }
.d-edge path { stroke: var(--accent-soft); } .d-arrowhead { fill: var(--accent-soft); }

/* ===== Site additions: documentation pages ===== */
.nav .links a[aria-current="page"] { color: var(--accent-ink); }
.iconbtn.gh svg { width: 19px; height: 19px; }
.menu { display: none; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-panel { display: grid; }
.menu-panel { display: none; position: absolute; right: 16px; top: 60px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px; gap: 2px; min-width: 220px; box-shadow: var(--shadow); }
.menu-panel a { padding: 10px 12px; border-radius: 8px; }
.menu-panel a:hover { background: var(--accent-wash); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.page-hero { padding: 72px 0 28px; }
.page-hero h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.08; letter-spacing: var(--tracking-h); font-weight: 800; max-width: 18em; }
.page-hero .lede { margin-bottom: 0; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 56px; padding: 24px 0 96px; align-items: start; }
.toc { position: sticky; top: 92px; font-size: 14px; border-left: 1px solid var(--line); padding-left: 18px; }
.toc p { font: 600 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc a { display: block; padding: 4px 0; color: var(--body); } .toc a:hover { color: var(--accent-ink); }
.prose { max-width: 780px; }
.prose > * + * { margin-top: 18px; }
.prose h2 { font-size: clamp(26px, 2.6vw, 34px); margin-top: 64px; scroll-margin-top: 90px; }
.prose h3 { font-size: 21px; margin-top: 36px; scroll-margin-top: 90px; }
.prose p, .prose li { font-size: 17px; }
.prose ul, .prose ol { padding-left: 22px; } .prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose code { background: var(--accent-wash); color: var(--ink); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.prose pre { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; border: 1px solid var(--line); }
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 700; border-bottom: 1.5px solid var(--line-strong); }
.prose figure { margin: 32px 0; }
.prose .diagram, .prose .shot { margin: 32px 0; }
.wide { margin-left: 0; margin-right: min(0px, calc((780px - 100%) / 2)); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; padding: 0 4px; }
.shot figcaption { padding: 10px 14px 12px; margin: 0; border-top: 1px solid var(--line); }
.note, .warn, .tip { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.note { box-shadow: inset 3px 0 0 var(--accent); } .tip { box-shadow: inset 3px 0 0 var(--cyan); } .warn { box-shadow: inset 3px 0 0 #f59e0b; }
.note > :first-child, .warn > :first-child, .tip > :first-child { margin-top: 0; }
.badge { display: inline-block; font: 600 11.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent-ink); border: 1px solid var(--line); vertical-align: middle; }
.badge.demo { background: color-mix(in srgb, #f59e0b 14%, transparent); color: var(--ink); border-color: color-mix(in srgb, #f59e0b 45%, transparent); }

/* tabs (CSS only): <div class="tabs"><input type="radio" name="t1" id="t1a" checked><label for="t1a">A</label>…<div class="tab">…</div>… */
.tabs { display: grid; grid-template-columns: repeat(var(--n, 2), max-content) minmax(0, 1fr); gap: 0 6px; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label { font: 600 13px var(--font-mono); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; color: var(--body); margin-bottom: 12px; }
.tabs > input:checked + label { background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent); }
.tabs > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs > .tab { grid-column: 1 / -1; grid-row: 2; display: none; min-width: 0; }
.tabs > input:nth-of-type(1):checked ~ .tab:nth-of-type(1), .tabs > input:nth-of-type(2):checked ~ .tab:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tab:nth-of-type(3), .tabs > input:nth-of-type(4):checked ~ .tab:nth-of-type(4) { display: block; }

.illus { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.illus img { width: 100%; }
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.timeline > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.timeline h3 { margin: 0 0 6px !important; font-size: 18px; }
.cta-band { margin: 72px 0 0; padding: 36px; border-radius: 22px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--surface);
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { margin: 0 !important; font-size: 26px; }
.cards.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
a.card { display: block; transition: transform .2s ease, box-shadow .2s ease; } a.card:hover { transform: translateY(-2px); }
.card .arrow { display: inline-block; margin-top: 14px; }

/* footer, the geeky way */
.foot { padding: 40px 0 48px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot h4 { margin: 0 0 10px; font: 600 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.foot nav a { display: block; padding: 3px 0; font-size: 15px; } .foot nav a:hover { color: var(--accent-ink); }
.copyright { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font: 13px/1.7 var(--font-mono); color: var(--muted); display: grid; gap: 4px; }
.copyright .prompt { color: var(--accent-ink); }
.copyright .love { color: #ec4899; }
.copyright .cursor { display: inline-block; width: .6em; height: 1.05em; vertical-align: -0.15em; background: var(--accent-ink); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .copyright .cursor { animation: none; } html { scroll-behavior: auto; } }

@media (max-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 900px) {
  .menu { display: block; } .cards.two, .timeline, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .tools .btn { display: none; } .page-hero { padding-top: 44px; }
}

/* ===== Diagram classes ===== */
.d-human { fill: color-mix(in srgb, var(--cyan) 14%, var(--surface)); stroke: var(--cyan); stroke-width: 1.5; }
.d-allow { fill: color-mix(in srgb, var(--cyan) 12%, var(--surface)); stroke: var(--cyan); stroke-width: 1.5; }
.d-block { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 2.2; }
.d-weak { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 5 5; }
.d-tier1 { fill: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.d-tier2 { fill: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.d-tier3 { fill: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.d-tier4 { fill: color-mix(in srgb, var(--accent) 36%, var(--surface)); }
.d-bar { fill: var(--accent-wash); }
.d-dot { fill: var(--line-strong); }
.d-fill { fill: var(--accent); }
.d-empty { fill: var(--line); }
.d-rule { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.d-life { fill: none; stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 3 5; }
.d-edge.cyan path { stroke: var(--cyan); }
.d-edge.strong path { stroke: var(--accent); }
.d-ah-cyan { fill: var(--cyan); }
.d-ah-strong { fill: var(--accent); }
.d-label { font: 500 13px var(--font-body); fill: var(--body); }
.d-label.b { font-weight: 700; fill: var(--ink); }
.d-note { font: 500 13px var(--font-body); fill: var(--muted); text-anchor: middle; }
.d-elabel { font: 600 12.5px var(--font-body); fill: var(--accent-ink); }
.d-elabel.ink { fill: var(--ink); }
.d-mono { font: 12px var(--font-mono); fill: var(--body); }
.d-big { font: 800 20px var(--font-display); fill: var(--ink); }
.d-head { font: 700 13px var(--font-mono); fill: var(--accent-ink); letter-spacing: .04em; }
.d-num { font: 700 14px var(--font-body); fill: var(--bg); text-anchor: middle; }
.d-start { text-anchor: start; }
.d-mid { text-anchor: middle; }
.d-end { text-anchor: end; }
