/* Shared by every page: the header, the footer and the scrollbars. Each page
   keeps its own tokens and layout; this file loads first, so a page can
   override any of it. */

/* tokens, base type and controls, the same as on the landing */
:root {
  --sheet: #f1f2ef;
  --panel: #f8f8f6;
  --ink: #111214;
  --ink-2: #5d6165;
  --rule: #d8dad6;
  --cut: #d92d20;
  --score: #2457c5;
  --on-accent: #ffffff;
  --sans: "Katagami Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Katagami Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4vw, 3rem);
  --gutter: clamp(16px, 4vw, 40px);
  /* code syntax colors, each at least 4.5:1 on the panel */
  --syn-kw: #c2261b; --syn-str: #2c7a33; --syn-num: #2457c5; --syn-com: #6a6e72;
  --syn-fn: #8a3ab0; --syn-type: #0a7080; --syn-punc: #4f5b70; --syn-var: #a84f00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sheet: #0e0f10; --panel: #151618; --ink: #ebece9; --ink-2: #9a9ea2;
    --rule: #26282b; --cut: #ff5246; --score: #6c94ff; --on-accent: #0e0f10; color-scheme: dark;
    --syn-kw: #ff7b70; --syn-str: #7fd88a; --syn-num: #82a8ff; --syn-com: #83888d;
    --syn-fn: #d0a6ff; --syn-type: #5fd3dc; --syn-punc: #9fabc0; --syn-var: #ffad66;
  }
}
:root[data-theme="dark"] {
  --sheet: #0e0f10; --panel: #151618; --ink: #ebece9; --ink-2: #9a9ea2;
  --rule: #26282b; --cut: #ff5246; --score: #6c94ff; --on-accent: #0e0f10; color-scheme: dark;
  --syn-kw: #ff7b70; --syn-str: #7fd88a; --syn-num: #82a8ff; --syn-com: #83888d;
  --syn-fn: #d0a6ff; --syn-type: #5fd3dc; --syn-punc: #9fabc0; --syn-var: #ffad66;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--sheet); color: var(--ink); font-family: var(--sans); font-size: var(--step-0); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cut); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.wrap { padding-inline: clamp(16px, 3vw, 48px); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); line-height: 1.05; }
h3 { font-size: var(--step-1); line-height: 1.2; }
p { margin: 0; max-width: 62ch; }


/* Controls. Sliders are rulers: a hairline rail with ticks every tenth, an ink
   fill to the value, and a square handle split by a red cut line. Checkboxes
   fill with a red block. All stay native inputs underneath. */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 26px; min-width: 0; margin: 0; cursor: ew-resize; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 26px; border: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 calc(50% - 1px) / var(--p) 2px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 10%) 0 100% / calc(100% - 1px) 5px no-repeat,
    linear-gradient(var(--ink-2), var(--ink-2)) 100% 100% / 1px 5px no-repeat;
}
input[type="range"]::-moz-range-track {
  height: 26px; border: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 calc(50% - 1px) / var(--p) 2px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 10%) 0 100% / calc(100% - 1px) 5px no-repeat,
    linear-gradient(var(--ink-2), var(--ink-2)) 100% 100% / 1px 5px no-repeat;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 20px; margin-top: 3px; border-radius: 2px; border: 1.5px solid var(--ink);
  background: linear-gradient(var(--cut), var(--cut)) center / 1.5px 100% no-repeat, var(--panel);
  transition: transform 0.12s ease;
}
input[type="range"]::-moz-range-thumb {
  width: 11px; height: 20px; border-radius: 2px; border: 1.5px solid var(--ink); box-sizing: border-box;
  background: linear-gradient(var(--cut), var(--cut)) center / 1.5px 100% no-repeat, var(--panel);
}
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { transform: scaleY(1.12); border-color: var(--cut); }
input[type="range"]:hover::-moz-range-thumb { border-color: var(--cut); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--score) 45%, transparent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--score) 45%, transparent); }
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 15px; height: 15px; margin: 0; border: 0; border-radius: 3px;
  display: inline-grid; place-content: center; background: color-mix(in srgb, var(--ink) 12%, var(--panel)); cursor: pointer; vertical-align: -2px;
}
input[type="checkbox"]::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--cut); transform: scale(0); transition: transform 0.12s ease; }

