@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Manrope-VariableFont_wght.woff2") format("woff2");
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/FiraCode-VariableFont_wght.woff2") format("woff2");
}

:root {
  --color-bg: #000;
  --color-surface: #0a0a0c;
  --color-surface-2: #111115;
  --color-fg: #f4f4f2;
  --color-text: rgba(244, 244, 242, 0.86);
  --color-muted: rgba(244, 244, 242, 0.6);
  --color-faint: rgba(244, 244, 242, 0.36);
  --color-line: rgba(255, 255, 255, 0.12);
  --color-line-strong: rgba(255, 255, 255, 0.24);
  --color-accent: #4b52ff;
  --color-accent-text: #9ea2ff;
  --color-accent-soft: rgba(75, 82, 255, 0.16);
  --color-code-bg: #0c0c10;
  --font: Manrope, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --size-xs: 0.75rem;
  --size-s: 0.875rem;
  --size-m: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem);
  --size-l: clamp(1.0625rem, 1.0625rem + ((1vw - 0.2rem) * 0.3), 1.25rem);
  --size-xl: clamp(1.5rem, 1.35rem + 0.8vw, 2rem);
  --size-xxl: clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem);
  --space-20: 10px;
  --space-30: 20px;
  --space-40: 30px;
  --space-50: clamp(30px, 5vw, 50px);
  --space-60: clamp(36px, 6vw, 70px);
  --space-70: clamp(50px, 7vw, 90px);
  --space-80: clamp(70px, 10vw, 140px);
  --content: 680px;
  --wide: 1240px;
  --pad: clamp(20px, 4vw, 50px);
  --radius: 14px;
  --radius-s: 8px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  color-scheme: dark;
  background: var(--color-bg);
  scrollbar-color: #2a2a30 var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font);
  font-size: var(--size-l);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  left: var(--pad);
  top: 8px;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--color-fg);
  color: var(--color-bg);
  font-size: var(--size-s);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin-inline: auto;
  max-width: 100%;
  min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: var(--size-xxl);
}

h2 {
  font-size: var(--size-xl);
}

h3 {
  font-size: var(--size-l);
}

p,
li,
blockquote,
figcaption {
  text-wrap: pretty;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-text));
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* Buttons & chips */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--color-fg);
  border-radius: 999px;
  background: var(--color-fg);
  color: var(--color-bg);
  font-size: var(--size-s);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  background: transparent;
  color: var(--color-fg);
}

.button-ghost {
  background: transparent;
  color: var(--color-fg);
  border-color: var(--color-line-strong);
}

.button-ghost:hover {
  border-color: var(--color-fg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--space-50);
}

.chip,
.filter-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-family: inherit;
  font-size: var(--size-s);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chip:hover,
.filter-btn:hover {
  color: var(--color-fg);
  border-color: var(--color-line-strong);
}

.chip[aria-current="page"],
.filter-btn.is-active {
  background: var(--color-fg);
  border-color: var(--color-fg);
  color: var(--color-bg);
}

.filter-count {
  margin-left: 0.45em;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 10px;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

/* Blur lives on a pseudo-element: a filter on the header itself would trap the fixed mobile menu. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-line);
}

.site-header-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 44px;
  max-width: var(--wide);
  margin-inline: auto;
  min-width: 0;
}

.site-header .site-title {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--size-m);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.site-header .site-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 100%;
  text-decoration: none;
}

.site-header .site-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--color-line-strong);
}

.site-header .site-title a:hover span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0 -10px 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle svg {
  display: block;
  margin: auto;
}

.site-nav {
  flex: 0 0 auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--color-muted);
  font-size: var(--size-s);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--color-fg);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a[aria-current="page"] {
  color: var(--color-fg);
  background: rgba(255, 255, 255, 0.1);
}

.nav-close {
  display: none;
}

/* Main */

.site-main {
  flex: 1 0 auto;
  padding-top: var(--space-60);
  padding-bottom: var(--space-80);
}

.page-title {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: 0 auto var(--space-50);
  font-size: var(--size-xl);
  overflow-wrap: anywhere;
}

.eyebrow,
.archive-kicker,
.post-kicker,
.featured-label,
.footer-heading,
.post-nav-label {
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Home hero */

.home-hero {
  display: grid;
  gap: var(--space-50);
  align-items: stretch;
  margin-bottom: var(--space-70);
}

.home-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--color-accent-text);
}

