/* === Tokens ================================================================ */
:root {
    --bg:          #fbf8f3;
    --surface:     #f3ede3;
    --card:        #ffffff;
    --text:        #1f1b16;
    --muted:       #655c52;
    --border:      #e6dccd;
    --accent:      #9a5b0b;
    --accent-hover:#7a4708;
    --accent-soft: rgba(154, 91, 11, 0.09);
    --on-accent:   #ffffff;
    --danger:      #b42318;
    --success:     #1f7a4c;
    --header-bg:   rgba(251, 248, 243, 0.88);
    --shadow:      0 1px 2px rgba(40, 25, 10, 0.05), 0 10px 30px rgba(40, 25, 10, 0.08);

    /* The white-on-blue of KooperEdit */
    --dos-blue:    #0b2a8f;
    --dos-text:    #f4f4f4;
    --dos-dim:     #8fb2ff;
    --dos-yellow:  #ffe066;

    --font: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    --radius: 12px;
    --header-h: 64px;
    --footer-h: 48px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg:          #15120f;
    --surface:     #1c1814;
    --card:        #221d18;
    --text:        #f0e9df;
    --muted:       #a99f92;
    --border:      #332c25;
    --accent:      #e5ad52;
    --accent-hover:#f2c578;
    --accent-soft: rgba(229, 173, 82, 0.12);
    --on-accent:   #1a1206;
    --danger:      #f97066;
    --success:     #4cc38a;
    --header-bg:   rgba(21, 18, 15, 0.88);
    --shadow:      0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
    margin: 0;
    padding-bottom: var(--footer-h);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--accent-soft);
    padding: 0.1em 0.35em;
    border-radius: 5px;
}
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow    { width: min(760px, 100% - 2.5rem); }

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--accent); color: var(--on-accent);
    padding: 0.5rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 0.5rem; }

/* === Buttons =============================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font: inherit; font-weight: 600;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-hover); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn svg { width: 20px; height: 20px; }

/* === Header ================================================================ */
#site-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand {
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 700; font-size: 1.1rem;
    color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); }
#nav-links { list-style: none; display: flex; align-items: center; gap: 0.3rem; margin: 0; padding: 0; }
#nav-links a {
    display: block; padding: 0.4rem 0.8rem; border-radius: 8px;
    color: var(--muted); text-decoration: none; font-weight: 500;
}
#nav-links a:hover, #nav-links a.active { color: var(--text); background: var(--accent-soft); }
.menu-toggle { display: none; }

/* Utilities dropdown (utility pages) */
.dropdown { position: relative; }
.dropdown-toggle {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.8rem; border: 0; border-radius: 8px;
    background: none; color: var(--muted);
    font: inherit; font-weight: 500; cursor: pointer;
}
.dropdown-toggle:hover, .dropdown-toggle[aria-expanded="true"],
.dropdown:has(.dropdown-all a.active) .dropdown-toggle { color: var(--text); background: var(--accent-soft); }
.dropdown-toggle svg {
    width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s;
}
.dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 60;
    min-width: 15rem; margin: 0; padding: 0.4rem;
    list-style: none;
    background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.dropdown-toggle[aria-expanded="true"] + .dropdown-menu { display: block; }
#nav-links .dropdown-menu a { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.5rem 0.7rem; color: var(--text); white-space: nowrap; }
#nav-links .dropdown-menu a code { min-width: 2.2em; color: var(--accent); font-size: 0.85em; }
#nav-links .dropdown-menu a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.dropdown-all { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px solid var(--border); }
#nav-links .dropdown-all a { color: var(--muted); }

@media (max-width: 760px) {
    .menu-toggle { display: inline-grid; }
    #nav-links {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 0.5rem 1.25rem 1rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        display: none;
    }
    #nav-links.open { display: flex; }
    #nav-links a { padding: 0.75rem 0.5rem; }
    #nav-links li:last-child { padding-top: 0.5rem; }
    .dropdown-toggle { width: 100%; padding: 0.75rem 0.5rem; }
    .dropdown-menu { position: static; min-width: 0; box-shadow: none; border: 0; padding: 0 0 0 0.75rem; background: none; }
    #nav-links .dropdown-menu li:last-child { padding-top: 0.3rem; }
}

