/* Gehlvora components — two inks, one stroke, sharp corners.
   Colours, type, spacing, sizes, durations and easings come from tokens.css.
   Tones (1-bit patterns) and motion helpers live here because they are not single values. */
:root {
  /* Tones: the "greys" of a two-colour system. Static textures; never scale or animate them. */
  --tone-6: conic-gradient(from 270deg at 1px 1px, var(--ink) 25%, transparent 0) 0 0 / 4px 4px;
  --tone-25: conic-gradient(from 90deg at 1px 1px, transparent 75%, var(--ink) 0) 0 0 / 2px 2px;
  --tone-50: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
  --tone-75: conic-gradient(from 90deg at 1px 1px, var(--ink) 75%, transparent 0) 0 0 / 2px 2px;
  --lines: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 3px);
  --lines-v: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 3px);
  --hatch: repeating-linear-gradient(-45deg, var(--ink) 0 1px, transparent 1px 5px);
  /* The same tones in paper, for use on ink grounds. */
  --tone-25-p: conic-gradient(from 90deg at 1px 1px, transparent 75%, var(--paper) 0) 0 0 / 2px 2px;
  --tone-50-p: repeating-conic-gradient(var(--paper) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
  --tone-75-p: conic-gradient(from 90deg at 1px 1px, var(--paper) 75%, transparent 0) 0 0 / 2px 2px;
  /* Dotted rule: a 1px line of tone-50. Secondary dividers; dashed is reserved for disabled. */
  --rule-dot: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 2px);
  --rule-dot-p: repeating-linear-gradient(90deg, var(--paper) 0 1px, transparent 1px 2px);
  --dither: var(--tone-50);
  --dither-paper: var(--tone-50-p);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: var(--focus-ring) solid var(--ink); outline-offset: var(--focus-offset); }
/* On ink grounds the ring turns paper so it always contrasts. */
:is(.band, .ticker, .term, .code-bar, .on-ink) :focus-visible { outline-color: var(--paper); }
h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
/* Flow: the reset removes every margin, so stacked text gets its space back here.
   Put .flow on any container of running text (articles, card bodies, dialogs, bands). */
