/* Cryo docs site.
 *
 * Tokens follow docs/brand/CRYO_BRAND_GUIDE.md (palette, IBM Plex, flat vector, no gradients)
 * and DESIGN.md contrast rules. Survey orange appears only as the diagram marker flag.
 * Layout and component choices are justified in docs/DOCS_SITE_DESIGN_RESEARCH_2026-10-05.md.
 */

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Cormorant Garamond";
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Cormorant Garamond";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}

:root {
    /* brand palette (fixed) */
    --c-snow: #f5fafd;
    --c-white: #ffffff;
    --c-frost: #eaf7fd;
    --c-firn: #b8e1f3;
    --c-glacier: #68c1ea;
    --c-core: #277abe;
    --c-ice: #143e60;
    --c-slate: #5c667a;
    --c-marker: #ea580c;
    --c-night: #0b0f16;
    --c-ink: #143e60;
    --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --hdr: 56px;
    --side: 272px;
    --rail: 232px;
    --measure: 66ch;
    --r: 12px;
    --r-sm: 8px;
    --ok: #1e8e5a;
    --warn: #a9791e;
    --bad: #b23a2e;
    /* Diagram edge roles (read / write / control) — not page chrome. */
    --flow-read: #277abe;
    --flow-write: #1a9b6c;
    --flow-ctl: #7b6ad6;
    --ease: cubic-bezier(0.2, 0, 0, 1);
}

html[data-theme="light"],
 :root {
    color-scheme: light;
    --bg: var(--c-snow);
    --surface: var(--c-white);
    --surface-2: var(--c-frost);
    /* Near-black ink, same as the product (`--primitive-neutral-800`). Deep ice on snow
     passes contrast but reads as washed blue; small diagram type needs the darker ink. */
    --ink: #131b24;
    --ink-soft: #3a4554;
    --muted: var(--c-slate);
    --line: #c5d0dc;
    --line-strong: #808b9e;
    --link: #266fa8;
    --on-tint: #1f5f94;
    --accent: var(--c-core);
    --on-accent: #ffffff;
    --accent-hover: #266fa8;
    --focus: #277abe;
    --code-bg: #143e60;
    --code-bar: #0f3352;
    --code-ink: #eaf7fd;
    --code-dim: #9cc3da;
    --code-line: #1d4d73;
    --tk-k: #8fd3f4;
    --tk-s: #bfe6c9;
    --tk-c: #8fb2c8;
    --tk-n: #f6d6a8;
    --tk-i: #d3ecfa;
    --tk-o: #aee0f7;
    --tk-cmd: #ffffff;
    --inline-bg: #eef1f6;
    --callout-note: #eaf7fd;
    --callout-tip: #e8f6ee;
    --callout-caution: #fbf3df;
    --callout-important: #fbe9e6;
    --callout-note-ink: #1f5f94;
    --callout-tip-ink: #1e6b47;
    --callout-caution-ink: #7a5712;
    --callout-important-ink: #8f2f25;
    --hl: #fff2c2;
    /* Diagrams: light cards on a dot grid. Role reads from the icon tile, not the card fill,
     so labels stay ink-on-white and every subtitle clears 4.5:1. */
    --d-canvas: #ffffff;
    --d-dot: #d3dde7;
    --d-node: #ffffff;
    --d-node-line: #c9d4df;
    --d-node-shadow: #e1e8ef;
    --d-cryo-node: #f2f8fd;
    --d-cryo-line: #9fc5e4;
    --d-label: #131b24;
    --d-sub: #5c667a;
    --d-read: var(--flow-read);
    --d-write: var(--flow-write);
    --d-ctl: var(--flow-ctl);
    --d-elabel: #3a4554;
    --d-lane-ink: #3a4554;
    --d-lane-read: #eef6fc;
    --d-lane-read-line: #b8d9f0;
    --d-lane-cryo: #e8f3fb;
    --d-lane-cryo-line: #9fc8e8;
    --d-lane-write: #ecf8f2;
    --d-lane-write-line: #b5e0cc;
    --d-lane-plain: #ffffff;
    --d-lane-plain-line: #d9e0e8;
    --d-tile-cryo: #277abe;
    --d-tile-cryo-fg: #ffffff;
    --d-tile-source: #d9eefb;
    --d-tile-source-fg: #1a5f8f;
    --d-tile-engine: #0f5c4c;
    --d-tile-engine-fg: #ffffff;
    --d-tile-store: #ebe8f4;
    --d-tile-store-fg: #4a4570;
    --d-tile-ui: #ffffff;
    --d-tile-ui-fg: #266fa8;
    --d-tile-ui-line: #c9d4df;
    --d-band: #f5f9fc;
    --d-step: #131b24;
    --d-step-ink: #ffffff;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--c-night);
    --surface: #111a25;
    --surface-2: #14283a;
    --ink: #eaf7fd;
    --ink-soft: #c5d4e0;
    --muted: #afc2cf;
    --line: rgba(234, 247, 253, 0.12);
    --line-strong: rgba(234, 247, 253, 0.24);
    --link: #90d4f0;
    --on-tint: #90d4f0;
    --accent: #68c1ea;
    --on-accent: #0b0f16;
    --accent-hover: #90d4f0;
    --focus: #90d4f0;
    --code-bg: #0c1622;
    --code-bar: #101d2c;
    --code-ink: #eaf7fd;
    --code-dim: #8da6b8;
    --code-line: #1c2b3b;
    --tk-k: #8fd3f4;
    --tk-s: #a9dcb8;
    --tk-c: #7f9aae;
    --tk-n: #f1cf9b;
    --tk-i: #d3ecfa;
    --tk-o: #8fd3f4;
    --tk-cmd: #ffffff;
    --inline-bg: #172636;
    --callout-note: #11283a;
    --callout-tip: #10281f;
    --callout-caution: #2a2212;
    --callout-important: #2e1714;
    --callout-note-ink: #90d4f0;
    --callout-tip-ink: #8fd9b0;
    --callout-caution-ink: #e8c36f;
    --callout-important-ink: #f1a79e;
    --hl: #3b3414;
    --d-canvas: #111a25;
    --d-dot: #233244;
    --d-node: #172433;
    --d-node-line: #2c3d50;
    --d-node-shadow: #090e15;
    --d-cryo-node: #132a40;
    --d-cryo-line: #2f6290;
    --d-label: #eaf7fd;
    --d-sub: #a9bccb;
    --d-read: #68c1ea;
    --d-write: #6ee7b8;
    --d-ctl: #b4a8f0;
    --d-elabel: #c5d4e0;
    --d-lane-ink: #c5d4e0;
    --d-lane-read: #0c2233;
    --d-lane-read-line: #1e4a66;
    --d-lane-cryo: #0d2438;
    --d-lane-cryo-line: #245a82;
    --d-lane-write: #0c241c;
    --d-lane-write-line: #1f5a42;
    --d-lane-plain: #111a25;
    --d-lane-plain-line: #263547;
    --d-tile-cryo: #277abe;
    --d-tile-cryo-fg: #ffffff;
    --d-tile-source: #133a57;
    --d-tile-source-fg: #90d4f0;
    --d-tile-engine: #34d399;
    --d-tile-engine-fg: #042016;
    --d-tile-store: #2d3550;
    --d-tile-store-fg: #d4cff0;
    --d-tile-ui: #172433;
    --d-tile-ui-fg: #90d4f0;
    --d-tile-ui-line: #2c3d50;
    --d-band: #142130;
    --d-step: #eaf7fd;
    --d-step-ink: #0b0f16;
    --c-ink: #eaf7fd;
}


/* ---------- base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--hdr) + 24px);
    background-color: var(--bg);
    overflow-x: clip;
}

html:has(body.home-page) {
    background-color: #d4eaf9;
}

html[data-theme="dark"]:has(body.home-page) {
    background-color: #0f2335;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.625;
    font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility;
}

html[data-theme="dark"] body {
    -webkit-font-smoothing: antialiased;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: var(--link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
}

img,
svg {
    max-width: 100%;
}

.skip {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip:focus {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 100;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    background: var(--surface);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
}

code,
kbd,
pre {
    font-family: var(--mono);
}

kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 1px 6px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
}


/* ---------- header ---------- */

.hdr {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--hdr);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.hdr-in {
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.logo-cr {
    color: var(--c-ice);
}

.logo-yo {
    color: var(--c-core);
}

html[data-theme="dark"] .logo-cr {
    color: var(--c-glacier);
}

html[data-theme="dark"] .logo-yo {
    color: var(--c-frost);
}

.logo:hover {
    text-decoration: none;
}

.logo-mark {
    flex: none;
}

html[data-theme="dark"] .logo-mark {
    --cryo-mark-line: var(--c-night);
    --cryo-mark-dash: #b8e1f3;
}

:root {
    --c-core-mark: var(--c-core);
}

.hdr-tabs {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.hdr-tab {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
}

.hdr-tab:hover {
    color: var(--ink);
    background: var(--surface-2);
    text-decoration: none;
}

.hdr-tab[aria-current] {
    color: var(--on-tint);
    background: var(--surface-2);
}

.hdr-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn,
.hdr-menu {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover,
.hdr-menu:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.hdr-menu {
    display: none;
    margin-right: -8px;
}

.theme-toggle .i-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .i-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .i-moon {
    display: block;
}

.search-open {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 8px 0 12px;
    margin-right: 6px;
    min-width: 232px;
    color: var(--muted);
    background: var(--surface);
    font: inherit;
    font-size: 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
}

.search-open:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.so-text {
    flex: 1;
    text-align: left;
}

.so-kbd {
    border-bottom-width: 1px;
}


/* ---------- shell ---------- */

.shell {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr) var(--rail);
    align-items: start;
}

body.home-page > .side,
body.notfound > .side {
    display: none;
}

.side {
    position: sticky;
    top: var(--hdr);
    height: calc(100vh - var(--hdr));
    overflow-y: auto;
    padding: 28px 12px 40px 20px;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}

.nav-group+.nav-group {
    margin-top: 24px;
}

.nav-label {
    margin: 0 0 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.side ul,
.toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 6px 10px;
    margin: 1px 0;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 14.5px;
    text-decoration: none;
    line-height: 1.4;
}

.nav-link:hover {
    color: var(--ink);
    background: var(--surface-2);
    text-decoration: none;
}

.nav-link[aria-current="page"] {
    color: var(--on-tint);
    background: var(--surface-2);
    font-weight: 600;
}

.scrim {
    position: fixed;
    inset: var(--hdr) 0 0 0;
    z-index: 29;
    background: rgba(11, 15, 22, 0.5);
}

.main {
    min-width: 0;
    padding: 36px clamp(24px, 3vw, 40px) 96px;
}

.toc {
    position: sticky;
    top: var(--hdr);
    max-height: calc(100vh - var(--hdr));
    overflow-y: auto;
    padding: 36px 20px 40px 8px;
    font-size: 13.5px;
    scrollbar-width: thin;
}

.toc-h {
    margin: 0 0 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.toc ul {
    border-left: 1px solid var(--line);
}

.toc a {
    display: block;
    padding: 4px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.4;
}

.toc a:hover {
    color: var(--ink);
    text-decoration: none;
}

.toc a.is-active {
    color: var(--on-tint);
    border-left-color: var(--accent);
    font-weight: 500;
}

.toc .toc-l3 a {
    padding-left: 24px;
    font-size: 13px;
}

.toc-m {
    display: none;
    margin: 0 0 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.toc-m summary {
    cursor: pointer;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.toc-m ul {
    list-style: none;
    margin: 0;
    padding: 0 14px 12px;
}

.toc-m a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

.toc-m .toc-l3 a {
    padding-left: 14px;
}


/* ---------- doc head ---------- */

.doc {
    max-width: 856px;
    margin: 0 auto;
}

.crumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 14px;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.doc h1 {
    margin: 0 0 14px;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

.lede {
    margin: 0;
    max-width: var(--measure);
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 22px 0 8px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

.doc-meta a {
    color: var(--muted);
}

.doc-meta a:hover {
    color: var(--ink);
}

.dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--line-strong);
}

.md-page {
    color: var(--muted);
}

.md-page:hover {
    color: var(--link);
}

.copy-page {
    /* Own row, right aligned. An auto margin on a shared row makes flexbox
       wrap the button onto a blank line even when the row looks empty. */
    flex-basis: 100%;
    width: fit-content;
    margin-left: auto;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 5px 12px;
    cursor: pointer;
}

.copy-page:hover {
    border-color: var(--accent);
}

.copy-page.is-done {
    color: var(--ok);
    border-color: var(--ok);
}


/* ---------- prose ---------- */

.prose {
    padding-top: 8px;
}

.prose>p,
.prose>ul,
.prose>ol,
.prose>dl {
    max-width: var(--measure);
}

.prose p {
    margin: 0 0 16px;
}

.prose h2 {
    margin: 52px 0 14px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.016em;
    position: relative;
    text-wrap: balance;
}

.prose h3 {
    margin: 32px 0 10px;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.006em;
    position: relative;
}

.prose h2+p,
.prose h3+p {
    margin-top: 0;
}

.anchor {
    position: absolute;
    left: -1.1em;
    padding-right: 0.3em;
    color: var(--line-strong);
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
    opacity: 1;
}

.anchor:hover {
    color: var(--accent);
    text-decoration: none;
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
    margin: 0 0 16px;
}

.prose li {
    margin: 4px 0;
}

.prose li::marker {
    color: var(--muted);
}

.prose strong {
    font-weight: 600;
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 40px 0;
}

.prose :not(pre)>code {
    font-size: 0.86em;
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--inline-bg);
    color: var(--ink);
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.prose a code {
    color: inherit;
}

.prose dl {
    margin: 0 0 16px;
}

.prose dt {
    font-weight: 600;
    margin-top: 14px;
}

.prose dd {
    margin: 2px 0 0;
    color: var(--muted);
}


/* tables */

.tbl {
    width: 100%;
    margin: 20px 0 24px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}

.tbl table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.tbl th,
.tbl td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.tbl th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
}

.tbl tr:last-child td {
    border-bottom: 0;
}

.tbl td:first-child,
.tbl th:first-child {
    padding-left: 16px;
}

.tbl .num {
    text-align: right;
    white-space: nowrap;
}

.tbl caption {
    caption-side: bottom;
    text-align: left;
    padding: 10px 16px;
    font-size: 13.5px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.tbl tfoot td {
    font-weight: 600;
    background: var(--surface-2);
}

.tbl code {
    font-size: 0.9em;
}

.yes,
.no,
.part {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    white-space: nowrap;
}

.yes::before,
.no::before,
.part::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: none;
    box-sizing: border-box;
}

.yes::before {
    background: var(--accent);
    border: 1.5px solid var(--accent);
}

.part::before {
    border: 1.5px solid var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3.5px var(--surface);
}

.no::before {
    border: 1.5px solid var(--line-strong);
}

.yes {
    color: var(--ink);
}

.part {
    color: var(--ink);
}

.no {
    color: var(--muted);
}

.bar {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--accent);
    min-width: 4px;
}

.bar-cell {
    width: 34%;
}


/* grade pills (letter + word, never colour alone) */

.grade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
}

.grade b {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.grade-a b {
    background: #1e8e5a;
}

.grade-b b {
    background: #4d7c0f;
}

.grade-c b {
    background: #8a6317;
}

.grade-d b {
    background: #b4560f;
}

.grade-f b {
    background: #b23a2e;
}


/* ---------- callouts ---------- */

.callout {
    display: flex;
    gap: 12px;
    margin: 22px 0;
    padding: 14px 16px;
    border-radius: var(--r);
    border: 1px solid transparent;
}

.callout .ic {
    flex: none;
    margin-top: 2px;
}

.callout-body {
    min-width: 0;
}

.callout-body> :last-child {
    margin-bottom: 0;
}

.callout-title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 14.5px;
}

.callout p {
    font-size: 15px;
    margin: 0 0 8px;
}

.callout-note {
    background: var(--callout-note);
    color: var(--ink);
    border-color: color-mix(in srgb, var(--callout-note-ink) 22%, transparent);
}

.callout-note .ic,
.callout-note .callout-title {
    color: var(--callout-note-ink);
}

.callout-tip {
    background: var(--callout-tip);
    border-color: color-mix(in srgb, var(--callout-tip-ink) 22%, transparent);
}

.callout-tip .ic,
.callout-tip .callout-title {
    color: var(--callout-tip-ink);
}

.callout-caution {
    background: var(--callout-caution);
    border-color: color-mix(in srgb, var(--callout-caution-ink) 28%, transparent);
}

.callout-caution .ic,
.callout-caution .callout-title {
    color: var(--callout-caution-ink);
}

.callout-important {
    background: var(--callout-important);
    border-color: color-mix(in srgb, var(--callout-important-ink) 26%, transparent);
}

.callout-important .ic,
.callout-important .callout-title {
    color: var(--callout-important-ink);
}


/* ---------- code ---------- */

.code {
    margin: 20px 0 24px;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--code-bg);
    color: var(--code-ink);
    border: 1px solid var(--code-line);
}

.code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px 6px 16px;
    background: var(--code-bar);
    border-bottom: 1px solid var(--code-line);
}

