@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/inter-latin-var.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2010-2027, U+2030-203A, U+2044, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/jetbrains-mono-latin-400.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2190-2193, U+2212; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-500.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2190-2193, U+2212; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(../fonts/naskh-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Naskh Wordmark"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/naskh-wordmark-700.woff2) format("woff2"); unicode-range: U+0627, U+062E, U+062F, U+0642, U+0644, U+0646; }
/* ---- tokens.css ---- */
/* Al-Khandaq website on Al-Rasid v3: design tokens.
   Abyss (dark) is the default; Pearl (light) follows the visitor's system
   setting. Colour values come from crates/khandaq-app/ui/kq.css, with --line
   and --ink-3 raised so text and borders meet WCAG AA. The display scale,
   motion tokens and grain come from the approved hybrid prototype.
   Only logical properties are used anywhere, so RTL pages need no mirrored
   rules. The mark is never mirrored and never takes the accent. */

:root {
  color-scheme: dark light;

  /* Abyss */
  --space: #05070b; --bg-void: #0b0f13; --bg: #0d1116; --panel-2: #141a21; --panel: #1a2027;
  --line: #606c79; --line-2: #2a343f; --line-soft: #1d252e;
  --ink: #e8edf2; --ink-2: #a3b0bd; --ink-3: #8996a4; --ink-strong: #ffffff;
  --accent: #a99bff; --accent-hover: #b8adff; --accent-soft: rgba(169, 155, 255, 0.14); --accent-line: rgba(169, 155, 255, 0.38);
  --on-accent: #101418; --focus-halo: rgba(169, 155, 255, 0.35);
  --ok: #58b368; --info: #5a9bd8; --warn: #d9a442; --bad: #c9564a; --critical: #e5484d; --gold: #d8b65c;
  --glass: rgba(5, 7, 11, 0.72);
  --grain-opacity: 0.06; --grain-invert: 0;

  /* Space and shape */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 18px; --r-pill: 999px;
  --wrap: 72rem; --wrap-wide: 90rem; --measure: 46rem;
  --gutter: clamp(16px, 4vw, 56px);
  --top-h: 64px;

  /* Type */
  --font-ui: "Inter", system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --font-head: var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --font-arabic: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-rtl-body: "Bahij TheSansArabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --font-rtl-head: "Bahij TheSansArabic", "Noto Naskh Arabic", "Inter", "Segoe UI", Tahoma, sans-serif;
  /* Display scale: fluid, from phone to a 1600px screen. */
  --fs-hero: clamp(2.75rem, 1.15rem + 6.6vw, 7.5rem);   /* 44 -> 120px */
  --fs-d1: clamp(2.25rem, 1.3rem + 4vw, 4.5rem);        /* 36 -> 72px  */
  --fs-d2: clamp(2rem, 1.25rem + 3vw, 3.75rem);         /* 32 -> 60px  */
  --fs-d3: clamp(1.625rem, 1.15rem + 2vw, 2.75rem);     /* 26 -> 44px  */
  --fs-h2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-body: 1rem; --fs-small: 0.875rem; --fs-micro: 0.6875rem;
  --track-hero: -0.052em; --track-d: -0.04em; --track-h: -0.02em; --track-micro: 0.14em;
  --lh-display: 0.98; --lh-head: 1.1; --lh-body: 1.6;

  /* Motion: one curve for arrivals, one for state changes, three durations. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-1: 250ms; --dur-2: 500ms; --dur-3: 1000ms;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Pearl */
    --space: #f4f1ea; --bg-void: #fbf9f4; --bg: #f4f1ea; --panel-2: #ebe6dc; --panel: #fffdf8;
    --line: #8b8271; --line-2: #d3cab9; --line-soft: #e3dccf;
    --ink: #2b2a25; --ink-2: #57534a; --ink-3: #635d51; --ink-strong: #000000;
    --accent: #5a4cc0; --accent-hover: #4a3db0; --accent-soft: rgba(90, 76, 192, 0.10); --accent-line: rgba(90, 76, 192, 0.38);
    --on-accent: #fffdf8; --focus-halo: rgba(90, 76, 192, 0.30);
    --ok: #2a6f37; --info: #2a63a0; --warn: #875a00; --bad: #b0392e; --critical: #bf2930; --gold: #7a5e10;
    --glass: rgba(244, 241, 234, 0.8);
    --grain-opacity: 0.05; --grain-invert: 1;
  }
}