.flow > * + * { margin-block-start: var(--flow-space, var(--stack-md)); }
.flow > :is(h1, h2, h3, h4) { --flow-space: var(--stack-xl); }
.flow > :is(h1, h2, h3, h4) + * { --flow-space: var(--stack-lg); }
.flow > .label + :is(h1, h2, h3) { --flow-space: var(--stack-sm); }
.flow > * + :is(.btn, .p-actions, .dialog-actions, .btn-row) { --flow-space: var(--stack-lg); }
/* Text in a frame never touches it: framed text gets at least inline-md at the sides. */
p, li, dd { overflow-wrap: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.label { font: 500 11px/1.45 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.mono { font-family: var(--font-mono); }

/* ---------- Tones ---------- */
.tone-6 { background: var(--tone-6); } .tone-25 { background: var(--tone-25); } .tone-50 { background: var(--tone-50); }
.tone-75 { background: var(--tone-75); } .tone-lines { background: var(--lines); } .tone-lines-v { background: var(--lines-v); } .tone-hatch { background: var(--hatch); }
/* Raised: a hard 1-bit "shadow" — a tone-50 block offset by 8px. Selected or lifted things only. */
.raised { position: relative; isolation: isolate; background: transparent; }
.raised::after { content: ""; position: absolute; inset: -1px; border: var(--stroke) solid var(--ink); background: var(--paper); z-index: -1; pointer-events: none; }
.raised::before { content: ""; position: absolute; inset: var(--space-8) calc(var(--space-8) * -1) calc(var(--space-8) * -1) var(--space-8); background: var(--tone-50); z-index: -1; pointer-events: none; transition: inset var(--dur-quick) var(--ease-out); }
@media (hover: hover) { .raised.lift:hover::before { inset: var(--space-12) calc(var(--space-12) * -1) calc(var(--space-12) * -1) var(--space-12); } }

/* ---------- Motion ---------- */
/* Signature: the invert wipe. A layer of `invert` with mix-blend difference sweeps across and swaps
   ink and paper exactly, text included; it leaves in the same direction it came. */
.inv { background: var(--paper); }
:is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a) { position: relative; isolation: isolate; }
:is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a)::after { content: ""; position: absolute; inset: 0; background: var(--invert); mix-blend-mode: difference; transform: scaleX(0); transform-origin: 100% 50%; transition: transform var(--dur-quick) var(--ease-out); pointer-events: none; }
/* Already selected (the current tab, page or language): a second press changes nothing, so no wipe and no press. */
@media (hover: hover) { :is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a):not([aria-selected="true"], [aria-current="page"], .lang button[aria-pressed="true"]):hover::after { transform: scaleX(1); transform-origin: 0 50%; } }
:is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a):not([aria-selected="true"], [aria-current="page"], .lang button[aria-pressed="true"]):focus-visible::after, :is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a)[aria-expanded="true"]::after { transform: scaleX(1); transform-origin: 0 50%; }
:is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a):not([aria-selected="true"], [aria-current="page"], .lang button[aria-pressed="true"]):active { transform: translateY(1px); transition: transform var(--dur-tap) var(--ease-press); }
/* Draw: give paths pathLength="1". */
.m-draw * { transition: stroke-dashoffset var(--dur-draw) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.js .m-draw * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .in .m-draw *, .js .m-draw.in * { stroke-dashoffset: 0; }

.m-wipe { transition: clip-path var(--dur-reveal) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.js .m-wipe { clip-path: inset(0 100% 0 0); }
.js .in .m-wipe, .js .m-wipe.in { clip-path: inset(0 -8px 0 0); }

.m-assemble > * { transition: transform var(--dur-reveal) var(--ease-out), clip-path var(--dur-reveal) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.js .m-assemble > * { transform: translateY(16px); clip-path: inset(0 0 100% 0); }
.js .in .m-assemble > *, .js .m-assemble.in > * { transform: none; clip-path: inset(-8px); }

.m-land { transform: rotate(var(--rot, -4deg)); transition: transform var(--dur-quick) var(--ease-press), visibility 0s; }
.js .m-land { transform: scale(1.4) rotate(-10deg); visibility: hidden; }
.js .in .m-land, .js .m-land.in { transform: rotate(var(--rot, -4deg)); visibility: visible; }

/* ---------- Button ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--space-8); height: var(--control); padding: 0 var(--inline-md) 0 var(--inline-md); border: var(--stroke) solid var(--ink); border-radius: var(--radius-none); font-size: 14px; font-weight: 500; text-decoration: none; position: relative; isolation: isolate; background: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.wide { width: 100%; justify-content: center; height: var(--control-lg); }
.btn.small { height: var(--control-sm); padding: 0 var(--space-16); font-size: 12px; }
/* Disabled: the only dashed thing in the system. No grey, no opacity. */
.btn[disabled], .btn[aria-disabled="true"] { background: var(--paper); color: var(--ink); border-style: dashed; cursor: not-allowed; }
.btn[disabled]::after, .btn[aria-disabled="true"]::after { display: none; }
.btn[aria-disabled="true"] { pointer-events: none; }
/* Busy: the wipe keeps sweeping back and forth while the action runs; width stays put. */
.btn[aria-busy="true"] { pointer-events: none; cursor: progress; }
.btn[aria-busy="true"]::after { transform-origin: 0 50%; animation: busy 1.1s var(--ease-in-out) infinite alternate; }
@keyframes busy { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Small controls keep a 44px hit area around their 32px box. */
.btn.small::before, .lang button::before { content: ""; position: absolute; inset: calc((var(--target) - var(--control-sm)) / -2) 0; }
.btn .ico { width: 18px; height: 18px; transition: transform var(--dur-quick) var(--ease-out); }
@media (hover: hover) { .btn:hover .ico { transform: translateX(4px); } }
.btn:focus-visible .ico { transform: translateX(4px); }
.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font-size: 14px; }

/* ---------- Icon and icon button ---------- */
.ico { width: var(--icon); height: var(--icon); fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: square; stroke-linejoin: miter; }
.ico * { vector-effect: non-scaling-stroke; }
.icon-btn { width: var(--control); height: var(--control); border: var(--stroke) solid var(--ink); border-radius: var(--radius-round); display: grid; place-items: center; flex: none; overflow: hidden; background: var(--paper); }
.icon-btn .ico { transition: transform var(--dur-quick) var(--ease-out); }
/* Round: the wipe grows as a circle from the left instead of a scaled square, so it never shows corners. */
.icon-btn::after { border-radius: inherit; transform: none !important; clip-path: circle(0 at 0 50%); transition: clip-path var(--dur-quick) var(--ease-out); }
@media (hover: hover) { .icon-btn:hover::after { clip-path: circle(150% at 0 50%); } }
.icon-btn:focus-visible::after, .icon-btn[aria-expanded="true"]::after { clip-path: circle(150% at 0 50%); }
@media (hover: hover) { .icon-btn:hover .ico { transform: rotate(90deg); } }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.icon-btn .ico-on, .icon-btn[aria-pressed="true"] .ico-off { display: none; }
.icon-btn[aria-pressed="true"] .ico-on { display: block; }

/* ---------- Chapter ---------- */
.chapter { display: flex; align-items: center; gap: var(--space-12); }
.chapter b { font-weight: 500; border: var(--stroke) solid var(--ink); padding: var(--space-4) var(--inset-xs); }
.chapter::after { content: ""; flex: 1; height: 1px; background: var(--rule-dot); }

/* ---------- Facts, tags ---------- */
.facts { display: flex; flex-wrap: wrap; gap: var(--space-8); list-style: none; align-items: flex-start; }
.facts li { border: var(--stroke) solid var(--ink); padding: var(--space-4) var(--space-12); white-space: nowrap; }
.facts li.solid { background: var(--ink); color: var(--paper); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-8); }
.tags li { border: var(--stroke) solid var(--ink); padding: var(--space-4) var(--space-12); }
.tags li::before { content: "#"; margin-right: var(--space-4); }

/* ---------- Language switch ---------- */
.lang { display: inline-flex; border: var(--stroke) solid var(--ink); }
.lang button { background: var(--paper); height: var(--control-sm); padding: 0 var(--space-12); }
.lang button + button { border-left: var(--stroke) solid var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Menu ---------- */
.menu-list { min-width: 200px; display: flex; flex-direction: column; background: var(--paper); border: var(--stroke) solid var(--ink); }
.menu-list:not([hidden]) { animation: menu-in var(--dur-quick) var(--ease-out); }
.menu-list.leaving { animation: menu-out var(--dur-quick) var(--ease-in-out) forwards; }
@keyframes menu-in { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(-8px); transform: none; } }
@keyframes menu-out { from { clip-path: inset(-8px); transform: none; } to { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } }
.menu-list > * { background: var(--paper); display: flex; gap: var(--space-16); padding: var(--space-16) var(--space-20); text-decoration: none; }
.menu-list > * + * { border-top: var(--stroke) solid var(--ink); }
.menu-list a[aria-current="page"]::before { content: "\2192"; margin-right: calc(var(--space-8) * -1); }
.menu-list > span { cursor: default; background: var(--tone-6); }
.menu-list em { font-style: normal; margin-left: auto; border: var(--stroke) solid var(--ink); padding: 0 var(--space-8); background: var(--paper); }

/* ---------- Nav bar, footer ---------- */
.nav { background: var(--paper); border-bottom: var(--stroke) solid var(--ink); position: sticky; top: 0; z-index: 10; }
.nav-in { height: var(--nav-height); display: flex; align-items: center; gap: var(--space-24); padding: 0 var(--space-24); }
.brand { display: flex; align-items: center; gap: var(--space-12); text-decoration: none; font-weight: 700; letter-spacing: -.02em; font-size: 18px; }
.brand svg { width: 22px; height: 20px; }
.nav .lang { margin-left: auto; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--ink); transform-origin: 0 50%; }
.footer { display: flex; flex-wrap: wrap; gap: var(--space-12) var(--space-24); justify-content: space-between; align-items: center; padding: var(--space-24); }
.footer .brand { font-size: 16px; }
.footer .meta { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.footer .meta a { background: var(--paper); padding: var(--space-8) var(--space-12); text-decoration: none; }
.footer .meta a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.footer .copy { width: 100%; padding-top: var(--space-16); background: var(--rule-dot) top / 100% 1px no-repeat; }

/* ---------- Field, message ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-8); }
.field :is(input, select) { height: var(--control-lg); padding: 0 var(--inline-md); border: var(--stroke) solid var(--ink); border-radius: var(--radius-none); background: var(--paper); color: var(--ink); font: 16px var(--font-sans); width: 100%; }
.field textarea { min-height: 120px; padding: var(--space-12) var(--inline-md); border: var(--stroke) solid var(--ink); border-radius: var(--radius-none); background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font-sans); width: 100%; resize: vertical; }
.field :is(input, textarea)::placeholder { color: var(--ink); opacity: 1; background: none; }
.field :is(input, select, textarea):focus { outline: var(--focus-ring) solid var(--ink); outline-offset: 2px; background: var(--paper); }
.field .label .opt { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: 12px; font-weight: 400; margin-left: var(--space-8); }
.field .hint { font-size: 14px; line-height: 1.5; margin-top: var(--space-4); }
/* Invalid: a 2px alert frame plus a written reason (never colour alone). */
.field :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert); }
.field :is(input, select, textarea)[aria-invalid="true"]:focus { outline-color: var(--alert); }
.field .hint.err { color: var(--alert); }
.field .hint.err::before { content: "Error: "; font-weight: 600; }
:lang(de) .field .hint.err::before { content: "Fehler: "; }
/* Read-only: no frame, only a baseline. Disabled: dashed. */
.field :is(input, textarea)[readonly] { border-color: transparent; border-bottom-color: var(--ink); padding-left: 0; }
.field :is(input, select, textarea):disabled { border-style: dashed; cursor: not-allowed; }
.check { display: flex; gap: var(--space-12); align-items: flex-start; font-size: 14px; }
/* Checkbox and radio: drawn in the system's own stroke. Radios stay round so they read as radios. */
.check { cursor: pointer; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin-top: 2px; border: var(--stroke) solid var(--ink); background: var(--paper); display: grid; place-items: center; cursor: pointer; transition: background var(--dur-tap) var(--ease-out); }
.check input[type="radio"] { border-radius: var(--radius-round); }
.check input::before { content: ""; width: 10px; height: 10px; background: var(--paper); transform: scale(0); transition: transform var(--dur-tap) var(--ease-press); }
.check input[type="checkbox"]::before { clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check input[type="radio"]::before { border-radius: var(--radius-round); background: var(--ink); width: 8px; height: 8px; }
.check input[type="checkbox"]:is(:checked, :indeterminate) { background: var(--ink); }
.check input:checked::before { transform: scale(1); }
.check input:indeterminate::before { transform: scale(1); clip-path: inset(40% 0); }
.check input:focus-visible { outline-offset: 2px; }
.check input:disabled { border-style: dashed; cursor: not-allowed; }
.check:has(input:disabled) { cursor: not-allowed; }
.check input[aria-invalid="true"] { border-color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert); }
fieldset.choices { border: 0; display: flex; flex-direction: column; gap: var(--space-12); }
fieldset.choices legend { margin-bottom: var(--space-16); }
.msg { border: var(--stroke) solid var(--ink); padding: var(--space-12) var(--inline-md); font-size: 14px; }
.msg:empty { display: none; }
.msg.err { border: var(--stroke) solid var(--alert); color: var(--alert); }
.msg.ok { display: flex; gap: var(--space-12); align-items: center; }
.msg.ok .ico { width: 18px; height: 18px; flex: none; }
.wait { display: flex; align-items: center; gap: var(--space-12); font-size: 14px; }
.wait i { width: 12px; height: 12px; border: var(--stroke) solid var(--ink); position: relative; overflow: hidden; flex: none; }
.wait i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; animation: wait 1.1s var(--ease-in-out) infinite alternate; }
@keyframes wait { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Callout, figure, rules ---------- */
.callout { border: var(--stroke) solid var(--ink); padding: var(--space-32) var(--inset-md) var(--inset-md); position: relative; }
.callout > * + :not(.label) { margin-top: var(--stack-sm); }
.callout .label { position: absolute; top: 0; transform: translateY(-50%); left: var(--space-20); background: var(--ink); color: var(--paper); padding: 0 var(--space-8); }
.fig { position: relative; border: var(--stroke) solid var(--ink); background: var(--paper); }
.fig-head, .fig-cap { display: flex; justify-content: space-between; gap: var(--space-12); padding: var(--space-12) var(--inline-md); }
.fig-head { border-bottom: var(--stroke) solid var(--ink); }
.fig-cap { border-top: var(--stroke) solid var(--ink); }
.fig svg .s { fill: none; stroke: var(--ink); stroke-width: var(--stroke-figure); }
.fig svg .s1 { fill: none; stroke: var(--ink); stroke-width: var(--stroke); }
.fig svg .p { fill: var(--paper); }
.fig svg .f { fill: var(--ink); }
.fig svg .t { fill: var(--ink); font: 500 11px var(--font-mono); letter-spacing: .08em; }
.muted-rule { border: 0; height: 1px; background: var(--rule-dot); }
.logo-rule { border: 0; height: 14px; background: linear-gradient(var(--ink), var(--ink)) left center / calc(50% - 22px) 1px no-repeat, linear-gradient(var(--ink), var(--ink)) right center / calc(50% - 22px) 1px no-repeat; position: relative; }
.logo-rule::after { content: ""; position: absolute; left: 50%; top: 0; width: 15px; height: 14px; transform: translateX(-50%); background: var(--ink); clip-path: polygon(50% 100%, 0 0, 100% 0); }

/* ---------- Footnote: a mono numeral that links down to a small note ---------- */
.fn-ref { font: 500 .62em/0 var(--font-mono); vertical-align: super; margin-left: 1px; }
.fn-ref a { text-decoration: none; padding: 0 2px; }
.fn-ref a:focus-visible { outline: var(--focus-ring) solid currentColor; outline-offset: 1px; }
@media (hover: hover) { .fn-ref a:hover { background: var(--ink); color: var(--paper); } }
.fn { font-size: 13px; line-height: 1.5; max-width: var(--measure); }
.fn sup { font: 500 .85em/0 var(--font-mono); margin-right: var(--space-4); }

/* ---------- Picture: 1-bit masks painted in ink, so they follow the theme ---------- */
.pic { display: block; width: 100%; aspect-ratio: var(--ar, 16 / 10); background: var(--ink); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.shot { border: var(--stroke) solid var(--ink); background: var(--paper); }
.shot figcaption { padding: var(--space-12) var(--inline-md); border-top: var(--stroke) solid var(--ink); }

/* ---------- Form card ---------- */
.a-wrap { background: var(--tone-25); padding: var(--space-48) var(--space-24); display: grid; place-items: start center; }
.a-card { width: 100%; max-width: var(--form-card); }
.a-card { border: var(--stroke) solid var(--ink); }
.a-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--inset-md); border-bottom: var(--stroke) solid var(--ink); }
.a-body { padding: var(--inset-lg); }
.a-body > * + * { margin-top: var(--stack-lg); }
.a-body > h1 + p { margin-top: var(--stack-md); }
.a-body h1 { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.a-body p { font-size: 16px; }

/* ---------- Product card ---------- */
.p-card { display: flex; flex-direction: column; border: var(--stroke) solid var(--ink); max-width: 420px; }
.p-soon .p-fig { background: var(--tone-25); }
.p-fig { position: relative; display: block; border-bottom: var(--stroke) solid var(--ink); background: var(--tone-6); }
.p-tag { position: absolute; top: var(--space-16); left: var(--space-16); background: var(--ink); color: var(--paper); padding: var(--space-4) var(--space-12); }
.p-body { display: flex; flex-direction: column; gap: var(--stack-md); padding: var(--inset-lg); flex-grow: 1; }
.p-body > .label + h2 { margin-top: calc(var(--stack-sm) - var(--stack-md)); }
.p-body > .p-actions { margin-top: var(--space-8); }
.p-body h2 { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.p-price { display: grid; grid-template-columns: 1fr 1fr; border: var(--stroke) solid var(--ink); }
.p-price > div { padding: var(--space-16) var(--inline-md); display: flex; flex-direction: column; gap: var(--space-8); }
.p-price > div + div { border-left: var(--stroke) solid var(--ink); }
.p-price dd { font: 700 20px/1.2 var(--font-sans); letter-spacing: -.01em; }
.p-price .p-free span { background: var(--ink); color: var(--paper); padding: 0 var(--space-8); }
.p-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); }

