/* styles/skin-dev.css - the Dev (neovim) theme of the plain page. Everything in here is scoped to
   :root[data-skin="dev"], which scripts/mode.js stamps before first paint.

   The page's real content, shown as a markdown buffer open in Neovim inside a terminal. The
   colours are Tokyo Night, and the skin is dark whatever the site's light/dark toggle says.

   How it works:
   - One nested rule. Native CSS nesting keeps every selector under the skin attribute, and under
     :not([data-mode="desktop"]) so the XP desktop never sees any of it. scripts/skin-dev.js
     checks for nesting support before it adds its chrome, so an old browser gets the base page.
   - The art direction is not overridden rule by rule: header, main and footer are sent back to
     browser defaults with `all: revert`, then restyled as plain monospace blocks. Nothing from
     onepager.css or ink.css survives inside them, so nothing can be left invisible or overlapping.
   - Line numbers are a CSS counter. Every block that is a "line" paints its number into the gutter
     with ::before, and every blank line after a block is that block's ::after. Wrapped text
     shares one number, like `:set wrap`. scripts/skin-dev.js reads the same pseudo-elements to
     know which elements are lines, so the stylesheet is the single source of truth.
   - Markdown prefixes (#, ##, -, >) are list markers, which leaves ::before free for the number.
   - Generated text carries an empty alternative (`content: "x" / ""`) so a screen reader hears
     the content and not the line numbers. The plain declaration before it is the fallback.

   ponytail: no motion in this skin except the terminal caret, and that blinks only under
   prefers-reduced-motion: no-preference. No resting state depends on an animation. */

@keyframes nv-blink { 50% { opacity: 0; } }