input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:hover { background: color-mix(in srgb, var(--ink) 18%, var(--panel)); }
button, .seg button { font: inherit; color: inherit; }
.btn { font-size: 0.875rem; background: var(--panel); border-radius: 6px; padding: 5px 12px; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease; }
.btn:hover { background: color-mix(in srgb, var(--ink) 10%, var(--panel)); }
.btn:active { transform: translateY(1px); }
.seg { display: inline-flex; border-radius: 6px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; cursor: pointer; font-size: 0.875rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: 0.8125rem; background: none; border-radius: 4px; padding: 4px 9px; cursor: pointer; color: var(--ink-2); }
.chips button[aria-pressed="true"] { color: var(--sheet); background: var(--ink); }
.chips button:hover { color: var(--ink); }
.chips button span { font-family: var(--mono); font-size: 0.75rem; margin-left: 4px; }
.seg { background: var(--panel); }
.chips button { background: var(--panel); }
button, .btn { border: 0; }

/* scrollbars: a hairline rail and an ink handle split by a red cut line, the
   same handle the sliders use */
@supports (-moz-appearance: none) {
  html, * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 45%, transparent) transparent; }
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-track:vertical { background: linear-gradient(var(--rule), var(--rule)) center / 1px 100% no-repeat; }
::-webkit-scrollbar-track:horizontal { background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent; border-radius: 3px; background-clip: padding-box;
  background-color: color-mix(in srgb, var(--ink) 55%, transparent);
}
::-webkit-scrollbar-thumb:vertical { background-image: linear-gradient(var(--cut), var(--cut)); background-size: 100% 1.5px; background-position: center; background-repeat: no-repeat; }
::-webkit-scrollbar-thumb:horizontal { background-image: linear-gradient(var(--cut), var(--cut)); background-size: 1.5px 100%; background-position: center; background-repeat: no-repeat; }
::-webkit-scrollbar-thumb:hover { background-color: var(--ink); }
::-webkit-scrollbar-thumb:active { background-color: var(--cut); }
::-webkit-scrollbar-corner { background: transparent; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--sheet) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand b { font-weight: 650; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand .mark { width: 0.82rem; height: 0.82rem; fill: currentColor; flex: none; margin-right: -2px; }
.brand span { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); }
.top nav { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 0.875rem; }
.top nav .links { display: flex; align-items: center; gap: 2px; margin-right: 8px; }
.top nav .links a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); transition: color 0.12s ease, background-color 0.12s ease; }
.top nav .links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.top nav .links a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.top nav .pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 6px; text-decoration: none; font-weight: 550; white-space: nowrap; transition: background-color 0.12s ease; }
.top nav .pill svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.top nav .fontify { background: var(--cut); color: var(--on-accent); }
.top nav .fontify:hover, .top nav .fontify[aria-current="page"] { color: var(--on-accent); background: color-mix(in srgb, var(--cut) 86%, #000); }
.top nav .dl { background: var(--ink); color: var(--sheet); }
.top nav .dl:hover, .top nav .dl[aria-current="page"] { color: var(--sheet); background: color-mix(in srgb, var(--ink) 82%, var(--sheet)); }
.top nav .gh { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--ink-2); }
.top nav .gh:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.top nav .gh svg { width: 17px; height: 17px; fill: currentColor; }

/* the menu replaces the links on narrow screens; it is a details element, so it opens without script */
.menu { display: none; position: static; }
.menu summary { list-style: none; display: inline-grid; place-items: center; width: 36px; height: 32px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.menu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.menu[open] summary .shut, .menu:not([open]) summary .open { display: none; }
.menu .sheet-menu { position: absolute; left: 0; right: 0; top: 100%; display: grid; padding: 8px clamp(16px, 3vw, 48px) 20px; background: var(--sheet); }
.menu .sheet-menu a { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; text-decoration: none; font-size: 1.375rem; font-weight: 550; letter-spacing: -0.01em; color: var(--ink); }
.menu .sheet-menu a span { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.menu .sheet-menu a[aria-current="page"] { color: var(--cut); }
@media (max-width: 980px) {
  .top nav .links { display: none; }
  .menu { display: block; }
}
@media (max-width: 560px) {
  .brand span, .top nav .fontify span, .top nav .dl span { display: none; }
  .top nav .pill { padding: 0; width: 32px; justify-content: center; }
  .top nav { gap: 6px; }
}

/* footer: a red block with the download and the web stylesheet, the page
   index, the name as a live specimen (member, weight, and weight under the
   pointer), then the author, the theme switch and a way back up */
footer.site { margin-top: 0; padding-block: clamp(24px, 4vw, 48px) 18px; background: var(--panel); color: var(--ink-2); font-size: 0.875rem; overflow: hidden; }
footer.site .f-use { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px clamp(24px, 4vw, 64px); align-items: end; padding: clamp(24px, 3.5vw, 44px); border-radius: 10px; background: var(--cut); color: var(--on-accent); }
footer.site .f-use h2 { font-size: clamp(1.75rem, 3.6vw, 3rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 650; }
footer.site .f-use p { margin-top: 12px; max-width: 44ch; font-size: 1rem; line-height: 1.45; }
footer.site .f-acts { display: grid; gap: 10px; min-width: 0; }
footer.site .f-dl { display: flex; align-items: center; gap: 10px; justify-self: start; padding: 12px 18px; border-radius: 8px; background: var(--on-accent); color: var(--cut); text-decoration: none; font-size: 1rem; font-weight: 600; transition: transform 0.12s ease; }
footer.site .f-dl:active { transform: translateY(1px); }
footer.site .f-dl svg { width: 18px; height: 18px; fill: currentColor; }
footer.site .f-dl small { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; color: var(--ink-2); }
footer.site .f-css { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 7px 7px 14px; border-radius: 8px; background: color-mix(in srgb, var(--on-accent) 16%, transparent); }
footer.site .f-css code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
footer.site .f-css button { flex: none; padding: 5px 12px; border-radius: 6px; background: var(--on-accent); color: var(--cut); font-size: 0.8125rem; cursor: pointer; }
footer.site .f-grid { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 4vw, 64px); margin-top: clamp(40px, 5vw, 64px); }
footer.site .f-col { display: grid; gap: 10px; align-content: start; }
footer.site .f-col h3 { margin-bottom: 2px; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
footer.site .f-col a { width: max-content; max-width: 100%; color: var(--ink-2); text-decoration: none; }
footer.site .f-col a:hover { color: var(--cut); }
footer.site .f-col small { font-family: var(--mono); font-size: 0.6875rem; font-weight: 400; color: var(--ink-2); }
footer.site .f-members a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: auto; font-size: 1.0625rem; color: var(--ink); }
footer.site .f-hinted a { display: grid; gap: 1px; }
footer.site .f-hinted a:hover small { color: inherit; }
footer.site .f-build p, footer.site .f-build a { font-family: var(--mono); font-size: 0.75rem; }
footer.site .f-build a { text-decoration: underline; text-underline-offset: 3px; }
footer.site .seg { background: var(--sheet); }
footer.site .f-type { margin-top: clamp(48px, 7vw, 96px); }
footer.site .f-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
footer.site .f-weight { display: flex; align-items: center; gap: 12px; font-size: 0.8125rem; }
footer.site .f-weight input { width: clamp(140px, 22vw, 280px); }
footer.site .f-weight output { min-width: 3ch; font-family: var(--mono); font-size: 0.75rem; color: var(--ink); }
footer.site .f-word { margin-top: clamp(20px, 2vw, 28px); cursor: ew-resize; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
footer.site .f-word b { display: inline-block; font-size: 17vw; line-height: 1.12; letter-spacing: -0.04em; font-weight: 800; color: var(--ink); white-space: nowrap; transition: font-weight 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
footer.site .f-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(24px, 3vw, 32px); font-size: 0.8125rem; }
footer.site .f-bar a { color: var(--ink); }
footer.site .f-top { padding: 6px 0; background: none; color: var(--ink-2); font-size: 0.8125rem; cursor: pointer; }
footer.site .f-top:hover { color: var(--cut); }
@media (max-width: 860px) {
  footer.site .f-use { grid-template-columns: minmax(0, 1fr); align-items: start; }
  footer.site .f-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  footer.site .f-members { grid-column: 1 / -1; }
  footer.site .f-controls .seg button { padding-inline: 9px; }
  footer.site .f-weight { width: 100%; }
  footer.site .f-weight input { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) { footer.site .f-word b, footer.site .f-dl { transition: none; } }

/* pages: a head with the title and a short lede, then one 12-column sheet of
   cells split by space, as on the landing */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px 48px; padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 0.95; letter-spacing: -0.035em; font-weight: 650; }
.page-head p { color: var(--ink-2); font-size: 1.0625rem; max-width: 52ch; }
.page-head .facts { display: flex; flex-wrap: wrap; gap: 12px 28px; font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); }
.page-head .facts b { display: block; font-family: var(--sans); font-size: 1.75rem; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
@media (max-width: 860px) { .page-head { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .page-head .facts { gap: 10px 20px; } .page-head .facts b { font-size: 1.375rem; } }
/* sections sit in rows of the sheet; a band in a contrasting tone between the rows separates them */
.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: clamp(8px, 1vw, 14px); background: color-mix(in srgb, var(--ink) 8%, var(--sheet)); }
.cell { position: relative; min-width: 0; margin: 0; padding: clamp(32px, 4vw, 56px) clamp(16px, 3vw, 44px); background: var(--sheet); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: 1 / -1; }
.panel-bg { background: var(--panel); }
.accent-cut { background: var(--cut); color: var(--on-accent); }
.accent-score { background: var(--score); color: var(--on-accent); }
@media (max-width: 1100px) { .s3, .s4, .s6 { grid-column: span 6; } .s5, .s7, .s8 { grid-column: 1 / -1; } }
@media (max-width: 700px) { .s3, .s4, .s6 { grid-column: 1 / -1; } .cell { padding: 22px 16px; } }
.copy-code { position: relative; margin: 0; padding: 16px 18px; padding-right: 92px; border-radius: 6px; background: var(--panel); font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-code button { position: absolute; top: 10px; right: 10px; }

/* the header's search, member picker and Human or Machine switch; on narrow
   screens the picker and the switch move into the menu */
kbd { font-family: var(--mono); font-size: 0.6875rem; line-height: 1.5; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-2); }
.top nav .find { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 7px 0 10px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); font-size: 0.8125rem; cursor: pointer; }
.top nav .find:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.top nav .find svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.top nav .pick { position: relative; }
.top nav .pick summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.top nav .pick summary::-webkit-details-marker { display: none; }
.top nav .pick summary:hover, .top nav .pick[open] summary { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.top nav .pick summary b { font-size: 1.0625rem; font-weight: 600; line-height: 1; }
.top nav .pick summary span { font-size: 0.8125rem; color: var(--ink-2); }
.pick-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: grid; gap: 2px; min-width: 260px; padding: 6px; border-radius: 10px; background: var(--panel); box-shadow: 0 16px 48px rgb(0 0 0 / 0.18); }
.pick-menu button { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 10px; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.pick-menu button b { font-size: 1.0625rem; font-weight: 500; color: var(--ink); }
.pick-menu button span { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }
.pick-menu button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pick-menu button[aria-pressed="true"] { background: var(--ink); }
.pick-menu button[aria-pressed="true"] b, .pick-menu button[aria-pressed="true"] span { color: var(--sheet); }
.top nav .mode, .menu-tools .seg { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.top nav .mode button { padding: 6px 10px; font-size: 0.8125rem; }
.menu-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 14px; }
@media (max-width: 1180px) {
  .top nav .find span, .top nav .find kbd, .top nav .pick summary span { display: none; }
  .top nav .find { width: 32px; padding: 0; justify-content: center; }
}
@media (max-width: 560px) { .top nav > .pick, .top nav > .mode, .top nav > .gh { display: none; } }

/* the command bar: pages, glyphs and actions, opened with Command K, Control K or / */
dialog.cmdk { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 96px)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / 0.3); overflow: hidden; flex-direction: column; }
dialog.cmdk[open] { display: flex; }
dialog.cmdk::backdrop { background: rgb(0 0 0 / 0.36); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.cmdk-in svg { width: 18px; height: 18px; fill: var(--ink-2); flex: none; }
.cmdk-in input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1.0625rem; color: var(--ink); outline: none; }
.cmdk-in input::-webkit-search-cancel-button { display: none; }
.cmdk-list { overflow-y: auto; padding: 0 8px 8px; }
.cmdk-group { padding: 12px 10px 6px; font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 6px; background: none; text-align: left; font-size: 0.9375rem; color: var(--ink); cursor: pointer; }
.cmdk-item[aria-selected="true"] { background: var(--ink); color: var(--sheet); }
.cmdk-item[aria-selected="true"] .cmdk-hint { color: color-mix(in srgb, var(--sheet) 70%, transparent); }
.cmdk-glyph { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 6px; background: var(--sheet); color: var(--ink); font-size: 1.5rem; line-height: 1; }
.cmdk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-hint { flex: none; font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }
.cmdk-none { padding: 18px 10px; color: var(--ink-2); }
.cmdk-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 16px; font-size: 0.75rem; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 4%, transparent); }
@media (max-width: 560px) { .cmdk-foot span:last-child { display: none; } }