/* ---------- Pricing pack, table ---------- */
.pr-pack { display: flex; flex-direction: column; border: var(--stroke) solid var(--ink); max-width: 280px; }
.pr-pack[aria-current="true"] .label:first-child span { background: var(--ink); color: var(--paper); padding: 0 var(--space-4); }
.pr-fig { border-bottom: var(--stroke) solid var(--ink); overflow: hidden; }
.pr-fig .pic { --ar: 1 / 1; transition: transform var(--dur-reveal) var(--ease-out); }
@media (hover: hover) { .pr-pack:hover .pr-fig .pic { transform: rotate(-4deg) scale(1.06); } }
.pr-body { display: flex; flex-direction: column; gap: var(--stack-sm); padding: var(--inset-md); flex-grow: 1; }
.pr-body > .btn { margin-top: var(--space-12); }
.pr-body h3 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.pr-price { font: 600 40px/1 var(--font-mono); letter-spacing: -.04em; }
.pr-body p.small { font-size: 14px; }
.pr-body .btn { justify-content: center; }
.pr-table { width: 100%; max-width: 860px; border-collapse: collapse; border: var(--stroke) solid var(--ink); }
.pr-table th, .pr-table td { padding: var(--space-16) var(--space-20); border-top: var(--stroke) solid var(--ink); text-align: left; font-weight: 400; }
.pr-table thead th { border-top: 0; padding-block: var(--space-12); }
.pr-table td, .pr-table thead th + th { width: 22%; text-align: center; border-left: var(--stroke) solid var(--ink); }
.pr-table thead .pr-sup { background: var(--ink); color: var(--paper); }
.pr-table tbody th { background: var(--paper); }
.pr-yes { width: 20px; height: 20px; margin: 0 auto; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: square; }
.pr-no { display: block; width: 16px; height: 1px; margin: 0 auto; background: var(--rule-dot); }

