/* Blog implementation of the portfolio and dotfiles design system. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/public-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/public-sans-latin-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-600.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --surface-primary: #0b1220;
  --surface-secondary: #111827;
  --surface-header: rgba(11, 18, 32, 0.96);
  --text-primary: #ffffff;
  --text-body: rgba(255, 255, 255, 0.78);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: #aab4c3;
  --border-default: rgba(255, 255, 255, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent-primary: #60a5fa;
  --accent-soft: #93c5fd;
  --inline-code-text: rgba(255, 255, 255, 0.86);
  --inline-code-surface: rgba(255, 255, 255, 0.055);
  --inline-code-border: rgba(255, 255, 255, 0.11);
  --accent-surface: rgba(37, 99, 235, 0.14);
  --selection-surface: rgba(96, 165, 250, 0.12);
  --accent-border: rgba(96, 165, 250, 0.35);
  --progress: #f9423a;
  --focus-ring: #93c5fd;
  --code-surface: #0a101c;
  --code-toolbar: rgba(255, 255, 255, 0.03);
  --code-border: rgba(255, 255, 255, 0.16);
  --code-text: #e5e7eb;
  --code-muted: #94a3b8;
  --code-comment: #94a3b8;
  --code-keyword: #c4b5fd;
  --code-value: #86efac;
  --code-number: #fbbf24;
  --code-function: #7dd3fc;
  --code-variable: #f9a8d4;
  --code-operator: #cbd5e1;
  --code-deleted: #f87171;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --page-gutter: clamp(var(--space-5), 5vw, var(--space-12));
  --page-width: 71.25rem;
  --reading-width: 46rem;
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface-primary: #f4f5f7;
  --surface-secondary: #ffffff;
  --surface-header: rgba(244, 245, 247, 0.95);
  --text-primary: #111827;
  --text-body: rgba(17, 24, 39, 0.84);
  --text-secondary: rgba(17, 24, 39, 0.66);
  --text-tertiary: #4b5563;
  --border-default: rgba(17, 24, 39, 0.16);
  --border-subtle: rgba(17, 24, 39, 0.09);
  --accent-primary: #1d4ed8;
  --accent-soft: #2563eb;
  --inline-code-text: #253047;
  --inline-code-surface: rgba(17, 24, 39, 0.045);
  --inline-code-border: rgba(17, 24, 39, 0.12);
  --accent-surface: rgba(37, 99, 235, 0.14);
  --selection-surface: rgba(37, 99, 235, 0.1);
  --accent-border: rgba(37, 99, 235, 0.4);
  --focus-ring: #1d4ed8;
  --code-surface: #f8fafc;
  --code-toolbar: #eef2f7;
  --code-border: rgba(17, 24, 39, 0.16);
  --code-text: #111827;
  --code-muted: #526071;
  --code-comment: #64748b;
  --code-keyword: #6d28d9;
  --code-value: #047857;
  --code-number: #b45309;
  --code-function: #0369a1;
  --code-variable: #be185d;
  --code-operator: #334155;
  --code-deleted: #b91c1c;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--surface-primary);
  color: var(--text-body);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-synthesis: none;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 150ms ease, color 150ms ease;
}

a {
  color: var(--accent-primary);
  text-decoration-color: color-mix(in srgb, var(--accent-primary) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-soft);
  text-decoration-color: var(--accent-soft);
}

p {
  text-wrap: pretty;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

::selection {
  background: #2563eb;
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: none;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  border-radius: 0.375rem;
  background: var(--surface-secondary);
  color: var(--text-primary);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-header);
  backdrop-filter: blur(0.75rem);
}

.reading-progress {
  position: relative;
  height: 2px;
  overflow: hidden;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--progress);
  transform: scaleX(0);
  transform-origin: left;
}

.header-inner,
.section-shell,
.footer-inner {
  width: auto;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: var(--space-6);
}

.brand-link,
.site-nav,
.section-eyebrow,
.archive-year > h3,
.article-row time,
.topic-list,
.back-link,
.post-navigation,
.footer-brand,
.contact-links,
.back-to-top,
.prose code,
.prose pre,
.prose figcaption {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-short {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.375rem;
}

.site-nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  transition: color 130ms ease-out;
}

.external-nav-link {
  gap: 0.3rem;
}

.external-nav-icon {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.5;
}

.site-nav a:hover,
.site-nav a.is-active,
.theme-toggle:hover {
  color: var(--text-primary);
}

.site-nav a.is-active {
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45rem;
}

.site-nav-separator {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.theme-toggle {
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 0.3125rem 0.75rem;
  background: transparent;
  cursor: pointer;
}

.section-shell {
  padding-block: clamp(4rem, 9vw, 6.875rem);
}

.section-block {
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 4rem;
}

.section-eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero {
  padding-block: clamp(4.5rem, 12vh, 8.75rem) clamp(4rem, 10vh, 7.5rem);
}

.hero .section-eyebrow {
  margin-bottom: var(--space-6);
  color: var(--accent-soft);
  letter-spacing: 0.18em;
}

.hero h1,
.section-heading h2,
.detail-header h1,
.comments-region h2,
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: var(--text-primary);
  font-family: "Bricolage Grotesque", "Public Sans", sans-serif;
  text-wrap: balance;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7.5vw, 5.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.hero-cursor {
  display: inline-block;
  width: 0.1em;
  height: 0.78em;
  margin-left: 0.12em;
  background: var(--progress);
  vertical-align: -0.04em;
  animation: cursor-blink 1.1s steps(1) infinite;
}

.hero-lead {
  max-width: 42rem;
  margin: var(--space-8) 0 0;
  color: var(--text-body);
  font-size: clamp(1.0625rem, 1.8vw, 1.1875rem);
  line-height: 1.7;
}

.archive-shell {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: clamp(var(--space-12), 6vw, var(--space-20));
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.archive-heading {
  position: sticky;
  top: calc(3.5rem + var(--space-8));
  align-self: start;
}

.archive-intro {
  max-width: 29ch;
  margin: var(--space-5) 0 0;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.topic-directory {
  margin-top: var(--space-10);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-5);
}

.topic-directory-label {
  margin: 0 0 var(--space-4);
  color: var(--text-tertiary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-directory ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-directory a {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 0.3rem 0.45rem 0.3rem 0.75rem;
  color: var(--text-secondary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition: border-color 130ms ease-out, background-color 130ms ease-out, color 130ms ease-out;
}

.topic-directory a:hover {
  border-color: var(--accent-primary);
  background: var(--selection-surface);
  color: var(--accent-soft);
}

.topic-directory-count {
  display: inline-grid;
  min-width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-secondary);
  color: var(--text-tertiary);
  font-size: 0.625rem;
}

.archive-years {
  min-width: 0;
}

.archive-year + .archive-year {
  margin-top: var(--space-16);
}

.archive-year > h3 {
  margin: 0 0 var(--space-4);
  color: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.article-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-default);
  list-style: none;
}

.article-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2) var(--space-5);
  min-width: 0;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 130ms ease-out;
}

.article-row:hover,
.article-row:focus-within {
  border-bottom-color: var(--accent-border);
}

.archive .article-row {
  align-items: center;
}

.archive .article-row time {
  grid-row: auto;
  padding-top: 0;
}

.article-row time {
  grid-row: 1 / span 2;
  padding-top: 0.35rem;
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-title {
  min-width: 0;
  color: var(--text-primary);
  font-family: "Bricolage Grotesque", "Public Sans", sans-serif;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-decoration: none;
}

.article-title:hover {
  color: var(--accent-soft);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-inline: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.topic-list a:hover {
  color: var(--text-primary);
}

.page-shell {
  width: min(100%, 52.5rem);
  min-height: calc(100vh - 20rem);
  margin-inline: auto;
  padding: clamp(var(--space-16), 10vw, var(--space-24)) var(--page-gutter);
}

.category-detail {
  width: 100%;
}

.detail-header {
  margin-bottom: var(--space-16);
}

.page-detail .detail-header,
.category-detail .detail-header {
  margin-bottom: var(--space-12);
}

.page-detail .prose > :first-child {
  margin-top: 0;
}

.post-header {
  max-width: var(--reading-width);
  margin-bottom: var(--space-16);
}

.post-page-shell {
  width: min(100%, var(--page-width));
}

.post-content-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-width)) minmax(11rem, 13rem);
  align-items: start;
  gap: clamp(var(--space-10), 5vw, 4.5rem);
}

.post-reading-column {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  margin-bottom: var(--space-10);
  color: var(--accent-soft);
  font-size: 0.75rem;
  text-decoration: none;
}

.detail-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  overflow-wrap: break-word;
}

.post-dek {
  max-width: 42rem;
  margin: var(--space-6) 0 0;
  color: var(--text-body);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-6) 0 0;
  color: var(--text-tertiary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.post-topics {
  justify-content: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.post-topics a {
  min-height: auto;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  font-size: 0.71875rem;
  letter-spacing: 0;
  line-height: 1.4;
  transition: border-color 130ms ease-out, background-color 130ms ease-out, color 130ms ease-out;
}

.post-topics a:hover {
  border-color: var(--accent-primary);
  background: var(--selection-surface);
  color: var(--text-primary);
}

.category-list .article-row {
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
}

.category-list .article-row time {
  grid-row: auto;
  padding-top: 0;
}

.empty-state {
  border-block: 1px solid var(--border-subtle);
  padding-block: var(--space-10);
}

.empty-state p {
  margin: 0;
  color: var(--text-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.empty-state a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  margin-top: var(--space-4);
  color: var(--accent-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  text-decoration: none;
}

.article-toc {
  position: sticky;
  top: calc(3.5rem + var(--space-8));
  grid-column: 2;
  grid-row: 1;
  max-height: calc(100vh - 7.5rem);
  align-self: start;
  overflow-y: auto;
  scrollbar-color: var(--border-default) transparent;
  scrollbar-width: thin;
}

.article-toc[hidden] {
  display: none;
}

.article-toc-rail {
  width: 100%;
}

.article-toc-title {
  margin: 0;
  padding: 0 0 var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-toc-picker {
  display: none;
}

.article-toc ol {
  margin: 0;
  border-left: 1px solid var(--border-default);
  padding: 0;
  list-style: none;
}

.article-toc li {
  min-width: 0;
}

.article-toc a {
  position: relative;
  display: block;
  padding: 0.4rem 0 0.4rem var(--space-4);
  color: var(--text-tertiary);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
}

.article-toc li.is-subsection a {
  padding-left: var(--space-6);
  font-size: 0.75rem;
}

.article-toc a:hover {
  color: var(--text-primary);
}

.article-toc a.is-active {
  color: var(--accent-soft);
  font-weight: 600;
}

.article-toc a.is-active::before {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: -1px;
  width: 2px;
  background: var(--accent-primary);
  content: "";
}

.prose {
  color: var(--text-body);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.post-detail .prose > p:first-child {
  color: var(--text-body);
  font-size: 1.1875rem;
  line-height: 1.7;
}

.prose p,
.prose li {
  max-width: min(65ch, var(--reading-width));
  hyphens: none;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.prose p {
  margin: 0 0 var(--space-5);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose em {
  color: var(--text-primary);
}

.prose a {
  color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  max-width: min(65ch, var(--reading-width));
  margin: 2.75rem 0 1rem;
  font-weight: 650;
  line-height: 1.18;
  scroll-margin-top: 0;
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
}

.prose h2 {
  margin-top: 3.5rem;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.prose h3 {
  margin-top: 3rem;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.prose h4 {
  font-size: 1.1875rem;
}

.prose h5 {
  font-size: 1.125rem;
}

.prose h6 {
  font-size: 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 var(--space-8);
  padding-left: 1.35rem;
}

.prose li {
  padding-left: var(--space-2);
}

.prose li + li {
  margin-top: var(--space-3);
}

.prose li::marker {
  color: var(--text-tertiary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
}

.prose blockquote {
  margin: var(--space-10) 0;
  border: 0;
  border-left: 2px solid var(--accent-border);
  padding: 0 0 0 clamp(var(--space-4), 3vw, var(--space-6));
  color: var(--text-body);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  height: 1px;
  margin: var(--space-12) 0;
  border: 0;
  background: var(--border-subtle);
}

.prose :not(pre) > code {
  border: 1px solid var(--inline-code-border);
  border-radius: 0.22rem;
  padding: 0.06em 0.3em;
  background: var(--inline-code-surface);
  color: var(--inline-code-text);
  box-decoration-break: clone;
  font-size: 0.82em;
  font-weight: 400;
  line-height: inherit;
  overflow-wrap: anywhere;
  vertical-align: 0.04em;
  -webkit-box-decoration-break: clone;
}

.prose h1 > code,
.prose h2 > code,
.prose h3 > code,
.prose h4 > code,
.prose h5 > code,
.prose h6 > code {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.86em;
  font-weight: 500;
  line-height: inherit;
  vertical-align: baseline;
}

.prose a > code {
  color: inherit;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-8) auto;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: var(--surface-secondary);
}

.prose figure {
  margin: var(--space-10) auto;
}

.media-figure-wide {
  width: 100%;
}

.media-figure-compact {
  max-width: 38.75rem;
}

.media-frame {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 0.625rem;
  padding: clamp(0.25rem, 1vw, 0.625rem);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.14);
}

.media-frame-scroll {
  overflow-x: auto;
}

.prose .media-frame.media-frame-scroll img {
  width: max(100%, 52rem);
  max-width: none;
}

.media-frame-dark {
  background: #0f172a;
}

.media-frame-light {
  background: #f8fafc;
}

.prose .media-frame img {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0.25rem;
}

.prose figcaption {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.55;
  text-align: center;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: var(--space-8) 0 var(--space-10);
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
  scrollbar-color: var(--border-default) transparent;
}

.prose th,
.prose td {
  min-width: 8rem;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem var(--space-4);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text-primary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.note {
  margin: var(--space-8) 0;
  border: 1px solid var(--accent-border);
  border-radius: 0.5rem;
  padding: var(--space-5);
  background: var(--accent-surface);
}

.note > :last-child {
  margin-bottom: 0;
}

.youtube-embed-container {
  position: relative;
  height: 0;
  max-width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
}

.youtube-embed-container iframe,
.youtube-embed-container object,
.youtube-embed-container embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.post-navigation,
.comments-region {
  margin-top: var(--space-20);
  padding-top: var(--space-10);
  border-top: 1px solid var(--border-subtle);
}

.post-navigation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.post-navigation-grid a {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  padding: var(--space-5);
  background: var(--surface-secondary);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 130ms ease-out, color 130ms ease-out;
}

.post-navigation-grid a:hover {
  border-color: var(--accent-border);
  color: var(--accent-soft);
}

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

.post-navigation-grid a:only-child {
  grid-column: 1 / -1;
  min-height: 7rem;
}

.post-navigation-kicker {
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-navigation strong {
  font-family: "Bricolage Grotesque", "Public Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.comments-region h2 {
  margin: 0 0 var(--space-8);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
}

#comments {
  min-height: 10rem;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-10);
  padding-block: clamp(3rem, 7vw, 5rem);
}

.footer-brand {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.footer-note {
  max-width: 44ch;
  margin: 0.875rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.8125rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.contact-links a:hover {
  color: var(--accent-soft);
}

.back-to-top {
  position: fixed;
  right: clamp(var(--space-4), 3vw, var(--space-8));
  bottom: clamp(var(--space-4), 3vw, var(--space-8));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--border-default);
  border-radius: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, color 130ms ease, border-color 130ms ease;
}

.back-to-top[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.back-to-top:hover {
  border-color: var(--accent-border);
  color: var(--text-primary);
}

@keyframes cursor-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .archive-shell {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .archive-heading {
    position: static;
  }

  .archive-intro {
    max-width: 38rem;
  }

  .back-to-top {
    position: static;
    display: none;
    width: max-content;
    margin: 0 var(--page-gutter) var(--space-8) auto;
  }

  .back-to-top[data-visible="true"] { display: flex; }
}

@media (max-width: 1100px) {
  .post-page-shell {
    width: min(100%, 52.5rem);
  }

  .post-header {
    max-width: none;
    margin-bottom: var(--space-12);
  }

  .post-content-layout {
    display: block;
  }

  .article-toc {
    position: static;
    max-height: none;
    margin: 0 0 var(--space-12);
    overflow: visible;
    border-block: 1px solid var(--border-subtle);
  }

  .article-toc-rail {
    display: none;
  }

  .article-toc-picker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 3.75rem;
    align-items: center;
    gap: var(--space-5);
    color: var(--text-tertiary);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .article-toc-select-wrap {
    position: relative;
    min-width: 0;
  }

  .article-toc-select-wrap::after {
    position: absolute;
    top: 50%;
    right: var(--space-3);
    color: var(--text-tertiary);
    content: "↓";
    font-size: 0.6875rem;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .article-toc select {
    width: 100%;
    min-height: 2.75rem;
    appearance: none;
    border: 1px solid var(--border-default);
    border-radius: 0.375rem;
    padding: 0.5rem 2rem 0.5rem var(--space-3);
    background: var(--surface-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font: 400 0.8125rem/1.35 "Public Sans", system-ui, sans-serif;
    letter-spacing: 0;
    text-transform: none;
  }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 8rem; }

  .header-inner {
    height: auto;
    min-height: 3.5rem;
    flex-wrap: wrap;
    gap: 0 var(--space-4);
    padding-block: 0.5rem 0.625rem;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0 var(--space-4);
  }

  .article-row,
  .category-list .article-row {
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: var(--space-3) var(--space-4);
  }

}

@media (max-width: 600px) {
  .post-navigation-grid { grid-template-columns: minmax(0, 1fr); }
  .post-navigation-next { grid-column: 1; }
}

@media (max-width: 480px) {
  html { scroll-padding-top: 7rem; }
  .brand-full, .site-nav-separator { display: none; }
  .brand-short { display: inline; }
  .header-inner { position: relative; }
  .site-nav { gap: 0 var(--space-2); }

  .theme-toggle {
    position: absolute;
    top: 0.5rem;
    right: var(--page-gutter);
  }

  .site-nav a,
  .theme-toggle {
    min-height: 2.75rem;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
  }

  .article-row,
  .category-list .article-row { grid-template-columns: 1fr; }
  .article-row time { grid-row: auto; padding-top: 0; }
  .footer-inner { flex-direction: column; }
}

@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