:root[data-skin="dev"]:not([data-mode="desktop"]) {
  color-scheme: dark;

  /* ---- 1. TOKENS: Tokyo Night ------------------------------------------ */
  --nv-bg:        #1a1b26;
  --nv-bg-dark:   #16161e;
  --nv-black:     #0f0f14;
  --nv-bg-hl:     #292e42;   /* CursorLine */
  --nv-visual:    #3d59a1;   /* Search: the selection is also how / shows its match */
  --nv-fg:        #c0caf5;
  --nv-fg-dim:    #a9b1d6;
  --nv-muted:     #8089b3;   /* quiet text that still has to be read: 5:1 on the background */
  --nv-comment:   #565f89;   /* decoration only */
  --nv-gutter:    #3b4261;   /* LineNr */
  --nv-blue:      #7aa2f7;
  --nv-cyan:      #7dcfff;
  --nv-green:     #9ece6a;
  --nv-magenta:   #bb9af7;
  --nv-orange:    #ff9e64;
  --nv-red:       #f7768e;
  --nv-yellow:    #e0af68;
  --nv-teal:      #1abc9c;

  --nv-font: ui-monospace, "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "DejaVu Sans Mono", monospace;
  --nv-fs: 0.875rem;
  --nv-lh: 1.375rem;         /* one row. Every vertical measure in the buffer is a multiple */

  --nv-tab-h: 2rem;          /* tabline */
  --nv-bar-h: 1.5rem;        /* statusline, and the command line under it */
  --nv-tree-w: 15rem;        /* file tree */
  --nv-term-h: 10.625rem;    /* terminal split: seven rows and its padding */
  --nv-gut: 7ch;             /* sign column, number column, one space */

  @media (pointer: coarse) { --nv-tab-h: 2.75rem; --nv-bar-h: 1.75rem; }   /* tabs are the nav: 44px */
  @media (max-width: 859px) { --nv-tree-w: 0rem; --nv-gut: 5ch; }
  @media (max-width: 859px), (max-height: 599px) { --nv-term-h: 0rem; }

  background: var(--nv-bg);
  scrollbar-color: var(--nv-gutter) var(--nv-bg-dark);
  scroll-padding-block: var(--nv-tab-h) calc(var(--nv-bar-h) * 2 + var(--nv-term-h));

  /* ---- 2. THE TERMINAL ------------------------------------------------- */
  body {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: var(--nv-tab-h) 0 calc(var(--nv-bar-h) * 2 + var(--nv-term-h));
    background: var(--nv-bg);
    color: var(--nv-fg);
    font: 400 var(--nv-fs)/var(--nv-lh) var(--nv-font);
    letter-spacing: 0;
    font-variant-ligatures: none;
    font-feature-settings: normal;
    counter-reset: nv-ln;
  }
  /* The painted surface: washes, grain, wallpaper. None of it belongs in a terminal. */
  body::before, body::after { content: none; }
  .wallpaper { display: none; }

  ::selection { background: var(--nv-visual); color: var(--nv-fg); }
  .skip {
    z-index: 60;
    border: 0;
    border-radius: 0;
    background: var(--nv-blue);
    color: var(--nv-black);
  }

  /* ---- 3. RESET: back to browser defaults, then plain blocks ------------
     transform, animation and transition are forced off because scripts/motion.js and
     scripts/bounce.js write transforms straight onto elements. */
  .site-header, .site-header :where(*),
  .site-footer, .site-footer :where(*),
  #main, #main :where(*:not(svg *)) {
    all: revert;
    margin: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  /* The brush strokes, rules and glows that onepager.css paints with pseudo-elements. Every
     pseudo-element this skin wants is declared further down, with more specificity. */
  .site-header::before, .site-header::after, .site-header :where(*)::before, .site-header :where(*)::after,
  .site-footer::before, .site-footer::after, .site-footer :where(*)::before, .site-footer :where(*)::after,
  #main::before, #main::after, #main :where(*)::before, #main :where(*)::after { all: revert; }
  /* Drawings, ink strokes, the marquee, the pull quote: decoration, already hidden from
     assistive tech. .bnc-w is the exception: bounce.js marks its letter spans aria-hidden and
     keeps the heading text on the host's aria-label, so those spans are the visible heading. */
  #main [aria-hidden="true"]:not(.bnc-w) { display: none; }

  /* ---- 4. TABLINE: the site header, one tab per page -------------------- */
  .site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    height: var(--nv-tab-h);
    background: var(--nv-bg-dark);
    box-shadow: 0 1px 0 var(--nv-black);
  }
  .site-header__inner {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-header__inner::-webkit-scrollbar { display: none; }
  /* bufferline's offset: the tabs start where the tree ends. */
  .site-header__inner::before {
    content: "File Explorer";
    content: "File Explorer" / "";
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--nv-tree-w);
    border-right: 1px solid var(--nv-black);
    color: var(--nv-muted);
  }
  .site-nav, .site-nav ul, .site-nav li { display: flex; flex: none; }
  .site-nav { order: 1; }       /* in the markup the theme trigger sits between the mark and the nav */
  .site-nav ul { list-style: none; }
  /* The real label ("Free stuff") stays in the link for screen readers at font-size 0; the file
     name is painted over it. The names are honest: every page is served as /<name> too. */
  .site-header__mark, .site-nav a {
    display: flex;
    flex: none;
    align-items: center;
    padding: 0 1rem;
    border-right: 1px solid var(--nv-black);
    font-size: 0;
    color: var(--nv-muted);
    text-decoration: none;
    white-space: nowrap;
  }
  .site-header__mark::before, .site-nav a::before { font-size: var(--nv-fs); }
  .site-header__mark::before                { content: "README.md";        content: "README.md" / ""; }
  .site-nav a[href="/free/"]::before          { content: "free.md";          content: "free.md" / ""; }
  .site-nav a[href="/work/"]::before          { content: "work.md";          content: "work.md" / ""; }
  .site-nav a[href="/contributions/"]::before { content: "contributions.md"; content: "contributions.md" / ""; }
  .site-nav a[href="/about/"]::before         { content: "about.md";         content: "about.md" / ""; }
  .site-nav a[href="/faq/"]::before           { content: "faq.md";           content: "faq.md" / ""; }
  .site-nav a[href="/contact/"]::before       { content: "contact.md";       content: "contact.md" / ""; }
  .site-header__mark:hover, .site-nav a:hover { color: var(--nv-fg); }
  &[data-page="home"] .site-header__mark,
  .site-nav a[aria-current="page"] {
    background: var(--nv-bg);
    color: var(--nv-fg);
    box-shadow: inset 2px 0 0 var(--nv-blue);
  }
  /* Contact is the main button: the one tab painted like lualine's mode block, and pinned first
     among the pages so the tabline never scrolls it out of sight on a narrow screen. */
  .site-nav .site-nav__cta { order: -1; }
  .site-nav .site-nav__cta a { background: var(--nv-green); color: var(--nv-black); font-weight: 700; }
  .site-nav .site-nav__cta a:hover { background: var(--nv-teal); color: var(--nv-black); }

  /* The theme switch is the way out of a theme people find hard to read, so it is a button
     anyone can find: a bright block at the right end of the tabline, in its own colour (Contact
     is green), with the ring and plain words, "Change theme". Pinned there while the tabs
     scroll. The reset above reverts everything in the header, so the hidden parts of its
     name are hidden again here; the current theme's name stays for assistive tech. */
  .theme-trigger {
    position: sticky;
    right: 0;
    display: flex;
    flex: none;
    order: 2;
    gap: 0.6ch;
    align-items: center;
    margin-left: auto;
    padding: 0 1.4ch;
    border: 0;
    background: var(--nv-magenta);
    box-shadow: -1px 0 0 var(--nv-black), -10px 0 12px -6px var(--nv-black);
    color: var(--nv-black);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    touch-action: none;
  }
  .theme-trigger::after {
    content: "Change theme";
    content: "Change theme" / "";
  }
  .theme-trigger:hover { background: var(--nv-orange); }
  .site-header .theme-trigger:focus-visible { outline: 2px solid var(--nv-black); outline-offset: -4px; }
  .theme-trigger__ring { display: block; flex: none; }
  /* The header reset also reverts the ring's own SVG attributes; put them back. */
  .theme-trigger__ring circle {
    cx: 8px;
    cy: 8px;
    r: 6px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-dasharray: 5.54 2;
  }
  .theme-trigger .u-visually-hidden,
  .theme-trigger__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  @media (max-width: 859px) {
    .site-header__inner::before { display: none; }
    .theme-trigger::after { content: "Theme"; content: "Theme" / ""; }
    .site-header__mark, .site-nav a { padding: 0 0.75rem; }
    /* skin-dev.js scrolls the open tab into view, which on a sub-page scrolled Contact off the
       left edge. Pinned there like the theme button on the right, the tabs pass under it. */
    .site-nav .site-nav__cta { position: sticky; left: 0; z-index: 1; }
    .site-nav .site-nav__cta a { box-shadow: 1px 0 0 var(--nv-black), 10px 0 12px -6px var(--nv-black); }
  }

  .site-header :focus-visible, #main :focus-visible,
  .nv-tree :focus-visible, .nv-cmd button:focus-visible {
    outline: 1px solid var(--nv-blue);
    outline-offset: -1px;
  }
  .site-nav .site-nav__cta a:focus-visible { outline: 2px solid var(--nv-black); outline-offset: -4px; }

  /* ---- 5. THE BUFFER ---------------------------------------------------- */
  #main, .site-footer {
    display: block;
    position: relative;
    z-index: 1;               /* above the cursorline, which is painted behind the text */
    flex: none;
    margin-left: var(--nv-tree-w);
    padding: 0 2ch 0 var(--nv-gut);
  }
  #main :is(h1, h2, h3, h4, h5, h6, p, li, summary, dt, dd, figcaption, blockquote, pre, figure) {
    max-width: 100ch;
    overflow-wrap: anywhere;
  }

  /* Line numbers. */
  #main :is(h1, h2, h3, h4, h5, h6, p, summary, dt, dd, figcaption, blockquote, pre)::before,
  #main li:not(:has(h3, ul, ol))::before,
  #main .story__fig::before,
  .site-footer p::before,
  #main :is(h1, h2, h3, h4, h5, h6, p, summary, dd, figcaption, blockquote, pre)::after,
  #main :is(ul, ol, dl):not(:has(ul, ol, h3))::after {
    counter-increment: nv-ln;
    content: counter(nv-ln);
    content: counter(nv-ln) / "";
    position: absolute;
    left: 0;
    width: calc(var(--nv-gut) - 1ch);
    font-weight: 400;
    font-style: normal;
    text-indent: 0;
    text-align: right;
    color: var(--nv-gutter);
    user-select: none;
    pointer-events: none;
  }
  /* A blank line after a block: the block's ::after, one row below its last line of text. */
  #main :is(h1, h2, h3, h4, h5, h6, p, summary, dd, figcaption, blockquote, pre)::after,
  #main :is(ul, ol, dl):not(:has(ul, ol, h3))::after { display: block; }
  #main :is(h1, h2, h3, h4, h5, h6, p, summary, dd, figcaption, blockquote, pre),
  #main :is(ul, ol, dl):not(:has(ul, ol, h3)),
  #main .story__fig { margin-bottom: var(--nv-lh); }

  /* Headings. */
  #main :is(h1, h2, h3, h4, h5, h6) {
    display: list-item;
    list-style-position: inside;
    font-weight: 700;
  }
  #main h1 { list-style-type: "# ";    color: var(--nv-blue); }
  #main h2 { list-style-type: "## ";   color: var(--nv-yellow); }
  #main h3 { list-style-type: "### ";  color: var(--nv-green); }
  #main h4 { list-style-type: "#### "; color: var(--nv-teal); }
  #main h1::marker { content: "# " / ""; }
  #main h2::marker { content: "## " / ""; }
  #main h3::marker { content: "### " / ""; }
  #main h4::marker { content: "#### " / ""; }

  /* Inline. */
  #main a {
    color: var(--nv-cyan);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }
  #main a:hover { color: var(--nv-blue); }
  #main :is(h1, h2, h3, h4) a { color: inherit; }
  #main :is(b, strong) { font-weight: 700; }
  #main :is(em, i) { font-style: italic; }
  #main :is(time, .num) { color: var(--nv-orange); }

  /* Lists. An item is one line; the paragraphs inside it run on, as they do in the .md twin. */
  #main :is(ul, ol) { list-style: none; }
  /* The marker sits inside the item, with a hanging indent for the wrapped rows. text-indent
     inherits, so everything inside the item is set back to none first. */
  #main li :where(*) { text-indent: 0; }
  #main li {
    display: list-item;
    padding-left: 2ch;
    text-indent: -2ch;
    list-style: "- " inside;
  }
  #main li:not(:has(h3))::marker { color: var(--nv-cyan); content: "- " / ""; }
  #main li:not(:has(h3, ul, ol)) p { display: inline; margin: 0; }
  #main li:not(:has(h3, ul, ol)) p::before,
  #main li:not(:has(h3, ul, ol)) p::after { content: none; counter-increment: none; }
  /* An entry with its own heading is a section, not a bullet. */
  #main li:has(h3) { padding-left: 0; text-indent: 0; list-style: none; }

  /* Folds: the FAQ's <details>. */
  #main summary {
    display: list-item;
    list-style: "\25B8  ### " inside;
    font-weight: 700;
    color: var(--nv-green);
    cursor: pointer;
  }
  #main details[open] > summary { list-style-type: "\25BE  ### "; }
  #main summary:hover { color: var(--nv-fg); }

  /* ---- 6. COMPONENTS, where plain markdown needs a nudge ---------------- */
  /* Home: the tagline is the blockquote the .md twin opens with. */
  #main .hero__sub {
    display: list-item;
    list-style: "> " inside;
    font-style: italic;
    color: var(--nv-fg-dim);
  }
  /* His goal, bold the way the .md twin writes it. */
  #main .hero__goal { font-weight: 700; color: var(--nv-magenta); }
  #main :is(.hero__actions, .hero__cta) a + a::before {
    content: "| ";
    display: inline-block;
    margin-right: 1ch;
    color: var(--nv-comment);
  }

  /* Home: the story's photos. No photos in a terminal: each figure is one line, its markdown
     image line, which the generator writes into data-md. attr() reads only the element's own
     attribute, so the figure is the line: its ::before is the number, like an li, and its
     ::after is the text, which counts nothing.
     Muted, not comment: the caption is the only trace of the photo, so it has to be read. */
  #main .story__fig :is(.story__frame, figcaption) { display: none; }
  #main .story__fig::after { content: attr(data-md); color: var(--nv-muted); }

  /* Separators inside a run-on item. The two paragraphs first need the gutter geometry undone. */
  #main :is(.rec__label, .like__t)::after {
    counter-increment: none;
    content: ":";
    display: inline;
    position: static;
    color: inherit;
    font-weight: inherit;
  }
  #main :is(.give__t, .else__t, .repos__t)::after {
    content: ":";
    display: inline-block;      /* an inline-block does not take the link's underline */
    color: var(--nv-fg);
  }
  /* Projects (the foot of free.md): status, stamp and the blacked-out names in the scheme's colours. */
  #main .sc__status { color: var(--nv-orange); }
  #main .sc__stamp { color: var(--nv-magenta); }
  /* The reset above shows .u-visually-hidden and hides every aria-hidden span: the other way
     round here, so a name reads as a blacked-out line and "Name withheld" stays for the ear. */
  #main .sc__redact[aria-hidden="true"] { display: inline; color: var(--nv-fg); }
  #main .sc .u-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #main .sc__aside { color: var(--nv-muted); }
  #main .sc__tags { color: var(--nv-fg-dim); }
  #main .sc__btn + .sc__btn::before { content: "| "; display: inline-block; margin-right: 1ch; color: var(--nv-comment); }
  #main .rows__sub::before { content: " - "; color: var(--nv-comment); }
  #main .rec__src { color: var(--nv-comment); }
  #main :is(.rec__big, .like__t) { font-weight: 700; }
  #main .row__org { color: var(--nv-magenta); }

  /* Work: date, role, employer, then the summary and its points. */
  #main .rail__when::after,
  #main .rail__role::after { content: none; counter-increment: none; }
  #main :is(.rail__when, .rail__role) { margin-bottom: 0; }
  #main .rail__org { color: var(--nv-magenta); }
  #main .feature__stack { font-style: italic; color: var(--nv-fg-dim); }

  /* Contributions: the calendar keeps its squares, in the scheme's green. */
  #main .contrib {
    --heat-0: #24283b;
    --heat-1: #3b4837;
    --heat-2: #5c7548;
    --heat-3: #7da159;
    --heat-4: #9ece6a;
  }
  #main .contrib__grid {
    display: block;
    width: 100%;
    height: auto;
  }
  #main .contrib__key { color: var(--nv-fg-dim); }
  #main .heat-key { display: inline-flex; gap: 3px; margin: 0 1ch; }
  #main .heat-key .heat { width: 0.7em; height: 0.7em; background: var(--heat-0); }
  #main .heat-key .heat--1 { background: var(--heat-1); }
  #main .heat-key .heat--2 { background: var(--heat-2); }
  #main .heat-key .heat--3 { background: var(--heat-3); }
  #main .heat-key .heat--4 { background: var(--heat-4); }
  #main .contrib__src .num { color: var(--nv-green); }

  #main [hidden] { display: none; }

  /* ---- 7. END OF BUFFER -------------------------------------------------
     The footer's one sentence becomes the last line, a comment. Its two buttons are not needed
     here: this skin is always dark, and XP is in the tabline's mode group. The rest of the
     window is filled with ~ rows, clipped to whatever height is left. */
  .site-footer {
    flex: 1 0 calc(var(--nv-lh) * 9);
    overflow: hidden;
  }
  .site-footer ul { display: none; }
  .site-footer p {
    display: list-item;
    list-style: "<!-- " inside;
    color: var(--nv-muted);
  }
  .site-footer p::marker { content: "<!-- " / ""; }
  .site-footer p::after { content: " -->"; content: " -->" / ""; }
  .site-footer::after {
    content: "~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~";
    content: "~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~\A~" / "";
    display: block;
    margin-left: calc(1ch - var(--nv-gut));
    white-space: pre;
    color: var(--nv-comment);
    user-select: none;
  }

  /* ---- 8. CHROME BUILT BY scripts/skin-dev.js --------------------------- */
  /* Cursorline: behind the text, with the current line number repainted on top of the gutter. */
  .nv-cursorline, .nv-cursornr {
    position: absolute;
    top: 0;                   /* skin-dev.js moves them with a transform */
    left: var(--nv-tree-w);
    background: var(--nv-bg-hl);
    pointer-events: none;
  }
  .nv-cursorline { right: 0; z-index: 0; }
  .nv-cursornr {
    z-index: 2;
    width: calc(var(--nv-gut) - 1ch);
    height: var(--nv-lh);
    font-weight: 700;
    text-align: right;
    color: var(--nv-orange);
  }

  /* File tree. */
  .nv-tree {
    position: fixed;
    top: var(--nv-tab-h);
    bottom: calc(var(--nv-bar-h) * 2);
    left: 0;
    z-index: 30;
    box-sizing: border-box;
    width: var(--nv-tree-w);
    overflow-y: auto;
    border-right: 1px solid var(--nv-black);
    background: var(--nv-bg-dark);
    white-space: nowrap;
  }
  .nv-tree p, .nv-tree ul { margin: 0; padding: 0; list-style: none; }
  .nv-tree__root { color: var(--nv-blue); font-weight: 700; }
  .nv-tree__root, .nv-tree a, .nv-tree__dir {
    display: block;
    padding: 0 1ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nv-tree a { color: var(--nv-fg-dim); text-decoration: none; }
  .nv-tree__dir { color: var(--nv-blue); }
  .nv-tree__g { color: var(--nv-gutter); }
  .nv-tree a:hover { background: var(--nv-bg-hl); color: var(--nv-fg); }
  .nv-tree a[aria-current="page"] {
    background: var(--nv-bg-hl);
    color: var(--nv-fg);
    font-weight: 700;
  }
  @media (max-width: 859px) { .nv-tree { display: none; } }

  /* Terminal split. */
  .nv-term {
    position: fixed;
    right: 0;
    bottom: calc(var(--nv-bar-h) * 2);
    left: var(--nv-tree-w);
    z-index: 30;
    box-sizing: border-box;
    height: var(--nv-term-h);
    overflow-y: auto;
    padding: 0.5rem 2ch;
    border-top: 1px solid var(--nv-gutter);
    background: var(--nv-bg-dark);
    color: var(--nv-fg-dim);
  }
  .nv-term p { margin: 0; overflow-wrap: anywhere; }
  .nv-term__path { color: var(--nv-blue); font-weight: 700; }
  .nv-term__branch { color: var(--nv-magenta); }
  .nv-term__ps { color: var(--nv-green); user-select: none; }
  .nv-term__note { color: var(--nv-muted); }
  .nv-term__caret {
    display: inline-block;
    width: 1ch;
    height: 1.15em;
    background: var(--nv-fg-dim);
    vertical-align: text-bottom;
  }
  @media (prefers-reduced-motion: no-preference) {
    .nv-term__caret { animation: nv-blink 1.1s steps(1) infinite; }
  }
  /* No room for a split: the terminal becomes the last thing in the page instead. */
  @media (max-width: 859px), (max-height: 599px) {
    .nv-term {
      position: static;
      flex: none;
      height: auto;
      margin-left: var(--nv-tree-w);
    }
  }

  /* Statusline and command line. */
  .nv-status, .nv-cmd {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 40;
    display: flex;
    box-sizing: border-box;
    height: var(--nv-bar-h);
    line-height: var(--nv-bar-h);
    white-space: nowrap;
  }
  .nv-status {
    --nv-mode: var(--nv-blue);
    bottom: var(--nv-bar-h);
    background: var(--nv-bg-dark);
    color: var(--nv-fg-dim);
    user-select: none;
  }
  .nv-status[data-nv-mode="COMMAND"] { --nv-mode: var(--nv-yellow); }
  .nv-status span { flex: none; padding: 0 1ch; }
  .nv-status__a, .nv-status__z { background: var(--nv-mode); color: var(--nv-black); font-weight: 700; }
  .nv-status__b, .nv-status__y { background: var(--nv-gutter); color: var(--nv-mode); }
  .nv-status .nv-status__c { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .nv-status__x { color: var(--nv-muted); }
  @media (max-width: 859px) { .nv-status__x, .nv-status__b { display: none; } }

  .nv-cmd {
    bottom: 0;
    padding: 0 1ch;
    background: var(--nv-bg);
    color: var(--nv-fg);
  }
  .nv-cmd label { flex: none; visibility: hidden; }
  .nv-cmd input {
    appearance: none;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    caret-color: var(--nv-fg);
  }
  .nv-cmd__msg {
    position: absolute;
    left: 1ch;
    max-width: calc(100% - 14ch);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }
  .nv-cmd__msg.is-err { color: var(--nv-red); }
  .nv-cmd:focus-within label { visibility: visible; }
  .nv-cmd:focus-within .nv-cmd__msg { display: none; }
  .nv-cmd__keys { flex: none; padding: 0 1ch; color: var(--nv-fg-dim); }
  .nv-cmd button {
    appearance: none;
    flex: none;
    margin: 0;
    padding: 0 1ch;
    border: 0;
    background: transparent;
    color: var(--nv-muted);
    font: inherit;
    cursor: pointer;
  }
  .nv-cmd button:hover { color: var(--nv-fg); }
  @media (pointer: coarse) { .nv-cmd input { font-size: 1rem; } }   /* 16px: no zoom on focus in iOS */

  /* :help, a floating window. */
  .nv-help {
    box-sizing: border-box;
    width: max-content;
    max-width: min(76ch, calc(100vw - 2rem));
    max-height: calc(100dvh - 4rem);
    padding: 0 2ch var(--nv-lh);
    overflow-y: auto;
    border: 1px solid var(--nv-blue);
    border-radius: 6px;
    background: var(--nv-bg-dark);
    color: var(--nv-fg);
    font: inherit;
  }
  .nv-help:focus-visible { outline: 0; }
  .nv-help::backdrop { background: rgb(0 0 0 / 0.4); }
  .nv-help p { margin: 0 -2ch; padding: 0 2ch; background: var(--nv-bg-hl); color: var(--nv-fg-dim); }
  .nv-help h2 {
    margin: var(--nv-lh) 0 0;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--nv-yellow);
  }
  .nv-help dl { display: grid; grid-template-columns: 22ch 1fr; gap: 0 2ch; margin: 0; }
  .nv-help dt { color: var(--nv-orange); }
  .nv-help dd { margin: 0; color: var(--nv-fg-dim); }
  @media (max-width: 599px) {
    .nv-help dl { display: block; }
    .nv-help dd { padding-left: 2ch; }
  }
}

/* The engineer-artist layer is Artsy's. In the buffer the spec line is a comment, nothing else. */
/* The space scene, its scroll hint and the theme band are Artsy's (story.css); the buffer's reset must not bring them back. */
:root[data-skin="dev"] #main :is(.hero__space, .hero__more, .theme-cta) { display: none; }
:root[data-skin="dev"] .mark__korent,
:root[data-skin="dev"] #main :is(.story__glyph, .story__note, .story__via) { display: none; }
:root[data-skin="dev"] .story__body::before, :root[data-skin="dev"] .story__body::after { display: none; }
:root[data-skin="dev"] .story__ch { display: flex; flex-direction: column; }
:root[data-skin="dev"] .story__body { padding: 0; }
:root[data-skin="dev"] .story__spec { display: none; }
/* Artsy moves its mark to the right (onepager.css); the buffer keeps README.md as the first tab. */
:root[data-skin="dev"] :is(.site-header__mark, .theme-trigger) { order: 0; }

/* The travel map in a buffer is its markdown line (data-md), like the photos. */
:root[data-skin="dev"] #main .story__fig .map { display: none; }
:root[data-skin="dev"] #main .story__pair { display: block; }