.code-title {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--code-dim);
}

.code pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
    tab-size: 2;
}

.code code {
    font-family: var(--mono);
}

.ln {
    display: inline;
}

.tk-p {
    color: var(--code-dim);
    user-select: none;
}

.tk-cmd {
    color: var(--tk-cmd);
    font-weight: 500;
}

.tk-out {
    color: var(--code-dim);
}

.tk-k {
    color: var(--tk-k);
}

.tk-s {
    color: var(--tk-s);
}

.tk-c {
    color: var(--tk-c);
    font-style: italic;
}

.tk-n {
    color: var(--tk-n);
}

.tk-i {
    color: var(--tk-i);
}

.tk-o {
    color: var(--tk-o);
}

.tk-u {
    color: var(--tk-i);
    text-decoration: underline;
    text-decoration-color: var(--code-line);
}

.copy {
    font: inherit;
    font-size: 12.5px;
    color: var(--code-dim);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
}

.copy:hover {
    color: var(--code-ink);
    border-color: var(--code-line);
}

.copy.is-done {
    color: #8fd9b0;
}

.tabs .code {
    margin-top: 0;
}


/* ---------- tabs ---------- */

.tabs {
    margin: 22px 0 26px;
}

.tablist {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    overflow-x: auto;
}

.tab {
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.tab:hover {
    color: var(--ink);
}

.tab[aria-selected="true"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.tabpanel> :first-child {
    margin-top: 0;
}

.tabpanel> :last-child {
    margin-bottom: 0;
}


/* ---------- steps ---------- */

.steps {
    list-style: none;
    counter-reset: step;
    padding: 0 !important;
    margin: 24px 0 28px;
    max-width: none !important;
}

.steps>li {
    position: relative;
    counter-increment: step;
    margin: 0;
    padding: 0 0 26px 48px;
}

.steps>li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--on-tint);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
}

.steps>li::after {
    content: "";
    position: absolute;
    left: 14.5px;
    top: 34px;
    bottom: 6px;
    width: 1px;
    background: var(--line);
}

.steps>li:last-child::after {
    display: none;
}

.steps>li:last-child {
    padding-bottom: 0;
}

.step-title {
    margin: 0 0 6px !important;
    font-weight: 600;
    font-size: 17px;
}

.steps>li> :not(.step-title):last-child {
    margin-bottom: 0;
}


/* ---------- link cards ---------- */

.linkcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 20px 0 28px;
}

.linkcard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s var(--ease);
}

.linkcard:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.lc-title {
    font-weight: 600;
    font-size: 15.5px;
}

.lc-desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.linkcard::after {
    content: "→";
    position: absolute;
    right: 14px;
    top: 13px;
    color: var(--muted);
}

.linkcard:hover::after {
    color: var(--accent);
}


/* ---------- operation order ---------- */

.ops {
    counter-reset: op;
    margin: 24px 0 28px;
}

.ops-group {
    margin: 0 0 6px;
}

.ops-phase {
    margin: 14px 0 6px 52px !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.ops ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ops li {
    position: relative;
    counter-increment: op;
    display: grid;
    grid-template-columns: 52px 1fr;
    margin: 0;
}

.ops li::before {
    content: counter(op);
    grid-column: 1;
    align-self: start;
    justify-self: start;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--on-tint);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.ops li::after {
    content: "";
    position: absolute;
    left: 14.5px;
    top: 30px;
    bottom: -6px;
    width: 1px;
    background: var(--line-strong);
}

.ops-group:last-child li:last-child::after {
    display: none;
}

.ops li>div {
    padding: 0 0 18px;
}

.ops li code {
    font-weight: 500;
    font-size: 14.5px;
}

.ops li a {
    color: inherit;
    text-decoration: none;
}

.ops li a:hover code {
    color: var(--link);
}

.expect {
    margin-top: 10px !important;
    color: var(--muted);
    font-size: 14.5px;
}

.expect::before {
    content: "Expected result. ";
    color: var(--ink);
    font-weight: 600;
}

.ops li p {
    margin: 2px 0 0 !important;
    color: var(--muted);
    font-size: 14.5px;
    max-width: 56ch;
}

.ops li.is-focus::before {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.ops .flag {
    display: inline-block;
    vertical-align: -2px;
    margin-left: 8px;
    width: 14px;
    height: 18px;
}


/* ---------- figures + diagrams ---------- */

.fig {
    margin: 28px 0 32px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.fig-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

.fig-tag {
    position: relative;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--on-tint);
    padding: 2px 10px 2px 22px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 4px 10px 10px 4px;
    white-space: nowrap;
}

.fig-tag::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
}

.fig-title {
    font-size: 14.5px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.fig-expand {
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 10px;
    cursor: pointer;
}

.fig-expand:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.fig-canvas,
.expand-body {
    background-color: var(--d-canvas);
    background-image: radial-gradient(var(--d-dot) 1px, transparent 1.25px);
    background-size: 16px 16px;
    background-position: 8px 8px;
}

.fig-canvas {
    padding: clamp(14px, 2.5vw, 22px);
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.fig figcaption {
    padding: 0 18px 14px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.fig .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    list-style: none;
    margin: 0;
    padding: 0 18px 14px;
    font-size: 13px;
    color: var(--muted);
}

.fig .legend li {
    margin: 0;
}

.lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lg i {
    display: inline-block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--d-write);
    border: 0;
}

.lg-read i {
    background: var(--d-read);
}

.lg-ctl i {
    width: 22px;
    height: 0;
    background: transparent;
    border-top: 2.5px dashed var(--d-ctl);
    border-radius: 0;
}

.fig-alt {
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.fig-alt summary {
    cursor: pointer;
    padding: 10px 18px;
    color: var(--muted);
}

.fig-alt summary:hover {
    color: var(--ink);
}

.fig-alt ul,
.fig-alt ol {
    margin: 0;
    padding: 0 18px 14px 40px;
    color: var(--muted);
}

.fig-bare {
    background: transparent;
    border: 0;
    margin: 0;
    overflow: visible;
}

.fig-bare .fig-canvas {
    padding: 0;
    border: 0;
    margin: 0;
    background: none;
}

.showcase .window-body {
    background-image: radial-gradient(var(--d-dot) 1px, transparent 1.25px);
    background-size: 16px 16px;
    background-position: 8px 8px;
}

.fig-bare .legend {
    padding: 12px 0 0;
}

.dgm {
    display: block;
    width: 100%;
    min-width: var(--minw, 0);
    height: auto;
    font-family: var(--font);
    overflow: visible;
}

.showcase .dgm {
    --d-canvas: var(--bg);
}

.dgm .lane rect {
    fill: var(--d-lane-plain);
    stroke: var(--d-lane-plain-line);
    stroke-width: 1;
}

.dgm .lane-read rect {
    fill: var(--d-lane-read);
    stroke: var(--d-lane-read-line);
}

.dgm .lane-cryo rect {
    fill: var(--d-lane-cryo);
    stroke: var(--d-lane-cryo-line);
}

.dgm .lane-write rect {
    fill: var(--d-lane-write);
    stroke: var(--d-lane-write-line);
}

.dgm .lane text,
.dgm .lane-title {
    fill: var(--d-lane-ink);
    font-size: 12.5px;
    font-weight: 600;
}

.dgm .lane-q {
    fill: var(--d-sub);
    font-weight: 500;
}

.dgm .band rect {
    fill: var(--d-band);
}

.dgm .band text {
    fill: var(--d-sub);
    font-size: 12px;
    font-weight: 600;
}

.dgm .lifeline {
    stroke: var(--d-node-line);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    fill: none;
}

.dgm .n-shadow {
    fill: var(--d-node-shadow);
}

.dgm .n-box {
    fill: var(--d-node);
    stroke: var(--d-node-line);
    stroke-width: 1;
    transition: stroke 0.15s var(--ease);
}

.dgm .n-cryo .n-box {
    fill: var(--d-cryo-node);
    stroke: var(--d-cryo-line);
}

.dgm .n-ghost .n-box {
    fill: none;
    stroke: var(--d-node-line);
    stroke-dasharray: 4 4;
}

.dgm .n-label {
    font-size: 14px;
    font-weight: 600;
    fill: var(--d-label);
}

.dgm .n-sub {
    font-size: 12px;
    font-weight: 400;
    fill: var(--d-sub);
}

.dgm .n-label.n-code {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
}

.dgm .n-sub.n-code {
    font-family: var(--mono);
    font-size: 11.5px;
}

.dgm .n-ghost .n-label {
    fill: var(--d-sub);
}

.dgm .n-tile {
    color: var(--d-tile-cryo-fg);
}

.dgm .n-tile rect {
    fill: var(--d-tile-cryo);
}

.dgm .n-glyph {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgm .n-mark.is-fill {
    fill: currentColor;
    stroke: none;
}

.dgm .n-mark.is-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgm .cryo-core {
    fill: var(--d-tile-cryo);
    stroke: none;
}

.dgm .n-logo .n-label {
    font-size: 12.5px;
}

.dgm .chevron rect {
    fill: var(--d-node);
    stroke: var(--d-read);
    stroke-width: 1;
}

.dgm .chevron path {
    fill: none;
    stroke: var(--d-read);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgm .strip rect {
    fill: var(--d-node);
    stroke: var(--d-cryo-line);
    stroke-width: 1;
}

.dgm .strip-item {
    fill: var(--d-elabel);
    font-size: 11.5px;
    font-weight: 500;
}

.dgm .strip-rule {
    stroke: var(--d-node-line);
    stroke-width: 1;
}

.dgm .t-source {
    color: var(--d-tile-source-fg);
}

.dgm .t-source rect {
    fill: var(--d-tile-source);
}

.dgm .t-engine {
    color: var(--d-tile-engine-fg);
}

.dgm .t-engine rect {
    fill: var(--d-tile-engine);
}

.dgm .t-store {
    color: var(--d-tile-store-fg);
}

.dgm .t-store rect {
    fill: var(--d-tile-store);
}

.dgm .t-ui {
    color: var(--d-tile-ui-fg);
}

.dgm .t-ui rect {
    fill: var(--d-tile-ui);
    stroke: var(--d-tile-ui-line);
    stroke-width: 1;
}

.dgm .t-ghost {
    color: var(--d-sub);
}

.dgm .t-ghost rect {
    fill: none;
    stroke: var(--d-node-line);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.dgm [class*="tone-"] {
    color: #ffffff;
}

.dgm .tone-ok rect {
    fill: var(--ok);
}

.dgm .tone-bad rect {
    fill: var(--bad);
}

.dgm .tone-warn rect {
    fill: var(--warn);
}

.dgm .tone-info rect {
    fill: var(--c-core);
}

.dgm a.node {
    cursor: pointer;
}

.dgm a.node:hover .n-box {
    stroke: var(--accent);
}

.dgm a.node:focus-visible {
    outline: none;
}

.dgm a.node:focus-visible .n-box {
    stroke: var(--focus);
    stroke-width: 2;
}

.dgm .edge path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgm .e-read path {
    stroke: var(--d-read);
}

.dgm .e-write path {
    stroke: var(--d-write);
}

.dgm .e-ctl path {
    stroke: var(--d-ctl);
    stroke-dasharray: 5 4;
}

.dgm .e-no>path {
    stroke: var(--d-ctl);
    stroke-dasharray: 2 4;
}

.dgm .no-mark circle {
    fill: var(--d-canvas);
    stroke: var(--d-ctl);
    stroke-width: 1.25;
}

.dgm .no-mark path {
    stroke: var(--d-ctl);
    stroke-width: 1.5;
}

.dgm .port {
    fill: var(--d-write);
}

.dgm .e-read .port {
    fill: var(--d-read);
}

.dgm .e-ctl .port {
    fill: var(--d-ctl);
}

.dgm .ah-read {
    fill: var(--d-read);
}

.dgm .ah-write {
    fill: var(--d-write);
}

.dgm .ah-ctl {
    fill: var(--d-ctl);
}

.dgm .elabel,
.dgm .mlabel {
    fill: var(--d-elabel);
    font-size: 12px;
    font-weight: 500;
    paint-order: stroke;
    stroke: var(--d-canvas);
    stroke-width: 5px;
    stroke-linejoin: round;
}

.dgm .elabel.on-read {
    stroke: var(--d-lane-read);
}

.dgm .elabel.on-cryo {
    stroke: var(--d-lane-cryo);
}

.dgm .elabel.on-write {
    stroke: var(--d-lane-write);
}

.dgm .elabel.on-plain {
    stroke: var(--d-lane-plain);
}

.dgm .mlabel {
    font-size: 12.5px;
    stroke: var(--d-band);
}

.dgm .step circle {
    fill: var(--d-step);
}

.dgm .step text {
    fill: var(--d-step-ink);
    font-size: 11px;
    font-weight: 600;
}

.dgm .is-main>path {
    stroke-width: 1.75;
}

.dgm .is-aside>path,
.dgm .is-aside .port {
    opacity: 0.45;
}

.dgm .is-aside .elabel {
    fill: var(--d-sub);
}

.dgm.is-focus .is-aside.is-hl>path,
.dgm.is-focus .is-aside.is-hl .port {
    opacity: 1;
}

.dgm .marker-pole {
    stroke: var(--c-marker);
    stroke-width: 1.75;
    fill: none;
    stroke-linecap: round;
}

.dgm .marker-flag {
    fill: var(--c-marker);
}

.dgm .node,
.dgm .edge {
    transition: opacity 0.15s var(--ease);
}

.dgm.is-focus .node:not(.is-hl),
.dgm.is-focus .edge:not(.is-hl) {
    opacity: 0.22;
}

.expand-dlg {
    width: min(1280px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    overflow: auto;
}

.expand-dlg::backdrop {
    background: rgba(11, 15, 22, 0.68);
    backdrop-filter: blur(6px);
}

.expand-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 14.5px;
}

.expand-bar button {
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
}

.expand-body {
    padding: 20px;
}

.expand-body .dgm {
    min-width: 900px;
}


/* ---------- pager + footer ---------- */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.pg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s var(--ease);
}

.pg:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.pg-next {
    text-align: right;
    grid-column: 2;
}

.pg-prev {
    grid-column: 1;
}

.pg-k {
    font-size: 13px;
    color: var(--muted);
}

.pg-t {
    font-size: 17px;
    font-weight: 600;
    color: var(--link);
}

.foot {
    border-top: 1px solid var(--line);
    background: var(--surface);
    margin-top: 24px;
}

.foot-in {
    max-width: 1400px;
    margin: 0 auto;
    padding: 44px 20px 28px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 32px;
}

.foot-brand p {
    margin: 12px 0 0;
    max-width: 34ch;
    color: var(--muted);
    font-size: 14.5px;
}

.foot-h {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
}

.foot ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.foot li {
    margin: 0 0 7px;
}

.foot li a {
    color: var(--muted);
    font-size: 14.5px;
    text-decoration: none;
}

.foot li a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.foot-fine {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 32px;
    color: var(--muted);
    font-size: 12.5px;
}

.foot-fine code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
}


/* ---------- search dialog ---------- */

.search {
    width: min(640px, calc(100vw - 24px));
    margin: 12vh auto auto;
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(11, 15, 22, 0.28);
    overflow: hidden;
}

.search::backdrop {
    background: rgba(11, 15, 22, 0.55);
}

.search-box {
    margin: 0;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.search-input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 17px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    max-height: min(52vh, 420px);
    overflow-y: auto;
}

.search-list li a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    text-decoration: none;
    color: var(--ink);
}

.search-list li a[aria-selected="true"] {
    background: var(--surface-2);
}

.sr-t {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.sr-t mark,
.sr-x mark {
    background: var(--hl);
    color: inherit;
    border-radius: 2px;
}

.sr-p {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.sr-x {
    display: block;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.45;
    margin-top: 2px;
}

.sr-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 14.5px;
}

.search-foot {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}


/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.btn-primary {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--on-accent);
}

html[data-theme="dark"] .btn-primary:hover {
    color: var(--on-accent);
}


/* ---------- home ---------- */

.home {
    overflow-x: clip;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s, background 0.18s;
}

.btn-lg {
    padding: 13px 22px;
    font-size: 16px;
    border-radius: 999px;
}

.btn-primary {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 8px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px var(--accent), 0 14px 40px -10px var(--accent);
}

.btn-ghost {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    transform: translateY(-1px);
}

[data-dots] {
    position: relative;
    isolation: isolate;
}

[data-dots]>.dots {
    --dot: #8cbad6;
    --dot-hot: #277abe;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

html[data-theme="dark"] [data-dots]>.dots {
    --dot: #5a8db3;
    --dot-hot: #a9e2fb;
}

.hero {
    padding: clamp(88px, 13vh, 150px) 0 72px;
    text-align: center;
}

.hero>.dots {
    -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 40%, #000 30%, transparent 85%);
    mask-image: radial-gradient(ellipse 75% 85% at 50% 40%, #000 30%, transparent 85%);
}

.hero-glow {
    position: absolute;
    z-index: -2;
    inset: -10% 0 auto;
    height: 120%;
    pointer-events: none;
    background: radial-gradient(40% 45% at 50% 30%, color-mix(in srgb, var(--c-glacier) 22%, transparent), transparent 70%), radial-gradient(30% 35% at 22% 60%, color-mix(in srgb, var(--c-core) 16%, transparent), transparent 70%), radial-gradient(28% 32% at 80% 55%, color-mix(in srgb, var(--c-firn) 16%, transparent), transparent 70%);
    filter: blur(20px);
    animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
    to {
        transform: translate3d(0, 3%, 0) scale(1.06);
    }
}

.hero-in {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-copy {
    max-width: 100%;
}

.hero-in.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.hero-split .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
}

.hero-split .hero-copy .tally,
.hero-split .hero-copy .stack {
    align-self: stretch;
}

.hero-split .hero-copy .stack {
    width: 100%;
    max-width: none;
}

.core-stage {
    --pack: 0;
    --solid: 0;
    min-width: 0;
    padding: 14px 0 0;
}

.core-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    padding: 0 4px 10px;
    color: var(--muted);
    border-bottom: 1px solid color-mix(in srgb, var(--c-firn) 72%, transparent);
}

.core-stage-head span {
    font-size: 13px;
    font-weight: 600;
}

.core-stage-head code {
    padding: 3px 8px;
    font: 500 11.5px/1.4 var(--mono);
    color: var(--c-ice);
    background: var(--c-frost);
    border: 1px solid var(--c-firn);
    border-radius: 5px;
}

html[data-theme="dark"] .core-stage-head code {
    color: var(--c-frost);
    background: color-mix(in srgb, var(--c-core) 18%, transparent);
    border-color: color-mix(in srgb, var(--c-glacier) 42%, transparent);
}

.core-specimen {
    position: relative;
    margin-top: 14px;
    padding: 12px 18px 16px;
    background: var(--sky-card);
    border: 1px solid var(--c-firn);
    border-radius: 18px;
    box-shadow: 0 18px 45px -34px var(--sky-shadow);
}

.core-specimen::before,
.core-specimen::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border-color: var(--c-firn);
    pointer-events: none;
}

.core-specimen::before {
    top: 10px;
    left: 10px;
    border-top: 1px solid;
    border-left: 1px solid;
}

.core-specimen::after {
    right: 10px;
    bottom: 10px;
    border-right: 1px solid;
    border-bottom: 1px solid;
}

.core-figure {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
    text-align: left;
    border-radius: 16px;
}

.core-figure:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.core-pack-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.core-pack-svg .core-shadow {
    fill: color-mix(in srgb, var(--c-firn) 58%, transparent);
}

.core-plate .plate-ground {
    stroke: var(--c-slate);
    stroke-width: 1.5;
}

.core-pack-svg .core-strata path,
.core-pack-svg .core-layers path {
    stroke: var(--c-firn);
    stroke-width: 1.25;
}

.core-pack-svg .core-body {
    fill: color-mix(in srgb, var(--c-firn) 48%, var(--c-frost));
    stroke: var(--c-ice);
    stroke-width: 2;
}

.core-pack-svg .core-end {
    fill: var(--c-frost);
    stroke: var(--c-ice);
    stroke-width: 2;
}

.core-pack-svg .core-cut {
    fill: var(--sky-card);
    stroke: var(--c-ice);
    stroke-width: 2;
}

.core-pack-svg .core-rim {
    fill: none;
    stroke: var(--c-ice);
    stroke-width: 2;
}

html[data-theme="dark"] .core-pack-svg .core-body,
html[data-theme="dark"] .core-pack-svg .core-end,
html[data-theme="dark"] .core-pack-svg .core-cut,
html[data-theme="dark"] .core-pack-svg .core-rim {
    stroke: var(--c-glacier);
}

.core-pack-svg .core-zone-loose {
    fill: color-mix(in srgb, var(--c-frost) 42%, transparent);
}

.core-pack-svg .core-zone-pack {
    fill: color-mix(in srgb, var(--c-firn) 38%, transparent);
}

.core-pack-svg .core-zone-solid {
    fill: color-mix(in srgb, var(--c-glacier) 18%, transparent);
}

.core-pack-svg .core-dividers path {
    fill: none;
    stroke: color-mix(in srgb, var(--c-slate) 35%, transparent);
    stroke-width: 1;
    stroke-dasharray: 3 5;
}

.core-pack-svg .core-tile {
    fill: var(--c-frost);
    stroke: var(--c-ice);
    stroke-width: 1.25;
}

html[data-theme="dark"] .core-pack-svg .core-tile {
    stroke: var(--c-glacier);
}

.core-pack-svg .core-packing-blocks {
    opacity: var(--pack);
}

.core-pack-svg .core-packing-blocks rect {
    fill: var(--c-firn);
    stroke: var(--c-ice);
    stroke-width: 1.1;
}

html[data-theme="dark"] .core-pack-svg .core-packing-blocks rect {
    fill: color-mix(in srgb, var(--c-core) 72%, var(--c-firn));
    stroke: var(--c-glacier);
}

html[data-theme="dark"] .core-plate .plate-gate,
html[data-theme="dark"] .core-plate .plate-seg,
html[data-theme="dark"] .core-plate .plate-core,
html[data-theme="dark"] .core-plate .plate-slice,
html[data-theme="dark"] .core-plate .plate-stray,
html[data-theme="dark"] .core-plate .plate-pile,
html[data-theme="dark"] .core-plate .plate-label {
    stroke: var(--c-glacier);
}

.core-pack-svg .core-solid {
    opacity: var(--solid, 0);
    transition: opacity 0.12s linear;
}

.core-pack-svg .core-solid>path:first-child {
    fill: var(--c-core);
    stroke: var(--c-ice);
    stroke-width: 1.5;
}

.core-pack-svg .core-solid-line {
    stroke: var(--c-frost);
    stroke-width: 1.5;
    fill: none;
}

html[data-theme="dark"] .core-pack-svg .core-solid>path:first-child {
    stroke: var(--c-glacier);
}

.core-pack-svg .core-marker-main line,
.core-pack-svg .plate-marker line,
.core-plate .plate-marker line {
    stroke: var(--c-ice);
    stroke-width: 1.5;
}

.core-pack-svg .core-marker-flag,
.core-pack-svg .plate-marker-flag,
.core-plate .plate-marker-flag {
    fill: var(--c-marker);
    stroke: var(--c-ice);
    stroke-width: 1.25;
}

.core-stage[data-focus="pack"] .core-marker-main {
    opacity: var(--solid);
}

.core-stage:not([data-focus="pack"]) .core-marker-main {
    opacity: 0;
}

.core-marker-main {
    transition: opacity 0.18s var(--ease);
}

.core-pack-svg .core-zone-labels text {
    fill: var(--muted);
    font: 500 13px/1 var(--sans);
    letter-spacing: 0.01em;
}

.core-controls {
    position: relative;
    margin: 4px 28px 0;
}

.core-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.core-slider {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    min-width: 0;
    height: 22px;
    margin: 0;
    background: transparent;
    accent-color: var(--c-core);
    cursor: pointer;
}

.core-slider::-webkit-slider-runnable-track {
    height: 3px;
    background: var(--c-core);
    border-radius: 99px;
}

.core-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6.5px;
    background: var(--sky-card);
    border: 2px solid var(--c-core);
    border-radius: 50%;
    box-shadow: 0 2px 6px -2px var(--sky-shadow);
}

.core-slider::-moz-range-track {
    height: 3px;
    background: var(--c-firn);
    border-radius: 99px;
}

.core-slider::-moz-range-progress {
    height: 3px;
    background: var(--c-core);
    border-radius: 99px;
}

.core-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    background: var(--sky-card);
    border: 2px solid var(--c-core);
    border-radius: 50%;
    box-shadow: 0 2px 6px -2px var(--sky-shadow);
}

.core-slider:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

.core-reading {
    min-height: 64px;
    padding: 14px 4px 0;
}

.core-caption {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
}

.core-support {
    margin: 5px 0 0;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.45;
    max-width: 36em;
}

.core-support.is-hidden {
    display: none;
}

.core-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.core-more[hidden] {
    display: none;
}

.core-more span {
    transition: transform 0.18s var(--ease);
}

.core-more:hover span {
    transform: translateX(2px);
}

.core-plates {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 10px;
    overflow: hidden;
    background: color-mix(in srgb, var(--sky-card) 85%, transparent);
    border: 1px solid var(--sky-card-line);
    border-radius: 12px;
}

.core-plate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 8px 8px 10px;
    font: inherit;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.core-plate+.core-plate {
    border-left: 1px solid var(--sky-card-line);
}

.core-plate:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--c-frost) 56%, transparent);
}

