/* SystemChart site: shared tokens, header, section ruler, logo wheel and footer. */
:root {
  --bg: #07090e;
  --bg-app: #0b0e14;
  --panel: #131722;
  --panel-2: #161a25;
  --line: #1e222d;
  --line-2: #2a2e39;
  --text: #d1d4dc;
  --bright: #f0f3fa;
  --dim: #a2a7b4;
  --faint: #7f8595;
  --up: #26a69a;
  --down: #ef5350;
  --cpu: #22d3ee;
  --gpu: #f0186f;
  --mem: #9b7bf0;
  --gold: #e3b341;
  --sky: #7dd3fc;
  --sans: "Segoe UI Variable Display", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --text-font: "Segoe UI Variable Text", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --din: Bahnschrift, "DIN Alternate", "DIN Condensed", "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header: 64px;
  /* Names the page stylesheets (wiki, releases, beta) already use. */
  --site-header-height: var(--header);
  --text-bright: var(--bright);
  --line-bright: var(--line-2);
  --cyan: var(--cpu);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--text-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  --topic-color: #ff6574;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--sans); color: var(--bright); margin: 0; letter-spacing: -0.022em; font-weight: 650; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 48px, 1180px); margin-inline: auto; }
main, header, footer, section { position: relative; z-index: 1; }

/* The recorder diagram behind the home page (flow.js) and the section transition. */
canvas.flow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; transition: opacity .2s linear; }
canvas.topic-transition { position: fixed; left: 0; width: 100vw; z-index: 60; pointer-events: none; }
canvas.topic-transition[hidden] { display: none; }
/* Covers a page reached through the wheel until the arriving vortex paints. */
html[data-navigation-arrival]::after { content: ''; position: fixed; inset: 0; z-index: 45; background: #070b12; pointer-events: none; }

/* ---------- brand lockup (spin.js) ---------- */
.brand {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; cursor: pointer; isolation: isolate;
}
.brand img.mark { width: 36px; height: 36px; transform-origin: 50% 50%; will-change: transform, filter; }
.brand img.word { height: 17px; width: auto; opacity: .96; }
.brand canvas.sparks { position: absolute; left: -18px; top: -74px; width: 268px; height: 250px; pointer-events: none; z-index: -1; }

/* ---------- buttons ---------- */
.btn {
  --glow: rgba(41, 98, 255, .45);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03); color: var(--bright);
  font: 600 15px/1 var(--sans); letter-spacing: -0.005em; white-space: nowrap; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
}
.btn:hover { transform: translateY(-1px); border-color: #3b4254; background: rgba(255, 255, 255, .06); }
.btn.primary { border-color: transparent; background: linear-gradient(180deg, #3a70ff, #2355f0); color: #fff; box-shadow: 0 10px 30px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.primary:hover { box-shadow: 0 16px 40px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn.small { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 8px; }

/* ---------- header: floats over the home page's hero, then frosts once the page moves ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 50; border-bottom: 1px solid transparent; transition: background .4s, border-color .4s, backdrop-filter .4s; }
.top.scrolled, .site-secondary .top { background: rgba(7, 9, 14, .78); backdrop-filter: blur(16px) saturate(1.2); border-color: rgba(255, 255, 255, .06); }
.bar { display: flex; align-items: center; gap: 18px; height: var(--header); width: min(100% - 40px, 1400px); margin-inline: auto; }
.lockup { display: flex; align-items: center; gap: 11px; --rotor: 32px; }
.lockup-word { display: inline-flex; align-items: center; min-height: 36px; }
.lockup-word img.word { height: 17px; width: auto; }
.lockup-word img.mark { width: 32px; height: 32px; margin-right: 11px; }
.nav-context { display: flex; align-items: center; gap: 12px; padding-left: 16px; border-left: 1px solid var(--line-2); font: 600 12px/1 var(--mono); }
.nav-position { color: var(--faint); letter-spacing: .04em; }
.nav-current { color: var(--topic-color); min-width: 6.6em; transition: color .4s; }
.links { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.links .plain { display: inline-flex; align-items: center; min-height: 36px; font: 600 13.5px/1 var(--sans); color: var(--dim); }
.links .plain:hover, .links .plain[aria-current="page"] { color: var(--bright); }

/* Transition sound (transition-sound.js adds one to the context and one for phones). */
.nav-sound { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); color: var(--dim); font: 600 11.5px/1 var(--mono); height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer; }
.nav-sound[aria-pressed="true"] { color: var(--bright); border-color: #354055; }
.nav-sound-mobile { display: none; }

/* Rotor: the mark turns to each stop's finish (navigation.js). */
.nav-rotor { appearance: none; position: relative; display: inline-grid; place-items: center; min-height: 36px; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rotor-images { position: relative; display: block; width: var(--rotor, 40px); height: var(--rotor, 40px); }
.rotor-mark { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: center; will-change: transform, opacity; }
.rotor-previous { opacity: 0; }
.nav-rotor:hover .rotor-images { filter: brightness(1.12); }
.nav-rotor:active .rotor-images { filter: brightness(1.25); }

/* Stop finishes: the colours the rotor turns through. */
[data-finish="redline"] { --stop-color: #ff6574; }
[data-finish="arctic"] { --stop-color: #69dae9; }
[data-finish="ultraviolet"] { --stop-color: #b69af3; }
[data-finish="emerald"] { --stop-color: #72dea7; }
[data-finish="ion"] { --stop-color: #87bfff; }
[data-finish="gold"] { --stop-color: #f0c36d; }
[data-finish="lime"] { --stop-color: #c5e478; }
[data-finish="rose"] { --stop-color: #f29ac2; }
[data-finish="amber"] { --stop-color: #ffa35f; }
[data-finish="silver"] { --stop-color: #d2dee6; }

/* ---------- the ruler: every stop as a tick down the left edge ---------- */
.nav-index.ruler { position: fixed; left: 22px; top: 50%; z-index: 40; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 14px 0; }
.nav-index.ruler::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, rgba(255, 255, 255, .16) 10%, rgba(255, 255, 255, .16) 90%, transparent); }
.ruler a { position: relative; display: flex; align-items: center; gap: 10px; height: 28px; font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.ruler a.page-stop { margin-top: 14px; }
.ruler a i { width: 12px; height: 1px; background: rgba(255, 255, 255, .3); transition: width .35s var(--ease), background .35s; }
.ruler a span { opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; }
.ruler:hover a span, .ruler a:focus-visible span { opacity: 1; transform: none; }
.ruler a:hover { color: var(--bright); }
.ruler a.here i { width: 20px; background: var(--stop-color); }
.ruler a.here span { opacity: 1; transform: none; background: var(--stop-color); color: #07090e; padding: 5px 8px; border-radius: 3px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: rgba(7, 9, 14, .92); }
footer .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; padding: 30px 0 64px; font-size: 13.5px; color: var(--faint); }
footer .brand canvas.sparks { left: -16px; top: -34px; width: 200px; height: 94px; }
footer .brand img.mark { width: 30px; height: 30px; }
footer .brand img.word { height: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 8px 22px; font-style: normal; }
footer nav a, .footer-contact a { display: inline-flex; align-items: center; min-height: 32px; }
footer nav a:hover, .footer-contact a:hover { color: var(--bright); }

/* ---------- pages other than home ---------- */
.site-secondary main { padding-top: var(--header); }
.site-secondary :is(main, main [id]) { scroll-margin-top: calc(var(--header) + 16px); }
.site-secondary .kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 700 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--topic-color); }
.site-secondary .kicker::before { content: ''; width: 20px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }
/* Content pages use the full column, so the ruler's active label only clears it from about 1480px. */
.site-secondary .nav-index.ruler { display: none; }
@media (min-width: 1500px) {
  .site-secondary.site-wheel .nav-index.ruler { display: flex; }
}

/* ---------- smaller screens ---------- */
/* Below this the ruler's active label would sit on the section content. */
@media (max-width: 1599px) {
  .site-home .nav-index.ruler { display: none; }
}
@media (max-width: 820px) {
  .nav-context { display: none; }
  .links { gap: 14px; }
  .links .plain { font-size: 13px; }
  .nav-sound-mobile { display: inline-grid; place-items: center; order: 1; width: 32px; height: 32px; padding: 0; font-size: 0; color: transparent; flex: none; }
  .nav-sound-mobile::before { content: ''; width: 16px; height: 16px; background: var(--dim); -webkit-mask: var(--sound-icon) center / contain no-repeat; mask: var(--sound-icon) center / contain no-repeat; }
  .nav-sound-mobile[aria-pressed="true"]::before { background: var(--bright); }
  .nav-sound-mobile { --sound-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6'/%3E%3C/svg%3E"); }
  .nav-sound-mobile[aria-pressed="true"] { --sound-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16.5 9a4 4 0 0 1 0 6'/%3E%3Cpath d='M19 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E"); }
}
@media (max-width: 560px) {
  .bar { gap: 10px; width: calc(100% - 24px); }
  .lockup-word img.word { display: none; }
  .lockup-word img.mark { margin-right: 0; }
  /* Only the wordmark is left in this link, so the rotor carries the brand on its own. */
  .lockup .lockup-word { display: none; }
  .links { gap: 10px; }
  .links .btn { padding: 0 11px; font-size: 13px; }
  footer .wrap { padding-bottom: 48px; }
  footer nav { margin-left: 0; }
}
@media (max-width: 400px) {
  .links .plain.docs { display: none; }
}