.home-title {
  font-size: clamp(2.5rem, 1.6rem + 4.2vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.home-lead {
  max-width: 34ch;
  margin: 1.25rem 0 0;
  font-size: var(--size-l);
  color: var(--color-muted);
  line-height: 1.45;
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin: var(--space-40) 0 0;
  padding: var(--space-30) 0 0;
  border-top: 1px solid var(--color-line);
}

.home-stats div {
  min-width: 0;
}

.home-stats dt {
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-faint);
}

.home-stats dd {
  margin: 0.3rem 0 0;
  font-size: var(--size-l);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: var(--space-40) 0 0;
}

.featured {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--color-line);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(75, 82, 255, 0.28), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(255, 122, 92, 0.08), transparent 60%),
    var(--color-surface);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.35s var(--ease);
}

.featured:hover {
  border-color: var(--color-line-strong);
  transform: translateY(-2px);
}

.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-fg);
  text-transform: none;
  letter-spacing: 0;
}

.featured-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent-text);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.featured .post-kicker {
  margin-top: auto;
  padding-top: var(--space-40);
}

.featured-title {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.featured-summary {
  color: var(--color-muted);
  font-size: var(--size-m);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: var(--size-s);
  color: var(--color-muted);
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: var(--size-s);
  font-weight: 600;
}

.featured-cta svg {
  transition: transform 0.25s var(--ease);
}

.featured:hover .featured-cta svg {
  transform: translateX(4px);
}

/* Stream + filters */

.stream-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: var(--space-30);
}

.stream-title {
  font-size: var(--size-xl);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

html.no-js .filters {
  display: none;
}

.filter-empty {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: var(--space-40) auto 0;
  color: var(--color-muted);
}

.load-more {
  display: none;
  margin: var(--space-50) auto 0;
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--color-line-strong);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--size-s);
  font-weight: 600;
  letter-spacing: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.load-more.is-visible {
  display: block;
}

.load-more:hover {
  border-color: var(--color-fg);
  background: rgba(255, 255, 255, 0.05);
}

body[data-page="home"]:not(.home-enhanced) #post-list > li[data-featured],
body[data-page="home"]:not(.home-enhanced) #post-list > li:nth-child(n + 12) {
  display: none;
}

html.js body.home-enhanced .pagination {
  display: none;
}

html.js body.home-enhanced #post-list > li {
  display: none;
}

html.js body.home-enhanced #post-list > li.is-shown {
  display: list-item;
}

/* Post list */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin-inline: auto;
  border-top: 1px solid var(--color-line);
}

.post-list li {
  margin: 0;
  animation: rise 0.45s var(--ease) both;
}

.post-list li:nth-child(1) { animation-delay: 0.02s; }
.post-list li:nth-child(2) { animation-delay: 0.05s; }
.post-list li:nth-child(3) { animation-delay: 0.08s; }
.post-list li:nth-child(4) { animation-delay: 0.11s; }
.post-list li:nth-child(5) { animation-delay: 0.14s; }
.post-list li:nth-child(6) { animation-delay: 0.17s; }
.post-list li:nth-child(7) { animation-delay: 0.2s; }
.post-list li:nth-child(8) { animation-delay: 0.23s; }
.post-list li:nth-child(9) { animation-delay: 0.26s; }
.post-list li:nth-child(10) { animation-delay: 0.29s; }
.post-list li:nth-child(n + 11) { animation-delay: 0.32s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-40);
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--color-line);
  text-decoration: none;
  transition: padding-left 0.25s var(--ease);
}

.post-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.4rem;
  bottom: 1.4rem;
  width: 2px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transition: transform 0.25s var(--ease);
}

.post-row:hover,
.post-row:focus-visible {
  padding-left: 18px;
}

.post-row:hover::before,
.post-row:focus-visible::before {
  transform: scaleY(1);
}

.post-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 820px;
}

.post-title {
  font-size: var(--size-l);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.post-row:hover .post-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--color-line-strong);
}

