@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ===========================================================================
   StixsworldHD — Ungodly AI Overhaul · Install Guide
   Design system: "Operating Theatre"
   Clinical teal + triage amber on a surgical-dark ground. Squared technical
   display type (Chakra Petch) over a humanist body (IBM Plex Sans), with
   IBM Plex Mono carrying every file path, key and section number.
   Author: StixsworldHD (StixsmasterHD4k)
   =========================================================================== */

/* ---- Tokens ------------------------------------------------------------- */
:root {
    /* Surgical-dark ground */
    --bg:          #0a1413;
    --bg-grad-a:   #0b1716;
    --bg-grad-b:   #081110;
    --surface:     #0f1f1d;
    --surface-2:   #132825;
    --surface-3:   #16302c;
    --line:        #1f3a36;
    --line-soft:   #18302c;

    /* Vital-signs phosphor + triage */
    --teal:        #23e3c9;
    --teal-bright: #5cf2dd;
    --teal-deep:   #0f9d89;
    --teal-ghost:  rgba(35, 227, 201, .10);
    --teal-glow:   rgba(35, 227, 201, .28);
    --amber:       #ffb02e;
    --amber-deep:  #e0891a;
    --amber-ghost: rgba(255, 176, 46, .10);
    --red:         #ff5d6c;
    --red-ghost:   rgba(255, 93, 108, .10);

    /* Ink */
    --ink:         #e9f5f2;
    --ink-dim:     #a3bdb7;
    --ink-faint:   #6f8e88;
    --ink-ghost:   #4f6b66;

    /* Type */
    --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
    --body:    'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    --mono:    'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    /* Metrics */
    --rail: 268px;
    --topbar-h: 60px;
    --measure: 70ch;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 18px 50px -22px rgba(0,0,0,.85);
    --shadow-lg: 0 40px 90px -30px rgba(0,0,0,.9);
    --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 20px); }
body {
    margin: 0;
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.68;
    color: var(--ink);
    background:
        radial-gradient(1100px 600px at 78% -8%, rgba(35,227,201,.07), transparent 60%),
        radial-gradient(900px 540px at -6% 4%, rgba(255,176,46,.045), transparent 55%),
        linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-bright); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--teal-glow); color: #03100e; }

/* Faint scanline / drape texture over the whole page */
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
    pointer-events: none; z-index: 1; mix-blend-mode: overlay;
}

