/* Codestinger: site styles.
   No framework. Tokens → base → layout primitives → components.
   Visual language: the { } brace, square geometry and hairlines, terminal idioms (ls, man, EOF)
   on the original site's mesh texture. */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url("../fonts/martian-mono-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 700; font-display: swap; src: url("../fonts/martian-mono-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 800; font-display: swap; src: url("../fonts/martian-mono-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/ibm-plex-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("../fonts/jetbrains-mono-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #101010;
  --surface: #181818;
  --line: #2a2a2a;
  --line-strong: #3d3d3d;

  --text: #eceae4;
  --text-2: #bdbab3;
  --text-3: #8e8b85;

  --accent: #f2b23a;
  --accent-hover: #ffd27a;
  --on-accent: #141414;

  --font-display: "Martian Mono", ui-monospace, monospace;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --gutter: clamp(20px, 5vw, 80px);
  --max: 1280px;
  --measure: 70ch;
  --header-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg) url("../img/mesh.png") repeat;
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.br { color: var(--accent); font-weight: 400; }
::selection { background: var(--accent); color: var(--on-accent); }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--on-accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font-mono); white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: rgb(16 16 16 / .75); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Bracket-cornered box: the { } idea applied to a rectangle */
.bracketed { position: relative; border: 1px solid var(--line); background: rgb(19 19 19 / .94); }
.bracketed::before, .bracketed::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 0 solid var(--accent); transition: width .15s, height .15s;
}
.bracketed::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.bracketed::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }
.bracketed:hover::before, .bracketed:hover::after, .bracketed:focus-within::before, .bracketed:focus-within::after { width: 28px; height: 28px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand { font: 700 16px/1 var(--font-display); color: var(--text); letter-spacing: -0.02em; }
.site-header .brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__logo { width: auto; height: 42px; }
@media (max-width: 380px) { .brand__logo { height: 34px; } .site-header .brand { gap: 8px; } }
.brand:hover { color: var(--text); }
.brand:hover .br { color: var(--accent-hover); }
.site-nav { display: flex; align-items: center; gap: 4px; font: 400 14px/1 var(--font-mono); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text-2); }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current]::before { content: "{"; color: var(--accent); margin-right: 2px; }
.site-nav a[aria-current]::after { content: "}"; color: var(--accent); margin-left: 2px; }
.site-nav__num { display: none; }
.site-nav__rss { color: var(--accent) !important; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
    border: 1px solid var(--line-strong); background: transparent; color: var(--text);
    font: 400 14px/1 var(--font-mono); cursor: pointer;
  }
  .nav-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
  .site-nav {
    position: absolute; inset: 100% 0 auto 0; height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 16px var(--gutter) 32px; overflow-y: auto;
    background: var(--bg) url("../img/mesh.png") repeat; border-top: 1px solid var(--line);
  }
  .site-nav a { min-height: 64px; padding: 0; gap: 16px; border-bottom: 1px solid var(--line); font: 700 22px/1 var(--font-display); color: var(--text); }
  .site-nav a[aria-current]::before, .site-nav a[aria-current]::after { font-weight: 400; }
  .site-nav__num { display: inline; min-width: 2.2em; font: 400 13px var(--font-mono); color: var(--text-3); }
  .js .site-nav:not(.is-open) { display: none; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Hero + interactive shell ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(16 16 16 / .9) 0%, rgb(16 16 16 / .6) 45%, rgb(16 16 16 / 0) 80%);
}
.hero__inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 88px); }
.hero__ps1 { font-size: 14px; color: var(--text-3); }
.hero__title { display: flex; flex-direction: column; align-items: flex-start; gap: .1em; font-weight: 800; }
.hero__line { display: block; white-space: nowrap; }
.hero__line--pre, .hero__line--post { font-size: clamp(30px, 5.2vw, 68px); line-height: 1.15; letter-spacing: -0.04em; }
.hero__line--key {
  margin-block: .1em .04em;
  font-size: clamp(56px, 12.5vw, 168px); line-height: .95; letter-spacing: -0.06em;
  color: var(--accent);
}
.hero__line--key .br { font-weight: 400; color: var(--text-3); letter-spacing: -0.12em; }
.hero__line--key .br:first-child { margin-left: -.08em; margin-right: .06em; }
.hero__line--key .br:last-child { margin-left: .02em; }
.hero__caret { display: inline-block; width: .5em; height: .1em; margin-left: .12em; background: var(--accent); vertical-align: baseline; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lede { max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.shell { max-width: 760px; border-block: 1px solid var(--line-strong); background: rgb(16 16 16 / .88); font-size: 15px; }
.js .shell { display: block; }
.shell[hidden] { display: none; }
.shell__log { max-height: 260px; overflow-y: auto; padding: 0 16px; font: 14px/1.7 var(--font-mono); color: var(--text-2); }
.shell__log:not(:empty) { padding-block: 12px 4px; }
.shell__log > div { white-space: pre-wrap; }
.shell__log .cmd { color: var(--text); }
.shell__log .err { color: #f08a6c; }
.shell__log a { color: var(--accent); }
.shell__log .dim { color: var(--text-3); }
.shell__line { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; }
.shell__ps1 { flex: none; font-size: 14px; color: var(--text-3); }
.shell__input {
  flex: 1; min-width: 0; height: 44px; padding: 0;
  border: 0; background: transparent; color: var(--text);
  font-size: 16px; caret-color: var(--accent); outline: none;
}
.shell__input::placeholder { color: var(--text-3); opacity: .8; }
.shell__line:focus-within { box-shadow: inset 2px 0 0 var(--accent); }
.shell__hints { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; padding: 8px 12px 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.shell__try { color: var(--text-3); margin-right: 6px; padding-left: 4px; }
.shell__hints button {
  min-height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font: 13px var(--font-mono); cursor: pointer;
}
.shell__hints button:hover, .shell__hints button:focus-visible { border-color: var(--accent); color: var(--accent); }
@media (max-width: 520px) {
  .shell__ps1 .accent { display: none; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero::after { background: linear-gradient(180deg, rgb(16 16 16 / .55), rgb(16 16 16 / .9)); }
}

.topics { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-block: 18px; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.topics__label { color: var(--text-3); }
.topics__item { color: var(--text-2); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 7vw, 88px) 0; }
.section--end { padding-bottom: clamp(56px, 7vw, 96px); }
.section--tight { padding-block: 8px clamp(56px, 7vw, 96px); }

.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.sec-head__title { flex: none; font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; letter-spacing: -0.03em; }
.sec-head__title .br { margin-inline: .1em; }
.sec-head__rule { flex: 1; min-width: 24px; border-top: 1px dashed var(--line-strong); }
.sec-head__more { flex: none; font: 400 14px var(--font-mono); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }

/* ---------- {experience} panel (neofetch-style key ...... value) ---------- */
.info { margin: 0; max-width: 980px; }
.info__row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding: 7px 0; }
.info__key { display: flex; gap: 8px; font-size: 15px; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; }
.info__key::after { content: ""; flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line-strong); transform: translateY(-5px); }
.info__val { margin: 0; font-size: 16px; color: var(--text); }
@media (max-width: 600px) {
  .info__row { grid-template-columns: 1fr; row-gap: 2px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
  .info__key::after { display: none; }
}

/* ---------- {work} tree ---------- */
.tree-root { font-size: 14px; color: var(--text-3); padding-bottom: 6px; }
.tree { margin: 0; padding: 0; list-style: none; }
.tree__row {
  display: grid; grid-template-columns: 3.2em minmax(10em, auto) minmax(0, 1fr); column-gap: 20px; align-items: baseline;
  padding: 9px 0;
}
.tree__row::before { content: "├──"; font: 15px var(--font-mono); color: var(--text-3); }
.tree__row:last-child::before { content: "└──"; }
.tree__name { font-size: 16px; font-weight: 600; color: var(--accent); }
.tree__desc { color: var(--text-2); font-size: 16px; }
@media (max-width: 700px) {
  .tree__row { grid-template-columns: 2.6em minmax(0, 1fr); row-gap: 2px; }
  .tree__desc { grid-column: 2; font-size: 15px; }
}

/* ---------- ls -l listing ---------- */
.ls-total { font-size: 13px; color: var(--text-3); padding-bottom: 8px; }
.ls-total__n { color: var(--accent); }
.ls { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ls__row {
  position: relative;
  display: grid; grid-template-columns: auto auto 3.5em minmax(0, 1fr) auto; column-gap: 24px; align-items: baseline;
  padding: 18px 12px; border-bottom: 1px solid var(--line);
  font: 14px/1.5 var(--font-mono); color: var(--text-3);
  background: rgb(16 16 16 / .8);
  box-shadow: inset 1px 0 0 rgb(242 178 58 / .35);
}
.ls__perm { color: #6f6c67; }
.ls__size { text-align: right; }
.ls__name { font: 700 clamp(17px, 1.6vw, 20px)/1.3 var(--font-display); letter-spacing: -0.03em; }
.ls__name a { color: var(--text); }
.ls__name a::after { content: ""; position: absolute; inset: 0; }
.ls__sum { margin-top: 6px; font: 15px/1.55 var(--font-body); color: var(--text-2); max-width: 60ch; }
.ls__cat { color: var(--accent); }
.ls__date { color: rgb(242 178 58 / .72); }
.ls__cat::after { content: "/"; }
/* Amber highlight for mouse and keyboard. Colours change together (no fade), so text never sits dark on dark. */
.ls__name a { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
  .ls__row:hover { background: var(--accent); color: rgb(20 20 20 / .7); }
  .ls__row:hover .ls__perm { color: rgb(20 20 20 / .55); }
  .ls__row:hover .ls__name a { color: var(--on-accent); }
  .ls__row:hover .ls__sum { color: rgb(20 20 20 / .85); }
  .ls__row:hover :is(.ls__cat, .ls__date, .ls__size) { color: rgb(20 20 20 / .75); }
}
.ls__row:has(a:focus-visible) { background: var(--accent); color: rgb(20 20 20 / .7); }
.ls__row:has(a:focus-visible) .ls__perm { color: rgb(20 20 20 / .55); }
.ls__row:has(a:focus-visible) .ls__name a { color: var(--on-accent); outline: none; }
.ls__row:has(a:focus-visible) .ls__sum { color: rgb(20 20 20 / .85); }
.ls__row:has(a:focus-visible) :is(.ls__cat, .ls__date, .ls__size) { color: rgb(20 20 20 / .75); }
/* Touch: a tap marks the row with an amber edge and title and keeps it readable while the next page loads */
@media (hover: none) {
  .ls__row:active, .ls__row:has(a:focus:not(:focus-visible)) { box-shadow: inset 3px 0 0 var(--accent); background: rgb(30 30 30 / .95); }
  .ls__row:active .ls__name a, .ls__row:has(a:focus:not(:focus-visible)) .ls__name a { color: var(--accent); }
}
.ls__empty { padding: 18px 12px; font: 14px var(--font-mono); color: var(--text-3); }

@media (max-width: 1200px) {
  .ls__row { grid-template-columns: auto auto minmax(0, 1fr); row-gap: 6px; }
  .ls__perm { display: none; }
  .ls__size { text-align: left; }
  .ls__cat { grid-column: 3; grid-row: 1; justify-self: end; }
  .ls__body { grid-column: 1 / -1; }
}

.pager { display: flex; align-items: center; gap: 20px; padding-top: 24px; font-size: 14px; }
.pager__status { color: var(--text-3); }

.drafts { margin-bottom: 48px; }
.drafts__note { margin: -8px 0 14px; font-size: 13px; color: var(--text-3); }
.drafts__note code { color: var(--accent); }
.drafts .ls__row { background: rgb(242 178 58 / .06); }
@media (hover: hover) { .drafts .ls__row:hover { background: var(--accent); } }
.drafts .ls__row:has(a:focus-visible) { background: var(--accent); }

/* ---------- Page heads & blog layout ---------- */
.page-head { display: flex; flex-direction: column; gap: 18px; padding-block: clamp(48px, 7vw, 88px) clamp(32px, 4vw, 48px); }
.page-head__cmd { font-size: 14px; color: var(--text-3); }
.page-head__title { font-size: clamp(32px, 5vw, 60px); letter-spacing: -0.05em; }
.page-head__lede { display: flex; flex-direction: column; gap: .8em; max-width: 44em; font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); }

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-bottom: clamp(56px, 7vw, 96px); }
.blog-aside { display: flex; flex-direction: column; gap: 36px; }
.blog-aside .sec-head { margin-bottom: 12px; }
.blog-aside .sec-head__title { font-size: 16px; }
@media (max-width: 960px) { .blog-layout { grid-template-columns: 1fr; gap: 48px; } }

.aside-list { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.aside-list li { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.aside-list a { display: flex; align-items: center; flex: 1; min-height: 44px; color: var(--text); }
.aside-list a:hover, .aside-list a[aria-current] { color: var(--accent); }
.aside-list span { display: flex; align-items: center; color: var(--text-3); }
.aside-list--wide { max-width: 720px; font-size: 16px; }
.aside-text { font-size: 15px; color: var(--text-2); }
.aside-links { display: flex; gap: 20px; margin-top: 10px; font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; padding: 0; list-style: none; font: 14px var(--font-mono); }
.tags a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); }
.tags a:hover, .tags a[aria-current] { color: var(--accent); }

/* ---------- Long-form documents (posts & pages) ---------- */
.doc__inner { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-bottom: clamp(56px, 7vw, 96px); }
.manhead { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px 0; font-size: 12px; letter-spacing: .04em; color: var(--text-3); }
.manhead span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .manhead__mid, .manhead__end { display: none; } }
.doc__head { display: flex; flex-direction: column; gap: 16px; padding-block: clamp(36px, 6vw, 64px) 32px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.doc__cat { font-size: 14px; color: var(--text-3); }
.doc__title { font-size: clamp(30px, 4.6vw, 54px); letter-spacing: -0.05em; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-3); }
.doc__eof { margin-top: 48px; padding-top: 16px; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--text-3); }


.prose { font-size: 18px; line-height: 1.75; color: #d9d6cf; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; margin-top: 2em; color: var(--text); font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; }
.prose h2 { font-size: 1.45em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1.1em; }
.prose h5, .prose h6 { font-size: 1em; }
.prose .heading-anchor { margin-left: .4em; color: var(--text-3); opacity: 0; font-weight: 400; }
.prose :is(h2, h3, h4, h5, h6):hover .heading-anchor, .prose .heading-anchor:focus-visible { opacity: 1; }
.prose a { text-decoration: underline; text-decoration-color: rgb(242 178 58 / .45); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose li + li { margin-top: .45em; }
.prose ul > li::marker { content: "- "; color: var(--accent); font-family: var(--font-mono); }
.prose ol > li::marker { color: var(--accent); font-family: var(--font-mono); font-size: .9em; }
.prose blockquote { position: relative; margin: 1.6em 0; padding: 0 0 0 2em; color: var(--text-2); }
.prose blockquote::before { content: ">"; position: absolute; left: 0; top: 0; font: 700 1em/1.75 var(--font-mono); color: var(--accent); }
.prose hr { border: 0; border-top: 1px dashed var(--line-strong); margin-block: 2.4em; }
.prose img { border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose :not(pre) > code { padding: .1em .35em; background: var(--surface); border: 1px solid var(--line); font: .85em var(--font-mono); color: var(--text); }
.prose .highlight { position: relative; border: 1px solid var(--line); }
.prose .highlight pre { margin: 0; padding: 20px 22px; overflow-x: auto; font: 14px/1.65 var(--font-mono); tab-size: 4; }
/* Callouts (Markdown `!!! important`, `!!! warning`, `!!! danger`, `!!! note`) */
.prose .admonition {
  --tone: var(--accent);
  margin-block: 1.8em; padding: 18px 22px 20px;
  border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
  border-top: 3px solid var(--tone);
  background: color-mix(in srgb, var(--tone) 7%, rgb(19 19 19 / .96));
}
.prose .admonition.danger, .prose .admonition.error, .prose .admonition.caution { --tone: #f08a6c; }
.prose .admonition.note, .prose .admonition.tip, .prose .admonition.hint, .prose .admonition.info { --tone: #9fb7c9; }
.prose .admonition > * + * { margin-top: .6em; }
.prose .admonition-title {
  display: flex; align-items: center; gap: 10px;
  font: 600 13px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tone);
}
.prose .admonition-title::before {
  content: "!"; display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none;
  background: var(--tone); color: var(--on-accent); font: 800 13px/1 var(--font-display); letter-spacing: 0;
}
.prose .admonition.note .admonition-title::before, .prose .admonition.tip .admonition-title::before,
.prose .admonition.hint .admonition-title::before, .prose .admonition.info .admonition-title::before { content: "i"; }
.prose .admonition p:not(.admonition-title) { color: var(--text); }

.copy-btn {
  position: absolute; top: 0; right: 0; min-height: 34px; padding: 0 12px;
  border: 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg); color: var(--text-2); font: 12px var(--font-mono); cursor: pointer;
}
.copy-btn:hover { color: var(--accent); }

.doc-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; font-size: 14px; }
.doc-nav a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.doc-nav a span { font-size: 12px; color: var(--text-3); }
.doc-nav a:hover { color: var(--accent); }
.doc-nav__next { grid-column: 2; text-align: right; }
.doc-nav__all { grid-column: 1 / -1; }
@media (max-width: 560px) { .doc-nav { grid-template-columns: 1fr; } .doc-nav__next { grid-column: auto; text-align: left; } }

/* ---------- Tools, contact, empty, 404 ---------- */
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.app-card__top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.app-card__status { color: var(--accent); }
.app-card__name { font-size: 22px; letter-spacing: -0.04em; }
.app-card__desc { flex-grow: 1; font-size: 15px; color: var(--text-2); }
.app-card__cmd { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); font: 13px/1.5 var(--font-mono); color: var(--text-2); overflow-x: auto; }
.app-card__foot { display: flex; justify-content: space-between; font-size: 13px; }
.app-card__links { display: flex; gap: 18px; }
.app-card__ver { color: var(--text-3); }

.follow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.follow__text { max-width: 36em; font-size: 18px; color: var(--text-2); }
.follow__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .follow { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .follow__actions .btn { flex: 1 1 40%; } }

.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: 720px; padding: clamp(24px, 4vw, 40px); }
.empty-state__out { font-size: 14px; color: var(--text-3); }
.empty-state p:not(.empty-state__out) { font-size: 18px; color: var(--text-2); }

.contact-list { margin: 0; max-width: 820px; border-top: 1px solid var(--line); }
.contact-list__row { display: grid; grid-template-columns: 8em minmax(0, 1fr); align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgb(16 16 16 / .8); }
.contact-list dt { padding-left: 12px; font-size: 14px; color: var(--text-3); }
.contact-list dd { margin: 0; }
.contact-list dd a { display: flex; align-items: center; min-height: 72px; padding-right: 12px; font: 700 clamp(16px, 2.2vw, 24px)/1.2 var(--font-display); letter-spacing: -0.03em; color: var(--text); overflow-wrap: anywhere; }
.contact-list__row:hover { background: var(--accent); }
.contact-list__row:hover dt, .contact-list__row:hover dd a { color: var(--on-accent); }
@media (max-width: 520px) {
  .contact-list__row { grid-template-columns: 1fr; gap: 0; }
  .contact-list dt { padding-top: 14px; }
  .contact-list dd a { min-height: 48px; padding-left: 12px; }
}

.notfound { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 760px; padding-block: clamp(64px, 10vw, 128px); }
.notfound__err { color: #f08a6c; font-size: 14px; }
.notfound .page-head__title { font-size: clamp(72px, 14vw, 160px); line-height: 1; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); padding-block: 48px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { margin-top: 12px; font-size: 15px; color: var(--text-3); }
.footer-col { display: flex; flex-direction: column; font: 14px var(--font-mono); }
.footer-col a { display: inline-flex; align-items: center; min-height: 36px; width: fit-content; color: var(--text-2); }
.footer-col a:hover { color: var(--accent); }
.footer-heading { margin-bottom: 6px; font: 400 13px var(--font-mono); color: var(--text-3); }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px dashed var(--line); font: 13px var(--font-mono); color: var(--text-3); }
.footer-legal a { color: var(--text-2); }
.footer-legal__sep { margin-inline: .4em; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Search (Pagefind) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search__form, .aside-search {
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: rgb(16 16 16 / .9);
}
.search__form:focus-within, .aside-search:focus-within { border-color: var(--accent); }
.search__prompt { font-size: 18px; }
.search__input, .aside-search input {
  flex: 1; min-width: 0; padding: 16px 0; border: 0; outline: none; background: transparent;
  color: var(--text); font-size: 16px; caret-color: var(--accent);
}
.aside-search input { padding: 12px 0; font-size: 14px; }
/* iOS zooms into any focused field under 16px, so touch screens get the full size */
@media (hover: none), (max-width: 960px) { .aside-search input { font-size: 16px; } }
.search__input::placeholder, .aside-search input::placeholder { color: var(--text-3); }
.search__status { min-height: 1.5em; margin: 18px 0 8px; font-size: 13px; color: var(--text-3); }
.search__results .ls__sum mark { background: none; color: var(--accent); font-weight: 600; }
.search-echo { color: var(--text-2); }

/* ---------- Related posts ---------- */
.related { margin-top: 40px; }
.related .ls__row { padding-block: 14px; }
.related .ls__row { grid-template-columns: auto auto minmax(0, 1fr); row-gap: 6px; }
.related .ls__perm { display: none; }
.related .ls__size { text-align: left; }
.related .ls__cat { grid-column: 3; grid-row: 1; justify-self: end; }
.related .ls__body { grid-column: 1 / -1; }