/* ---------- Steps, pillars ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: var(--stroke) solid var(--ink); }
.steps li { padding: var(--space-32) var(--inset-md) var(--space-24) 0; }
.steps li + li { padding-left: var(--inset-md); border-left: var(--stroke) solid var(--ink); }
.steps .n { font: 600 72px/1 var(--font-mono); letter-spacing: -.06em; display: block; margin-bottom: var(--space-24); }
.steps h3 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin-bottom: var(--space-12); }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); border: var(--stroke) solid var(--ink); }
.pillar { background: var(--paper); text-decoration: none; padding: var(--inset-lg) var(--inset-md); }
.pillar + .pillar { border-left: var(--stroke) solid var(--ink); }
.pillar .ico { width: 32px; height: 32px; margin-bottom: var(--space-40); }
.pillar h3 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin-bottom: var(--space-12); }
.pillar p { font-size: 15px; }

/* ---------- Ticker, code, terminal ---------- */
.ticker { overflow: hidden; background: var(--ink); color: var(--paper); height: var(--control-lg); display: flex; align-items: center; }
.ticker-track { display: flex; flex: none; white-space: nowrap; animation: tick 40s linear infinite; }
.ticker:is(:hover, :focus-within) .ticker-track { animation-play-state: paused; }
.ticker-track > span { padding: 0 var(--space-24); display: inline-flex; align-items: center; gap: var(--space-24); }
.ticker-track > span::after { content: ""; width: 7px; height: 6px; background: var(--paper); clip-path: polygon(0 0, 100% 0, 50% 100%); }
@keyframes tick { to { transform: translateX(-50%); } }
.code { border: var(--stroke) solid var(--ink); background: var(--paper); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: var(--space-8) var(--space-8) var(--space-8) var(--inline-md); background: var(--ink); color: var(--paper); }
.code-bar button { padding: var(--space-4) var(--space-12); border: var(--stroke) solid var(--paper); background: var(--ink); }
.code pre code { border: 0; padding: 0; font: inherit; }
.code pre { padding: var(--inset-md); overflow-x: auto; tab-size: 4; font: 14px/1.7 var(--font-mono); }
code { font: .86em var(--font-mono); border: var(--stroke) solid var(--ink); padding: 1px var(--space-4); margin-inline: 1px; }
.term { background: var(--ink); color: var(--paper); font: 13px/1.9 var(--font-mono); border: var(--stroke) solid var(--ink); }
.term .fig-head { border-color: var(--paper); }
.term .dots { display: flex; gap: var(--space-8); }
.term .dots i { width: 8px; height: 8px; border: var(--stroke) solid var(--paper); border-radius: var(--radius-round); }
.term pre { padding: var(--inset-md); white-space: pre-wrap; font: inherit; }
.term .ok { background: var(--paper); color: var(--ink); padding: 0 var(--space-4); }
.caret { display: inline-block; width: .6em; height: 1.1em; background: var(--paper); vertical-align: -.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; } }