/* ---- Skip link ---------------------------------------------------------- */
.skip {
    position: fixed; top: -60px; left: 16px; z-index: 200;
    background: var(--teal); color: #03100e; font-family: var(--display);
    font-weight: 600; padding: 10px 16px; border-radius: 0 0 10px 10px;
    transition: top .2s var(--ease);
}
.skip:focus { top: 0; color: #03100e; }

/* ===========================================================================
   Top bar
   =========================================================================== */
.topbar {
    position: sticky; top: 0; z-index: 90;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 18px;
    padding: 0 22px;
    background: linear-gradient(180deg, rgba(10,20,19,.92), rgba(10,20,19,.74));
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brandmark {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
    display: grid; place-items: center;
    background: radial-gradient(circle at 35% 30%, #123c37, #071513);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px rgba(35,227,201,.12), 0 0 22px -6px var(--teal-glow);
    color: var(--teal);
}
.brandmark svg { width: 20px; height: 20px; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.topbar__title b {
    font-family: var(--display); font-weight: 700; font-size: 14.5px; letter-spacing: .3px;
    color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__title span { font-size: 11px; color: var(--ink-faint); letter-spacing: .4px; font-family: var(--mono); }
.topbar__spacer { flex: 1 1 auto; }
.verpill {
    font-family: var(--mono); font-size: 11.5px; font-weight: 500;
    color: var(--teal); background: var(--teal-ghost);
    border: 1px solid rgba(35,227,201,.32); border-radius: 999px;
    padding: 5px 12px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 7px;
}
.verpill::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--teal); box-shadow: 0 0 8px var(--teal);
    animation: blip 2.4s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.topbar__ghlink { color: var(--ink-dim); font-size: 13px; font-weight: 500; white-space: nowrap; }
.topbar__ghlink:hover { color: var(--teal); }

.menu-btn {
    display: none; width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
    cursor: pointer; place-items: center;
}
.menu-btn svg { width: 22px; height: 22px; }

/* ===========================================================================
   Shell layout
   =========================================================================== */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); position: relative; z-index: 2; }

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar {
    position: sticky; top: var(--topbar-h);
    align-self: start;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto; overscroll-behavior: contain;
    border-right: 1px solid var(--line);
    padding: 26px 16px 60px;
    background: linear-gradient(180deg, rgba(13,28,26,.5), rgba(8,17,16,.2));
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

.navgroup { margin-bottom: 22px; }
.navgroup__label {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--ink-ghost); padding: 0 12px 8px; display: flex; align-items: center; gap: 8px;
}
.navgroup__label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.navlink {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 10px;
    color: var(--ink-dim); font-weight: 500; font-size: 14px;
    position: relative; transition: background .16s var(--ease), color .16s var(--ease);
}
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink__plate {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    color: var(--ink-faint); background: var(--surface);
    border: 1px solid var(--line); border-radius: 6px;
    width: 26px; height: 22px; display: grid; place-items: center; flex: 0 0 auto;
    transition: inherit;
}
.navlink.is-active { background: var(--teal-ghost); color: var(--ink); }
.navlink.is-active::before {
    content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 22px; border-radius: 3px;
    background: var(--teal); box-shadow: 0 0 12px var(--teal-glow);
}
.navlink.is-active .navlink__plate {
    color: #03100e; background: var(--teal); border-color: var(--teal);
}

.sidebar__cta {
    margin: 28px 8px 0; padding: 16px; border-radius: var(--radius-sm);
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
}
.sidebar__cta p { margin: 0 0 12px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
.sidebar__cta .btn { width: 100%; justify-content: center; }

/* Sidebar backdrop (mobile) */
.nav-backdrop {
    display: none; position: fixed; inset: 0; z-index: 80;
    background: rgba(4,9,8,.62); backdrop-filter: blur(2px);
}

/* ---- Content ------------------------------------------------------------ */
.content { min-width: 0; padding: 0; }
.content__inner {
    max-width: 1180px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(0,1fr) 224px; gap: 52px;
    padding: 44px 44px 96px;
}
.main { min-width: 0; }
.has-toc .main { max-width: var(--measure); }

/* On-this-page TOC */
.toc { position: sticky; top: calc(var(--topbar-h) + 32px); align-self: start; height: max-content; }
.toc__label {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--ink-ghost); margin-bottom: 12px; padding-left: 14px;
}
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc__list a {
    display: block; padding: 6px 14px; font-size: 13px; color: var(--ink-faint);
    border-left: 2px solid transparent; margin-left: -1px; line-height: 1.4;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--teal); border-left-color: var(--teal); }
.toc__sub a { padding-left: 28px; font-size: 12.5px; }

/* ===========================================================================
   Page header / breadcrumb
   =========================================================================== */
.crumb {
    font-family: var(--mono); font-size: 12px; color: var(--ink-ghost);
    display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
}
.crumb a { color: var(--ink-faint); }
.crumb a:hover { color: var(--teal); }
.crumb svg { width: 13px; height: 13px; opacity: .6; }

.page-eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--teal); background: var(--teal-ghost);
    border: 1px solid rgba(35,227,201,.26); border-radius: 999px;
    padding: 5px 13px; margin-bottom: 18px;
}
.page-eyebrow svg { width: 14px; height: 14px; }

h1.page-title {
    font-family: var(--display); font-weight: 700; letter-spacing: -.4px;
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.04;
    margin: 0 0 16px; color: var(--ink);
}
.page-lead { font-size: 1.12rem; color: var(--ink-dim); max-width: 64ch; margin: 0 0 8px; line-height: 1.6; }

.page-divider { height: 1px; background: linear-gradient(90deg, var(--line), transparent); margin: 32px 0; border: 0; }