/* === Hero ================================================================== */
.hero {
    padding: clamp(3rem, 8vw, 6rem) 0;
    background:
        radial-gradient(ellipse at 85% 10%, var(--accent-soft), transparent 60%),
        var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.eyebrow {
    display: inline-block;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.3rem 0.75rem; border-radius: 999px;
}
.eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.eyebrow a:hover { color: var(--accent-hover); }
.hero-kooper {
    display: block;
    width: 120px; height: 120px; margin-bottom: 1.25rem;
    object-fit: cover; object-position: 50% 35%;
    border-radius: 50%;
    border: 4px solid var(--card);
    box-shadow: var(--shadow), 0 0 0 2px var(--accent);
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin-bottom: 0.3em; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.term {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transform: rotate(1.2deg);
}
.term-bar { display: flex; gap: 6px; padding: 10px 12px; background: #c0c0c0; }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #7a7a7a; }
.term-bar span:first-child { background: #b02020; }
.term-body {
    margin: 0;
    padding: 1.2rem 1.4rem;
    background: var(--dos-blue);
    color: var(--dos-text);
    font-family: var(--mono);
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-x: auto;
}
.term-body .p { color: var(--dos-yellow); }
.term-body .c { color: var(--dos-dim); }
.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .term { transform: none; }
}

/* === Sections ============================================================== */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-header { max-width: 640px; margin-bottom: 2.5rem; }
.section-header p { color: var(--muted); font-size: 1.1rem; }

/* === Utilities ============================================================= */
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.75rem 1.25rem; }
@media (max-width: 760px) { .groups { grid-template-columns: minmax(0, 1fr); } }
/* Groups with more than one utility take the full width; single ones pair up */
.group:has(.card + .card) { grid-column: 1 / -1; }
.group-title {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 1.15rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}
.group-icon {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--dos-blue); color: var(--dos-yellow);
    font-size: 1rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }
.card {
    display: flex; flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.card-head h4 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.cmd {
    font-size: 0.85rem; font-weight: 700;
    background: var(--dos-blue); color: var(--dos-text);
    padding: 0.15rem 0.55rem; border-radius: 6px;
}
.card p { color: var(--muted); }
.card ul { margin: 0 0 1.25rem; padding-left: 1.15rem; font-size: 0.95rem; }
.card li { margin-bottom: 0.25rem; }
.card li::marker { color: var(--accent); }
.card-foot {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding-top: 1rem; border-top: 1px dashed var(--border);
    font-size: 0.85rem;
}
.tag { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; }

/* === Why Kooper ============================================================ */
.why-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 3rem; align-items: center; }
.why-text p { font-size: 1.08rem; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } }

.carousel {
    position: relative;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #2a231c;
}
.carousel-track { position: relative; aspect-ratio: 4 / 3; }
.slide {
    position: absolute; inset: 0; margin: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 7s ease-out;
}
/* Slow drift on the photo that's showing */
.slide.is-active img { transform: scale(1.07); }
/* The portrait photo: keep his face in frame */
.slide img[src$="kooper3.jpg"] { object-position: center 35%; }

.carousel-btn {
    position: absolute; top: 50%; z-index: 2;
    transform: translateY(-50%);
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel:hover .carousel-btn, .carousel-btn:focus-visible { opacity: 1; }
.carousel-btn:hover { background: rgba(0, 0, 0, 0.7); }
@media (hover: none) { .carousel-btn { opacity: 1; } }

.carousel-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    padding: 2rem 1rem 0.8rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
}
.carousel-dots { display: flex; gap: 6px; }
.carousel-dots button {
    width: 28px; height: 28px; padding: 0;
    border: none; background: transparent; cursor: pointer;
    display: grid; place-items: center;
}
.carousel-dots button::before {
    content: "";
    width: 9px; height: 9px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    transition: width 0.3s, background 0.3s;
}
.carousel-dots button[aria-current="true"]::before { width: 22px; background: #fff; }
.carousel-pause {
    display: grid; place-items: center;
    width: 30px; height: 30px; padding: 0;
    border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.35); color: #fff;
    cursor: pointer;
}
.carousel-pause svg { width: 15px; height: 15px; }
.carousel-pause .i-play { display: none; }
.carousel.paused .carousel-pause .i-play { display: block; }
.carousel.paused .carousel-pause .i-pause { display: none; }