.core-plate[aria-selected="true"] {
    color: var(--c-ice);
    background: var(--c-frost);
    box-shadow: inset 0 -2px var(--c-core);
}

html[data-theme="dark"] .core-plate[aria-selected="true"] {
    color: var(--c-frost);
    background: color-mix(in srgb, var(--c-core) 20%, transparent);
}

.core-plate:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

.core-plate-art {
    display: block;
    width: 100%;
    max-width: 112px;
    aspect-ratio: 16 / 9;
}

.core-plate-art .plate-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.core-plate .plate-gate,
.core-plate .plate-seg,
.core-plate .plate-core,
.core-plate .plate-slice,
.core-plate .plate-stray,
.core-plate .plate-pile,
.core-plate .plate-label {
    fill: var(--c-frost);
    stroke: var(--c-ice);
    stroke-width: 1.25;
}

.core-plate .plate-seg.plate-wait {
    fill: var(--c-firn);
}

.core-plate .plate-gate,
.core-plate .plate-pile {
    fill: var(--c-core);
}

.core-plate .plate-slice-out {
    fill: var(--c-firn);
}

.core-plate .plate-label {
    fill: var(--sky-card);
}

html[data-theme="dark"] .core-plate .plate-gate,
html[data-theme="dark"] .core-plate .plate-seg,
html[data-theme="dark"] .core-plate .plate-core,
html[data-theme="dark"] .core-plate .plate-slice,
html[data-theme="dark"] .core-plate .plate-stray,
html[data-theme="dark"] .core-plate .plate-pile,
html[data-theme="dark"] .core-plate .plate-label {
    stroke: var(--c-glacier);
}

.core-plate .plate-gauge {
    fill: none;
    stroke: var(--c-slate);
    stroke-width: 1.25;
}

.core-plate .plate-gauge-needle,
.core-plate .plate-cut,
.core-plate .plate-string {
    stroke: var(--c-slate);
    stroke-width: 1.25;
    fill: none;
}

.core-plate .plate-hole {
    fill: var(--c-slate);
    stroke: none;
}

.core-plate .plate-marker {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s var(--ease);
}

.core-plate[aria-selected="true"] .plate-marker {
    opacity: 1;
}

.core-plate-name {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 28px;
    padding: 6px 14px 6px 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 65%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.hero h1 {
    margin: 0 0 24px;
    max-width: 15ch;
    font-size: clamp(44px, 7.4vw, 92px);
    line-height: 0.98;
    font-weight: 600;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.grad {
    color: var(--accent);
}

.hero .lede {
    margin: 0 auto;
    font-size: clamp(18px, 1.6vw, 21px);
    max-width: 38em;
    color: var(--ink-soft);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 36px 0 44px;
}

.hero-term {
    width: min(560px, 100%);
    text-align: left;
}

.hero .code {
    margin: 0;
    box-shadow: 0 30px 60px -30px rgba(11, 15, 22, 0.55);
}

.hero-note {
    margin: 14px 0 0;
    font-size: 13.5px;
    color: var(--muted);
    text-align: center;
}

.hero-in:not(.hero-split)>* {
    animation: rise 0.9s var(--ease) both;
}

.hero-in:not(.hero-split)> :nth-child(2) {
    animation-delay: 0.08s;
}

.hero-in:not(.hero-split)> :nth-child(3) {
    animation-delay: 0.16s;
}

.hero-in:not(.hero-split)> :nth-child(4) {
    animation-delay: 0.24s;
}

.hero-in:not(.hero-split)> :nth-child(5) {
    animation-delay: 0.32s;
}

.hero-split .hero-copy>*,
.hero-split .core-stage {
    animation: rise 0.9s var(--ease) both;
}

.hero-split .core-stage {
    animation-delay: 0.14s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

.showcase {
    padding: 8px 0 88px;
}

.showcase .wrap {
    max-width: 1120px;
}

.window {
    position: relative;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--c-glacier) 55%, transparent), var(--line) 35%, var(--line) 65%, color-mix(in srgb, var(--c-core) 50%, transparent));
    box-shadow: 0 50px 120px -40px color-mix(in srgb, var(--c-core) 45%, transparent);
}

.window>* {
    position: relative;
}

.window-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--surface);
    border-radius: 19px 19px 0 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

.window-bar .shot-chrome span {
    width: 11px;
    height: 11px;
    opacity: 0.6;
}

.window-bar p {
    margin: 0;
    justify-self: center;
    text-align: center;
    flex: unset;
}

.window-bar a {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
}

.window-body {
    padding: clamp(16px, 3vw, 36px);
    background: var(--surface);
    border-radius: 0 0 19px 19px;
}

.stats {
    border-block: 1px solid var(--line);
    background: var(--surface);
}

.stats-in {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-in>div {
    padding: 36px 24px;
    border-left: 1px solid var(--line);
}

.stats-in>div:first-child {
    border-left: 0;
    padding-left: 0;
}

.stats b {
    display: block;
    font-size: clamp(44px, 5vw, 64px);
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.stats span {
    display: block;
    margin-top: 10px;
    font-size: 14.5px;
    color: var(--muted);
    max-width: 22ch;
}

.sect {
    padding: clamp(72px, 10vw, 120px) 0;
}

.eyebrow {
    margin: 0 0 14px;
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.sect h2 {
    margin: 0 0 14px;
    font-size: clamp(32px, 4.2vw, 52px);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -0.035em;
    text-wrap: balance;
    max-width: 20ch;
}

.sect .sub {
    margin: 0 0 44px;
    max-width: 56ch;
    color: var(--muted);
    font-size: 18.5px;
}

.path,
.guarantees>div {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}

.path::before,
.guarantees>div::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c-glacier) 16%, transparent), transparent 70%);
}

.path:hover,
.guarantees>div:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--c-core) 60%, transparent);
}

.path:hover::before,
.guarantees>div:hover::before {
    opacity: 1;
}

.paths {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.path {
    padding: 26px 24px 20px;
}

.path h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.path>p {
    margin: 0 0 18px;
    font-size: 14.5px;
    color: var(--muted);
    min-height: 4.6em;
}

.path ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.path li a {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
}

.path li a::after {
    content: "→";
    color: var(--muted);
    transition: transform 0.2s var(--ease), color 0.2s;
}

.path li a:hover {
    color: var(--link);
}

.path li a:hover::after {
    color: var(--accent);
    transform: translateX(4px);
}

.try-line .wrap {
    max-width: 760px;
}

.try-line .sub {
    max-width: 58ch;
}

.try-line .cb {
    margin: 22px 0 24px;
}

.film-close .wrap {
    max-width: 1040px;
}

.film-close .eyebrow {
    margin-bottom: 12px;
}

.film {
    margin: 0;
}

.film-stage {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--c-ice) 55%, transparent);
}

.film video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: var(--surface);
    cursor: pointer;
}

.film video::-webkit-media-controls,
.film video::-webkit-media-controls-enclosure,
.film video::-webkit-media-controls-panel,
.film video::-webkit-media-controls-overlay-play-button,
.film video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
    opacity: 0 !important;
    pointer-events: none;
}

.film-stage.is-playing video {
    cursor: default;
}

.film-play,
.film-toggle,
.film-mute {
    border: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
}

.film-play svg,
.film-toggle svg,
.film-mute svg {
    display: block;
    fill: currentColor;
}

.film-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    color: var(--c-ice);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 10px 28px -16px color-mix(in srgb, var(--c-ice) 70%, transparent);
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.film-play svg {
    width: 22px;
    height: 22px;
    margin-left: 2px;
}