/* ===========================================================================
   Prose
   =========================================================================== */
.main h2 {
    font-family: var(--display); font-weight: 600; letter-spacing: -.2px;
    font-size: 1.55rem; line-height: 1.18; color: var(--ink);
    margin: 52px 0 16px; padding-top: 8px; scroll-margin-top: calc(var(--topbar-h) + 24px);
    display: flex; align-items: baseline; gap: 12px;
}
.main h2 .h2num {
    font-family: var(--mono); font-size: .82rem; font-weight: 600; color: var(--teal);
    background: var(--teal-ghost); border: 1px solid rgba(35,227,201,.24);
    border-radius: 6px; padding: 2px 8px; transform: translateY(-3px);
}
.main h3 {
    font-family: var(--display); font-weight: 600; font-size: 1.16rem; color: var(--ink);
    margin: 32px 0 12px; scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.main p { margin: 0 0 16px; color: var(--ink-dim); }
.main p strong, .main li strong { color: var(--ink); font-weight: 600; }
.main ul, .main ol { margin: 0 0 18px; padding-left: 0; list-style: none; }
.main ul li, .main ol li { position: relative; padding-left: 26px; margin-bottom: 10px; color: var(--ink-dim); }
.main ul li::before {
    content: ""; position: absolute; left: 4px; top: .62em;
    width: 7px; height: 7px; border-radius: 2px;
    background: var(--teal); box-shadow: 0 0 8px -1px var(--teal-glow); transform: rotate(45deg);
}
.main ol { counter-reset: li; }
.main ol li { counter-increment: li; padding-left: 34px; }
.main ol li::before {
    content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: .05em;
    font-family: var(--mono); font-size: .76rem; font-weight: 600; color: var(--amber);
    background: var(--amber-ghost); border: 1px solid rgba(255,176,46,.26);
    border-radius: 5px; width: 24px; height: 22px; display: grid; place-items: center;
}
.lead-block { font-size: 1.05rem; color: var(--ink-dim); }

/* Inline code + keycaps */
code.ic-inline, .main p code, .main li code, .main td code {
    font-family: var(--mono); font-size: .86em; color: var(--teal-bright);
    background: rgba(35,227,201,.08); border: 1px solid rgba(35,227,201,.18);
    border-radius: 5px; padding: .1em .42em; white-space: nowrap;
}
kbd {
    font-family: var(--mono); font-size: .82em; font-weight: 600; color: var(--ink);
    background: linear-gradient(180deg, var(--surface-3), var(--surface));
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
    padding: .14em .5em; box-shadow: 0 1px 0 rgba(0,0,0,.4);
}

/* ===========================================================================
   Hero (home)
   =========================================================================== */
.hero { position: relative; margin: 8px 0 8px; }
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--ink-faint); margin-bottom: 22px;
}
.hero__eyebrow b { color: var(--teal); font-weight: 600; }
.hero__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.hero h1 {
    font-family: var(--display); font-weight: 700; letter-spacing: -1px;
    font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.4rem); line-height: .98; margin: 0 0 22px; color: var(--ink);
}
.hero h1 em { font-style: normal; color: transparent;
    background: linear-gradient(100deg, var(--teal), var(--teal-bright) 45%, var(--amber));
    -webkit-background-clip: text; background-clip: text;
}
.hero__sub { font-size: 1.18rem; color: var(--ink-dim); max-width: 60ch; margin: 0 0 30px; line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }

/* Vital monitor panel */
.monitor {
    margin: 40px 0 8px; border-radius: var(--radius);
    background: linear-gradient(180deg, #08110f, #0a1614);
    border: 1px solid var(--line); box-shadow: var(--shadow);
    overflow: hidden;
}
.monitor__bar {
    display: flex; align-items: center; gap: 14px; padding: 12px 18px;
    border-bottom: 1px solid var(--line); background: rgba(13,28,26,.5);
    font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
}
.monitor__leds { display: flex; gap: 7px; }
.monitor__leds i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.led-r { background: #ff5d6c; box-shadow: 0 0 7px #ff5d6c; }
.led-a { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.led-g { background: var(--teal); box-shadow: 0 0 7px var(--teal); }
.monitor__bar b { color: var(--ink-dim); font-weight: 500; letter-spacing: .5px; }
.monitor__status { margin-left: auto; color: var(--teal); display: inline-flex; align-items: center; gap: 8px; }
.monitor__status::before { content:""; width:7px; height:7px; border-radius:50%; background: var(--teal); box-shadow:0 0 8px var(--teal); animation: blip 2s infinite; }
.monitor__ekg { display: block; width: 100%; height: 124px; }
.ekg-line { fill: none; stroke: var(--teal); stroke-width: 2; filter: drop-shadow(0 0 6px var(--teal-glow)); }
.ekg-dash { stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: trace 4.6s var(--ease) forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.monitor__readout {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
}
.readout {
    padding: 16px 18px; border-right: 1px solid var(--line-soft);
}
.readout:last-child { border-right: 0; }
.readout span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-ghost); display: block; margin-bottom: 5px; }
.readout b { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--teal); line-height: 1; }
.readout.amber b { color: var(--amber); }
.readout small { font-size: 11px; color: var(--ink-faint); display: block; margin-top: 4px; }

/* ===========================================================================
   Buttons
   =========================================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--display); font-weight: 600; font-size: 14.5px; letter-spacing: .2px;
    padding: 11px 20px; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent; transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
    white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: linear-gradient(180deg, var(--teal), var(--teal-deep)); color: #03100e; box-shadow: 0 10px 28px -12px var(--teal-glow); }
.btn--primary:hover { color: #03100e; transform: translateY(-1px); box-shadow: 0 16px 34px -12px var(--teal-glow); }
.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { color: var(--ink); border-color: var(--teal-deep); background: var(--surface-3); transform: translateY(-1px); }
.btn--amber { background: linear-gradient(180deg, var(--amber), var(--amber-deep)); color: #1a1003; }
.btn--amber:hover { color: #1a1003; transform: translateY(-1px); }

/* ===========================================================================
   Cards & grids
   =========================================================================== */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: linear-gradient(170deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; position: relative; transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.card--link:hover { border-color: var(--teal-deep); transform: translateY(-2px); }
.card__ic {
    width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
    background: var(--teal-ghost); border: 1px solid rgba(35,227,201,.22); color: var(--teal); margin-bottom: 14px;
}
.card__ic.amber { background: var(--amber-ghost); border-color: rgba(255,176,46,.22); color: var(--amber); }
.card__ic svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin: 0 0 7px; }
.card p { margin: 0; color: var(--ink-dim); font-size: .95rem; line-height: 1.55; }
.card__tag {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--ink-faint); margin-bottom: 10px; display: inline-block;
}
.card__more { margin-top: 14px; font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--teal); display: inline-flex; align-items: center; gap: 7px; }
.card--link:hover .card__more svg { transform: translateX(3px); }
.card__more svg { width: 15px; height: 15px; transition: transform .16s var(--ease); }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 28px 0; }
.stat { background: var(--surface); padding: 20px 18px; }
.stat b { font-family: var(--display); font-weight: 700; font-size: 1.9rem; color: var(--teal); display: block; line-height: 1; }
.stat.amber b { color: var(--amber); }
.stat span { font-size: 12.5px; color: var(--ink-faint); margin-top: 7px; display: block; }

/* ===========================================================================
   Procedure step plates  (the signature device)
   =========================================================================== */