/* === About ================================================================= */
#about p { font-size: 1.08rem; }
.principles { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.principles li {
    padding: 0.9rem 1.1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

/* === Contact =============================================================== */
.contact-form { margin-top: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-group label { font-weight: 600; font-size: 0.95rem; }
.form-group label span { color: var(--accent); }
input, textarea {
    font: inherit;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 1rem 0 0; min-height: 1.5em; font-weight: 600; }
.form-status.ok  { color: var(--success); }
.form-status.err { color: var(--danger); }

/* === Footer: always at the bottom of the visible page ===================== */
#site-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--footer-h);
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}
.footer-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#site-footer a { font-weight: 600; }
@media (max-width: 480px) { .footer-paw { display: none; } .footer-inner { justify-content: center; } }

/* === Reduced motion ======================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
    .slide.is-active img { transform: none; }
}

/* === 404 =================================================================== */
.not-found { min-height: calc(100vh - var(--header-h) - var(--footer-h)); display: grid; place-items: center; text-align: center; }
.not-found img { border-radius: var(--radius); margin: 0 auto 1.5rem; object-fit: cover; }

/* Let grid children shrink below their content (e.g. the terminal <pre>) */
.hero-grid > *, .why-grid > * { min-width: 0; }
.group { display: flex; flex-direction: column; }
.group .cards { flex: 1; }

/* === Cards link to their utility's page ==================================== */
.card { position: relative; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.card .more { color: var(--accent); font-weight: 600; }
.card:hover .more span { display: inline-block; transform: translateX(3px); transition: transform 0.15s; }

.hero-cmds a { color: var(--dos-text); text-decoration: none; border-bottom: 1px dashed var(--dos-dim); }
.hero-cmds a:hover { color: var(--dos-yellow); border-color: var(--dos-yellow); }

/* === Utility pages ========================================================= */
.util-hero {
    padding: 2rem 0 3.5rem;
    background: radial-gradient(ellipse at 85% 0%, var(--accent-soft), transparent 60%), var(--bg);
    border-bottom: 1px solid var(--border);
}
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 2rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.util-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.util-hero-grid > * { min-width: 0; }
.util-hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.4em; }
.cmd-lg { font-size: 1.1rem; padding: 0.3rem 0.8rem; }
.util-hero .lede { max-width: 46ch; font-size: 1.15rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.5rem; margin: 1.75rem 0 0; }
.facts div { border-left: 3px solid var(--accent); padding-left: 0.8rem; }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0.15rem 0 0; font-weight: 500; }
@media (max-width: 900px) {
    .util-hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* With a screenshot, the text sits above it and the screenshot gets the full width */
.util-hero-grid.has-shot { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.util-hero-grid.has-shot .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
@media (max-width: 700px) { .util-hero-grid.has-shot .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .util-hero-grid.has-shot .facts { grid-template-columns: minmax(0, 1fr); } }
.facts dd a { word-break: break-word; }
.btn-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-icon svg { width: 18px; height: 18px; fill: currentColor; }

/* Screenshots: the real terminal screen, captured by npm run screens (colours in screens.css) */
.shot { margin: 0; }
.shot-frame {
    container-type: inline-size;
    max-width: 1000px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: #0c0c0c;
}
.shot .term-bar { align-items: center; }
.shot .term-bar b { margin-left: 0.6rem; font: 600 0.8rem var(--mono); color: #333; }
.shot-screen {
    margin: 0;
    overflow-x: auto;
    background: #0c0c0c;
    color: #cccccc;
    font-family: var(--mono);
    line-height: 1.25;
    white-space: pre;
    font-variant-ligatures: none;
}
/* Each run of colour fills its line exactly, so coloured bars and boxes have no gaps */
.shot-screen span { display: inline-block; height: 1.25em; vertical-align: top; }
.shot figcaption { margin-top: 0.6rem; font-size: 0.9rem; color: var(--muted); text-align: center; }
.shots { display: grid; gap: 2rem; margin: 0.5rem 0 1rem; }

/* Downloads */
.release-line { color: var(--muted); }
.release-line strong { color: var(--text); }
.prose table.downloads th { width: 7rem; text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text); background: var(--surface); }
.prose table.downloads td .dl { margin: 0.15rem 0.4rem 0.15rem 0; }
.dl {
    display: inline-flex; align-items: baseline; gap: 0.45rem;
    padding: 0.35rem 0.8rem; border-radius: 8px;
    border: 1px solid var(--accent); color: var(--accent);
    font-weight: 600; text-decoration: none;
}
.dl:hover { background: var(--accent-soft); color: var(--accent-hover); }
.dl-size { font-weight: 400; font-size: 0.85em; color: var(--muted); }
.text-ok { color: var(--success); font-weight: 600; }

/* Layout: contents sidebar + article */
.util-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 3.5rem;
    padding: 3rem 0 2rem;
    align-items: start;
}
.toc {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    max-height: calc(100vh - var(--header-h) - var(--footer-h) - 3rem);
    overflow-y: auto;
    font-size: 0.92rem;
}
.toc h2 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.toc nav + nav { margin-top: 2rem; }
.toc ol, .toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a {
    display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--muted); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--text); }