.post-teaser {
  color: var(--color-muted);
  font-size: var(--size-s);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  padding-top: 1.35rem;
  font-size: var(--size-s);
  color: var(--color-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-minutes {
  color: var(--color-faint);
  font-size: var(--size-xs);
}

.post-row:hover .post-row-meta time {
  color: var(--color-fg);
}

/* Pagination */

.pagination {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: var(--space-40) auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--size-s);
  font-weight: 500;
}

.pagination-numbers,
.pagination-step {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pagination a,
.pagination .current,
.pagination .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 0.8rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  text-decoration: none;
}

.pagination .dots {
  border-color: transparent;
  color: var(--color-muted);
}

.pagination a:hover {
  border-color: var(--color-fg);
}

.pagination .current {
  background: var(--color-fg);
  border-color: var(--color-fg);
  color: var(--color-bg);
}

/* Article */

.article-header {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin: 0 auto var(--space-60);
}

.article-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 1.25rem;
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-faint);
}

.article-crumbs a {
  color: var(--color-accent-text);
  text-decoration: none;
}

.article-crumbs a:hover {
  text-decoration: underline;
}

.article-header h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: var(--space-40);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-top: var(--space-30);
  border-top: 1px solid var(--color-line);
  font-size: var(--size-s);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.byline-author {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.byline-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.byline a {
  color: var(--color-fg);
  font-weight: 600;
  text-decoration: none;
}

.byline a:hover {
  text-decoration: underline;
}

.byline-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-faint);
}

.article-body {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin-inline: auto;
}

.entry {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin-inline: auto;
  color: var(--color-text);
  line-height: 1.7;
}

.article-body .entry {
  width: 100%;
}

.entry > *:first-child {
  margin-top: 0;
}

.article .entry > p:first-child {
  font-size: 1.12em;
  line-height: 1.6;
  color: var(--color-fg);
}

.entry p,
.entry ul,
.entry ol,
.entry pre,
.entry blockquote,
.entry figure,
.entry table,
.entry .code-block,
.entry .wp-block-columns {
  margin: 1.25em 0 0;
}

.entry h2,
.entry h3,
.entry h4 {
  position: relative;
  color: var(--color-fg);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.entry h2 {
  margin: 2.4em 0 0;
  font-size: var(--size-xl);
}

.entry h3 {
  margin: 2em 0 0;
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.entry h4 {
  margin: 1.8em 0 0;
  font-size: 1em;
  font-weight: 600;
}

.heading-anchor {
  margin-left: 0.4em;
  color: var(--color-faint);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.entry h2:hover .heading-anchor,
.entry h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--color-accent-text);
}

.entry a:not(.heading-anchor) {
  color: var(--color-fg);
  text-decoration-color: rgba(158, 162, 255, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.entry a:not(.heading-anchor):hover {
  color: var(--color-accent-text);
  text-decoration-color: currentColor;
}

.entry ul,
.entry ol {
  padding-left: 1.4em;
}

.entry li {
  padding-left: 0.2em;
}

.entry li + li {
  margin-top: 0.45em;
}

.entry ul > li::marker {
  color: var(--color-accent-text);
}

.entry ol > li::marker {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.entry em {
  font-style: italic;
}

.entry strong {
  font-weight: 650;
  color: var(--color-fg);
}

.entry blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--color-accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.entry blockquote > :first-child {
  margin-top: 0;
}

.entry code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 400;
  letter-spacing: 0;
}

.entry :not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-fg);
  overflow-wrap: anywhere;
}

.code-block {
  position: relative;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-s);
  background: var(--color-code-bg);
  overflow: hidden;
}

.code-block::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 14px 0 0 rgba(255, 255, 255, 0.16), 28px 0 0 rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.entry pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem 1.2rem;
  color: #e6e6f0;
  font-family: var(--font-mono);
  font-size: 0.8em;
  line-height: 1.6;
  tab-size: 2;
  scrollbar-width: thin;
}

.entry .code-block pre {
  padding-top: 2.6rem;
  border-top: 0;
  background:
    linear-gradient(var(--color-line), var(--color-line)) 0 2.1rem / 100% 1px no-repeat;
}

.entry pre code {
  font-size: inherit;
}

