/* Inverted take on a light, monospace-labelled developer index. */
:root {
  --bg: #0b0b0c;
  --bg-2: #131315;
  --fg: #f1f1ee;
  --muted: #8d8d89;
  --faint: #5e5e5b;
  --line: rgba(255, 255, 255, 0.24);
  --line-soft: rgba(255, 255, 255, 0.1);
  --hl: #0f9595;           /* exact inverse of the reference's red hover */
  --hl-fg: #ffffff;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --display: "Zen Dots", "Eurostile", "Bank Gothic", sans-serif;
  --futur: "Michroma", "Eurostile", "Bank Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(14px, 2vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
code, pre { font-family: var(--mono); }
button { font: inherit; color: inherit; }
::selection { background: var(--hl); color: var(--hl-fg); }
.wrap { padding-inline: var(--gutter); }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.bar-left { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.bar-left::-webkit-scrollbar { display: none; }
.logo { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; flex: none; }
.logo span { width: 12px; height: 12px; background: var(--fg); display: block; }
.chip {
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em;
  padding: 7px 10px; color: var(--muted); white-space: nowrap; transition: color .12s, background .12s;
}
a.chip:hover { color: var(--fg); background: var(--line-soft); }
.chip.active { background: var(--fg); color: var(--bg); }
.chip-static { padding-right: 0; color: var(--faint); }
@media (max-width: 640px) { .bar-right { display: none; } }

/* ---------- page titles ---------- */
.page-title {
  margin: clamp(36px, 7vw, 84px) 0 0;
  font-size: clamp(72px, 15vw, 188px); line-height: .88; letter-spacing: -0.065em; font-weight: 500;
  word-break: break-word;
}
.page-title sup {
  font-size: clamp(14px, 1.5vw, 20px); letter-spacing: 0; font-weight: 400;
  vertical-align: top; position: relative; top: .5em; margin-left: .3em; color: var(--muted);
}
.page-lead { max-width: 560px; margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.crumb { margin: 28px 0 0; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.crumb a:hover { color: var(--fg); }
.crumb + .page-title, .crumb + .post-title {
  margin: 14px 0 0; max-width: 22ch; overflow-wrap: anywhere;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(32px, 6.4vw, 92px); line-height: 1.06; letter-spacing: 0;
}

/* ---------- index layout ---------- */
.index { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 40px); margin-top: clamp(36px, 6vw, 72px); padding-bottom: 96px; }
.index-single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 800px) { .index { grid-template-columns: 1fr; } }

.label, .list-head, .meta dt {
  font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.filters .label { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tree { margin-top: 14px; font: 400 11px/1 var(--mono); }
.tree summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 12px; padding: 4px 0 8px; color: var(--fg);
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "⌄"; color: var(--muted); display: inline-block; width: 10px; transition: transform .15s; }
.tree:not([open]) summary::before { transform: rotate(-90deg); }
.tree ul { list-style: none; margin: 0 0 0 18px; padding: 0; }
.tree li { margin: 0; }
.tree label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; color: var(--muted); transition: color .12s; }
.tree label:hover, .tree input:checked ~ span { color: var(--fg); }
.tree input { position: absolute; opacity: 0; pointer-events: none; }
.box { width: 10px; height: 10px; border: 1px solid var(--faint); flex: none; transition: background .12s, border-color .12s; }
.tree input:checked + .box { background: var(--hl); border-color: var(--hl); }
.tree input:focus-visible + .box { outline: 1px solid var(--fg); outline-offset: 2px; }
.n { color: var(--faint); }
.no-js .tree, .filters .tree { display: block; }

/* ---------- list rows ---------- */
.list-head { display: grid; grid-template-columns: 120px 1fr; padding: 0 12px 10px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { position: relative; border-bottom: 1px solid var(--line); transition: background .08s; }
.row-link { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; padding: 11px 52px 11px 12px; }
.row-date { display: flex; align-items: center; gap: 8px; font: 400 11px var(--mono); color: var(--muted); }
.sq { width: 5px; height: 5px; background: var(--fg); display: inline-block; flex: none; }
.row-title { font-family: var(--display); font-weight: 400; font-size: clamp(16px, 1.9vw, 25px); letter-spacing: 0; line-height: 1.25; overflow-wrap: anywhere; }
.arrow { display: inline-block; font-size: .6em; vertical-align: .25em; opacity: 0; transform: translate(-3px, 3px); transition: opacity .1s, transform .12s; }
/* Hover inverts the row (light background, dark text). Real hover only on devices that have it;
   touch devices get the same look while the row is pressed. */
@media (hover: hover) {
  .row:hover { background: var(--fg); color: var(--bg); }
  .row:hover .row-date, .row:hover .n { color: rgba(11,11,12,.6); }
  .row:hover .sq { background: var(--bg); }
  .row:hover .arrow { opacity: 1; transform: none; }
  .row:hover .row-toggle { color: var(--bg); }
  .row:hover .row-more p { color: rgba(11,11,12,.75); }
  .row:hover .tag { border-color: rgba(11,11,12,.45); color: var(--bg); }
}
.row:active { background: var(--fg); color: var(--bg); }
.row:active .row-date, .row:active .n { color: rgba(11,11,12,.6); }
.row:active .sq { background: var(--bg); }
.row:active .arrow { opacity: 1; transform: none; }
.row:active .row-toggle { color: var(--bg); }
.row:active .row-more p { color: rgba(11,11,12,.75); }
.row:active .tag { border-color: rgba(11,11,12,.45); color: var(--bg); }
.row[hidden] { display: none; }

.row-toggle {
  display: none; position: absolute; top: 0; right: 0; width: 52px; height: 49px;
  background: none; border: 0; cursor: pointer; font: 400 18px var(--mono); color: var(--muted);
}
.js .row-toggle { display: block; }
.row-toggle[aria-expanded="true"] { transform: rotate(45deg); }
.row-more { display: none; padding: 2px 52px 20px 132px; }
.row.open .row-more { display: block; }
.row-more p { margin: 0 0 12px; max-width: 620px; color: var(--muted); }
.row-more p p { margin: 0; }
@media (max-width: 560px) {
  .row-link { grid-template-columns: 1fr; gap: 6px; padding-block: 16px; }
  .row-toggle { height: 56px; }          /* bigger tap target */
  .row-more { padding-left: 12px; padding-bottom: 24px; }
  .list-head { display: none; }
}
.empty { margin: 24px 12px; color: var(--muted); font: 400 12px var(--mono); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 5px 8px;
  border: 1px solid var(--line); color: var(--muted); transition: color .12s, border-color .12s, background .12s;
}
a.tag:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }

/* ---------- post ---------- */
.post-title {
  margin: 14px 0 0; max-width: 18ch; font-size: clamp(40px, 8vw, 104px); line-height: .95;
  letter-spacing: -0.055em; font-weight: 500;
}
.post { max-width: 760px; margin-top: clamp(28px, 4vw, 48px); padding-bottom: 120px; }

/* post pages: one centred reading column (title, byline and body share it) */
.post-page { max-width: 760px; margin-inline: auto; }
.post-page .crumb + .post-title { max-width: none; font-size: clamp(30px, 5vw, 56px); line-height: 1.12; }

/* published / updated / author / topics, shown at the top of the article (Michroma labels) */
.byline { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 5vw, 44px); margin: 0 0 26px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); }
.byline dt { font: 400 8.5px/1 var(--futur); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.byline dd { margin: 8px 0 0; font: 400 10px/1.7 var(--futur); letter-spacing: .02em; overflow-wrap: anywhere; }
.byline dd a:hover { color: var(--hl); }
.byline .tag { font-family: var(--futur); font-weight: 400; font-size: 8px; letter-spacing: .08em; }

/* search box above the post list on the home page (hidden without JS) */
.search {
  display: none; width: 100%; margin: 0 0 6px; padding: 14px 12px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; color: var(--fg); font: 400 14px var(--mono); outline: 0; -webkit-appearance: none; appearance: none;
}
.js .search { display: block; }
.search::placeholder { color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.search:focus { border-bottom-color: var(--fg); }
@media (max-width: 800px) { .search { font-size: 16px; } }
@media (max-width: 560px) { .search { margin-bottom: 0; } .search ~ .rows { border-top: 0; } }  /* list header is hidden here, so avoid a double line */
.meta { align-self: start; position: sticky; top: 20px; }
@media (max-width: 800px) { .meta { position: static; } }
.meta dl { margin: 0; border-top: 1px solid var(--line); }
.meta dt { padding-top: 12px; }
.meta dd { margin: 8px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); font: 400 12px/1.5 var(--mono); }
.meta dd a:hover { color: var(--hl); }
.post-lead { margin: 0 0 8px; font-family: var(--serif); font-weight: 300; font-size: clamp(17px, 2vw, 21px); line-height: 1.6; color: var(--muted); }
.post-lead p { margin: 0; }

.prose { padding-top: 24px; font-family: var(--serif); font-size: 16.5px; line-height: 1.85; color: #dcdcd8; }
/* headings, code and tables inside articles keep the UI faces */
.prose h2, .prose h3, .prose th { font-family: var(--sans); }
.prose code, .prose pre, .prose pre code { font-family: var(--mono); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 30px; letter-spacing: -0.035em; font-weight: 500; color: var(--fg); line-height: 1.15; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 22px; letter-spacing: -0.025em; font-weight: 500; color: var(--fg); }
.prose p, .prose ul, .prose ol { margin: 1.1em 0; }
.prose a { color: var(--fg); border-bottom: 1px solid var(--hl); transition: background .12s; }
.prose a:hover { background: var(--hl); color: var(--hl-fg); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose img { border: 1px solid var(--line); margin: 1.4em 0; display: block; }
.prose blockquote { margin: 1.6em 0; padding: 2px 20px; border-left: 2px solid var(--hl); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.prose :not(pre) > code { font-size: .85em; padding: .12em .4em; background: var(--bg-2); border: 1px solid var(--line-soft); }
.prose pre {
  position: relative; margin: 1.6em 0; padding: 16px 18px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.7;
}
.prose pre code { font-size: inherit; color: #dcdcd8; background: none; border: 0; padding: 0; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 5px 8px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.prose pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--fg); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding-block: 28px 40px; border-top: 1px solid var(--line);
  font: 400 11px var(--mono); color: var(--muted);
}
.footer a:hover { color: var(--fg); }

/* site-name heading on the home page: Zen Dots display face */
.page-title-site {
  font-family: var(--display); font-weight: 400; letter-spacing: 0; line-height: 1.02;
  font-size: clamp(42px, 9.5vw, 132px); max-width: 100%; overflow-wrap: anywhere;
}
.page-title-site sup { font-family: var(--sans); letter-spacing: 0; }

/* left-hand panels (home filters, post metadata) use Michroma, an extended futuristic face */
.filters .label, .filters .tree, .meta dt, .meta dd, .meta .tag { font-family: var(--futur); font-weight: 400; }
.filters .label, .meta dt { font-size: 8.5px; letter-spacing: .12em; }
.filters .tree { font-size: 9.5px; }
.filters .tree summary { font-size: 10.5px; }
.filters .tree label { padding: 7px 0; }
.meta dd { font-size: 10px; line-height: 1.7; letter-spacing: .02em; overflow-wrap: anywhere; }
.meta .tag { font-size: 8px; letter-spacing: .08em; }

/* dates in the post list (and counts on the tags page) use Michroma */
.row-date { font-family: var(--futur); font-weight: 400; font-size: 9.5px; letter-spacing: .04em; }