.steps { counter-reset: step; margin: 8px 0; }
.step {
    position: relative; padding: 0 0 8px 78px; margin-bottom: 8px;
}
.step::before {
    counter-increment: step; content: counter(step, decimal-leading-zero);
    position: absolute; left: 0; top: 0;
    width: 54px; height: 54px; border-radius: 13px;
    font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink);
    background: linear-gradient(165deg, var(--surface-3), var(--surface));
    border: 1px solid var(--line);
    display: grid; place-items: center;
    box-shadow: inset 0 0 0 1px rgba(35,227,201,.06);
}
.step::after {
    content: ""; position: absolute; left: 26px; top: 60px; bottom: -2px; width: 2px;
    background: linear-gradient(180deg, var(--line), transparent);
}
.step:last-child::after { display: none; }
.step__plate-led {
    position: absolute; left: 43px; top: 9px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--teal); box-shadow: 0 0 9px var(--teal); z-index: 2;
}
.step__head { display: flex; align-items: center; gap: 12px; min-height: 54px; margin-bottom: 4px; }
.step__title { font-family: var(--display); font-weight: 600; font-size: 1.22rem; color: var(--ink); margin: 0; }
.step__tag {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase;
    color: var(--amber); border: 1px solid rgba(255,176,46,.28); background: var(--amber-ghost);
    border-radius: 5px; padding: 3px 8px;
}
.step__body { padding-top: 4px; }
.step__body > :last-child { margin-bottom: 0; }

/* ===========================================================================
   Callouts (clinical notes)
   =========================================================================== */
.note {
    display: grid; grid-template-columns: auto 1fr; gap: 14px;
    border-radius: var(--radius-sm); padding: 16px 18px; margin: 22px 0;
    border: 1px solid var(--line); background: var(--surface);
    border-left: 3px solid var(--teal);
}
.note__ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--teal); background: var(--teal-ghost); flex: 0 0 auto; }
.note__ic svg { width: 19px; height: 19px; }
.note__body { min-width: 0; }
.note__body > :last-child { margin-bottom: 0; }
.note__kicker { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .4px; text-transform: uppercase; color: var(--teal); display: block; margin-bottom: 4px; }
.note p { margin: 0 0 8px; color: var(--ink-dim); font-size: .95rem; }
.note--caution { border-left-color: var(--amber); }
.note--caution .note__ic { color: var(--amber); background: var(--amber-ghost); }
.note--caution .note__kicker { color: var(--amber); }
.note--critical { border-left-color: var(--red); }
.note--critical .note__ic { color: var(--red); background: var(--red-ghost); }
.note--critical .note__kicker { color: var(--red); }

/* ===========================================================================
   Code / file path blocks
   =========================================================================== */
.codeblock { margin: 20px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #060d0c; overflow: hidden; box-shadow: var(--shadow); }
.codeblock__bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: rgba(13,28,26,.6); border-bottom: 1px solid var(--line); }
.codeblock__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); }
.codeblock__name { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-left: 4px; }
.codeblock__name b { color: var(--teal); font-weight: 500; }
.copy-btn {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
    padding: 4px 9px; cursor: pointer; transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--teal); border-color: var(--teal-deep); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.copied { color: var(--teal); border-color: var(--teal-deep); }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.codeblock code, .codeblock pre { font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink); }
.codeblock .c-dim { color: var(--ink-faint); }
.codeblock .c-key { color: var(--teal-bright); }
.codeblock .c-val { color: var(--amber); }
.codeblock .c-cmt { color: var(--ink-ghost); font-style: italic; }
.codeblock .c-path { color: var(--teal); }

/* path pill inline */
.pathpill {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    font-family: var(--mono); font-size: 13px; color: var(--ink);
    background: #060d0c; border: 1px solid var(--line); border-radius: 9px;
    padding: 9px 12px; margin: 6px 0;
}
.pathpill svg { width: 15px; height: 15px; color: var(--teal); flex: 0 0 auto; }
.pathpill span { overflow-x: auto; white-space: nowrap; }

/* ===========================================================================
   Directory tree renderer
   =========================================================================== */
.tree {
    font-family: var(--mono); font-size: 13px; line-height: 2;
    background: #060d0c; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 18px 20px; margin: 20px 0; overflow-x: auto; box-shadow: var(--shadow);
}
.tree .t-row { white-space: nowrap; color: var(--ink-dim); }
.tree .t-dir { color: var(--teal); }
.tree .t-dir b { color: var(--teal-bright); font-weight: 600; }
.tree .t-file { color: var(--ink-dim); }
.tree .t-conn { color: var(--ink-ghost); }
.tree .t-new { color: var(--amber); }
.tree .t-tag { color: var(--ink-ghost); font-style: italic; }
.tree .t-tag.t-tag--new { color: var(--amber); font-style: normal; }