/* Arabic script joins letters: never track it, and give it room. */
:root[dir="rtl"] {
  --track-hero: 0; --track-d: 0; --track-h: 0; --track-micro: 0;
  --lh-display: 1.35; --lh-head: 1.45; --lh-body: 1.85;
}

/* ---- base.css ---- */
/* Base: reset, page, links, focus, code, tables, film grain. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--space); }
body {
  margin: 0; min-block-size: 100svh; display: flex; flex-direction: column;
  background: var(--space); color: var(--ink);
  font: 400 var(--fs-body) / var(--lh-body) var(--font-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
[dir="rtl"] body { font-family: var(--font-rtl-body); }
main { display: block; flex: 1 0 auto; }
img, svg, video, canvas { max-inline-size: 100%; block-size: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-1); }
[tabindex="-1"]:focus { outline: none; }
b, strong { font-weight: 600; }
::selection { background: var(--accent-soft); }

p, ul, ol, dl, pre, .tbl { margin: 0 0 var(--sp-4); }
li + li { margin-block-start: var(--sp-1); }
hr { border: 0; border-block-start: 1px solid var(--line-soft); margin: var(--sp-6) 0; }
blockquote { margin: 0 0 var(--sp-4); padding-inline-start: var(--sp-4); border-inline-start: 2px solid var(--line); color: var(--ink-2); }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; font-feature-settings: "zero" 1; }
:not(pre) > code { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r-1); padding: 0 0.3em; overflow-wrap: anywhere; }
pre { background: var(--bg-void); border: 1px solid var(--line-soft); border-radius: var(--r-3); padding: var(--sp-3) var(--sp-4); overflow-x: auto; line-height: 1.55; direction: ltr; text-align: start; }
pre code { font-size: 0.8125rem; }

.tbl { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-3); }
table { border-collapse: collapse; inline-size: 100%; font-size: 0.925rem; }
th, td { text-align: start; vertical-align: top; padding: var(--sp-2) var(--sp-3); border-block-end: 1px solid var(--line-soft); }
th { background: var(--panel-2); font-weight: 600; }
tr:last-child td { border-block-end: 0; }

/* Film grain over everything: material, not decoration. One small SVG tile. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: url(../grain.svg) repeat; background-size: 160px 160px;
  opacity: var(--grain-opacity); filter: invert(var(--grain-invert));
}
@media (forced-colors: active) { body::after { display: none; } }

/* ---------- Scrollbars ----------
   Quiet, thin, the page's own colours: a stone-grey thumb on the page ground,
   brighter on hover. Never the accent (the accent means "you are here").
   Standard properties (Chrome 121+, Firefox); the ::-webkit- rules are only
   for Safari, which lacks scrollbar-color. */
:root { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--space); }
:where(pre, .tbl, .toc, [class*="scroll"]) { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
@media (hover: hover) { :root:hover { scrollbar-color: var(--line) var(--space); } }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { inline-size: 10px; block-size: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--line); }
  ::-webkit-scrollbar-corner { background: transparent; }
}

/* ---- type.css ---- */
/* Type: headings, the display scale, leads, labels. */

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: var(--lh-head); letter-spacing: var(--track-h); margin: 0 0 var(--sp-3); text-wrap: balance; }
[dir="rtl"] :is(h1, h2, h3, h4) { font-family: var(--font-rtl-head); font-weight: 700; }
h1 { font-size: var(--fs-d1); line-height: var(--lh-display); letter-spacing: var(--track-d); margin-block-end: var(--sp-5); }
h2 { font-size: var(--fs-h2); margin-block-start: var(--sp-8); }
h3 { font-size: var(--fs-h3); margin-block-start: var(--sp-6); }
h4 { font-size: 1rem; margin-block-start: var(--sp-5); }
p { text-wrap: pretty; }

/* Display headings, for the big statements on designed pages. */
.d-hero { font-size: var(--fs-hero); line-height: var(--lh-display); letter-spacing: var(--track-hero); }
.d1 { font-size: var(--fs-d1); line-height: var(--lh-display); letter-spacing: var(--track-d); }
.d2 { font-size: var(--fs-d2); line-height: 1.04; letter-spacing: var(--track-d); }
.d3 { font-size: var(--fs-d3); line-height: 1.06; letter-spacing: var(--track-d); }
[dir="rtl"] :is(.d-hero, .d1, .d2, .d3) { line-height: var(--lh-display); }
.soft { color: var(--ink-3); }