/* ---------- Stamp: a rotated label that breaks out of its frame ---------- */
.stamp { display: inline-block; border: var(--stroke) solid var(--ink); background: var(--paper); padding: var(--space-8) var(--space-12); transform: rotate(var(--rot, -4deg)); }
.stamp.solid { background: var(--ink); color: var(--paper); }

/* ---------- Band: an inverted full-width section with a breakout numeral ---------- */
.band { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); padding: var(--inset-xl); }
.band > * + * { position: relative; margin-top: var(--stack-lg); }
.band .num { position: absolute; right: calc(var(--space-16) * -1); bottom: -0.22em; font: 600 220px/1 var(--font-mono); letter-spacing: -.08em; color: transparent; background: var(--tone-50-p); -webkit-background-clip: text; background-clip: text; pointer-events: none; }
.band .chapter b { border-color: var(--paper); }
.band .chapter::after { border-color: var(--paper); }
.band h2 { position: relative; font-size: 48px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; max-width: 14ch; margin-top: var(--space-32); }
/* A band holds at most one button; it keeps the ink ground with a paper frame. */
.band .btn { background: var(--ink); color: var(--paper); border-color: var(--paper); }


/* ---------- Skip link ---------- */
.skip { position: absolute; left: var(--space-16); top: var(--space-8); z-index: 100; background: var(--ink); color: var(--paper); padding: var(--space-8) var(--space-16); text-decoration: none; transform: translateY(-200%); transition: transform var(--dur-quick) var(--ease-out); }
.skip:focus-visible { transform: none; outline-color: var(--ink); }