/* the machine view: every page as its Markdown twin, in Katagami Mono, on a CRT
   screen that fills the window; the header becomes a prompt */
:root[data-mode="machine"] {
  --crt-bg: #060807; --crt-fg: #c9dccd; --crt-hi: #effff1; --crt-dim: #6b8070; --crt-link: #8fb6ff; --crt-tick: #ff8072;
  --sans: "Katagami Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark; background: var(--crt-bg);
}
:root[data-mode="machine"] body { background: var(--crt-bg); color: var(--crt-fg); }
:root[data-mode="machine"] body, :root[data-mode="machine"] body * { font-family: "Katagami Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace !important; letter-spacing: 0 !important; }
:root[data-mode="machine"] body > main:not(.machine), :root[data-mode="machine"] footer.site { display: none; }
:root:not([data-mode="machine"]) main.machine { display: none; }
main.machine { display: block; min-height: calc(100dvh - 56px); padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 48px) 64px; color: var(--crt-fg); font-size: 0.875rem; line-height: 1.7; text-shadow: 0 0 1px rgb(201 220 205 / 0.55), 0 0 10px rgb(140 255 170 / 0.22); }
/* scanlines and the tube's vignette over the whole window, above the header; a faint flicker */
main.machine::before { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.16) 0 1px, transparent 1px 3px), radial-gradient(ellipse 120% 100% at 50% 45%, transparent 58%, rgb(0 0 0 / 0.45) 100%);
  animation: crt-flicker 7s steps(1) infinite; }