.lead { font-size: var(--fs-lead); color: var(--ink-2); max-inline-size: var(--measure); }
.small { font-size: var(--fs-small); color: var(--ink-2); }
.prose { max-inline-size: 50rem; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
/* Small mono capitals: section labels, column heads, metadata. */
.micro { font: 500 var(--fs-micro) / 1.4 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--ink-2); }
[dir="rtl"] .micro { font: 600 0.8125rem / 1.5 var(--font-rtl-body); text-transform: none; }
/* The Arabic wordmark. "Naskh Wordmark" holds only its six letters. */
.ar { font-family: "Naskh Wordmark", var(--font-arabic); font-weight: 700; }
[dir="rtl"] .ar { font-family: var(--font-rtl-head); }

/* ---- shell.css ---- */
/* Shell: skip link, header with the animated mark, mobile menu, notice, footer. */

.wrap { max-inline-size: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-inline-size: var(--wrap-wide); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; inset-inline-start: var(--sp-3); inset-block-start: -10rem; z-index: 60; background: var(--ink); color: var(--space); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); font-weight: 600; text-decoration: none; }
.skip:focus { inset-block-start: var(--sp-3); color: var(--space); }

/* ---------- The mark ----------
   Four strata; the three upper ones are cut. On load the layers settle from
   the floor up and the cuts open (CSS only). Hover narrows the cuts.
   Hooks for the home script: data-active="0..3" on .mk highlights a layer
   (0 = top, network; 3 = floor, hardware); .mk-badge.on shows a tray-style
   status badge holding a .g glyph. The SVG is never mirrored in RTL and is
   always ink, never the accent. */
.mk { display: block; overflow: visible; direction: ltr; }
.mk .l { animation: mk-rise 0.9s var(--ease-out) backwards; animation-delay: calc(var(--i) * 110ms + var(--mk-delay, 0.15s)); transition: opacity var(--dur-2) var(--ease); }
.mk .l0 { --i: 3; --c: 32px; } .mk .l1 { --i: 2; --c: 22px; } .mk .l2 { --i: 1; --c: 12px; } .mk .l3 { --i: 0; --c: 0px; }
.mk .a, .mk .b { transition: transform 0.7s var(--ease-out); animation: 0.9s var(--ease-out) backwards; animation-delay: calc(var(--i) * 110ms + var(--mk-delay, 0.15s) + 0.3s); }
.mk .a { animation-name: mk-cut-a; } .mk .b { animation-name: mk-cut-b; }
@keyframes mk-rise { from { opacity: 0; transform: translateY(30px); } }
@keyframes mk-cut-a { from { transform: translateX(var(--c)); } }
@keyframes mk-cut-b { from { transform: translateX(calc(var(--c) * -1)); } }
:is(.brand, .foot-mark):hover .mk .a { transform: translateX(calc(var(--c) * 0.45)); }
:is(.brand, .foot-mark):hover .mk .b { transform: translateX(calc(var(--c) * -0.45)); }
.mk[data-active] .l { opacity: 0.28; }
.mk[data-active="0"] .l0, .mk[data-active="1"] .l1, .mk[data-active="2"] .l2, .mk[data-active="3"] .l3 { opacity: 1; }
.mk-wrap { position: relative; inline-size: 22px; block-size: 22px; flex: none; }
.mk-wrap .mk { inline-size: 22px; block-size: 22px; }
.mk-badge { position: absolute; inset-inline-end: -4px; inset-block-end: -4px; display: grid; place-items: center; inline-size: 12px; block-size: 12px;
  border-radius: 50%; background: var(--space); opacity: 0; transform: scale(0.4); transition: opacity 0.4s var(--ease), transform var(--dur-2) var(--ease-out); }
.mk-badge.on { opacity: 1; transform: none; }
.mk-badge .g.warn { border-inline-width: 3.5px; border-block-end-width: 6px; }
.mk-badge :is(.g.ok, .g.crit, .g.bad, .g.info) { inline-size: 6px; block-size: 6px; }

/* ---------- Header ----------
   Sticky. Transparent at the top of the page, glass once scrolled: driven by
   the scroll position in CSS where supported (motion.css), and by the
   .scrolled class when a page script sets it. Otherwise always glass. */