.toc a.active, .toc a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc code { background: none; padding: 0; font-size: 0.85em; color: inherit; margin-right: 0.3rem; }
@media (max-width: 900px) {
    .util-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 2rem; }
    .toc { position: static; max-height: none; }
    .toc nav[aria-label="All utilities"] { display: none; }
    .toc ol { display: flex; flex-wrap: wrap; gap: 0.4rem; border: none; }
    .toc ol a { border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.8rem; margin: 0; background: var(--card); }
}

/* Article text */
.prose { max-width: 780px; }
.doc-section { padding-bottom: 1.5rem; }
.doc-section + .doc-section { border-top: 1px solid var(--border); padding-top: 2rem; }
.prose h2 { font-size: 1.6rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.5; }
.prose th { text-align: left; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.prose th, .prose td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: none; }
.prose td:first-child { white-space: nowrap; }
.prose td code { white-space: nowrap; }
@media (max-width: 600px) { .prose td:first-child { white-space: normal; } }

.code { margin: 0 0 1.4rem; border-radius: 10px; overflow: hidden; background: var(--dos-blue); box-shadow: var(--shadow); }
.code-label { font-family: var(--mono); font-size: 0.78rem; padding: 0.45rem 1rem; background: #c0c0c0; color: #1a1a1a; }
.code pre { margin: 0; padding: 1rem 1.2rem; overflow-x: auto; font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; color: var(--dos-text); }
.code code { background: none; padding: 0; font-size: inherit; color: inherit; }

.note {
    margin: 0 0 1.4rem; padding: 1rem 1.2rem;
    background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px;
    font-size: 0.95rem;
}

.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.app-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.app-card h3 { margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.6rem; }
.app-card p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.app-key {
    display: inline-grid; place-items: center; width: 26px; height: 26px;
    border-radius: 6px; background: var(--dos-blue); color: var(--dos-yellow);
    font-family: var(--mono); font-size: 0.85rem;
}

/* Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem 0 4rem; }
.pager-link {
    display: flex; flex-direction: column; gap: 0.25rem;
    padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card); text-decoration: none; color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
}
.pager-link:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pager-name { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager-next { text-align: left; align-items: flex-start; } }