/* the roll bar: a soft band of light that drifts down the screen */
main.machine::after { content: ""; position: fixed; left: 0; right: 0; top: -30vh; height: 30vh; z-index: 61; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgb(160 255 190 / 0.045) 50%, transparent); animation: crt-roll 9s linear infinite; }
@keyframes crt-flicker { 0%, 100% { opacity: 1; } 41% { opacity: 0.94; } 42% { opacity: 1; } 77% { opacity: 0.97; } 78% { opacity: 1; } }
@keyframes crt-roll { from { transform: translateY(0); } to { transform: translateY(160vh); } }
@keyframes crt-blink { 50% { opacity: 0; } }
.m-block { margin: 0; max-width: 120ch; }
main.machine pre.md { margin: 0; font-size: inherit; line-height: inherit; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-req { margin-bottom: 12px !important; }
.m-rule { height: 1.7em; margin: 18px 0; overflow: hidden; white-space: nowrap; color: var(--crt-dim); opacity: 0.6; }
.md .m-cmd, .md .m-h { color: var(--crt-hi); font-weight: 700; }
.md .m-dim { color: var(--crt-dim); }
.md .m-tick { color: var(--crt-tick); }
.md .m-code { color: var(--crt-link); }
.md a, .m-acts a { color: var(--crt-link); text-decoration: none; }
.md a:hover, .m-acts a:hover { text-decoration: underline; }
.m-acts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; }
.m-acts button, .m-acts a { padding: 0; background: none; border: 0; color: var(--crt-link); font: inherit; cursor: pointer; }
.m-acts button::before, .m-acts a::before { content: "["; color: var(--crt-dim); }
.m-acts button::after, .m-acts a::after { content: "]"; color: var(--crt-dim); }
.m-end { margin: 24px 0 0; }
.m-cursor { color: var(--crt-hi); animation: crt-blink 1.1s steps(1) infinite; }