.top { position: sticky; inset-block-start: 0; z-index: 40; border-block-end: 1px solid var(--line-soft);
  background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.top-in { display: flex; align-items: center; gap: var(--sp-5); block-size: var(--top-h); max-inline-size: var(--wrap-wide); margin-inline: auto; padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--font-ui); letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
[dir="rtl"] .brand .name { font-family: var(--font-rtl-head); font-weight: 700; letter-spacing: 0; font-size: 1.05rem; }
.top .nav { margin-inline-start: auto; }
.top ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.top li + li { margin: 0; }
.top .nav ul { gap: clamp(14px, 1.6vw, 26px); }
.top .nav a { position: relative; display: block; padding-block: var(--sp-2); color: var(--ink-2); text-decoration: none; font-size: var(--fs-small); white-space: nowrap; transition: color var(--dur-1) var(--ease); }
.top .nav a:hover, .top .nav a[aria-current="page"] { color: var(--ink); }
.top .nav a::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 2px; block-size: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease-out); }
[dir="rtl"] .top .nav a::after { transform-origin: right; }
.top .nav a:hover::after { transform: scaleX(1); }
.top .nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.langs ul { gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.langs a { display: block; padding: 3px 10px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-size: 0.8125rem; line-height: 1.5; }
.langs a:hover { color: var(--ink); }
.langs a[aria-current="true"] { background: var(--panel); color: var(--ink); }
.top .cta { flex: none; }

/* Mobile menu: a <details>, so it opens without JavaScript. */
.menu { display: none; }
.menu > summary { list-style: none; display: inline-grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: var(--r-pill); border: 1px solid var(--line-2); cursor: pointer; color: var(--ink); }
.menu > summary::-webkit-details-marker { display: none; }
.menu .bars, .menu .bars::before, .menu .bars::after { display: block; inline-size: 16px; block-size: 1.5px; background: currentColor; border-radius: 1px; transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-1); }
.menu .bars { position: relative; }
.menu .bars::before, .menu .bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu .bars::before { inset-block-start: -5px; } .menu .bars::after { inset-block-start: 5px; }
.menu[open] .bars { background-color: transparent; }
.menu[open] .bars::before { transform: translateY(5px) rotate(45deg); }
.menu[open] .bars::after { transform: translateY(-5px) rotate(-45deg); }
.menu-panel { position: absolute; inset-inline: 0; inset-block-start: 100%; max-block-size: calc(100svh - var(--top-h)); overflow-y: auto;
  background: var(--space); border-block: 1px solid var(--line-soft); padding: var(--sp-2) var(--gutter) var(--sp-6); }
.menu-panel .nav ul { display: block; margin-block-end: var(--sp-5); }
.menu-panel .nav li + li { border-block-start: 1px solid var(--line-soft); }
.menu-panel .nav a { display: block; padding-block: 14px; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 500; letter-spacing: var(--track-h); }
.menu-panel .nav a[aria-current="page"] { color: var(--accent); }
.menu-panel .langs ul { display: inline-flex; }
.menu-panel .langs a { padding: 6px 14px; font-size: 0.9375rem; }

@media (max-width: 74.99rem) {
  .top-in > .nav, .top-in > .langs { display: none; }
  .menu { display: block; }
  .top .cta { margin-inline-start: auto; }
}
@media (max-width: 23rem) { .top-in { gap: var(--sp-3); } }

/* Machine-translation notice. */
.notice { background: var(--panel-2); border-block-end: 1px solid var(--line-soft); font-size: var(--fs-small); color: var(--ink-2); }
.notice p { margin: 0; padding-block: var(--sp-2); }

main > .wrap { padding-block: var(--sp-7) var(--sp-9); }
.crumb { font-size: var(--fs-small); margin-block-end: var(--sp-4); }

/* ---------- Footer ---------- */
.foot { position: relative; background: var(--space); border-block-start: 1px solid var(--line-soft); padding-block: var(--sp-8) var(--sp-7); overflow: hidden; color: var(--ink-2); font-size: var(--fs-small); }
.foot-top { display: flex; flex-wrap: wrap; gap: var(--sp-7); justify-content: space-between; align-items: flex-start; }
.foot-mark { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); color: var(--ink); text-decoration: none; view-timeline: --foot-mark block; }
.foot .foot-mark:hover { color: var(--ink); text-decoration: none; }
.foot-mark .mk { inline-size: clamp(64px, 8vw, 112px); block-size: auto; aspect-ratio: 1; }
.foot-mark .word { font: 600 clamp(2.25rem, 1.4rem + 3.6vw, 5.75rem)/1 var(--font-ui); letter-spacing: -0.05em; }
[dir="rtl"] .foot-mark .word { font-family: var(--font-rtl-head); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.foot-cols { display: grid; grid-template-columns: repeat(4, auto); gap: var(--sp-6) clamp(24px, 4vw, 64px); }
.foot-cols h2 { margin: 0 0 var(--sp-3); color: var(--ink-3); }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-cols li + li { margin: 0; }
.foot a { color: var(--ink-2); text-decoration: none; transition: color var(--dur-1) var(--ease); }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot-bot { margin-block-start: var(--sp-8); padding-block-start: var(--sp-5); border-block-start: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); color: var(--ink-3); }
.foot-bot p { margin: 0; }
.foot-bot { align-items: center; }
/* "A product of Akhund Baba": one ink (muted text), mark at least 90 px wide,
   never mirrored (khandaq design/brand/akhundbaba/README.md). */