/* ===========================================================================
   Scan frames (screenshots) + lightbox
   =========================================================================== */
.scan { margin: 24px 0; }
.scan__frame {
    position: relative; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); background: #060d0c; cursor: zoom-in;
    box-shadow: var(--shadow); transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.scan__frame:hover { border-color: var(--teal-deep); transform: translateY(-2px); }
.scan__frame img { width: 100%; height: auto; display: block; }
.scan__bar {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px;
    border-bottom: 1px solid var(--line); background: rgba(13,28,26,.65);
    font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
}
.scan__bar .led-g { width: 9px; height: 9px; border-radius: 50%; }
.scan__bar b { color: var(--ink-dim); font-weight: 500; }
.scan__zoom {
    position: absolute; right: 12px; bottom: 12px; z-index: 3;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 11px; color: var(--ink);
    background: rgba(6,13,12,.82); border: 1px solid var(--line); border-radius: 8px;
    padding: 6px 10px; backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .18s var(--ease);
}
.scan__frame:hover .scan__zoom { opacity: 1; }
.scan__zoom svg { width: 14px; height: 14px; color: var(--teal); }
.scan__cap { font-size: 13px; color: var(--ink-faint); margin-top: 12px; padding-left: 4px; }
.scan__cap b { color: var(--ink-dim); font-weight: 600; }

/* Lightbox overlay */
.lightbox {
    position: fixed; inset: 0; z-index: 300; display: none;
    align-items: center; justify-content: center;
    background: rgba(3,8,7,.9); backdrop-filter: blur(8px);
    padding: 4vh 4vw;
}
.lightbox.is-open { display: flex; animation: lb-in .22s var(--ease); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox__stage { position: relative; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox__imgwrap { overflow: auto; max-width: 92vw; max-height: 84vh; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.lightbox__img { display: block; max-width: 88vw; max-height: 82vh; width: auto; height: auto; cursor: zoom-in; }
.lightbox__img.actual { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox__cap {
    margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.lightbox__cap b { color: var(--teal); font-weight: 500; }
.lightbox__hint { color: var(--ink-ghost); }
.lightbox__close {
    position: absolute; top: -8px; right: -8px; z-index: 2;
    width: 42px; height: 42px; border-radius: 11px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
    display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.lightbox__close:hover { color: var(--red); border-color: var(--red); }
.lightbox__close svg { width: 22px; height: 22px; }

/* ===========================================================================
   Tables
   =========================================================================== */
.tablewrap { margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tablescroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 540px; }
table.data thead th {
    text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .8px; text-transform: uppercase;
    color: var(--ink-faint); background: rgba(13,28,26,.6); padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink-dim); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(35,227,201,.035); }
table.data .num { font-family: var(--mono); font-weight: 600; color: var(--teal); width: 1%; white-space: nowrap; }
table.data .sec-name { font-family: var(--display); font-weight: 600; color: var(--ink); white-space: nowrap; }
.rowtag-new {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase;
    color: #1a1003; background: var(--amber); border-radius: 4px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; font-weight: 600;
}

/* ===========================================================================
   Mode cards / feature anchors
   =========================================================================== */
.modegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 22px 0; }
.mode {
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px;
    background: linear-gradient(170deg, var(--surface-2), var(--surface)); position: relative;
}
.mode__name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--teal); margin: 0 0 2px; }
.mode__tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; display: block; }
.mode p { margin: 0; font-size: .92rem; color: var(--ink-dim); line-height: 1.5; }

.feature-block { padding-top: 12px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.feature-block__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.feature-block__ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-ghost); border: 1px solid rgba(35,227,201,.22); color: var(--teal); flex: 0 0 auto; }
.feature-block__ic svg { width: 24px; height: 24px; }
.feature-block__head h2 { margin: 0; padding: 0; }

