/* 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; }

/* 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-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; }
}

/* This article: FAQ answer box, video clips, downloads, roadmap */
.ar-answer { margin: 26px 0 0; max-width: 820px; padding: 20px 22px; border: 1px solid rgba(255,43,47,.45); border-radius: 18px; background: linear-gradient(145deg, var(--red-soft), rgba(255,255,255,.02)); }
.ar-answer b { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.ar-answer p { margin: 0; font-size: 17px; color: #dfe4ec; }
.ar-clip { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #161212; }
.ar-clip video { display: block; width: 100%; height: auto; }
.ar-badge { position: absolute; z-index: 1; left: 12px; top: 12px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ar-badge.is-wrong { background: rgba(251,191,36,.92); color: #1a1405; }
.ar-badge.is-right { background: rgba(74,222,128,.92); color: #04170c; }
.ar-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; align-items: start; }
.ar-compare figure { margin: 0; }
.ar-compare .ar-shot { cursor: zoom-in; }
.ar-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.ar-dl { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); text-decoration: none; transition: border-color .2s, transform .2s; }
.ar-content a.ar-dl { color: var(--text); }
.ar-dl:hover { border-color: rgba(255,43,47,.55); transform: translateY(-2px); }
.ar-dl > .ico { width: 30px; height: 30px; color: var(--red); margin-top: 2px; }
.ar-dl strong { display: block; font-size: 16px; }
.ar-dl span { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.ar-dl em { display: inline-block; margin-top: 8px; font-style: normal; font-size: 12px; font-weight: 800; color: #ff9a9c; }
.ar-roadmap { margin: 22px 0; padding: 24px; border-radius: 20px; border: 1px dashed rgba(255,255,255,.22); background: var(--panel); }
.ar-roadmap h3 { margin-top: 0 !important; }
.ar-roadmap ul { margin-bottom: 0 !important; }
@media (max-width: 760px) {
    .ar-compare, .ar-downloads { grid-template-columns: 1fr; }
}

/* Editor tabs: one panel per code editor. Without JavaScript every panel shows, one after another. */
.ar-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; border-bottom: 1px solid var(--line); }
.ar-tab { appearance: none; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 9px 16px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.ar-tab:hover { color: var(--text); }
.ar-tab[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: inset 0 2px 0 var(--red); }
.ar-tab small { margin-left: 6px; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ar-tabs:not(.is-ready) { display: none; }
.ar-tab-panel { padding: 6px 0 0; }
.ar-tab-panel > h3:first-child { margin-top: 18px; }
.ar-tabs.is-ready ~ .ar-tab-panel > .ar-tab-title { display: none; }
.ar-steps { counter-reset: s; list-style: none; padding: 0 !important; }
.ar-steps > li { counter-increment: s; position: relative; padding-left: 42px; margin: 0 0 18px; }
.ar-steps > li::before { content: counter(s); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; font-weight: 900; }
.ar-steps figure { margin: 14px 0 0; }
.ar-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.ar-pair figure { margin: 0; }
@media (max-width: 700px) { .ar-pair { grid-template-columns: 1fr; } }