.foot .ab-endorse { display: inline-flex; align-items: center; gap: var(--sp-4); color: var(--ink-2); margin-inline-end: auto; }
.foot .ab-endorse:hover { color: var(--ink); text-decoration: none; }
.ab-endorse .ab-mark { inline-size: 96px; block-size: auto; flex: none; }
@media (max-width: 52rem) { .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); inline-size: 100%; } }
/* The footer mark builds on view (motion.css); without that it is shown whole. */
.foot .mk :is(.l, .a, .b) { animation: none; }

@media print { .top, .foot, .notice, .skip, body::after { display: none; } body { background: #fff; color: #000; } }

/* ---- components.css ---- */
/* Components: buttons, risk glyphs, cards, rows, callouts, command box. */

/* ---------- Pill buttons ----------
   .btn-primary is ink on the page, the strongest thing on it; the accent
   stays for "you are here" and focus. .arrow nudges forward on hover. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-block-size: 48px; padding: 0 22px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; font: 600 0.9375rem/1.2 var(--font-ui); letter-spacing: -0.005em; cursor: pointer;
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
[dir="rtl"] .btn { font-family: var(--font-rtl-body); font-weight: 700; letter-spacing: 0; }
.btn:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--space); }
.btn-primary:hover { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--space); }
.btn-sm { min-block-size: 36px; padding: 0 16px; font-size: 0.8125rem; }
.btn svg { inline-size: 18px; block-size: 18px; flex: none; }
.btn .arrow { display: inline-block; transition: transform var(--dur-2) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(4px); }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block: var(--sp-5) var(--sp-3); }

/* ---------- Risk glyphs ----------
   Colour never travels alone: each state has its own shape, and the word next
   to it stays ink. Danger hues never colour words. */
.g { display: inline-block; flex: none; vertical-align: middle; }
.g.ok { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--ok); }
.g.info { inline-size: 8px; block-size: 8px; border-radius: 50%; border: 1.5px solid var(--info); }
.g.warn { inline-size: 0; block-size: 0; border-inline: 5px solid transparent; border-block-end: 9px solid var(--warn); }
.g.bad { inline-size: 8px; block-size: 8px; background: var(--bad); }
.g.crit { inline-size: 11px; block-size: 11px; border-radius: 50%; background: var(--critical); }
.g.unknown { inline-size: 9px; block-size: 9px; border-radius: 50%; border: 1.5px dashed var(--ink-2); }
@media (forced-colors: active) { .g { forced-color-adjust: none; } }

/* ---------- Cards and grids ---------- */
.grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin-block: var(--sp-5); padding: 0; list-style: none; }
.grid > li { margin: 0; }
.card { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r-4); padding: var(--sp-5); transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out); }
.card:hover { border-color: var(--line-2); }
.card :is(h2, h3) { margin-block-start: 0; font-size: 1.125rem; letter-spacing: var(--track-h); }
.card p:last-child { margin-block-end: 0; }
.card p { color: var(--ink-2); }
.card .tag { display: inline-block; margin-block-end: var(--sp-2); }

/* ---------- Rows: a ruled list with a glyph, a label and a value ----------
   <ul class="rows"><li><i class="g warn"></i><span>Label<span class="s">detail</span></span><small>value</small></li></ul> */
.rows { list-style: none; margin: 0 0 var(--sp-4); padding: 0; border-block-start: 1px solid var(--line-soft); }
.rows li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 14px; margin: 0; padding-block: 13px; border-block-end: 1px solid var(--line-soft); font-size: 0.9375rem; }
.rows li .g { justify-self: center; }
.rows li small { font: 400 0.75rem var(--font-mono); color: var(--ink-2); text-align: end; }
.rows li .s { display: block; font-size: 0.8125rem; color: var(--ink-2); }