/* ---------- Dialog: native <dialog>, so focus trap, Esc and focus return come free ---------- */
.dialog { margin: auto; width: min(100% - 2 * var(--space-16), var(--form-card)); border: var(--stroke) solid var(--ink); background: var(--paper); color: var(--ink); padding: 0; }
.dialog::backdrop { background: var(--tone-50); }
.dialog[open] { animation: dlg-in var(--dur-quick) var(--ease-out); }
@keyframes dlg-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
/* Leaving: quicker than arriving, continuing the way the wipe goes (bundle.js adds .leaving). */
.dialog.leaving { animation: dlg-out var(--dur-quick) var(--ease-in-out) forwards; }
@keyframes dlg-out { from { clip-path: inset(0); } to { clip-path: inset(0 0 0 100%); } }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-12); padding: var(--space-8) var(--space-8) var(--space-8) var(--inset-md); border-bottom: var(--stroke) solid var(--ink); }
.dialog-body { padding: var(--inset-lg) var(--inset-md); }
.dialog-body > * + * { margin-top: var(--stack-md); }
.dialog-body h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8); padding: var(--space-16) var(--inset-md); border-top: var(--stroke) solid var(--ink); }

/* ---------- Toast: one at a time, bottom centre, announced politely ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--space-24); z-index: 90; width: max-content; max-width: calc(100% - 2 * var(--space-16)); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-8); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-12); background: var(--ink); color: var(--paper); padding: var(--space-16) var(--space-20); font-size: 14px; clip-path: inset(0); transition: clip-path var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-out); }
.toast.enter { clip-path: inset(0 100% 0 0); transform: translateY(8px); }
.toast.hide { clip-path: inset(0 0 0 100%); }
.toast .ico { width: 18px; height: 18px; flex: none; }
.toast.err { background: var(--paper); color: var(--alert); border: var(--stroke) solid var(--alert); }
.toast button { margin-left: var(--space-8); text-decoration: underline; text-underline-offset: 3px; }
.toasts.demo { position: static; transform: none; }

/* ---------- Tabs ---------- */
.tabs [role="tablist"] { display: flex; border-bottom: var(--stroke) solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { background: var(--paper); height: var(--control); padding: 0 var(--space-16); border: var(--stroke) solid var(--ink); border-bottom: 0; margin-right: -1px; white-space: nowrap; flex: none; }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tabs [role="tabpanel"] { padding: var(--space-24) 0; }
.tabs [role="tabpanel"]:focus-visible { outline-offset: -2px; }

/* ---------- Accordion: native <details> ---------- */
.acc { border-top: var(--stroke) solid var(--ink); }
.acc:last-of-type { border-bottom: var(--stroke) solid var(--ink); }
.acc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-16); padding: var(--space-20) var(--space-12); font-weight: 700; font-size: 18px; letter-spacing: -.01em; cursor: pointer; background: var(--paper); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .ico { flex: none; transition: transform var(--dur-quick) var(--ease-out); }
.acc[open] summary .ico { transform: rotate(45deg); }
.acc .acc-body { padding: var(--space-4) var(--space-12) var(--space-24); max-width: var(--measure); }
.acc[open] .acc-body { animation: acc-in var(--dur-reveal) var(--ease-out); }
@keyframes acc-in { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(-8px); transform: none; } }