/* the header as a prompt: ~/katagami, paths, bracketed commands, inverse video for what is on */
:root[data-mode="machine"] .top { background: var(--crt-bg); backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: 0 0 8px rgb(140 255 170 / 0.22); }
:root[data-mode="machine"] .top a, :root[data-mode="machine"] .top button, :root[data-mode="machine"] .top summary { text-transform: lowercase; }
:root[data-mode="machine"] .brand { color: var(--crt-hi); align-items: center; }
:root[data-mode="machine"] .brand .mark { display: none; }
:root[data-mode="machine"] .brand b { font-size: 0.9375rem; font-weight: 700; text-transform: lowercase; }
:root[data-mode="machine"] .brand b::before { content: "~/"; color: var(--crt-dim); }
:root[data-mode="machine"] .brand span { color: var(--crt-dim); }
:root[data-mode="machine"] .brand::after { content: "▌"; color: var(--crt-hi); animation: crt-blink 1.1s steps(1) infinite; }
:root[data-mode="machine"] .top nav .links a { color: var(--crt-fg); border-radius: 0; }
:root[data-mode="machine"] .top nav .links a::before { content: "/"; color: var(--crt-dim); }
:root[data-mode="machine"] .top nav .links a:hover, :root[data-mode="machine"] .top nav .links a[aria-current="page"] { color: var(--crt-bg); background: var(--crt-fg); text-shadow: none; }
:root[data-mode="machine"] .top nav .links a[aria-current="page"]::before, :root[data-mode="machine"] .top nav .links a:hover::before { color: inherit; }
:root[data-mode="machine"] .top nav .pill, :root[data-mode="machine"] .top nav .find, :root[data-mode="machine"] .top nav .gh, :root[data-mode="machine"] .top nav .pick summary { gap: 0; background: none; color: var(--crt-fg); padding: 0 6px; width: auto; height: 32px; border-radius: 0; font-weight: 400; text-decoration: none; }
:root[data-mode="machine"] .top nav .pill:hover, :root[data-mode="machine"] .top nav .find:hover, :root[data-mode="machine"] .top nav .gh:hover, :root[data-mode="machine"] .top nav .pick summary:hover { color: var(--crt-bg); background: var(--crt-fg); text-shadow: none; }
:root[data-mode="machine"] .top nav .pill svg, :root[data-mode="machine"] .top nav .find svg, :root[data-mode="machine"] .top nav .gh svg, :root[data-mode="machine"] .top nav .pick summary b { display: none; }
:root[data-mode="machine"] .top nav .pill span, :root[data-mode="machine"] .top nav .find span { display: inline; }
:root[data-mode="machine"] .top nav .pill::before, :root[data-mode="machine"] .top nav .find::before { content: "["; color: var(--crt-dim); }
:root[data-mode="machine"] .top nav .pill::after, :root[data-mode="machine"] .top nav .find::after { content: "]"; color: var(--crt-dim); }
:root[data-mode="machine"] .top nav .gh::after { content: "[git]"; }
:root[data-mode="machine"] .top nav .pick summary span { display: inline; color: inherit; }
:root[data-mode="machine"] .top nav .pick summary span::before { content: "font="; color: var(--crt-dim); }
:root[data-mode="machine"] .top nav .find kbd { background: none; color: var(--crt-dim); padding: 0 0 0 8px; text-transform: none; }
:root[data-mode="machine"] .menu .sheet-menu a span { text-transform: none; }
:root[data-mode="machine"] .menu .sheet-menu > a::before { content: "/"; color: var(--crt-dim); }
:root[data-mode="machine"] .menu .sheet-menu > a { font-size: 1.125rem; }
:root[data-mode="machine"] .menu .sheet-menu { min-height: calc(100dvh - 56px); align-content: start; outline: 0; }
:root[data-mode="machine"] .top nav .mode, :root[data-mode="machine"] .menu-tools .seg { background: none; border-radius: 0; }
:root[data-mode="machine"] .seg button { color: var(--crt-fg); border-radius: 0; text-transform: lowercase; }
:root[data-mode="machine"] .seg button[aria-pressed="true"] { color: var(--crt-bg); background: var(--crt-fg); text-shadow: none; }
:root[data-mode="machine"] .pick-menu, :root[data-mode="machine"] .menu .sheet-menu { background: var(--crt-bg); box-shadow: none; outline: 1px solid var(--crt-dim); border-radius: 0; }
:root[data-mode="machine"] .pick-menu button b, :root[data-mode="machine"] .menu .sheet-menu a { color: var(--crt-fg); font-weight: 400; text-transform: lowercase; }
:root[data-mode="machine"] .pick-menu button[aria-pressed="true"] { background: var(--crt-fg); }
:root[data-mode="machine"] .pick-menu button[aria-pressed="true"] b, :root[data-mode="machine"] .pick-menu button[aria-pressed="true"] span { color: var(--crt-bg); }
:root[data-mode="machine"] .menu summary { color: var(--crt-fg); }
:root[data-mode="machine"] dialog.cmdk { background: var(--crt-bg); color: var(--crt-fg); border-radius: 0; outline: 1px solid var(--crt-dim); }
:root[data-mode="machine"] .cmdk-in input { color: var(--crt-hi); }
:root[data-mode="machine"] .cmdk-item { color: var(--crt-fg); border-radius: 0; }
:root[data-mode="machine"] .cmdk-item[aria-selected="true"] { background: var(--crt-fg); color: var(--crt-bg); }
:root[data-mode="machine"] .cmdk-glyph { background: none; color: var(--crt-hi); }
:root[data-mode="machine"] .cmdk-foot { background: none; }
@media (max-width: 1180px) { :root[data-mode="machine"] .top nav .find span, :root[data-mode="machine"] .top nav .find kbd { display: none; } :root[data-mode="machine"] .top nav .find::before { content: "[/"; } }
@media (max-width: 1180px) { :root[data-mode="machine"] .top nav .links a { padding-inline: 5px; } :root[data-mode="machine"] .top nav > .gh { display: none; } }
@media (max-width: 980px) { :root[data-mode="machine"] .top nav > .pill { display: none; } }
@media (max-width: 700px) { main.machine .m-cmds pre { white-space: pre; overflow-x: auto; overflow-wrap: normal; } }
@media (prefers-reduced-motion: reduce) { main.machine::before, main.machine::after, .m-cursor, :root[data-mode="machine"] .brand::after { animation: none; } main.machine::after { display: none; } }
