/* Article styles. Everything this page needs lives in this folder; the only outside pieces are the site's
   ../../theme.css (color tokens + header) and ../../js/site-header.js, and both are optional. */

/* Fallback tokens: :where() has zero specificity, so the site's theme.css wins whenever it loads. */
:where(:root) {
    --bg: #080a0f;
    --bg-soft: #0d1119;
    --panel: #111722;
    --panel-2: #151d2a;
    --text: #f7f8fb;
    --muted: #a7afbc;
    --line: rgba(255,255,255,.11);
    --red: #ff2b2f;
    --red-2: #d90f1b;
    --red-soft: rgba(255,43,47,.16);
    --max: 1220px;
    --radius: 24px;
}
:root {
    --code: #0b0f16;
    --ok: #4ade80;
    --info: #7cb8ff;
    --warn: #fbbf24;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 4%, var(--red-soft), transparent 30%),
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: auto, 48px 48px, 48px 48px;
    z-index: -1;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
/* :where() keeps these below theme.css, so the site header lays out exactly as on the other pages */
:where(.container) { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* Fallback header, shown only when the site header script isn't available */
.ar-fallback-header { border-bottom: 1px solid var(--line); background: rgba(8,10,15,.85); }
.ar-fallback-header .container { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ar-fallback-header a { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .06em; text-decoration: none; }
.ar-fallback-header img { width: 28px; height: 28px; }
.ar-fallback-header .ar-fallback-link { font-size: 13px; letter-spacing: 0; color: var(--muted); }

/* Icons from the Incisor GUI, used as masks so they take the theme colors */
.ico {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -.2em;
    background: currentColor;
    -webkit-mask: var(--i) center / contain no-repeat;
    mask: var(--i) center / contain no-repeat;
    flex-shrink: 0;
}

/* Hero */
.ar-hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.ar-crumb { font-size: 13px; font-weight: 800; color: var(--muted); }
.ar-crumb a { text-decoration: none; }
.ar-crumb a:hover { color: var(--text); }
.ar-kicker { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--red); font-size: 12px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.ar-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.ar-hero h1 { margin: 14px 0 0; font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -.045em; }
.ar-hero h1 span { color: var(--red); }
.ar-lede { max-width: 720px; margin: 22px 0 0; font-size: clamp(17px, 2vw, 21px); color: #c7ced8; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.ar-pill { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.07); color: #cbd1db; }
.ar-pill.is-accent { background: var(--red); color: white; }
.ar-hero-icon {
    width: 150px; height: 150px; border-radius: 34px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--red), var(--red-2));
    box-shadow: 0 18px 50px var(--red-soft);
    color: white; font-size: 92px;
}

/* Layout: sticky contents on the left, article on the right */
.ar-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding: 56px 0 96px; }
.ar-toc { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.ar-toc-title { font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ar-toc a { padding: 6px 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 700; text-decoration: none; line-height: 1.35; }
.ar-toc a:hover { color: var(--text); }
.ar-toc a.is-current { color: var(--text); border-left-color: var(--red); background: linear-gradient(90deg, var(--red-soft), transparent); }
.ar-content { max-width: 800px; min-width: 0; }

/* Text */
.ar-content section { scroll-margin-top: 100px; padding-top: 12px; margin-bottom: 64px; }
.ar-content h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.035em; line-height: 1.1; margin: 0 0 18px; }
.ar-step { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-right: .3em; border-radius: 10px; background: var(--red); color: white; font-size: .8em; vertical-align: .08em; }
.ar-content h3 { font-size: 20px; letter-spacing: -.015em; margin: 34px 0 10px; }
.ar-content p, .ar-content li { color: #c7ced8; font-size: 16.5px; }
.ar-content p { margin: 0 0 14px; }
.ar-content strong { color: var(--text); }
.ar-content ul, .ar-content ol { padding-left: 22px; margin: 0 0 16px; }
.ar-content li { margin-bottom: 6px; }
.ar-content li::marker { color: var(--red); }
.ar-content a { color: #ff9a9c; text-underline-offset: 3px; }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em;
    color: #ffc2c3;
    background: var(--red-soft);
    padding: 1px 6px;
    border-radius: 6px;
    overflow-wrap: anywhere;
}

/* Cards */
.ar-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.ar-cards.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ar-card { padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.ar-card h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; }
.ar-card h4 .ico { color: var(--red); width: 22px; height: 22px; }
.ar-card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.ar-card .ar-num { display: block; font-size: 12px; font-weight: 900; letter-spacing: .14em; color: var(--red); margin-bottom: 8px; }

/* Figures: click to zoom */
figure { margin: 26px 0; }
.ar-shot { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #111; cursor: zoom-in; }
.ar-shot img { width: 100%; }
figcaption { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
figcaption strong { color: var(--text); }
.ar-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: start; margin: 26px 0; }
.ar-split figure { margin: 0; }
.ar-narrow { max-width: 580px; }
.ar-split.is-flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.ar-stack { display: grid; gap: 18px; }
.ar-tall { max-height: 640px; overflow: hidden; }
.ar-tall::after { content: ""; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(transparent, rgba(8,10,15,.95)); pointer-events: none; }

/* Lightbox */
.ar-lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px; background: rgba(4,5,8,.92); cursor: zoom-out; }
.ar-lightbox.is-open { display: grid; }
.ar-lightbox img { max-width: min(1400px, 100%); max-height: calc(100vh - 48px); width: auto; border-radius: 12px; border: 1px solid var(--line); }

/* Callouts */
.ar-note { display: flex; gap: 14px; margin: 22px 0; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ar-note > .ico { width: 24px; height: 24px; margin-top: 2px; color: var(--info); }
.ar-note p { margin: 0; font-size: 15px; }
.ar-note p + p { margin-top: 8px; }
.ar-note.is-tip { border-color: rgba(74,222,128,.3); background: rgba(74,222,128,.06); }
.ar-note.is-tip > .ico { color: var(--ok); }
.ar-note.is-warn { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.06); }
.ar-note.is-warn > .ico { color: var(--warn); }

/* Legend of GUI icons */
.ar-legend { list-style: none; padding: 0 !important; margin: 18px 0 !important; display: grid; gap: 8px; }
.ar-legend li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; }
.ar-legend .ar-key { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #2a2b2e; color: #e6e6e6; font-size: 20px; }
.ar-legend .ar-key.is-text { font-size: 10px; font-weight: 900; }
.ar-legend li > div > strong:first-child { display: block; font-size: 14.5px; }
.is-green { color: var(--ok) !important; }
.is-blue { color: var(--info) !important; }
.is-deepblue { color: #3d5cff !important; }
.is-yellow { color: var(--warn) !important; }
.is-red { color: var(--red) !important; }

/* Timeline diagram */
.ar-timeline { margin: 26px 0; padding: 22px 22px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.ar-timeline-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.ar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 34px; }
.ar-row-label { font-size: 13px; font-weight: 800; line-height: 1.2; }
.ar-row-label small { display: block; color: var(--muted); font-weight: 700; font-size: 11.5px; }
.ar-track { position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.05); }
.ar-bar {
    position: absolute; top: 0; bottom: 0;
    left: calc(var(--s) * 1%);
    width: calc(var(--w) * 1%);
    border-radius: 999px;
    background: linear-gradient(90deg, #3f8fa0, #5fb7c9);
    transform-origin: left;
}
.ar-js .ar-bar { transform: scaleX(0); }   /* bars start empty only when article.js can animate them */
.ar-bar.is-demand { background: linear-gradient(90deg, var(--red-2), var(--red)); }
.ar-timeline.is-playing .ar-bar { animation: ar-fill .5s ease-out forwards; animation-delay: calc(var(--s) * 28ms); }
@keyframes ar-fill { to { transform: scaleX(1); } }
.ar-ping { position: absolute; top: 50%; left: calc(var(--at) * 1%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: white; box-shadow: 0 0 0 3px var(--red); }
.ar-marks { position: relative; height: 38px; margin-left: 164px; margin-top: 8px; border-top: 1px dashed var(--line); }
.ar-mark { position: absolute; left: calc(var(--at) * 1%); top: 6px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.ar-mark::before { content: ""; position: absolute; left: 50%; top: -12px; width: 1px; height: 8px; background: var(--muted); }
.ar-mark.is-hl { color: var(--text); }
.ar-replay { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.ar-replay:hover { color: var(--text); border-color: var(--red); }

/* Code */
.ar-code { position: relative; margin: 20px 0; border-radius: 16px; border: 1px solid var(--line); background: var(--code); overflow: hidden; }
.ar-code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
.ar-copy { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 3px 10px; font: inherit; font-size: 11.5px; cursor: pointer; }
.ar-copy:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.ar-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #dfe4ec; }
.ar-code code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.ar-code .c { color: #7d8797; font-style: italic; }
.ar-code .k { color: #ff7a7d; }
.ar-code .s { color: #a5e3a1; }
.ar-code .n { color: #f7c46c; }
.ar-code .f { color: #8cc8ff; }

/* Tables */
.ar-table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: #c7ced8; }
th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }

/* Checklist */
.ar-checks { list-style: none; padding: 0 !important; }
.ar-checks li { position: relative; padding-left: 30px; }
.ar-checks li .ico { position: absolute; left: 0; top: .3em; color: var(--ok); }

.ar-footer { padding: 36px 0 52px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.ar-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ar-footer a { text-decoration: none; font-weight: 800; color: var(--text); }

@media (max-width: 1000px) {
    .ar-layout { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
    .ar-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding-bottom: 28px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
    .ar-toc-title { width: 100%; }
    .ar-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; }
    .ar-content { max-width: none; }
}
@media (max-width: 760px) {
    .ar-hero { padding: 44px 0 36px; }
    .ar-hero-grid { grid-template-columns: 1fr; }
    .ar-hero-icon { display: none; }
    .ar-cards, .ar-cards.is-3, .ar-split, .ar-split.is-flip { grid-template-columns: 1fr; }
    .ar-row { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
    .ar-ping { position: absolute; top: 50%; left: calc(var(--at) * 1%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: white; box-shadow: 0 0 0 3px var(--red); }
.ar-marks { margin-left: 106px; height: 52px; }
    .ar-mark { white-space: normal; width: 70px; text-align: center; line-height: 1.2; }
    .ar-tall { max-height: 520px; }
}
@media (max-width: 640px) {
    :where(.container) { width: min(100% - 24px, var(--max)); }
    .ar-content p, .ar-content li { font-size: 16px; }
    .ar-code pre { font-size: 12.5px; padding: 14px; }
    td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ar-js .ar-bar { transform: none; }
    .ar-timeline.is-playing .ar-bar { animation: none; }
}

/* Checklist (this article) */
.ck-wrap { max-width: 880px; margin: 0 auto; padding: 48px 0 96px; }
.ck-bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; justify-content: space-between; margin-top: 30px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.ck-progress { flex: 1; min-width: 220px; }
.ck-progress-label { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.ck-progress-label strong { color: var(--text); }
.ck-meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.ck-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red-2), var(--red)); transition: width .35s ease; }
.ck-bar-actions { display: flex; gap: 8px; }
.ck-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.ck-btn:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.ck-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ck-jumps a { text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); }
.ck-jumps a:hover { color: var(--text); border-color: rgba(255,43,47,.55); }

.ck-pass { scroll-margin-top: 96px; margin-top: 56px; }
.ck-pass-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--red); margin-bottom: 16px; }
.ck-pass-kicker { font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.ck-pass h2 { margin: 6px 0 0; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; line-height: 1.1; }
.ck-pass-lede { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.ck-pass-count { flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--muted); }

.ck-item { position: relative; margin-bottom: 12px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 16px; background: var(--panel); transition: border-color .2s, opacity .2s; }
.ck-item.is-done { border-left-color: var(--ok); }
.ck-head { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 18px 20px 4px; cursor: pointer; }
.ck-head input { position: absolute; opacity: 0; pointer-events: none; }
.ck-box { width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; border: 2px solid var(--red); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.ck-box::after { content: ""; width: 14px; height: 14px; background: white; -webkit-mask: var(--icon-checkmark) center / contain no-repeat; mask: var(--icon-checkmark) center / contain no-repeat; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.ck-head input:checked + .ck-box { background: var(--ok); border-color: var(--ok); }
.ck-head input:checked + .ck-box::after { opacity: 1; transform: none; }
.ck-head input:focus-visible + .ck-box { outline: 2px solid var(--red); outline-offset: 3px; }
.ck-title { display: block; font-size: 18px; font-weight: 850; letter-spacing: -.01em; line-height: 1.3; }
.ck-num { color: var(--red); margin-right: 8px; font-variant-numeric: tabular-nums; }
.ck-item.is-done .ck-title { color: var(--muted); }
.ck-item.is-done .ck-num { color: var(--ok); }
.ck-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ck-tag { font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; color: white; }
.ck-tag.is-download { background: #2f63d6; }
.ck-tag.is-runtime { background: #23855b; }
.ck-tag.is-cpu, .ck-tag.is-gpu { background: rgba(255,255,255,.1); color: #d7dce4; }
.ck-tag.is-loc { background: #7a4fd0; }
.ck-tag.is-ip { background: var(--red-2); }
.ck-tag.is-new { background: transparent; color: var(--red); border: 1px solid var(--red); }
.ck-why { margin: 8px 20px 0 62px; color: #c7ced8; font-size: 15.5px; }
.ck-why p { margin: 0; }
.ck-how { margin: 10px 20px 0 62px; padding-bottom: 16px; }
.ck-how summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 800; color: #ff9a9c; }
.ck-how summary::-webkit-details-marker { display: none; }
.ck-how summary::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; border: 1px solid currentColor; font-size: 13px; line-height: 1; }
.ck-how[open] summary::before { content: "−"; }
.ck-how summary:hover { color: var(--text); }
.ck-how-body { margin-top: 12px; }
.ck-how-body p, .ck-how-body li { color: #c7ced8; font-size: 15px; }
.ck-how-body p { margin: 0 0 10px; }
.ck-how-body ul, .ck-how-body ol { margin: 0 0 12px; padding-left: 20px; }
.ck-how-body li { margin-bottom: 5px; }
.ck-how-body li::marker { color: var(--red); }
.ck-how-body strong { color: var(--text); }
.ck-how-body a { color: #ff9a9c; text-underline-offset: 3px; }
.ck-how-body figure { margin: 14px 0; }
.ck-how-body .ar-code { margin: 14px 0; }
.ck-how-body .ar-note { margin: 14px 0; }
.ck-item:not(:has(.ck-how)) { padding-bottom: 16px; }

.ck-final { margin-top: 56px; padding: 26px 26px 12px; border-radius: 20px; border: 1px solid rgba(255,43,47,.45); background: linear-gradient(145deg, var(--red-soft), rgba(255,255,255,.02)); scroll-margin-top: 96px; }
.ck-final h2 { margin: 6px 0 14px; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; }
.ck-final .ck-item { background: rgba(8,10,15,.45); }
.ck-final .ck-title { font-size: 16px; font-weight: 750; }

.ck-float { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(17,23,34,.94); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px; font-weight: 800; color: var(--text); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.ck-float.is-visible { opacity: 1; transform: none; }
.ck-float .ico { color: var(--ok); width: 18px; height: 18px; }
.ck-float.is-complete { border-color: var(--ok); }

@media (max-width: 640px) {
    .ck-head { padding: 16px 16px 4px; gap: 12px; }
    .ck-why, .ck-how { margin-left: 16px; margin-right: 16px; }
    .ck-pass-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ck-final { padding: 20px 14px 8px; }
}