/* ---------- Breadcrumb ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-8); }
.crumbs [aria-current="page"] { background: var(--ink); color: var(--paper); padding: 2px var(--space-8); }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; list-style: none; }
.pager > li > * { min-width: var(--target); height: var(--target); display: inline-grid; place-items: center; padding: 0 var(--space-12); border: var(--stroke) solid var(--ink); margin-right: -1px; text-decoration: none; background: var(--paper); font-family: var(--font-mono); font-size: 14px; }
.pager [aria-current="page"] { text-decoration: none;  background: var(--ink); color: var(--paper); }
.pager .gap { border-color: transparent; }
.pager a:not([aria-current]) { text-decoration: none; }
.pager [aria-disabled="true"] { border-style: dashed; cursor: not-allowed; }
.pager .ico { width: 18px; height: 18px; }

@media (max-width: 720px) {
  body { font-size: 15px; }
  .steps { grid-template-columns: 1fr; }
  .steps li + li { padding-left: 0; border-left: 0; border-top: var(--stroke) solid var(--ink); }
  .band { padding: var(--space-32) var(--space-16); }
  .a-body, .p-body { padding: var(--inset-md); }
}

@media (max-width: 960px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillar:nth-child(3) { border-left: 0; }
  .pillar:nth-child(n+3) { border-top: var(--stroke) solid var(--ink); }
}
@media (max-width: 520px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar + .pillar { border-left: 0; border-top: var(--stroke) solid var(--ink); }
  .band .num { font-size: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
}

/* Higher contrast asked for: drop decorative grounds, keep frames. */
@media (prefers-contrast: more) {
  :root { --tone-6: none; --tone-25: none; }
}