.spec {
    display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; margin: 18px 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--surface);
}
.spec dt { font-family: var(--mono); font-size: 12px; color: var(--teal); white-space: nowrap; }
.spec dd { margin: 0; color: var(--ink-dim); font-size: .94rem; }
.spec dd code { font-size: .85em; }

/* hooks list */
.hooks { margin: 18px 0; display: grid; gap: 8px; }
.hook { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.hook code { font-family: var(--mono); font-size: 12px; color: var(--teal-bright); background: rgba(35,227,201,.06); border: 1px solid rgba(35,227,201,.16); border-radius: 6px; padding: 4px 8px; white-space: nowrap; align-self: start; }
.hook span { color: var(--ink-dim); font-size: .92rem; }

/* ===========================================================================
   FAQ / disclosure
   =========================================================================== */
.faq { margin: 8px 0; }
.faq details {
    border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px;
    background: var(--surface); overflow: hidden;
}
.faq details[open] { border-color: var(--teal-deep); }
.faq summary {
    list-style: none; cursor: pointer; padding: 16px 18px;
    font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--ink);
    display: flex; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q { font-family: var(--mono); font-size: 12px; color: var(--amber); flex: 0 0 auto; }
.faq summary .chev { margin-left: auto; width: 18px; height: 18px; color: var(--ink-faint); transition: transform .2s var(--ease); flex: 0 0 auto; }
.faq details[open] summary .chev { transform: rotate(90deg); color: var(--teal); }
.faq__body { padding: 0 18px 18px 18px; }
.faq__body > :first-child { margin-top: 0; }
.faq__body > :last-child { margin-bottom: 0; }
.faq__body p, .faq__body li { font-size: .95rem; }

/* ===========================================================================
   Next / prev pager
   =========================================================================== */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 0; }
.pager__link {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
    background: var(--surface); transition: border-color .16s var(--ease), transform .16s var(--ease);
    display: flex; flex-direction: column; gap: 4px;
}
.pager__link:hover { border-color: var(--teal-deep); transform: translateY(-2px); }
.pager__dir { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-ghost); display: flex; align-items: center; gap: 7px; }
.pager__dir svg { width: 14px; height: 14px; }
.pager__title { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.pager__link--next { text-align: right; align-items: flex-end; }
.pager__link--next .pager__dir { flex-direction: row-reverse; }

/* ===========================================================================
   Footer
   =========================================================================== */
.footer { border-top: 1px solid var(--line); background: rgba(8,17,16,.5); position: relative; z-index: 2; }
.footer__inner { max-width: 1180px; margin: 0 auto; padding: 40px 44px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand b { font-family: var(--display); font-weight: 700; color: var(--ink); }
.footer__brand span { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.footer__meta { font-size: 13px; color: var(--ink-faint); max-width: 52ch; line-height: 1.5; }
.footer__meta a { color: var(--teal); }
.footer__author { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.footer__author b { color: var(--teal); font-weight: 500; }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 1080px) {
    .content__inner { grid-template-columns: minmax(0,1fr); gap: 0; }
    .toc { display: none; }
    .has-toc .main { max-width: none; }
}
@media (max-width: 860px) {
    :root { --topbar-h: 56px; }
    .menu-btn { display: grid; }
    .topbar__ghlink { display: none; }
    .shell { grid-template-columns: minmax(0,1fr); }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 290px; height: 100vh; z-index: 100;
        transform: translateX(-100%); transition: transform .26s var(--ease);
        background: linear-gradient(180deg, #0c1c1a, #081413);
        padding-top: 80px;
    }
    .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .nav-backdrop.is-open { display: block; }
    .content__inner { padding: 30px 22px 80px; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .stats, .monitor__readout { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .pager { grid-template-columns: 1fr; }
    .footer__inner { padding: 30px 22px; }
    .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 460px) {
    .step { padding-left: 0; }
    .step::before { position: static; margin-bottom: 12px; }
    .step::after { display: none; }
    .step__plate-led { display: none; }
    .monitor__readout, .stats { grid-template-columns: 1fr; }
    .readout, .stat { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

/* ---- Motion / a11y ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .ekg-dash { stroke-dashoffset: 0; }
}