.film-play:hover {
    transform: scale(1.04);
}

.film-stage.is-playing .film-play {
    opacity: 0;
    pointer-events: none;
}

.film-bar {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 2;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 8px 0 6px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--c-ice) 60%, transparent);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
    pointer-events: none;
}

.film-stage:hover .film-bar,
.film-stage:focus-within .film-bar,
.film-stage.is-scrubbing .film-bar {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.film-toggle,
.film-mute {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.film-play:focus-visible,
.film-toggle:focus-visible,
.film-mute:focus-visible,
.film-scrub:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.film-toggle:hover,
.film-mute:hover {
    background: var(--surface-2);
}

.film-toggle svg,
.film-mute svg {
    width: 16px;
    height: 16px;
}

.film-toggle .i-pause,
.film-stage.is-playing .film-toggle .i-play,
.film-mute .i-off,
.film-stage.is-muted .film-mute .i-on {
    display: none;
}

.film-stage.is-playing .film-toggle .i-pause,
.film-stage.is-muted .film-mute .i-off {
    display: block;
}

.film-time,
.film-dur {
    font-family: var(--mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.film-scrub {
    width: 100%;
    height: 16px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.film-scrub::-webkit-slider-runnable-track {
    height: 2px;
    background: linear-gradient(to right, var(--c-core) var(--p, 0%), var(--line) var(--p, 0%));
    border-radius: 2px;
}

.film-scrub::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    margin-top: -4px;
    background: var(--c-core);
    border-radius: 50%;
}

.film-scrub::-moz-range-track {
    height: 2px;
    background: var(--line);
    border: 0;
    border-radius: 2px;
}

.film-scrub::-moz-range-progress {
    height: 2px;
    background: var(--c-core);
    border-radius: 2px;
}

.film-scrub::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--c-core);
    border: 0;
    border-radius: 50%;
}

.film figcaption {
    margin: 14px 2px 0;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 720px) {
    .film-play {
        width: 52px;
        height: 52px;
        margin: -26px 0 0 -26px;
    }
    .film-bar {
        right: 8px;
        bottom: 8px;
        left: 8px;
        gap: 6px;
        height: 36px;
        padding-right: 4px;
    }
    .film-dur,
    .film-time {
        display: none;
    }
}

.credit {
    padding-top: 28px;
}

.credit-plate {
    position: relative;
    padding: 36px 0 8px;
    border-top: 1px solid var(--line);
}

.credit-plate::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 72px;
    height: 3px;
    background: var(--c-core);
}

.credit h2 {
    max-width: 12ch;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(52px, 7vw, 92px);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.credit h2 em {
    font-style: italic;
    font-weight: 600;
    color: var(--c-core);
}

.credit-note {
    max-width: 36ch;
    margin: 22px 0 0;
    color: var(--ink-soft);
    font-size: 16.5px;
    line-height: 1.5;
}

.contributors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 40px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.contributors li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: baseline;
    padding: 14px 0 16px;
    border-bottom: 1px solid var(--line);
}

.contrib-mark {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.contrib-name {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

a.contrib-name:hover {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contrib-role {
    grid-column: 2;
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(28px, 6vw, 96px);
    align-items: start;
}

.split-sticky {
    position: sticky;
    top: calc(var(--hdr) + 40px);
}

.guarantees {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    counter-reset: g;
}

.guarantees>div {
    padding: 30px 30px 26px;
    counter-increment: g;
}

.guarantees>div::after {
    content: "0" counter(g);
    position: absolute;
    top: 22px;
    right: 26px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    opacity: 0.7;
}

.guarantees dt {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 21px;
    letter-spacing: -0.015em;
}

.guarantees dd {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15.5px;
    max-width: 44ch;
}

.guarantees a {
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
}

.guarantees a::after {
    content: " →";
}

.sect-cta {
    padding-top: 0;
}

.home-cta {
    --bg: var(--c-night);
    --surface: #111a25;
    --ink: #eaf7fd;
    --muted: #afc2cf;
    --line: rgba(234, 247, 253, 0.12);
    --accent: #68c1ea;
    --on-accent: #0b0f16;
    --accent-hover: #90d4f0;
    --link: #90d4f0;
    overflow: hidden;
    padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 80px);
    border-radius: 28px;
    color: var(--ink);
    text-align: center;
    background: radial-gradient(60% 80% at 50% 0%, rgba(39, 122, 190, 0.45), transparent 70%), var(--c-night);
    border: 1px solid rgba(104, 193, 234, 0.25);
}

.home-cta>.dots {
    --dot: #4f87b0 !important;
    --dot-hot: #c6ecfd !important;
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 85%);
    mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 85%);
}

.home-cta h2 {
    margin-inline: auto;
}

.home-cta .sub {
    margin-inline: auto;
    color: var(--muted);
}

.home-cta .code {
    max-width: 520px;
    margin: 0 auto 32px;
    text-align: left;
}

.home .note-fine {
    margin: 28px auto 0;
    max-width: 60ch;
    font-size: 14px;
    color: var(--muted);
}

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js-reveal .reveal.is-in {
    opacity: 1;
    transform: none;
}

.hdr {
    transition: background 0.2s, box-shadow 0.2s;
}

.home-page .hdr {
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom-color: transparent;
}

.home-page .hdr.is-scrolled {
    border-bottom-color: var(--line);
}

@media (max-width: 1024px) {
    .stats-in {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stats-in>div:nth-child(3) {
        border-left: 0;
        padding-left: 0;
    }
    .stats-in>div:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 900px) {
    .split-sticky {
        position: static;
    }
    .window-bar p {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-split .hero-copy>*,
    .hero-split .core-stage {
        animation: none;
    }
}

@media (max-width: 560px) {
    .paths,
    .guarantees {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero {
        padding-top: 64px;
    }
}


/* 404 */

.nf {
    max-width: 640px;
    margin: 0 auto;
    padding: 96px 24px 120px;
}

.nf-code {
    font-family: var(--mono);
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 12px;
}

.nf h1 {
    font-size: 36px;
    line-height: 1.15;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.nf-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}


/* ---------- home: free flow ---------- */

body.home-page {
    --bg: #ffffff;
}

html[data-theme="dark"] body.home-page {
    --bg: #0b0f16;
}

.home .sect {
    border-top: 0;
    background: transparent;
}

.marquee {
    padding: 8px 0 72px;
    text-align: center;
}

.marquee-k {
    margin: 0 0 22px;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.marquee-track {
    display: flex;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.stack.marquee-track ul {
    display: flex;
    flex: none;
    gap: 56px;
    margin: 0;
    padding: 0 28px;
    list-style: none;
    animation: marquee 38s linear infinite;
}

.stack.marquee-track li {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    opacity: 0.45;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.stack.marquee-track li:hover {
    opacity: 1;
}

.marquee-track:hover ul,
.marquee-track:focus-within ul {
    animation-play-state: paused;
}

@keyframes marquee {
    to {
        transform: translateX(-100%);
    }
}

.showcase .window-bar {
    grid-template-columns: auto auto;
    justify-content: space-between;
}

.showcase .window {
    padding: 0;
    border: 1px solid var(--line);
    background: none;
    box-shadow: 0 40px 100px -50px color-mix(in srgb, var(--c-core) 45%, transparent), 0 0 0 8px color-mix(in srgb, var(--c-frost) 40%, transparent);
}

html[data-theme="dark"] .showcase .window {
    box-shadow: 0 40px 100px -50px rgba(104, 193, 234, 0.32), 0 0 0 8px rgba(104, 193, 234, 0.05);
}

.window-bar {
    border-bottom: 0;
    background: var(--bg);
}

.window-body {
    background: var(--bg);
}

.stats {
    border: 0;
    background: transparent;
    padding: 24px 0 0;
}

.stats-in>div,
.stats-in>div:first-child {
    border: 0 !important;
    padding: 12px 0;
    text-align: center;
}

.stats span {
    margin-inline: auto;
}

.paths {
    gap: clamp(20px, 3vw, 44px);
}

.path,
.guarantees>div {
    border: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none !important;
    transform: none !important;
}

.path::before,
.guarantees>div::before {
    inset: -18px;
    border-radius: 20px;
}

.path {
    padding: 0;
}

.path h3 {
    font-size: 22px;
}

.path h3::before {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin-bottom: 18px;
    background: var(--accent);
    transform: scaleX(0.5);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.path:hover h3::before {
    transform: none;
}

.path li a {
    border-top-color: color-mix(in srgb, var(--line) 70%, transparent);
}

.guarantees {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.guarantees>div {
    padding: 22px 0 22px 56px;
    border-top: 1px solid var(--line);
}

.guarantees>div:last-child {
    border-bottom: 1px solid var(--line);
}

.guarantees>div::after {
    left: 0;
    right: auto;
    top: 26px;
    font-size: 14px;
    color: var(--accent);
    opacity: 1;
}

.guarantees dt {
    font-size: 19px;
}

.guarantees dd {
    margin-bottom: 8px;
}

.receipt {
    position: sticky;
    top: calc(var(--hdr) + 40px);
    border-radius: 18px;
    overflow: hidden;
    background: var(--c-night);
    color: #eaf7fd;
    border: 1px solid rgba(104, 193, 234, 0.2);
    box-shadow: 0 40px 90px -45px rgba(20, 62, 96, 0.8);
}

.receipt-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: #8da6b8;
    border-bottom: 1px solid rgba(234, 247, 253, 0.08);
}

.receipt-feed {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    height: 392px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 70%, transparent);
    mask-image: linear-gradient(#000 70%, transparent);
}

.receipt-feed li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(234, 247, 253, 0.06);
    font-size: 13px;
}

.receipt-feed code {
    font-family: var(--mono);
    font-size: 13px;
    color: #8fd3f4;
}

.receipt-feed span {
    grid-column: 1;
    color: #8da6b8;
    font-family: var(--mono);
    font-size: 12px;
}

.receipt-feed em {
    grid-row: 1;
    grid-column: 2;
    font-style: normal;
    font-size: 12px;
    text-align: right;
}

.receipt-feed time {
    grid-column: 2;
    text-align: right;
    color: #8da6b8;
    font-family: var(--mono);
    font-size: 12px;
}

.receipt-feed .ok {
    color: #8fd9b0;
}

.receipt-feed .wait {
    color: #e8c36f;
}

.receipt-feed .bad {
    color: #f1a79e;
}

.receipt-feed li.is-new {
    animation: feedIn 0.6s var(--ease);
    background: rgba(104, 193, 234, 0.07);
}

@keyframes feedIn {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
}

.sect-cta {
    padding-top: 0;
}

.home-cta {
    --bg: var(--c-night);
    --surface: #111a25;
    --ink: #eaf7fd;
    --muted: #afc2cf;
    --line: rgba(234, 247, 253, 0.12);
    --accent: #68c1ea;
    --on-accent: #0b0f16;
    --accent-hover: #90d4f0;
    --link: #90d4f0;
    overflow: hidden;
    padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 80px);
    border-radius: 28px;
    color: var(--ink);
    text-align: center;
    background: radial-gradient(60% 80% at 50% 0%, rgba(39, 122, 190, 0.45), transparent 70%), var(--c-night);
    border: 1px solid rgba(104, 193, 234, 0.25);
}

.home-cta>.dots {
    --dot: #4f87b0 !important;
    --dot-hot: #c6ecfd !important;
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 85%);
    mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 20%, transparent 85%);
}

.home-cta h2 {
    margin-inline: auto;
}

.home-cta .sub {
    margin-inline: auto;
    color: var(--muted);
}

.home-cta .code {
    max-width: 520px;
    margin: 0 auto 32px;
    text-align: left;
}

.home .note-fine {
    margin: 28px auto 0;
    max-width: 60ch;
    font-size: 14px;
    color: var(--muted);
}

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js-reveal .reveal.is-in {
    opacity: 1;
    transform: none;
}

.hdr {
    transition: background 0.2s, box-shadow 0.2s;
}

.home-page .hdr {
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom-color: transparent;
}

.home-page .hdr.is-scrolled {
    border-bottom-color: var(--line);
}

@media (max-width: 1024px) {
    .stats-in {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stats-in>div:nth-child(3) {
        border-left: 0;
        padding-left: 0;
    }
    .stats-in>div:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 900px) {
    .split-sticky {
        position: static;
    }
    .window-bar p {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-split .hero-copy>*,
    .hero-split .core-stage {
        animation: none;
    }
}

@media (max-width: 560px) {
    .paths,
    .guarantees {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero {
        padding-top: 64px;
    }
}


/* 404 */

.nf {
    max-width: 640px;
    margin: 0 auto;
    padding: 96px 24px 120px;
}

.nf-code {
    font-family: var(--mono);
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 12px;
}

.nf h1 {
    font-size: 36px;
    line-height: 1.15;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.nf-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}


/* ---------- home: free flow ---------- */

body.home-page {
    --bg: #ffffff;
}

html[data-theme="dark"] body.home-page {
    --bg: #0b0f16;
}

.home .sect {
    border-top: 0;
    background: transparent;
}

.marquee {
    padding: 8px 0 72px;
    text-align: center;
}

.marquee-k {
    margin: 0 0 22px;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.marquee-track {
    display: flex;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.stack.marquee-track ul {
    display: flex;
    flex: none;
    gap: 56px;
    margin: 0;
    padding: 0 28px;
    list-style: none;
    animation: marquee 38s linear infinite;
}

.stack.marquee-track li {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    opacity: 0.45;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.stack.marquee-track li:hover {
    opacity: 1;
}

.marquee-track:hover ul,
.marquee-track:focus-within ul {
    animation-play-state: paused;
}

@keyframes marquee {
    to {
        transform: translateX(-100%);
    }
}

.showcase .window-bar {
    grid-template-columns: auto auto;
    justify-content: space-between;
}

.showcase .window {
    padding: 0;
    border: 1px solid var(--line);
    background: none;
    box-shadow: 0 40px 100px -50px color-mix(in srgb, var(--c-core) 45%, transparent), 0 0 0 8px color-mix(in srgb, var(--c-frost) 40%, transparent);
}

html[data-theme="dark"] .showcase .window {
    box-shadow: 0 40px 100px -50px rgba(104, 193, 234, 0.32), 0 0 0 8px rgba(104, 193, 234, 0.05);
}

.window-bar {
    border-bottom: 0;
    background: var(--bg);
}

.window-body {
    background: var(--bg);
}

.stats {
    border: 0;
    background: transparent;
    padding: 24px 0 0;
}

.stats-in>div,
.stats-in>div:first-child {
    border: 0 !important;
    padding: 12px 0;
    text-align: center;
}

.stats span {
    margin-inline: auto;
}

.paths {
    gap: clamp(20px, 3vw, 44px);
}

.path,
.guarantees>div {
    border: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none !important;
    transform: none !important;
}

.path::before,
.guarantees>div::before {
    inset: -18px;
    border-radius: 20px;
}

.path {
    padding: 0;
}

.path h3 {
    font-size: 22px;
}

.path h3::before {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin-bottom: 18px;
    background: var(--accent);
    transform: scaleX(0.5);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.path:hover h3::before {
    transform: none;
}

.path li a {
    border-top-color: color-mix(in srgb, var(--line) 70%, transparent);
}

.guarantees {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.guarantees>div {
    padding: 22px 0 22px 56px;
    border-top: 1px solid var(--line);
}

.guarantees>div:last-child {
    border-bottom: 1px solid var(--line);
}

.guarantees>div::after {
    left: 0;
    right: auto;
    top: 26px;
    font-size: 14px;
    color: var(--accent);
    opacity: 1;
}

.guarantees dt {
    font-size: 19px;
}

.guarantees dd {
    margin-bottom: 8px;
}

.receipt {
    position: sticky;
    top: calc(var(--hdr) + 40px);
    border-radius: 18px;
    overflow: hidden;
    background: var(--c-night);
    color: #eaf7fd;
    border: 1px solid rgba(104, 193, 234, 0.2);
    box-shadow: 0 40px 90px -45px rgba(20, 62, 96, 0.8);
}

.receipt-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: #8da6b8;
    border-bottom: 1px solid rgba(234, 247, 253, 0.08);
}

.receipt-feed {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    height: 392px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 70%, transparent);
    mask-image: linear-gradient(#000 70%, transparent);
}

.receipt-feed li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(234, 247, 253, 0.06);
    font-size: 13px;
}

.receipt-feed code {
    font-family: var(--mono);
    font-size: 13px;
    color: #8fd3f4;
}

.receipt-feed span {
    grid-column: 1;
    color: #8da6b8;
    font-family: var(--mono);
    font-size: 12px;
}

.receipt-feed em {
    grid-row: 1;
    grid-column: 2;
    font-style: normal;
    font-size: 12px;
    text-align: right;
}

.receipt-feed time {
    grid-column: 2;
    text-align: right;
    color: #8da6b8;
    font-family: var(--mono);
    font-size: 12px;
}

.receipt-feed .ok {
    color: #8fd9b0;
}

.receipt-feed .wait {
    color: #e8c36f;
}

.receipt-feed .bad {
    color: #f1a79e;
}

.receipt-feed li.is-new {
    animation: feedIn 0.6s var(--ease);
    background: rgba(104, 193, 234, 0.07);
}

@keyframes feedIn {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
}

.sect-cta {
    padding-top: 40px;
}

@media (max-width: 1024px) {
    .stats-in>div:nth-child(-n+2) {
        border: 0;
    }
}

@media (max-width: 900px) {
    .receipt {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .stack.marquee-track ul {
        flex: 1 1 100%;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 20px;
        padding: 0 14px;
        animation: none;
    }
    .stack.marquee-track ul[aria-hidden="true"] {
        display: none;
    }
}


/* ---------- home: sky ---------- */

body.home-page {
    --sky-card: #ffffff;
    --sky-card-line: rgba(20, 62, 96, 0.09);
    --sky-shadow: rgba(20, 62, 96, 0.28);
    --sky-back: #f1f8fd;
    --sky-flap-a: #e4f2fb;
    --sky-flap-b: #f5fbfe;
    --marker: #f2a516;
    background-color: var(--bg);
    background-image: radial-gradient(55% 520px at 50% 160px, rgba(255, 255, 255, 0.7), transparent 72%), linear-gradient(180deg, #d4eaf9 0, #e1f1fb 560px, #eef7fd 1100px, var(--bg) 1750px);
    background-repeat: no-repeat;
}

html[data-theme="dark"] body.home-page {
    --sky-card: #101a26;
    --sky-card-line: rgba(234, 247, 253, 0.1);
    --sky-shadow: rgba(0, 0, 0, 0.6);
    --sky-back: #0f1c29;
    --sky-flap-a: #142a3d;
    --sky-flap-b: #101e2c;
    background-image: radial-gradient(55% 520px at 50% 160px, rgba(104, 193, 234, 0.13), transparent 72%), linear-gradient(180deg, #0f2335 0, #0c1927 640px, #0b131d 1150px, var(--bg) 1750px);
}

.home-page .hdr:not(.is-scrolled) {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero.sky {
    padding: clamp(44px, 8vh, 84px) 0 64px;
}

.hero.sky:has(.hero-split) {
    text-align: left;
}

.hero.sky>.dots {
    --dot: #5e829b;
    --dot-hot: #277abe;
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
}

html[data-theme="dark"] .hero.sky>.dots {
    --dot: #3c6a8c;
    --dot-hot: #a9e2fb;
}

.sky-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 26px;
    padding: 5px 12px 5px 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    background: var(--sky-card);
    border: 1px solid var(--sky-card-line);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(20, 62, 96, 0.08), 0 0 0 4px color-mix(in srgb, var(--sky-card) 45%, transparent);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.sky-pill:hover {
    color: var(--ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.sky-pill>span:last-child {
    color: var(--muted);
    transition: transform 0.18s var(--ease);
}

.sky-pill:hover>span:last-child {
    transform: translateX(2px);
}

.sky-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffd977, var(--marker) 70%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker) 22%, transparent);
}

.hero.sky h1 {
    max-width: none;
    margin: 0 0 22px;
    font-family: var(--serif);
    font-size: clamp(46px, 6.2vw, 86px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.012em;
}

.marker {
    color: #131b24;
    padding: 0 0.12em 0.02em;
    margin: 0 0.02em;
    border-radius: 0.22em 0.12em 0.2em 0.14em;
    background: linear-gradient(100deg, color-mix(in srgb, var(--marker) 88%, #fff), var(--marker) 30%, var(--marker) 80%, color-mix(in srgb, var(--marker) 85%, #c76b00)) no-repeat 0 66% / 100% 74%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    animation: marker 0.9s 0.5s var(--ease) both;
}

@keyframes marker {
    from {
        background-size: 0% 74%;
    }
}

.hero.sky .lede {
    max-width: min(40em, 100%);
    font-size: clamp(16.5px, 1.35vw, 18.5px);
}

.tally {
    display: inline-grid;
    grid-template-columns: repeat(4, auto);
    margin: 34px 0 0;
    padding: 4px;
    background: var(--sky-card);
    border: 1px solid var(--sky-card-line);
    border-radius: 14px;
    box-shadow: 0 14px 36px -16px var(--sky-shadow);
}

.tally>div {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    min-width: 104px;
    padding: 12px 20px 10px;
}

.tally>div+div {
    border-left: 1px solid var(--sky-card-line);
}

.tally dd {
    margin: 0;
    font-family: var(--serif);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
    font-variant-numeric: lining-nums tabular-nums;
}

.tally dt {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.hero.sky .hero-actions {
    margin: 32px 0 44px;
}

.stack-k {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
}

.stack {
    width: min(760px, 100%);
    margin: 12px auto 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--sky-card-line);
}

.stack ul {
    gap: 40px;
    padding: 0 20px;
}

.stack li {
    font-size: 16px;
    color: var(--muted);
    opacity: 1;
    transition: color 0.18s;
}

.stack li:hover {
    color: var(--ink);
}

.stack.marquee-track ul {
    gap: 56px;
    padding: 0 28px;
}

.stack.marquee-track li {
    font-size: 16px;
    color: var(--ink);
    opacity: 0.45;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.stack.marquee-track li:hover {
    opacity: 1;
}

.maintenance-demo {
    padding: 38px 0 108px;
}

.maintenance-demo-head {
    max-width: 780px;
    margin: 0 auto 34px;
    text-align: center;
}

.maintenance-demo-head .eyebrow {
    margin-bottom: 12px;
}

.maintenance-demo-head h2 {
    max-width: 22ch;
    margin: 0 auto 14px;
    font-family: var(--serif);
    font-size: clamp(40px, 5.2vw, 68px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.012em;
}

.showcase .maintenance-demo-head h2 {
    max-width: 34ch;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.maintenance-demo-head>p:last-child {
    max-width: 62ch;
    margin: 0 auto;
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.6;
}

.maintenance-machine {
    position: relative;
    padding: clamp(14px, 2.4vw, 28px);
    background: #0b1926;
    border: 1px solid #27465d;
    border-radius: 20px;
    box-shadow: 0 34px 80px -54px rgba(5, 16, 26, 0.9);
}

.maintenance-demo-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 16px 4px 0;
    color: var(--muted);
    font-size: 14px;
}

.maintenance-demo-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    text-decoration: none;
}

.maintenance-demo-foot a span {
    transition: transform 0.18s var(--ease);
}

.maintenance-demo-foot a:hover span {
    transform: translateX(2px);
}

/* Maintenance flow. The default (no .is-animated, no data-step) is the finished story, so no-JS
 * and reduced motion still show everything. JS adds .is-animated, walks data-step 0–5, and marks
 * the matching ring node, readout panel and step button. .is-rewritten keeps the before tiles
 * faded only once step 4 has played, so jumping straight to step 5 still compares before/after. */
.mf {
    --mf-card: #0f2a40;
    --mf-head: #10283a;
    --mf-line: #315d79;
    --mf-deep: #1d3b51;
    --mf-ink: #eaf7fd;
    --mf-accent: #90d4f0;
    --mf-muted: #8fb0c4;
    --mf-dim: #5f87a0;
    --mf-bad: #f4b183;
    --mf-good: #8fe0b8;
    position: relative;
    color: var(--mf-ink);
    background-image: radial-gradient(rgba(40, 70, 90, 0.5) 1px, transparent 1px);
    background-size: 18px 18px;
}

.mf code {
    font-family: var(--mono);
}

.mf-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 4px 14px;
    border-bottom: 1px solid #31536a;
    font: 500 13px/1.2 var(--mono);
    letter-spacing: 0.05em;
}

.mf-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--mf-accent);
}

.mf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #68c1ea;
    box-shadow: 0 0 0 3px rgba(104, 193, 234, 0.18);
}

.mf-top-right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.mf-state {
    color: var(--mf-muted);
    text-transform: uppercase;
}

.mf-play {
    padding: 6px 12px;
    color: var(--mf-ink);
    background: transparent;
    border: 1px solid var(--mf-line);
    border-radius: 999px;
    font: 500 12px/1 var(--mono);
    letter-spacing: 0.06em;
    cursor: pointer;
}

.mf-play:hover {
    border-color: var(--mf-accent);
}

.mf-play[hidden] {
    display: none;
}

.mf-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 300px 64px minmax(0, 1fr);
    align-items: stretch;
    padding: 30px 0 22px;
}

.mf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--mf-card);
    border: 1.4px solid var(--mf-line);
    border-radius: 9px;
}

.mf-card header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--mf-head);
    border-bottom: 1.4px solid var(--mf-line);
    border-radius: 8px 8px 0 0;
    font: 500 13px/1 var(--mono);
    letter-spacing: 0.12em;
}

.mf-card header b {
    font-weight: 500;
}

.mf-card header em {
    margin-left: auto;
    color: var(--mf-muted);
    font-size: 11px;
    font-style: normal;
    letter-spacing: 0.08em;
}

.mf-glyph {
    width: 16px;
    height: 16px;
    background:
        linear-gradient(#68c1ea, #68c1ea) 0 0 / 7px 7px no-repeat,
        linear-gradient(#68c1ea, #68c1ea) 9px 0 / 7px 7px no-repeat,
        linear-gradient(#68c1ea, #68c1ea) 0 9px / 7px 7px no-repeat,
        linear-gradient(#68c1ea, #68c1ea) 9px 9px / 7px 7px no-repeat;
}

.mf-tiles {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-content: center;
    gap: 5px;
    padding: 18px 16px;
}

.mf-tiles i {
    aspect-ratio: 1;
    border-radius: 2px;
    background: #b8e1f3;
    opacity: 0.86;
    transition: opacity 0.3s var(--ease);
}

.mf-tiles i:nth-child(3n+2) {
    background: #68c1ea;
}

.mf-tiles i:nth-child(7n+3),
.mf-tiles i:nth-child(11n+5) {
    opacity: 0.5;
}

.mf-tiles i:nth-child(5n+4) {
    transform: scale(0.7);
}

.mf-tiles i:nth-child(13n+6) {
    transform: scale(0.5);
}

.mf-scan {
    position: absolute;
    top: 12px;
    left: 10px;
    right: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--mf-ink);
    box-shadow: 0 0 14px 3px rgba(144, 212, 240, 0.55);
    opacity: 0;
    pointer-events: none;
}

.mf-chunk {
    position: absolute;
    inset: 9px;
    border: 1.6px dashed var(--mf-accent);
    border-radius: 7px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}

.mf-chunk span {
    position: absolute;
    top: -11px;
    left: 12px;
    padding: 3px 9px;
    color: var(--mf-accent);
    background: var(--mf-card);
    border: 1px solid var(--mf-accent);
    border-radius: 999px;
    font: 500 11.5px/1.2 var(--mono);
}

.mf-blocks {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    padding: 18px 16px;
}

.mf-blocks i {
    position: relative;
    background: #277abe;
    border: 1.2px solid #68c1ea;
    border-radius: 6px;
    transition: background-color 0.45s var(--ease) calc(var(--d) + 700ms), border-color 0.45s var(--ease) calc(var(--d) + 700ms), transform 0.5s var(--ease) calc(var(--d) + 700ms);
}

.mf-blocks i::before {
    content: "~256 MB";
    position: absolute;
    top: 10px;
    left: 12px;
    color: #eaf7fd;
    font: 500 11px/1 var(--mono);
    letter-spacing: 0.04em;
    opacity: 0.85;
    transition: opacity 0.3s var(--ease) calc(var(--d) + 900ms);
}

.mf-blocks i::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    right: 16px;
    border-top: 1.2px solid #b8e1f3;
    opacity: 0.7;
    transition: opacity 0.3s var(--ease) calc(var(--d) + 900ms);
}

.mf-receipt {
    position: absolute;
    top: -14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    color: var(--mf-accent);
    background: var(--mf-head);
    border: 1.2px solid var(--mf-accent);
    border-radius: 6px;
    font: 500 11.5px/1 var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.mf-receipt svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--mf-accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-receipt path {
    stroke-dasharray: 14;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s var(--ease) 0.25s;
}

.mf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    border-top: 1.4px solid var(--mf-deep);
}

.mf-stats div {
    padding: 11px 13px 12px;
    border-right: 1px solid var(--mf-deep);
}

.mf-stats div:last-child {
    border-right: 0;
}

.mf-stats dt {
    color: var(--mf-dim);
    font: 500 10.5px/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mf-stats dd {
    margin: 7px 0 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.3s var(--ease);
}

.mf .is-bad {
    color: var(--mf-bad);
}

.mf .is-good {
    color: var(--mf-good);
}

.mf-rail {
    position: relative;
    align-self: start;
    height: 2px;
    margin: 110px 8px 0;
    background: repeating-linear-gradient(90deg, #3f718f 0 3px, transparent 3px 10px);
}

.mf-rail::after {
    content: "";
    position: absolute;
    top: -4px;
    right: 0;
    width: 9px;
    height: 9px;
    border-top: 1.6px solid var(--mf-accent);
    border-right: 1.6px solid var(--mf-accent);
    transform: rotate(45deg);
}

.mf-rail span {
    position: absolute;
    top: -4px;
    left: 0;
    width: 20px;
    height: 8px;
    border-radius: 2px;
    background: #b8e1f3;
    opacity: 0;
}

.mf-rail span:nth-child(2) {
    top: -15px;
    width: 14px;
}

.mf-rail span:nth-child(3) {
    top: 7px;
    width: 24px;
}

.mf-rail-out span {
    width: 26px;
    height: 10px;
    background: #277abe;
    border: 1px solid #68c1ea;
}

.mf-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mf-ring {
    display: block;
    width: 220px;
    height: 220px;
    overflow: visible;
}

.mf-ring-outer {
    fill: #0f2a40;
    stroke: #315d79;
    stroke-width: 1.5;
}

.mf-ring-track {
    fill: none;
    stroke: #1d3b51;
    stroke-width: 3;
}

.mf-ring-progress {
    fill: none;
    stroke: var(--mf-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100 101;
    stroke-dashoffset: var(--mf-progress, 0);
    transition: stroke-dashoffset 0.6s var(--ease);
}

.mf[data-step="0"],
.mf[data-step="1"] {
    --mf-progress: 100;
}

.mf[data-step="2"] {
    --mf-progress: 75;
}

.mf[data-step="3"] {
    --mf-progress: 50;
}

.mf[data-step="4"] {
    --mf-progress: 25;
}

.mf-ring-dial {
    fill: none;
    stroke: #277abe;
    stroke-width: 1.5;
    stroke-dasharray: 2 5;
    transform-box: fill-box;
    transform-origin: center;
}

.mf.is-playing .mf-ring-dial {
    animation: mf-rotate 28s linear infinite;
}

.mf-ring-core {
    fill: #08131d;
    stroke: #68c1ea;
    stroke-width: 1.5;
}

.mf-ring-bezel {
    fill: none;
    stroke: #416c88;
    stroke-width: 1.2;
}

.mf-cube-small {
    transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}

.mf.is-animated[data-step="4"] .mf-cube-small {
    opacity: 0.25;
    transform: translate(10px, 10px);
}

.mf-node circle {
    fill: #10283a;
    stroke: #416c88;
    stroke-width: 1.5;
    transition: fill 0.3s var(--ease), stroke 0.3s var(--ease);
}

.mf-node text {
    fill: var(--mf-dim);
    font: 600 11px/1 var(--mono);
    text-anchor: middle;
    transition: fill 0.3s var(--ease);
}

.mf-node.is-done circle {
    fill: #1b4766;
    stroke: var(--mf-accent);
}

.mf-node.is-done text {
    fill: var(--mf-ink);
}

.mf-node.is-active circle {
    fill: var(--mf-accent);
    stroke: var(--c-marker);
    stroke-width: 2.5;
}

.mf-node.is-active text {
    fill: #0b1926;
}

.mf-readout {
    position: relative;
    width: 100%;
    height: 164px;
    background: #0c2133;
    border: 1.4px solid var(--mf-line);
    border-radius: 9px;
}

.mf-panel {
    position: absolute;
    inset: 0;
    padding: 13px 15px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: none;
}

.mf-panel.is-active {
    opacity: 1;
    transform: none;
}

.mf-panel-title {
    margin: 0 0 11px;
    color: var(--mf-accent);
    font: 500 12px/1.2 var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mf-panel-title code {
    color: var(--mf-ink);
    font: inherit;
    text-transform: none;
}

.mf-kv {
    display: grid;
    gap: 6px;
    margin: 0;
}

.mf-kv div {
    display: flex;
    justify-content: space-between;
    padding-bottom: 5px;
    color: var(--mf-muted);
    border-bottom: 1px dashed var(--mf-deep);
    font-size: 13px;
}

.mf-kv div:last-child {
    border-bottom: 0;
}

.mf-kv dd {
    margin: 0;
    color: var(--mf-ink);
    font: 500 13px/1.2 var(--mono);
}

.mf-kv .is-key dt {
    color: var(--mf-ink);
}

.mf-kv .is-key dd {
    color: var(--mf-good);
}

.mf-budget {
    position: relative;
    height: 26px;
    overflow: hidden;
    border: 1.4px dashed var(--mf-dim);
    border-radius: 5px;
}

.mf-budget-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    background: #68c1ea;
    transition: width 0.9s var(--ease) 0.25s;
}

.mf-budget-label {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    font: 500 12px/1 var(--mono);
}

.mf-pred {
    display: block;
    margin-top: 10px;
    padding: 7px 9px;
    overflow: hidden;
    color: #b8e1f3;
    background: #08131d;
    border-radius: 5px;
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mf-panel-note {
    margin: 9px 0 0;
    color: var(--mf-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.mf-panel-note code {
    color: var(--mf-accent);
    font-size: 11.5px;
}

.mf-slots {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 10px 12px;
}

.mf-rep {
    font: 500 12.5px/1 var(--mono);
}

.mf-cells {
    display: flex;
    gap: 4px;
}

.mf-cells i {
    width: 20px;
    height: 18px;
    border: 1.3px solid #b8e1f3;
    border-radius: 4px;
}

.mf-cells i.on {
    background: #68c1ea;
}

.mf-cells i.job {
    background: #277abe;
    box-shadow: 0 0 0 2px rgba(144, 212, 240, 0.4);
    transition: background 0.3s var(--ease) 0.7s, box-shadow 0.3s var(--ease) 0.7s;
}

.mf-slot-note {
    color: var(--mf-muted);
    font-size: 12.5px;
    text-align: right;
}

.mf-slot-note.is-pick {
    color: var(--mf-ink);
    font-weight: 600;
    transition: opacity 0.3s var(--ease) 0.8s;
}

.mf-progress {
    height: 10px;
    margin-top: 4px;
    overflow: hidden;
    background: var(--mf-deep);
    border-radius: 5px;
}

.mf-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #277abe, var(--mf-accent));
    transition: width 2.4s linear 0.2s;
}

.mf-big {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 16px 0 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.mf-big span:first-child {
    color: var(--mf-bad);
}

.mf-big span:nth-of-type(2) {
    color: var(--mf-good);
}

.mf-big em {
    color: var(--mf-muted);
    font-size: 20px;
    font-style: normal;
}

.mf-big small {
    color: var(--mf-muted);
    font-size: 13px;
    font-weight: 400;
}

.mf-log {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px;
    font-size: 14px;
}

.mf-log code {
    color: var(--mf-accent);
}

.mf-ok {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #fff;
    background: #1e8e5a;
    border-radius: 50%;
    font-size: 12px;
}

.mf-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 16px 0 2px;
    list-style: none;
    border-top: 1px solid #31536a;
}

.mf-steps button {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 5px 9px;
    width: 100%;
    height: 100%;
    padding: 12px 14px 14px;
    overflow: hidden;
    color: var(--mf-ink);
    text-align: left;
    background: rgba(15, 42, 64, 0.55);
    border: 1px solid var(--mf-deep);
    border-radius: 9px;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.mf-steps button:hover {
    border-color: #416c88;
}

.mf-steps button:focus-visible {
    outline: 2px solid var(--mf-accent);
    outline-offset: 2px;
}

.mf-n {
    color: var(--mf-dim);
    font: 500 12px/1.3 var(--mono);
}

.mf-steps b {
    font-size: 15px;
    font-weight: 600;
}

.mf-d {
    grid-column: 1 / -1;
    color: var(--mf-muted);
    font-size: 13px;
    line-height: 1.4;
}

.mf-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--mf-accent);
}

.mf-steps button.is-done .mf-n {
    color: var(--mf-accent);
}

.mf-steps button.is-active {
    background: var(--mf-head);
    border-color: var(--mf-accent);
}

.mf-steps button.is-active .mf-n {
    color: var(--mf-accent);
}

.mf.is-playing .mf-steps button.is-active .mf-bar {
    animation: mf-bar var(--mf-dur, 2s) linear forwards;
}

.mf.is-animated:not(.is-playing) .mf-steps button.is-active .mf-bar {
    width: 100%;
}

/* Step states. Only the "not there yet" states are written; everything else is the default. */
.mf.is-animated[data-step="0"] .mf-before .mf-stats dd {
    opacity: 0;
}

.mf.is-animated[data-step="1"] .mf-before .mf-stats dd {
    transition-delay: 0.9s;
}

.mf.is-animated[data-step="1"] .mf-scan {
    animation: mf-scan 1.5s var(--ease) both;
}

.mf.is-animated:is([data-step="2"], [data-step="3"]) .mf-chunk {
    opacity: 1;
    transition-delay: 0.2s;
}

.mf.is-animated[data-step="4"] .mf-tiles i,
.mf.is-animated.is-rewritten[data-step="5"] .mf-tiles i {
    opacity: 0.1;
    transition: opacity 0.3s var(--ease) calc(var(--i, 0) * 11ms);
}

.mf.is-animated:is([data-step="0"], [data-step="1"], [data-step="2"], [data-step="3"]) .mf-blocks i {
    background-color: transparent;
    border-color: #2a4d66;
    border-style: dashed;
    transform: scale(0.94);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.mf.is-animated:is([data-step="0"], [data-step="1"], [data-step="2"], [data-step="3"]) .mf-blocks i::before,
.mf.is-animated:is([data-step="0"], [data-step="1"], [data-step="2"], [data-step="3"]) .mf-blocks i::after {
    opacity: 0;
    transition: none;
}

.mf.is-animated:is([data-step="0"], [data-step="1"], [data-step="2"], [data-step="3"]) .mf-after .mf-stats dd {
    opacity: 0;
}

.mf.is-animated[data-step="4"] .mf-after .mf-stats dd {
    transition-delay: 2.2s;
}

.mf.is-animated:not([data-step="5"]) .mf-receipt {
    opacity: 0;
    transform: translateY(6px);
}

.mf.is-animated:not([data-step="5"]) .mf-receipt path {
    stroke-dashoffset: 14;
    transition: none;
}

.mf.is-animated .mf-panel:not(.is-active) .mf-budget-fill,
.mf.is-animated .mf-panel:not(.is-active) .mf-progress span {
    width: 0;
    transition: none;
}

.mf.is-animated .mf-panel:not(.is-active) .mf-cells i.job {
    background: transparent;
    box-shadow: none;
    transition: none;
}

.mf.is-animated .mf-panel:not(.is-active) .mf-slot-note.is-pick {
    opacity: 0;
    transition: none;
}

.mf.is-animated[data-step="4"] .mf-rail span {
    animation: mf-packet 0.9s var(--ease) infinite;
}

.mf.is-animated[data-step="4"] .mf-rail span:nth-child(2) {
    animation-delay: 0.15s;
}

.mf.is-animated[data-step="4"] .mf-rail span:nth-child(3) {
    animation-delay: 0.3s;
}

.mf.is-animated[data-step="4"] .mf-rail-out span {
    animation-delay: 0.45s;
}

.mf.is-animated[data-step="4"] .mf-rail-out span:nth-child(2) {
    animation-delay: 0.6s;
}

.mf.is-animated[data-step="4"] .mf-rail-out span:nth-child(3) {
    animation-delay: 0.75s;
}

@keyframes mf-scan {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    12%,
    88% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateY(calc(var(--mf-scan-h, 240px)));
    }
}

@keyframes mf-packet {
    0% {
        left: 0;
        opacity: 0;
    }
    20%,
    75% {
        opacity: 1;
    }
    100% {
        left: calc(100% - 26px);
        opacity: 0;
    }
}

@keyframes mf-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes mf-bar {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@media (max-width: 960px) {
    .mf-stage {
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
        max-width: 460px;
        margin: 0 auto;
        padding-top: 22px;
    }
    .mf-rail {
        justify-self: center;
        width: 2px;
        height: 34px;
        margin: 8px 0;
        background: repeating-linear-gradient(180deg, #3f718f 0 3px, transparent 3px 10px);
    }
    .mf-rail::after {
        top: auto;
        right: -4px;
        bottom: 0;
        transform: rotate(135deg);
    }
    .mf-rail span {
        display: none;
    }
    .mf-tiles {
        min-height: 230px;
    }
    .mf-blocks {
        min-height: 200px;
    }
    .mf-ring {
        width: 200px;
        height: 200px;
    }
    .mf-steps {
        gap: 6px;
    }
    .mf-steps button {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 3px;
        padding: 10px 4px 12px;
        text-align: center;
    }
    .mf-d {
        display: none;
    }
    .mf-steps b {
        font-size: 13px;
    }
}

@media (max-width: 560px) {
    .mf-top {
        flex-wrap: wrap;
        font-size: 11.5px;
    }
    .mf-state {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mf *,
    .mf *::after {
        animation: none !important;
        transition: none !important;
    }
}

.sky-env {
    padding: 24px 0 112px;
}

.envelope {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding-top: 20px;
}

.env-back {
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 60%;
    border-radius: 24px;
    background: var(--sky-back);
    border: 1px solid var(--sky-card-line);
    transform: rotate(-1.4deg);
    box-shadow: 0 10px 30px -20px var(--sky-shadow);
}

.env-card {
    position: relative;
    overflow: hidden;
    padding: 128px clamp(24px, 6vw, 64px) 48px;
    text-align: center;
    background: var(--sky-card);
    border-radius: 24px;
    box-shadow: 0 0 0 1px var(--sky-card-line), 0 40px 80px -40px var(--sky-shadow);
}

.env-flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    filter: drop-shadow(0 1px 0 var(--sky-card-line)) drop-shadow(0 8px 12px rgba(20, 62, 96, 0.07));
}

.env-flap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--sky-flap-a), var(--sky-flap-b));
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.env-seal {
    position: absolute;
    top: 80px;
    left: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #ffffff;
    background: #131b24;
    box-shadow: 0 0 0 5px var(--sky-card), 0 8px 18px -6px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%);
}

html[data-theme="dark"] .env-seal {
    color: #0b0f16;
    background: #eaf7fd;
}

.env-card h2 {
    margin: 0 0 12px;
    font-family: var(--serif);
    font-size: clamp(34px, 4.2vw, 46px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.env-card .sub {
    max-width: 52ch;
    margin: 0 auto 28px;
    font-size: 16.5px;
    color: var(--muted);
}

.env-card .code {
    max-width: 520px;
    margin: 0 auto 28px;
    text-align: left;
}

.home .sect h2 {
    font-family: var(--serif);
    font-size: clamp(36px, 4.8vw, 60px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.01em;
}

.home .film-close h2 {
    max-width: none;
    margin: 0 0 28px;
    font-size: clamp(26px, 3.4vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .home .film-close h2 {
        font-size: clamp(15px, 4.6vw, 22px);
        letter-spacing: -0.045em;
    }
}

@media (max-width: 900px) {
    .hero-in.hero-split {
        grid-template-columns: 1fr;
    }
    .hero-split .hero-copy {
        display: contents;
    }
    .hero.sky:has(.hero-split) {
        text-align: center;
    }
    .hero-split .hero-copy>* {
        justify-self: center;
    }
    .hero-split .hero-copy .sky-pill {
        order: 1;
    }
    .hero-split .hero-copy h1 {
        order: 2;
    }
    .hero-split .hero-copy .lede {
        order: 3;
    }
    .hero-split .core-stage {
        order: 4;
        width: min(720px, 100%);
        margin-top: 14px;
        text-align: left;
    }
    .hero-split .hero-copy .tally {
        order: 5;
        width: min(620px, 100%);
    }
    .hero-split .hero-copy .hero-actions {
        order: 7;
    }
    .hero-split .hero-copy .stack-k {
        order: 8;
    }
    .hero-split .hero-copy .stack {
        order: 9;
        width: 100%;
    }
    .hero.sky h1 {
        max-width: 14ch;
    }
    .hero.sky .hero-split h1 {
        max-width: none;
    }
    .hero.sky h1 br {
        display: none;
    }
    .core-support {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .tally {
        grid-template-columns: repeat(2, auto);
    }
    .tally>div:nth-child(3) {
        border-left: 0;
    }
    .tally>div:nth-child(n+3) {
        border-top: 1px solid var(--sky-card-line);
    }
    .stack ul {
        gap: 28px;
        padding: 0 14px;
    }
    .stack.marquee-track ul {
        gap: 28px;
    }
    .maintenance-demo {
        padding: 28px 0 82px;
    }
    .maintenance-demo-head {
        margin-bottom: 24px;
        text-align: left;
    }
    .maintenance-demo-head h2 {
        max-width: 22ch;
        margin-left: 0;
    }
    .showcase .maintenance-demo-head h2 {
        max-width: none;
    }
    .maintenance-demo-head>p:last-child {
        margin-left: 0;
    }
    .maintenance-machine {
        padding: 10px;
        border-radius: 16px;
    }
    .maintenance-demo-foot {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }
    .core-plates {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .core-plate:nth-child(3) {
        border-left: 0;
    }
    .core-plate:nth-child(n+3) {
        border-top: 1px solid var(--sky-card-line);
    }
    .env-back {
        transform: rotate(-0.8deg);
    }
}


/* ---------- home: table journey ----------
 * One table's month of decay, then each operation in order, drawn as the brand's ice core
 * (loose grains = small files, solid blocks = compacted files, lines = snapshots). Without JS the
 * chapters read as a plain column and the stage stays hidden; site.js adds .is-live, builds the
 * core and repaints it from the chapter crossing the middle of the viewport. */
.journey {
    padding: 24px 0 120px;
}

.tj {
    --tj-card: #0b1926;
    --tj-line: #27465d;
    --tj-ink: #eaf7fd;
    --tj-muted: #8fb0c4;
    --tj-bad: #f4b183;
    --tj-good: #8fe0b8;
    max-width: 720px;
    margin: 0 auto;
}

.tj.is-live {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: clamp(32px, 5vw, 80px);
    max-width: none;
}

.tj-stage {
    display: none;
}

.tj.is-live .tj-stage {
    position: sticky;
    top: calc(var(--hdr) + 20px);
    display: flex;
    align-items: center;
    height: calc(100vh - var(--hdr) - 40px);
    min-height: 600px;
    max-height: 780px;
}

.tj-card {
    width: 100%;
    padding: 16px 20px 16px;
    color: var(--tj-ink);
    background:
        repeating-linear-gradient(180deg, transparent 0 23px, rgba(104, 193, 234, 0.035) 23px 24px),
        var(--tj-card);
    border: 1px solid var(--tj-line);
    border-radius: 20px;
    box-shadow: 0 34px 80px -54px rgba(5, 16, 26, 0.9);
}

.tj-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #31536a;
}

.tj-mark {
    width: 52px;
    height: 52px;
    overflow: visible;
}

.tj-mark path {
    stroke: var(--tj-card);
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.tj-mark .m-block path {
    stroke-width: 2.6;
}

.tj-mark path.m-dash {
    fill: none;
    stroke: var(--c-glacier);
    stroke-width: 2;
    stroke-linecap: round;
}

.tj-mark path.m-seam {
    fill: none;
    stroke: #b8e1f3;
    stroke-width: 1.1;
}

.tj-mark path.m-edge {
    fill: none;
}

.tj-mark .m-block {
    transform-box: fill-box;
    transform-origin: center;
}

.tj-mark.is-fusing .m-bit {
    animation: tj-fuse 1.1s var(--ease) both;
}

.tj-mark.is-fusing .m-block {
    animation: tj-thud 1.1s var(--ease) both;
}

@keyframes tj-fuse {
    0% { opacity: 1; transform: none; }
    55% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
    56% { opacity: 0; transform: none; }
    100% { opacity: 1; transform: none; }
}

@keyframes tj-thud {
    0%, 45% { transform: none; }
    60% { transform: scale(1.12); }
    100% { transform: none; }
}

.tj-say {
    min-width: 0;
    margin: 0;
    color: var(--tj-muted);
    font-size: 13.5px;
    line-height: 1.35;
}

.tj-say b {
    display: block;
    color: var(--tj-ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tj-when {
    flex: none;
    padding: 5px 10px;
    color: var(--tj-ink);
    border: 1px solid #315d79;
    border-radius: 999px;
    font: 500 12.5px/1.2 var(--mono);
    font-variant-numeric: tabular-nums;
}

/* core sample */
.tj-core {
    display: block;
    width: 100%;
    height: auto;
    margin: 6px 0 2px;
    overflow: visible;
}

.tj-core .c-ground {
    stroke: #3b5a72;
    stroke-width: 1;
}

.tj-core .c-body {
    fill: #0f2a3f;
    stroke: var(--c-glacier);
    stroke-width: 1.5;
}

.tj-core .c-cut {
    fill: #10263a;
    stroke: #2c5571;
    stroke-width: 1;
}

.tj-core .c-end {
    fill: var(--c-ice);
    stroke: var(--c-glacier);
    stroke-width: 1.5;
}

.tj-core .c-tray {
    fill: none;
    stroke: var(--c-glacier);
    stroke-width: 1.2;
    stroke-dasharray: 4 3;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
}

.tj-core[data-n="6"] .c-tray {
    opacity: 1;
}

.c-blocks g {
    opacity: var(--on, 1);
    transform: scaleX(calc(0.35 + 0.65 * var(--on, 1)));
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
}

.tj-core[data-n="3"] .c-blocks g {
    transition-delay: calc(var(--n) * 140ms + 280ms);
}

.c-blocks rect {
    fill: var(--c-core);
    stroke: var(--c-glacier);
    stroke-width: 1.4;
}

.c-blocks path {
    stroke: var(--c-frost);
    stroke-width: 1;
    opacity: 0.7;
}

.c-layer {
    stroke: #b8e1f3;
    stroke-width: 0.8;
    opacity: 0;
    transform: translateY(var(--y, 166px));
    transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}

.c-layer.is-on {
    opacity: 0.38;
}

.c-tile {
    fill: rgba(234, 247, 253, 0.07);
    stroke: var(--c-frost);
    stroke-width: 1.2;
    opacity: 0;
    transform: translate(var(--x), calc(var(--y) - 22px)) rotate(var(--r));
    transition:
        transform 0.7s var(--ease),
        opacity 0.5s var(--ease),
        stroke 0.4s var(--ease),
        fill 0.4s var(--ease);
    transition-delay: calc(var(--i, 0) * 5ms);
}

.c-tile.is-loose,
.c-tile.is-ghost {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r));
}

.c-tile.is-ghost {
    fill: none;
    stroke: #7fa3bb;
    stroke-dasharray: 2.5 2;
    opacity: 0.6;
}

.c-tile.is-gone {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) rotate(0deg) scale(0.5);
    transition-duration: 0.9s, 0.9s, 0.4s, 0.4s;
}

.c-slip {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0);
    transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
    transition-delay: calc(var(--i, 0) * 40ms);
}

.c-slip.is-on {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
}

.c-slip rect {
    fill: #b8e1f3;
    stroke: var(--tj-card);
    stroke-width: 1;
}

.c-slip path {
    stroke: var(--c-ice);
    stroke-width: 1.2;
}

.c-stray {
    fill: none;
    stroke: var(--c-frost);
    stroke-width: 1.2;
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.4);
    transition: transform 0.6s var(--ease), opacity 0.5s var(--ease);
    transition-delay: calc(var(--i, 0) * 50ms);
}

.c-stray.is-on {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
}

.c-stray.is-swept {
    opacity: 0.9;
    transform: translate(var(--px), var(--py)) rotate(0deg) scale(0.8);
    transition-duration: 1.1s, 0.4s;
}

.tj-core[data-n="8"] .c-stray.is-swept {
    opacity: 0;
    transform: translate(var(--px), calc(var(--py) + 6px)) scale(0.3);
}

.c-drawer-box {
    fill: var(--c-ice);
    stroke: var(--c-glacier);
    stroke-width: 1.3;
}

.c-drawer-pull {
    stroke: var(--c-glacier);
    stroke-width: 2;
    stroke-linecap: round;
}

.c-card {
    fill: var(--c-frost);
    stroke: var(--tj-card);
    stroke-width: 0.8;
    opacity: 0;
    transform: translate(var(--x), 44px);
    transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
    transition-delay: calc(var(--i, 0) * 20ms);
}

.c-card.is-on {
    opacity: 1;
    transform: translate(var(--x), 28px);
}

.is-messy .c-card.is-on {
    transform: translate(var(--x), calc(28px - var(--jy))) rotate(var(--jr));
}

.c-string {
    fill: none;
    stroke: var(--tj-muted);
    stroke-width: 1;
}

.c-label {
    fill: none;
    stroke: #b8e1f3;
    stroke-width: 1.2;
    stroke-dasharray: 3 2;
    transition: fill 0.4s var(--ease);
}

.c-hole {
    fill: var(--tj-card);
    stroke: #b8e1f3;
    stroke-width: 1;
}

.c-bars {
    stroke: var(--c-core);
    stroke-width: 2.6;
    stroke-linecap: round;
    opacity: 0;
    transition: opacity 0.4s var(--ease) 0.2s;
}

.is-fresh .c-label {
    fill: var(--c-frost);
    stroke-dasharray: none;
}

.is-fresh .c-bars {
    opacity: 1;
}

.c-scan {
    stroke: var(--c-glacier);
    stroke-width: 2;
    opacity: 0;
}

.c-scan.is-on {
    animation: tj-scan 1.1s var(--ease) both;
}

@keyframes tj-scan {
    0% { opacity: 0; transform: translateX(0); }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { opacity: 0; transform: translateX(398px); }
}

.c-marker {
    transition: transform 0.7s var(--ease);
}

.c-marker line {
    stroke: var(--c-frost);
    stroke-width: 1.5;
}

.c-marker path {
    fill: var(--c-marker);
}

/* bill */
.tj-bill {
    padding: 8px 0 4px;
}

.tj-bill-k {
    margin: 0 0 2px;
    color: var(--tj-muted);
    font-size: 13px;
}

.tj-bill-v {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0 0 10px;
    font-size: clamp(34px, 3.4vw, 46px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.tj-bill-v em {
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0;
}

.tj-bill-v em.is-up {
    color: var(--tj-bad);
}

.tj-bill-v em.is-down {
    color: var(--tj-good);
}

.tj-stack {
    display: flex;
    gap: 2px;
    height: 12px;
    margin-bottom: 12px;
    padding: 2px;
    background: #12293c;
    border-radius: 4px;
}

.tj-stack i {
    flex: none;
    width: 0;
    border-radius: 2px;
    transition: width 0.6s var(--ease), opacity 0.3s var(--ease);
}

.tj-stack i:not(.is-hot) {
    opacity: 0.55;
}

[data-tj-seg="live"],
[data-tj-row="live"]::before {
    background: var(--c-core);
    box-shadow: inset 0 0 0 1px var(--c-glacier);
}

[data-tj-seg="gets"],
[data-tj-row="gets"]::before {
    background: var(--c-glacier);
}

[data-tj-seg="ghost"],
[data-tj-row="ghost"]::before {
    background: repeating-linear-gradient(135deg, #7fa3bb 0 2px, transparent 2px 4px);
    box-shadow: inset 0 0 0 1px #7fa3bb;
}

[data-tj-seg="del"],
[data-tj-row="del"]::before {
    background: #b8e1f3;
}

[data-tj-seg="orphan"],
[data-tj-row="orphan"]::before {
    box-shadow: inset 0 0 0 1.4px var(--c-frost);
}

.tj-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tj-rows li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: var(--tj-muted);
    font-size: 13px;
    transition: color 0.3s var(--ease);
}

.tj-rows li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.tj-rows span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tj-rows b {
    color: var(--tj-ink);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.tj-rows li.is-hot {
    color: var(--tj-ink);
}

.tj-meters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid #31536a;
}

.tj-meters dt {
    margin: 0 0 4px;
    color: var(--tj-muted);
    font-size: 12px;
}

.tj-meters dd {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* chapters */
.tj-chapters {
    position: relative;
}

.tj-ch {
    position: relative;
    padding: 0 0 56px 30px;
}

.tj-ch::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: -6px;
    left: 5px;
    width: 2px;
    background: var(--line);
}

.tj-ch-end::before {
    display: none;
}

.tj-ch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: inset 0 0 0 2px var(--line-strong);
    transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.tj.is-live .tj-ch {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 82vh;
    padding-bottom: 0;
}

.tj.is-live .tj-ch-long {
    justify-content: flex-start;
    min-height: 170vh;
    padding-top: 12vh;
}

.tj.is-live .tj-ch-long .tj-ch-in {
    position: sticky;
    top: calc(var(--hdr) + 24px);
}

.tj.is-live .tj-ch::before {
    top: 0;
    bottom: 0;
}

.tj.is-live .tj-ch:first-child::before {
    top: 50%;
}

.tj.is-live .tj-ch-end::before {
    display: block;
    bottom: 50%;
}

.tj.is-live .tj-ch::after {
    top: calc(50% - 6px);
}

.tj.is-live .tj-ch:first-child {
    min-height: 70vh;
}

.tj.is-live .tj-ch.is-seen::after,
.tj.is-live .tj-ch.is-active::after {
    background: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.tj.is-live .tj-ch.is-active::after {
    box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
}

.tj-ch p.tj-k {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

.tj-ch p.tj-k code {
    padding: 0;
    color: inherit;
    background: none;
    font-family: var(--mono);
    font-size: 13.5px;
}

.tj-ch h3 {
    margin: 0 0 14px;
    font-family: var(--serif);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.tj-ch h3 code {
    padding: 0;
    background: none;
    font-family: var(--mono);
    font-size: 0.72em;
    letter-spacing: -0.02em;
}

.tj-ch h3 .anchor {
    display: none;
}

.tj-ch p {
    max-width: 56ch;
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 16.5px;
    line-height: 1.6;
}

.tj-ch p.tj-why b {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.tj-ch p.tj-plain {
    padding: 2px 0 2px 16px;
    color: var(--ink);
    border-left: 2px solid var(--c-glacier);
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    line-height: 1.32;
}

.tj-ch p.tj-plain b {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-family: var(--font);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tj-ch p.tj-fact {
    padding: 12px 14px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.55;
}

.tj-fact b {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.tj-fact a {
    margin-left: 4px;
    padding: 1px 7px;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tj-fact a::after {
    content: " ↗";
}

.tj-fact a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.tj-turn {
    padding: 14px 16px;
    background: var(--c-frost);
    border-radius: 12px;
}

html[data-theme="dark"] .tj-turn {
    background: #10283a;
}

.tj-turn strong {
    color: var(--ink);
}

.tj-keys {
    display: none;
}

.tj.is-live .tj-keys {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    max-width: 56ch;
    margin: 4px 0 18px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.tj-ch .tj-keys p {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 2px 10px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.tj-keys p::before {
    content: "";
    grid-row: span 2;
    width: 22px;
    height: 16px;
    border-radius: 2px;
}

.tj-keys b {
    color: var(--ink);
    font-weight: 600;
}

.tj-keys .k-block::before {
    background: linear-gradient(90deg, transparent 4px, var(--c-frost) 4px 5px, transparent 5px) var(--c-core);
    box-shadow: inset 0 0 0 1.4px var(--c-glacier);
}

.tj-keys .k-grain::before {
    background:
        linear-gradient(var(--c-core), var(--c-core)) 1px 2px / 6px 6px no-repeat,
        linear-gradient(var(--c-core), var(--c-core)) 9px 8px / 6px 6px no-repeat,
        linear-gradient(var(--c-core), var(--c-core)) 15px 1px / 6px 6px no-repeat;
}

.tj-keys .k-layer::before {
    background: repeating-linear-gradient(180deg, transparent 0 3px, var(--c-glacier) 3px 4px);
}

.tj-keys .k-drawer::before {
    background:
        repeating-linear-gradient(90deg, var(--c-frost) 0 2px, transparent 2px 4px) 4px 0 / 14px 7px no-repeat,
        linear-gradient(var(--c-ice), var(--c-ice)) 0 7px / 22px 9px no-repeat;
}

.tj-keys .k-tag::before {
    width: 16px;
    margin-left: 3px;
    background: radial-gradient(circle at 4px 4px, var(--bg) 1.6px, transparent 2px) var(--c-firn, #b8e1f3);
}

.tj-keys .k-flag::before {
    background:
        linear-gradient(var(--c-marker), var(--c-marker)) 8px 1px / 10px 7px no-repeat,
        linear-gradient(var(--ink), var(--ink)) 7px 1px / 1.5px 15px no-repeat;
}

/* receipt */
.tj-paper {
    max-width: 430px;
    margin: 6px 0 22px;
    filter: drop-shadow(0 18px 28px rgba(20, 62, 96, 0.18));
    transform: rotate(-0.6deg);
}

.tj-paper-in {
    padding: 18px 22px 30px;
    color: var(--c-ice);
    background: #fff;
    font-family: var(--mono);
    font-size: 13px;
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}

.tj-paper-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #b8e1f3;
}

.tj-paper-head img {
    flex: none;
}

.tj-ch .tj-paper-head p {
    margin: 0;
    color: var(--c-ice);
    font-size: 13px;
    line-height: 1.4;
}

.tj-paper-head b {
    display: block;
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tj-paper-head span {
    color: #5c667a;
}

.tj-paper code {
    padding: 0;
    color: inherit;
    background: none;
    font-size: 13px;
}

.tj-paper table {
    width: 100%;
    margin: 8px 0 0;
    border-collapse: collapse;
}

.tj-paper th {
    padding: 6px 0;
    color: #5c667a;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.tj-paper td {
    padding: 6px 0;
    border-top: 1px dashed #d3e9f4;
}

.tj-paper th:last-child,
.tj-paper td:last-child {
    text-align: right;
}

.tj-paper tr.tj-paper-total td {
    padding-top: 10px;
    border-top: 2px solid var(--c-ice);
    font-size: 15px;
    font-weight: 600;
}

.tj-ch .tj-paper-foot {
    margin: 12px 0 0;
    color: #5c667a;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-align: center;
}

.tj-calc {
    display: none;
}

.tj.is-live .tj-calc {
    display: block;
    max-width: 56ch;
    margin: 0 0 18px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.tj-calc label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
}

.tj-calc-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tj-calc input {
    flex: 1;
    accent-color: var(--accent);
}

.tj-calc output {
    min-width: 84px;
    font: 500 13.5px/1 var(--mono);
    text-align: right;
}

.tj-ch p.tj-calc-v {
    margin: 12px 0 0;
    font-size: 15px;
}

.tj-calc-v span {
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tj-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.tj-links a {
    font-weight: 600;
    text-decoration: none;
}

.tj-note {
    max-width: 78ch;
    margin: 28px auto 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
    text-align: center;
}

/* mood: green and smiling when the table is cheap, red and crying when it is not */
.tj-card {
    border-color: color-mix(in srgb, var(--mood, #27465d) 45%, #27465d);
    box-shadow:
        0 34px 80px -54px rgba(5, 16, 26, 0.9),
        0 0 0 1px color-mix(in srgb, var(--mood, transparent) 22%, transparent),
        0 40px 110px -60px var(--mood, transparent);
    transition: border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.tj-mark .m-eye {
    fill: var(--tj-card);
    stroke: none;
    transform-box: fill-box;
    transform-origin: center;
    animation: tj-blink 5.5s infinite;
}

.tj-mark path.m-mouth {
    fill: none;
    stroke: var(--tj-card);
    stroke-width: 1.7;
    stroke-linecap: round;
    transition: d 0.5s var(--ease);
}

@keyframes tj-blink {
    0%, 94%, 100% { transform: none; }
    96% { transform: scaleY(0.1); }
}

.tj-say {
    position: relative;
    padding: 7px 12px;
    background: #12304a;
    border: 1px solid #2a5370;
    border-radius: 12px;
}

.tj-say::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -6px;
    width: 10px;
    height: 10px;
    background: #12304a;
    border-bottom: 1px solid #2a5370;
    border-left: 1px solid #2a5370;
    transform: translateY(-50%) rotate(45deg);
}

.tj-bill-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.tj-bill-row .tj-bill-v {
    margin: 0;
}

.tj-face {
    width: 58px;
    height: 58px;
}

.tj-face .f-head {
    fill: var(--face, #4ade80);
    stroke: color-mix(in srgb, var(--face, #4ade80) 55%, #000);
    stroke-width: 1.5;
    transition: fill 0.5s var(--ease), stroke 0.5s var(--ease);
}

.tj-face .f-eye {
    fill: var(--tj-card);
}

.tj-face .f-brow,
.tj-face .f-mouth {
    fill: none;
    stroke: var(--tj-card);
    stroke-linecap: round;
    transition: d 0.5s var(--ease), opacity 0.4s var(--ease);
}

.tj-face .f-brow {
    stroke-width: 2;
    opacity: 0;
}

.tj-face .f-mouth {
    stroke-width: 2.6;
}

.tj-face .f-tear {
    fill: var(--c-glacier);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

.tj-mood {
    margin: 0;
    text-align: right;
}

.tj-mood b {
    display: block;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
    transition: color 0.5s var(--ease);
}

.tj-mood span {
    color: var(--tj-muted);
    font-size: 12px;
    white-space: nowrap;
}

.tj-total-wrap,
[data-tj-total] {
    transition: color 0.5s var(--ease);
}

.tj-meters dd.tj-x {
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 500;
}

.tj .is-good { --mf: #4ade80; --mt: #15803d; --rail: #22c55e; }
.tj .is-meh { --mf: #fbbf24; --mt: #b45309; --rail: #f59e0b; }
.tj .is-bad { --mf: #f87171; --mt: #b91c1c; --rail: #ef4444; }

html[data-theme="dark"] .tj .is-good { --mt: #4ade80; }
html[data-theme="dark"] .tj .is-meh { --mt: #fbbf24; }
html[data-theme="dark"] .tj .is-bad { --mt: #f87171; }

.tj-m-good { --rail: #22c55e; }
.tj-m-meh { --rail: #f59e0b; }
.tj-m-bad { --rail: #ef4444; }

.tj.is-live .tj-ch.is-seen::after,
.tj.is-live .tj-ch.is-active::after {
    background: var(--rail);
    box-shadow: inset 0 0 0 2px var(--rail);
}

.tj.is-live .tj-ch.is-active::after {
    box-shadow: inset 0 0 0 2px var(--rail), 0 0 0 6px color-mix(in srgb, var(--rail) 22%, transparent);
}

.tj.is-live .tj-ch.is-seen::before {
    background: color-mix(in srgb, var(--rail) 45%, var(--line));
}

.face {
    position: relative;
    display: inline-block;
    flex: none;
    width: 28px;
    height: 28px;
    vertical-align: middle;
    background:
        radial-gradient(circle at 34% 40%, #0b1926 0 2px, transparent 2.6px),
        radial-gradient(circle at 66% 40%, #0b1926 0 2px, transparent 2.6px),
        var(--mf, #4ade80);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--mf, #4ade80) 60%, #000);
}

.face::after {
    content: "";
    position: absolute;
    left: 29%;
    width: 42%;
    height: 22%;
    border: 2px solid #0b1926;
}

.face::after,
.is-good .face::after,
.face.is-good::after {
    top: 50%;
    border-top: 0;
    border-radius: 0 0 99px 99px;
}

.is-meh .face::after {
    top: 64%;
    height: 0;
    border-width: 2px 0 0;
    border-radius: 0;
}

.is-bad .face::after {
    top: 62%;
    border-top: 2px solid #0b1926;
    border-bottom: 0;
    border-radius: 99px 99px 0 0;
}

.is-bad .face::before {
    content: "";
    position: absolute;
    top: 48%;
    right: 16%;
    width: 4px;
    height: 6px;
    background: var(--c-core);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.tj-ch p.tj-ba {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    max-width: 56ch;
    margin: 2px 0 16px;
    font-size: 14px;
    line-height: 1.2;
}

.tj-ba-side {
    display: inline-grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    column-gap: 9px;
    align-items: center;
    padding: 6px 14px 6px 6px;
    background: color-mix(in srgb, var(--mf) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--mf) 45%, transparent);
    border-radius: 999px;
}

.tj-ba-side .face {
    grid-row: span 2;
    width: 30px;
    height: 30px;
}

.tj-ba-k {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
}

.tj-ba-side b {
    color: var(--mt);
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tj-ba-arrow {
    color: var(--muted);
    font-size: 18px;
}

.tj-ba-note {
    color: var(--mt);
    font-size: 13.5px;
    font-weight: 600;
}

.tj-paper .face {
    width: 20px;
    height: 20px;
    margin-right: 6px;
}

@media (max-width: 900px) {
    .tj.is-live {
        display: block;
    }
    .tj.is-live .tj-stage {
        z-index: 3;
        top: var(--hdr);
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0 -24px;
        padding: 8px 12px 10px;
        background: var(--bg);
    }
    .tj-card {
        padding: 10px 12px;
        border-radius: 14px;
    }
    .tj-top {
        gap: 8px;
        padding-bottom: 6px;
    }
    .tj-mark {
        width: 26px;
        height: 26px;
    }
    .tj-say {
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tj-say b {
        display: none;
    }
    .tj-core {
        margin: 2px 0 0;
    }
    .tj-bill {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0;
    }
    .tj-bill-k,
    .tj-rows,
    .tj-meters,
    .tj-mood {
        display: none;
    }
    .tj-bill-row {
        grid-template-columns: auto auto;
        gap: 8px;
        margin: 0;
    }
    .tj-face {
        width: 34px;
        height: 34px;
    }
    .tj-bill-v {
        flex: none;
        margin: 0;
        font-size: 24px;
    }
    .tj-bill-v em {
        font-size: 12px;
    }
    .tj-stack {
        flex: 1;
        margin: 0;
    }
    .tj.is-live .tj-ch,
    .tj.is-live .tj-ch:first-child {
        min-height: 80vh;
    }
    .tj.is-live .tj-ch-long {
        justify-content: center;
        min-height: 140vh;
        padding-top: 0;
    }
    .tj.is-live .tj-ch-long .tj-ch-in {
        position: static;
    }
    .tj.is-live .tj-keys {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tj-rows li,
    .tj-stack i,
    .tj-ch::after,
    .tj-core *,
    .tj-face *,
    .tj-mark *,
    .tj-card,
    .c-tray {
        transition: none !important;
    }
    .tj-mark .m-eye {
        animation: none;
    }
    .tj-mark.is-fusing .m-bit,
    .tj-mark.is-fusing .m-block,
    .c-scan.is-on {
        animation: none;
    }
}

/* ---------- docs: open layout ---------- */

body.docs {
    --bg: #ffffff;
    --surface-2: #eef6fb;
}

html[data-theme="dark"] body.docs {
    --bg: #0b0f16;
    --surface-2: rgba(104, 193, 234, 0.1);
}

body.docs .hdr {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.5) blur(12px);
    -webkit-backdrop-filter: saturate(1.5) blur(12px);
}

body.docs .hdr-tab[aria-current] {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--accent);
    border-radius: 0;
}

body.docs .hdr-tab {
    border-radius: 0;
    height: var(--hdr);
    display: inline-flex;
    align-items: center;
}

body.docs .hdr-tab:hover {
    background: transparent;
}

body.docs .search-open {
    border-color: var(--line);
    border-radius: 999px;
    background: var(--bg);
    box-shadow: 0 1px 2px rgba(11, 15, 22, 0.04);
}

body.docs .side {
    border-right: 0;
    padding-top: 36px;
}

body.docs .nav-group+.nav-group {
    margin-top: 30px;
}

body.docs .nav-label {
    margin-left: 12px;
    font-size: 13.5px;
    letter-spacing: 0;
}

body.docs .nav-link {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 14.5px;
    color: var(--ink-soft);
    transition: background 0.15s, color 0.15s;
}

body.docs .nav-link:hover {
    background: transparent;
    color: var(--ink);
}

body.docs .nav-link[aria-current="page"] {
    background: var(--surface-2);
    color: var(--on-tint);
    font-weight: 500;
}

body.docs .main {
    padding-top: 44px;
}

body.docs .doc {
    max-width: 760px;
}

body.docs .crumbs {
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
}

body.docs .crumbs a {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: var(--muted);
}

body.docs .crumbs a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

body.docs .crumb-sep {
    color: var(--line-strong);
}

body.docs .crumb-here {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--on-tint);
}

body.docs .doc h1 {
    font-size: clamp(32px, 3.4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.028em;
    margin-bottom: 10px;
}

body.docs .lede {
    font-size: 18px;
    color: var(--muted);
}

body.docs .doc-meta {
    border-bottom: 0;
    padding-bottom: 0;
    margin: 18px 0 12px;
}

body.docs .copy-page {
    border-color: var(--line);
    border-radius: 999px;
    background: transparent;
}

body.docs .prose {
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink-soft);
}

body.docs .prose strong,
body.docs .prose dt {
    color: var(--ink);
}

body.docs .prose h2 {
    margin-top: 56px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.012em;
    color: var(--ink);
}

/* The page opens with its own heading, so the first section heading
   should not add another blank band above it. */
body.docs .prose > h2:first-child {
    margin-top: 8px;
}

body.docs .prose h3 {
    margin-top: 34px;
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
}

body.docs .prose :not(pre)>code {
    border: 0;
    padding: 2px 6px;
}

body.docs .prose a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

body.docs .prose a:hover {
    text-decoration-color: var(--accent);
}

body.docs .fig {
    border-color: var(--line);
    border-radius: 16px;
    background: var(--bg);
}

body.docs .fig-bar {
    border-bottom: 0;
    padding: 14px 18px 0;
}

body.docs .fig-tag {
    display: none;
}

body.docs .fig-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    text-wrap: balance;
}

body.docs .fig-expand {
    border: 0;
    border-radius: 999px;
}

body.docs .fig-expand:hover {
    background: var(--surface-2);
}

body.docs .fig-canvas {
    padding: 16px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

body.docs .fig-alt {
    border-top-color: transparent;
}

body.docs .tbl {
    border-radius: 14px;
    background: var(--bg);
}

body.docs .tbl th {
    background: transparent;
    text-transform: none;
}

body.docs .callout {
    border-radius: 14px;
    padding: 16px 18px;
}

body.docs .code {
    border-radius: 14px;
}

body.docs .tablist {
    gap: 6px;
}

body.docs .tab[aria-selected="true"] {
    color: var(--accent);
}

body.docs .toc {
    padding-top: 44px;
}

body.docs .toc-h {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
    font-weight: 500;
}

body.docs .toc-h::before {
    content: "";
    width: 14px;
    height: 10px;
    background: linear-gradient(currentColor 0 0) 0 0 / 100% 1.5px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 70% 1.5px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 85% 1.5px no-repeat;
    opacity: 0.7;
}

body.docs .toc ul {
    border-left: 1px solid var(--line);
}

body.docs .toc a {
    padding: 5px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    transition: color 0.15s;
}

body.docs .toc .toc-l3 a {
    padding-left: 12px;
}

body.docs .toc a.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}

body.docs .pager {
    border-top: 0;
    margin-top: 72px;
}

body.docs .pg-t {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
}

body.docs .pg-k {
    display: none;
}

body.docs .pg-prev .pg-t::before {
    content: "‹  ";
    color: var(--muted);
}

body.docs .pg-next .pg-t::after {
    content: "  ›";
    color: var(--muted);
}

body.docs .pager a:hover .pg-t {
    color: var(--accent);
}

body.docs .foot {
    background: var(--bg);
}


/* ---------- docs: reader helpers ---------- */

body.docs .nav-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.meta-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-left: 10px;
}

.meta-links a,
.share-page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.meta-links a:hover,
.share-page:hover {
    color: var(--accent);
    text-decoration: none;
}

.community {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 28px;
    margin: 64px 0 0;
    padding: 24px 26px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c-glacier) 16%, transparent), transparent 60%), var(--bg);
}

.community p {
    margin: 0;
    font-size: 14.5px;
    color: var(--muted);
    max-width: 46ch;
}

.community .cm-h {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.cm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 14px;
    border-radius: 999px;
}

.btn-sm svg {
    width: 15px;
    height: 15px;
}

body.docs .pager {
    margin-top: 40px;
}

body.docs .pg {
    border: 0;
    background: none;
    padding: 8px 0;
    box-shadow: none;
}

.toc-top {
    display: inline-block;
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}

.toc-top:hover {
    color: var(--accent);
    text-decoration: none;
}

.side {
    display: flex;
    flex-direction: column;
}

.side-in {
    flex: 1;
}

.side-collapse {
    position: sticky;
    bottom: 0;
    align-self: flex-start;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 24px 0 0 6px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.side-collapse:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.side-collapse svg {
    transition: transform 0.2s var(--ease);
}

@media (min-width: 901px) {
    body.side-collapsed {
        --side: 56px;
    }
    body.side-collapsed .side-in {
        display: none;
    }
    body.side-collapsed .side {
        padding-left: 12px;
    }
    body.side-collapsed .side-collapse {
        margin-top: 0;
    }
    body.side-collapsed .side-collapse svg {
        transform: rotate(180deg);
    }
}

@media (max-width: 900px) {
    .side-collapse {
        display: none;
    }
}



/* ---------- screenshots (OLake-style: framed media, centered caption) ---------- */

.shot {
    margin: 28px 0 36px;
}

.shot-frame {
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 20px 50px -40px color-mix(in srgb, var(--c-core) 35%, transparent);
}

.shot-chrome {
    display: flex;
    align-items: center;
    gap: 7px;
}

.shot-chrome span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line-strong);
    opacity: 0.55;
}

.shot-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.shot-demo {
    font-style: normal;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

.shot-bar p {
    margin: 0;
    justify-self: center;
    padding: 2px 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    background: var(--bg);
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shot-zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: var(--bg);
    cursor: zoom-in;
    transition: opacity 0.15s var(--ease);
}

.shot-zoom:hover {
    opacity: 0.96;
}

.shot-zoom img {
    display: block;
    width: 100%;
    height: auto;
}

.shot-dark {
    display: none !important;
}

html[data-theme="dark"] .shot-light {
    display: none !important;
}

html[data-theme="dark"] .shot-dark {
    display: block !important;
}

.shot figcaption {
    margin: 0;
    padding: 16px 32px 4px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
    text-align: center;
    max-width: 42rem;
    margin-inline: auto;
}

.tabpanel .shot {
    margin-top: 4px;
}

.zoom {
    width: min(1400px, 96vw);
    max-width: none;
    max-height: 94vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--bg);
    overflow: auto;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
}

.zoom::backdrop {
    background: rgba(11, 15, 22, 0.72);
    backdrop-filter: blur(4px);
}

.zoom img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-out;
}

.zoom-close {
    position: sticky;
    top: 10px;
    float: right;
    margin: 10px 10px -46px 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}


/* ---------- responsive ---------- */

@media (max-width: 1240px) {
    .shell {
        grid-template-columns: var(--side) minmax(0, 1fr);
    }
    .toc {
        display: none;
    }
    .toc-m {
        display: block;
    }
}

@media (max-width: 1024px) {
    .paths {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .foot-in {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
     :root {
        --side: min(300px, 86vw);
    }
    .hdr-in {
        gap: 12px;
        padding: 0 12px;
    }
    .hdr-end {
        gap: 2px;
    }
    .icon-btn,
    .hdr-menu,
    .search-open {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
    .hdr-menu {
        display: inline-grid;
    }
    .hdr-tabs {
        display: none;
    }
    .search-open {
        margin-right: 0;
        justify-content: center;
        padding: 0;
    }
    .so-text,
    .so-kbd {
        display: none;
    }
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }
    body.home-page > .side,
    body.notfound > .side {
        display: block;
    }
    .side {
        position: fixed;
        z-index: 30;
        top: var(--hdr);
        left: 0;
        bottom: 0;
        height: auto;
        width: var(--side);
        background: var(--bg);
        transform: translateX(-102%);
        transition: transform 0.22s var(--ease);
        padding-left: 16px;
    }
    body.nav-open .side {
        transform: none;
    }
    .main {
        padding: 28px 20px 72px;
    }
    .doc h1 {
        font-size: 32px;
    }
    .split {
        grid-template-columns: minmax(0, 1fr);
    }
    .sect {
        padding: 52px 0;
    }
    .anchor {
        display: none;
    }
}

@media (max-width: 560px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-actions .btn {
        justify-content: center;
    }
    .credit h2 {
        font-size: 48px;
    }
    .contributors {
        grid-template-columns: 1fr;
    }
    .foot-in {
        grid-template-columns: 1fr;
    }
    .pager {
        grid-template-columns: 1fr;
    }
    .pg-next,
    .pg-prev {
        grid-column: 1;
    }
    .doc-meta .copy-page {
        margin-left: 0;
    }
    .doc-meta {
        column-gap: 8px;
    }
    .meta-links {
        display: flex;
        flex: 1 0 100%;
        gap: 6px;
        margin: 4px 0 0;
    }
    .meta-links a,
    .share-page {
        min-height: 44px;
        padding: 7px 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
        white-space: nowrap;
    }
    .doc-meta .copy-page {
        flex: 1 0 100%;
        width: 100%;
        min-height: 44px;
    }
    .wrap {
        padding: 0 18px;
    }
    .lede {
        font-size: 17.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .hdr,
    .side,
    .toc,
    .pager,
    .foot,
    .copy,
    .fig-expand,
    .copy-page,
    .search-open {
        display: none !important;
    }
    .shell {
        display: block;
    }
    .code {
        color-scheme: light;
        background: #fff;
        color: #000;
        border-color: #999;
    }
}