.copy-code {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.2rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font);
  font-size: var(--size-xs);
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.copy-code:hover,
.copy-code:focus-visible {
  color: var(--color-fg);
  border-color: var(--color-line);
  background: rgba(255, 255, 255, 0.05);
}

.copy-code.is-done {
  color: #7ee2a8;
}

.entry figure {
  margin-left: 0;
  margin-right: 0;
}

.entry figure img,
.entry > p img {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-s);
}

.entry figcaption {
  margin-top: 0.6rem;
  font-size: var(--size-s);
  color: var(--color-muted);
  text-align: center;
}

.entry img {
  display: block;
}

.entry figure img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.entry figure img:hover {
  opacity: 0.88;
}

.entry .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: start;
  gap: 0.75rem;
}

.entry .wp-block-gallery figure {
  margin: 0;
}

.entry .wp-block-gallery img {
  width: 100%;
  height: auto;
}

.entry .wp-block-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.25rem;
}

.entry .wp-block-column > :first-child {
  margin-top: 0;
}

.entry hr {
  height: auto;
  margin: 2.5em 0;
  border: 0;
  color: var(--color-faint);
  text-align: center;
}

.entry hr::before {
  content: "• • •";
  letter-spacing: 0.6em;
}

.entry table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--size-s);
}

.entry th,
.entry td {
  border-bottom: 1px solid var(--color-line);
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.entry th {
  color: var(--color-fg);
  font-weight: 600;
}

/* Table of contents */

.toc-wrap {
  margin-bottom: var(--space-50);
}

.toc {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: var(--size-s);
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  cursor: pointer;
  list-style: none;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.toc[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0 0.6rem 0.8rem;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--color-muted);
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.toc .toc-l3 a {
  padding-left: 1.6rem;
  font-size: 0.95em;
}

.toc a:hover {
  color: var(--color-fg);
  background: rgba(255, 255, 255, 0.04);
}

.toc a.is-active {
  color: var(--color-fg);
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* Catalog — section index */

.catalog-hero {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: 0 auto var(--space-40);
  text-align: center;
}

.catalog-title {
  width: auto;
  margin: 0 0 0.7rem;
  font-size: var(--size-xxl);
  letter-spacing: -0.035em;
}

.catalog-lead {
  margin: 0;
  font-size: var(--size-m);
  color: var(--color-muted);
}

.catalog-jump {
  max-width: 980px;
}

.catalog {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}

.catalog-section {
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 20px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(75, 82, 255, 0.1), transparent 60%),
    var(--color-surface);
  padding: var(--space-30);
  overflow: hidden;
}

.catalog-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.7rem;
  row-gap: 0.35rem;
  margin-bottom: var(--space-30);
  padding-bottom: var(--space-30);
  border-bottom: 1px solid var(--color-line);
  font-size: var(--size-l);
}

.catalog-index {
  font-size: 1em;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1.125;
  color: var(--color-accent-text);
  font-variant-numeric: tabular-nums;
}

.catalog-section-copy {
  min-width: 0;
}

.catalog-section-copy h2 {
  font-size: 1em;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.catalog-meta {
  margin: 0;
  font-size: var(--size-s);
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.catalog-layer {
  margin: 0 0 var(--space-30);
  padding: 0;
}

.catalog-layer:last-child {
  margin-bottom: 0;
}

.catalog-layer h3 {
  margin: 0 0 0.5rem;
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-list li:last-child a {
  border-bottom: 0;
}

.catalog-list a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-line);
  text-decoration: none;
}

.catalog-list a:hover .catalog-item-title {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--color-line-strong);
}

.catalog-item-title {
  min-width: 0;
  font-size: var(--size-m);
  overflow-wrap: anywhere;
}

.catalog-list time {
  font-size: var(--size-s);
  color: var(--color-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.catalog-list a:hover time {
  color: var(--color-fg);
}

/* Archives & pages */

.archive-hero {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: 0 auto var(--space-50);
  text-align: center;
}

.archive-kicker {
  margin: 0 0 0.9rem;
  color: var(--color-accent-text);
}

.archive-kicker a {
  text-decoration: none;
}

.archive-kicker a:hover {
  text-decoration: underline;
}

.archive-title {
  margin: 0 auto 0.65rem;
  max-width: 22ch;
  font-size: var(--size-xxl);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.archive-count {
  margin: 0;
  font-size: var(--size-m);
  color: var(--color-muted);
}

.statement-panel {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin-inline: auto;
  position: relative;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(75, 82, 255, 0.14), transparent 60%),
    var(--color-surface);
  padding: clamp(24px, 4vw, 44px);
}

.statement-panel .entry {
  width: auto;
  margin: 0;
}

.statement-panel .entry p + p {
  margin-top: 1.1rem;
}

.statement-panel .entry ul {
  list-style: none;
  padding: 0;
}

/* Post nav + more */

.post-nav {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin: var(--space-70) auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.post-nav-link:hover {
  border-color: var(--color-line-strong);
  background: var(--color-surface);
}

.post-nav-next {
  grid-column: 2;
  text-align: right;
}

.post-nav-title {
  font-size: var(--size-m);
  font-weight: 500;
  line-height: 1.3;
}

.post-nav-link time {
  font-size: var(--size-xs);
  color: var(--color-faint);
}

.more-posts {
  width: min(100% - (var(--pad) * 2), var(--wide));
  margin: var(--space-70) auto 0;
}

.more-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--space-30);
}

.more-head h2 {
  font-size: var(--size-xl);
}

.more-head a {
  color: var(--color-muted);
  font-size: var(--size-s);
  font-weight: 500;
  text-decoration: none;
}

.more-head a:hover {
  color: var(--color-fg);
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.3s var(--ease);
}

.card:hover {
  border-color: var(--color-line-strong);
  transform: translateY(-2px);
}

.card-title {
  font-size: var(--size-m);
  font-weight: 500;
  line-height: 1.3;
}

.card-teaser {
  color: var(--color-muted);
  font-size: var(--size-s);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card time {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: var(--size-xs);
  color: var(--color-faint);
}

/* Footer */

.site-footer {
  margin-top: auto;
  padding: var(--space-60) 0 var(--space-40);
  border-top: 1px solid var(--color-line);
  background: linear-gradient(180deg, var(--color-surface), var(--color-bg) 70%);
}

.footer-grid {
  display: grid;
  gap: var(--space-50);
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.footer-logo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--color-line-strong);
}

.footer-title {
  margin: 0 0 0.35rem;
  font-size: var(--size-l);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-tagline {
  max-width: 32ch;
  margin: 0;
  color: var(--color-muted);
  font-size: var(--size-s);
  line-height: 1.5;
}

.footer-heading {
  margin: 0 0 0.9rem;
  color: var(--color-faint);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-sections ul {
  display: block;
  columns: 2 200px;
  column-gap: 1.5rem;
}

.footer-sections li {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  line-height: 1.35;
}

.footer-col a {
  color: var(--color-muted);
  font-size: var(--size-s);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--color-fg);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-20);
  margin-top: var(--space-60);
  padding-top: var(--space-30);
  border-top: 1px solid var(--color-line);
  font-size: var(--size-xs);
  color: var(--color-faint);
}

.footer-bottom p {
  margin: 0;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: fade 0.2s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(100%, 1400px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-s);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: inherit;
  cursor: pointer;
}

.back-top {
  position: fixed;
  right: max(var(--pad), env(safe-area-inset-right));
  bottom: max(var(--pad), env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-top:hover {
  border-color: var(--color-fg);
}

body.nav-open,
body.lightbox-open {
  overflow: hidden;
}

.empty {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin-inline: auto;
  color: var(--color-muted);
}

.empty p {
  margin-top: 1.2rem;
}

.not-found {
  width: min(100% - (var(--pad) * 2), var(--content));
  margin: var(--space-40) auto 0;
  text-align: center;
  color: var(--color-muted);
}

.not-found-code {
  margin: 0 0 0.5rem;
  font-size: clamp(6rem, 4rem + 12vw, 12rem);
  font-weight: 200;
  letter-spacing: -0.08em;
  line-height: 1;
  background: linear-gradient(180deg, var(--color-fg), rgba(158, 162, 255, 0.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found .archive-title {
  color: var(--color-fg);
}

.not-found .home-actions {
  justify-content: center;
}

/* Responsive */

@media (min-width: 960px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--space-70);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 0.8fr);
  }
}

@media (min-width: 1240px) {
  .article.has-toc .article-body {
    width: min(100% - (var(--pad) * 2), var(--wide));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--content)) minmax(0, 1fr);
    column-gap: var(--space-50);
    align-items: start;
  }

  .article.has-toc .entry {
    grid-column: 2;
    grid-row: 1;
  }

  .article.has-toc .toc-wrap {
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-width: 280px;
    max-height: calc(100vh - var(--header-h) - 48px);
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .article.has-toc .toc {
    border: 0;
    border-left: 1px solid var(--color-line);
    border-radius: 0;
    background: transparent;
  }

  .article.has-toc .toc summary {
    pointer-events: none;
    padding-top: 0.2rem;
  }

  .article.has-toc .toc summary::after {
    display: none;
  }
}

@media (max-width: 959px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    margin: 0;
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    backdrop-filter: blur(22px) saturate(1.15);
    padding: max(var(--space-40), env(safe-area-inset-top)) var(--pad) var(--space-40);
    animation: fade 0.2s ease;
  }

  .site-nav.is-open .nav-close {
    display: block;
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(calc(var(--pad) - 10px), env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .site-nav.is-open ul {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin-top: 4.5rem;
  }

  .site-nav.is-open li {
    border-bottom: 1px solid var(--color-line);
  }

  .site-nav.is-open a {
    padding: 1rem 0;
    border-radius: 0;
    background: none;
    color: var(--color-fg);
    font-size: var(--size-xl);
    white-space: normal;
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-nav.is-open {
      background: rgba(0, 0, 0, 0.95);
    }
  }

  .filters {
    flex-wrap: nowrap;
    margin-inline: calc(var(--pad) * -1);
    padding-inline: var(--pad);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
  }

  .filters::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .post-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 1.15rem 0;
  }

  .post-row::before {
    top: 1.15rem;
    bottom: 1.15rem;
  }

  .post-row-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0;
    order: -1;
  }

  .post-row-meta .post-minutes::before {
    content: "·";
    margin-right: 0.6rem;
  }

  .post-teaser {
    -webkit-line-clamp: 3;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    grid-column: auto;
    text-align: left;
  }

  .home-stats {
    gap: 1rem 1.75rem;
  }

  .byline-author + .byline-sep {
    display: none;
  }

  .byline-author {
    width: 100%;
  }
}

@media (hover: none) {
  .heading-anchor {
    opacity: 0.5;
  }
}

@media (min-width: 782px) {
  .catalog-section {
    padding: var(--space-40);
  }

  .catalog-section-head {
    gap: 1.1rem 1.5rem;
    align-items: end;
  }

  .catalog-index {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 200;
    line-height: 0.8;
    color: rgba(158, 162, 255, 0.4);
  }

  .catalog-section-copy h2 {
    font-size: var(--size-xl);
  }

  .catalog-layer {
    padding: 0.15rem 0 0.15rem 1.15rem;
    border-left: 1px solid var(--color-line);
  }

  .catalog-list a {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.25rem;
    position: relative;
    transition: padding-left 0.2s var(--ease);
  }

  .catalog-list a::before {
    content: "";
    position: absolute;
    left: -1.15rem;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--color-accent);
    transition: width 0.2s ease;
  }

  .catalog-list a:hover,
  .catalog-list a:focus-visible {
    padding-left: 0.55rem;
  }

  .catalog-list a:hover::before,
  .catalog-list a:focus-visible::before {
    width: 2px;
  }

  .catalog-list time {
    flex: 0 0 auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .reading-progress,
  .back-top,
  .toc-wrap,
  .post-nav,
  .more-posts,
  .copy-code,
  .heading-anchor,
  .skip-link {
    display: none !important;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .entry,
  .entry strong,
  .entry h2,
  .entry h3,
  .article-header h1 {
    color: #000;
  }

  .code-block {
    background: #f5f5f5;
    border-color: #ccc;
  }

  .entry pre {
    color: #000;
    white-space: pre-wrap;
  }

  .entry a:not(.heading-anchor)::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .post-list li {
    opacity: 1;
    transform: none;
  }
}