/* ---------- Callouts ---------- */
.callout { border-inline-start: 2px solid var(--warn); background: var(--panel-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); max-inline-size: 50rem; }
.callout.info { border-inline-start-color: var(--line); }

/* ---------- Command box ----------
   <div class="cmd"><code>winget install …</code><button type="button" class="btn-copy" data-copy hidden>Copy</button></div>
   The copy button stays hidden without JavaScript; a page script that
   handles [data-copy] removes `hidden`. The command itself is selectable. */
.cmd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-inline-start: 14px; border-radius: 10px; background: var(--bg-void); border: 1px solid var(--line-soft);
  font: 400 0.8125rem/1.5 var(--font-mono); color: var(--ink-2); direction: ltr; text-align: start; }
.cmd code { flex: 1; min-inline-size: 0; overflow-x: auto; white-space: nowrap; color: var(--ink); background: none; border: 0; padding: 0; font-size: inherit; }
.btn-copy { flex: none; font: 500 0.75rem var(--font-ui); color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 10px; cursor: pointer; transition: border-color var(--dur-1) var(--ease); }
.btn-copy:hover { border-color: var(--line); }

/* ---------- Small pieces ---------- */
.kv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: var(--sp-2) var(--sp-5); max-inline-size: 50rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
@media (max-width: 40rem) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-block-end: var(--sp-3); } }
.fn { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.soon { color: var(--ink-3); font-size: 0.875rem; }

/* ---- motion.css ---- */
/* Motion, without JavaScript.
   - Scroll reveals use CSS scroll-driven animations, only where the browser
     supports them; everywhere else content is simply there.
   - Page-to-page navigation cross-fades (cross-document view transitions).
   - Under prefers-reduced-motion everything here is off, and the load
     animation of the mark is dropped: the page is composed and still. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Cross-document transitions only ever run between same-origin pages (the
     site's own). Chromium skips one when the document is hidden or throttled
     as it starts (a background tab or pane) and logs "Transition was aborted
     because of invalid state"; the navigation itself is unaffected, so this
     is left on. Only .top carries a view-transition-name: names must be unique. */
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  ::view-transition-old(root) { animation: vt-out var(--dur-1) var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in var(--dur-2) var(--ease-out) both; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

  /* Headline lines rising on load: <h1 class="lines"><span><span>…</span></span>…</h1>. */
  .lines > span { display: block; overflow: hidden; padding-block-end: 0.08em; }
  .lines > span > span { display: block; animation: line-up 1.3s var(--ease-out) backwards; animation-delay: 0.15s; }
  .lines > span:nth-child(2) > span { animation-delay: 0.27s; }
  .lines > span:nth-child(3) > span { animation-delay: 0.39s; }
  @keyframes line-up { from { transform: translateY(105%); } }

  @supports (animation-timeline: scroll()) {
    /* Header: transparent over the top of the page, glass once scrolled. */
    .top:not(.scrolled) { animation: top-glass linear both; animation-timeline: scroll(root block); animation-range: 0 72px; }
    @keyframes top-glass {
      from { background-color: transparent; border-block-end-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
    }
  }

  @supports (animation-timeline: view()) {
    /* .reveal: rises and sharpens as it enters the viewport.
       Existing content gets it through the selectors below. */
    :is(.reveal, main .grid > li, main .strata > li, main .rows > li) {
      animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 70%;
    }
    @keyframes reveal { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } }

    /* Footer mark: the layers build from the floor up as it scrolls into view,
       then the cuts open. */
    .foot-mark .mk .l { animation: mk-rise linear both; animation-timeline: --foot-mark; }
    .foot-mark .mk .l3 { animation-range: entry 0% entry 55%; }
    .foot-mark .mk .l2 { animation-range: entry 15% entry 70%; }
    .foot-mark .mk .l1 { animation-range: entry 30% entry 85%; }
    .foot-mark .mk .l0 { animation-range: entry 45% entry 100%; }
    .foot-mark .mk :is(.a, .b) { animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both; animation-delay: 0s; animation-timeline: --foot-mark; animation-range: entry 60% cover 50%; }
    .foot-mark .mk .a { animation-name: mk-cut-a; }
    .foot-mark .mk .b { animation-name: mk-cut-b; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk :is(.l, .a, .b) { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