/* Windows High Contrast and other forced palettes: patterns and blend modes vanish,
   so state is carried by real borders and system colours. */
@media (forced-colors: active) {
  :root { --tone-6: none; --tone-25: none; --tone-50: none; --tone-75: none; --rule-dot: linear-gradient(CanvasText, CanvasText); }
  :is(.inv, .btn, .menu-list a, .pillar, .footer .meta a, .lang button, .code-bar button, .icon-btn, .pr-table tbody th, .tabs [role="tab"], .acc summary, .pager a)::after { display: none; }
  .raised::before { display: none; }
  :is(.btn.primary, .lang button[aria-pressed="true"], .tabs [aria-selected="true"], .pager [aria-current="page"], .icon-btn[aria-pressed="true"], .crumbs [aria-current="page"], .facts li.solid) { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .check input:checked { background: Highlight; }
  .check input::before { background: HighlightText; }
  .btn[disabled], .btn[aria-disabled="true"], .pager [aria-disabled="true"], :disabled { color: GrayText; border-color: GrayText; }
  :focus-visible { outline-color: Highlight; }
}

/* ---------- Warning button: alert frame, alert fill slides in on hover ---------- */
.btn.danger { background: var(--paper); border-color: var(--alert); color: var(--ink); }
.btn.btn.danger::after { background: var(--alert); mix-blend-mode: normal; z-index: -1; }
@media (hover: hover) { .btn.danger:hover { color: var(--paper); } }
.btn.danger:focus-visible { color: var(--paper); }

/* ---------- Section rule ---------- */
.rule-section { border: 0; border-top: var(--stroke-heading, 2px) solid var(--ink); }

/* ---------- Tooltip: a small help button that reveals one sentence ---------- */
.tip-btn { position: relative; width: 18px; height: 18px; padding: 0; margin-left: var(--space-4); background: none; border: var(--stroke) solid currentColor; border-radius: var(--radius-round); color: inherit; font: 500 11px/1 var(--font-mono); vertical-align: 1px; cursor: help; }
.tip-btn:is(:hover, :focus) { background: var(--ink); color: var(--paper); }
.tip-btn::before { content: ""; position: absolute; inset: -13px; }
.tip { position: absolute; z-index: 2; top: 100%; left: 0; right: 0; padding: var(--space-8) var(--space-12); background: var(--ink); color: var(--paper); font: 400 14px/1.4 var(--font-sans); text-align: left; cursor: default; clip-path: inset(50%); }
.tip-btn:is(:hover, :focus) .tip { clip-path: none; }

/* ---------- Segmented control: pick one of a few settings in place ---------- */
.seg { display: inline-flex; border: var(--stroke) solid var(--ink); }
.seg button { height: var(--target); padding: 0 var(--inline-md); font-size: 14px; font-weight: 500; }
.seg button + button { border-left: var(--stroke) solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button[aria-pressed="true"]::after { display: none; } /* buttons may carry .inv; the chosen one doesn't wipe */

/* ---------- Step indicator: where you are in a short flow ---------- */
.step-ind { display: flex; gap: var(--space-8); list-style: none; }
.step-ind li { flex: 1; padding: var(--space-4) var(--space-8); border: var(--stroke) solid var(--ink); }
.step-ind li.on { background: var(--ink); color: var(--paper); }

/* ---------- Key box: a code or key shown once, to copy ---------- */
.key-box { margin-bottom: var(--space-16); padding: var(--space-12) var(--inline-md); border: var(--stroke) solid var(--ink); font: 600 20px/1.6 var(--font-mono); letter-spacing: .06em; text-align: center; overflow-wrap: anywhere; }

/* ---------- Button row: a few buttons side by side, wrapping ---------- */
.btn-row { display: flex; gap: var(--space-12); flex-wrap: wrap; align-items: center; }
