/* Supacode — Blog
   Builds on style.css: same black canvas, EDIX display type and nav.
   Adds a silver tint, a drifting colour field and glass surfaces. */

.blog {
  /* Blog tint. Everything tinted on the blog derives from these two. */
  --accent: #d1d1d1;          /* silver */
  --accent-deep: #b4b1b1;     /* warm grey */
  --on-accent: #111113;       /* text on filled accent chips */
  --glow: .22;                /* strength of the tinted background glow */
  --violet: #a78bfa;
  --blue: #4d7cff;

  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  --glass-border: rgba(255, 255, 255, .11);
  --glass-hi: rgba(255, 255, 255, .16);
  --glass-blur: blur(22px) saturate(150%);
  --radius: 20px;
  --radius-sm: 12px;

  --font-read: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --read: 740px;
  --wide: 1180px;

  font-family: var(--font-read);
  background: #000;
}

.blog ::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- Drifting colour field ---------- */

.aurora {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent-deep) 7%, #000) 0%, #000 60%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .32;
  will-change: transform;
}
.blob-a {
  width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax;
  background: radial-gradient(circle at 40% 40%, var(--accent) 0%, var(--accent-deep) 45%, transparent 70%);
  animation: drift-a 26s ease-in-out infinite alternate;
  opacity: var(--glow);
}
.blob-b {
  width: 46vmax; height: 46vmax; right: -16vmax; top: 18vh;
  background: radial-gradient(circle, var(--violet) 0%, transparent 68%);
  opacity: .24;
  animation: drift-b 32s ease-in-out infinite alternate;
}
.blob-c {
  width: 40vmax; height: 40vmax; left: 20vw; bottom: -26vmax;
  background: radial-gradient(circle, var(--blue) 0%, transparent 68%);
  opacity: .2;
  animation: drift-c 38s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(14vw, 10vh, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-12vw, 16vh, 0) scale(.9); } }
@keyframes drift-c { to { transform: translate3d(-10vw, -14vh, 0) scale(1.15); } }

.aurora-stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; }
/* Fine grain keeps the large gradients from banding */
.aurora-grain {
  position: absolute; inset: -50%;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Glass ---------- */

.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 rgba(255, 255, 255, .03),
    0 24px 48px -24px rgba(0, 0, 0, .7);
  isolation: isolate;
}
/* Specular sheen that follows the pointer (set by blog.js) */
.glass::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .09), transparent 45%);
}
.glass:hover::after { opacity: 1; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(22, 24, 22, .92); }
}

/* Nav: always glass on blog pages */
.nav-glass {
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ""; display: block; height: 1px; margin-top: 4px; background: var(--accent);
}

/* ---------- Layout ---------- */

.blog-main { min-height: 70vh; }
.blog-wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.blog .footer { position: relative; }
.blog .eyebrow a { color: inherit; transition: color .2s; }
.blog .eyebrow a:hover { color: var(--accent); }

.blog-hero { padding: calc(var(--nav-h) + clamp(56px, 10vw, 120px)) 0 clamp(40px, 6vw, 72px); }
.blog-hero-sm { padding-bottom: 40px; }
.blog-hero-title { font-size: clamp(32px, 9.2vw, 108px); }
.blog-hero-sm .blog-hero-title { font-size: clamp(40px, 7vw, 88px); }
.blog-hero-lede { max-width: 560px; margin: 24px 0 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--text-2); line-height: 1.8; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
  color: var(--text-2);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: color .2s, background-color .2s, border-color .2s;
}
.chip span { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
a.chip:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, .09); }
.chip.is-active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.chip.is-active span { color: color-mix(in srgb, var(--on-accent) 60%, transparent); }
.chip-lg {
  height: 38px; padding: 0 16px; font-size: 13px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* ---------- Post cards ---------- */

.blog-list { padding-bottom: 120px; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  margin-top: 20px;
}
.post-card { overflow: hidden; transition: transform .5s var(--ease), border-color .3s, box-shadow .5s var(--ease); }
.post-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 30px 60px -30px color-mix(in srgb, var(--accent-deep) 45%, transparent);
}
.post-card-link { display: flex; flex-direction: column; height: 100%; }
.post-card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: #0b0d0a; border-bottom: 1px solid var(--line); }
.post-card-cover picture { display: contents; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.post-card:hover .post-card-cover img { transform: scale(1.04); }
.post-card-cover-empty {
  display: grid; place-items: center;
  background:
    radial-gradient(80% 120% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(80% 120% at 100% 100%, rgba(167, 139, 250, .16), transparent 60%),
    #070807;
}
.post-card-cover-empty .display { font-size: clamp(22px, 3vw, 30px); color: rgba(255, 255, 255, .22); }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 22px; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 12px; color: var(--text-3); }
.post-card-title { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 600; letter-spacing: -.005em; }
.post-card-excerpt {
  margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-foot {
  display: flex; justify-content: space-between; margin: auto 0 0; padding-top: 8px;
  font-size: 12px; color: var(--text-3);
}
.post-card-foot .arrow { color: var(--accent); transition: transform .3s var(--ease); }
.post-card:hover .post-card-foot .arrow { transform: translateX(4px); }

.post-card-featured .post-card-link { display: grid; grid-template-columns: 1.15fr 1fr; }
.post-card-featured .post-card-cover { aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--line); }
.post-card-featured .post-card-body { padding: clamp(24px, 4vw, 48px); justify-content: center; gap: 16px; }
.post-card-featured .post-card-title { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.35; }
.post-card-featured .post-card-excerpt { font-size: 15px; -webkit-line-clamp: 4; }
.post-card-featured .post-card-foot { margin-top: 12px; flex: 0; }

/* ---------- Archive ---------- */

.archive { display: grid; gap: 20px; padding-bottom: 120px; }
.archive-year { padding: clamp(20px, 3vw, 36px); }
.archive-year-title { font-size: clamp(36px, 5vw, 56px); display: flex; align-items: baseline; gap: 14px; }
.archive-year-title .mono { font-size: 13px; color: var(--accent); letter-spacing: 0; }
.archive-list { list-style: none; margin: 18px 0 0; padding: 0; }
.archive-list a {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  transition: padding .3s var(--ease), color .2s;
}
.archive-list li:first-child a { border-top: 0; }
.archive-list a:hover { padding-left: 12px; color: var(--accent); }
.archive-list time { font-size: 13px; color: var(--text-3); min-width: 42px; }
.archive-title { flex: 1; font-size: 16px; line-height: 1.5; }

/* ---------- Post ---------- */

.read-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.read-progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}

.post-header { max-width: calc(var(--read) + var(--gutter) * 2); padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px)); }
.post-title {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 24px 0 0; font-size: 13px; color: var(--text-2); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.post-cover { margin: 48px auto 0; max-width: calc(1080px + var(--gutter) * 2); }
.post-cover picture { display: block; }
.post-cover img {
  width: 100%; max-height: 560px; object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--read)) 240px;
  justify-content: center;
  gap: 56px;
  margin-top: 56px;
}
.post-layout.no-toc { grid-template-columns: minmax(0, var(--read)); }

.toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; padding: 20px 18px; max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; }
.toc-title { margin: 0 0 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block; padding: 5px 10px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; color: var(--text-2);
  border-left: 2px solid transparent;
  transition: color .2s, background-color .2s, border-color .2s;
}
.toc .toc-l3 a { padding-left: 22px; font-size: 12.5px; color: var(--text-3); }
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0 8px 8px 0; }

.post-footer { max-width: calc(var(--read) + 240px + 56px + var(--gutter) * 2); padding-top: 72px; padding-bottom: 120px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav-item { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; transition: border-color .3s, transform .5s var(--ease); }
.post-nav-item .eyebrow { margin: 0; font-size: 11px; }
.post-nav-item:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-2px); }
.post-nav-older { text-align: right; }
.post-nav-title { font-size: 15px; line-height: 1.5; font-weight: 600; }

/* ---------- Prose ---------- */

.prose { font-size: 17px; line-height: 1.85; color: #e6e6ea; letter-spacing: .005em; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap, .prose figure, .prose details { margin: 0 0 1.4em; }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--text); font-weight: 700; letter-spacing: -.01em; line-height: 1.4; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h2 { font-size: 1.55em; margin: 2.2em 0 .8em; padding-bottom: .4em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.25em; margin: 1.9em 0 .7em; }
.prose h4 { font-size: 1.05em; margin: 1.6em 0 .6em; }
.heading-anchor {
  position: absolute; left: -1.1em; width: 1em;
  color: var(--accent); opacity: 0; font-weight: 400;
  transition: opacity .2s;
}
.prose :is(h2, h3, h4):hover .heading-anchor, .heading-anchor:focus-visible { opacity: .8; }

.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose a.heading-anchor { text-decoration: none; }
.prose strong { color: #fff; font-weight: 650; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent); }
.prose ol > li::marker { font-family: var(--font-mono); font-size: .88em; }
.prose li > ul, .prose li > ol { margin: .3em 0 .3em; }
.prose hr { border: 0; height: 1px; margin: 3em 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

.prose blockquote {
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--text-2);
}
.prose blockquote > :last-child { margin-bottom: 0; }

.prose img, .prose picture img, .prose video {
  max-width: 100%; height: auto; margin: 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.prose picture { display: block; }
.prose p > img, .prose p > picture { display: block; margin: 1.8em auto; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { margin-top: 10px; font-size: 13px; color: var(--text-3); text-align: center; }

.media video { display: block; width: 100%; background: #000; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.media audio { display: block; width: 100%; color-scheme: dark; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 1.4em; }

/* inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: .86em;
  padding: .15em .45em; border-radius: 6px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  color: color-mix(in srgb, var(--accent) 45%, #fff);
  overflow-wrap: anywhere;
}
.prose kbd {
  font-family: var(--font-mono); font-size: .82em; padding: .1em .45em;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: rgba(255, 255, 255, .05);
}

/* code blocks */
.code-block {
  margin: 0 0 1.6em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(8, 10, 12, .78);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 48px -28px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.code-block figcaption {
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 10px 0 14px; margin: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  text-align: left;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.code-label { flex: 1; letter-spacing: .02em; }
.code-copy {
  height: 26px; padding: 0 10px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2); border: 1px solid transparent;
  transition: color .2s, background-color .2s, border-color .2s;
}
.code-copy:hover { color: var(--text); background: rgba(255, 255, 255, .06); border-color: var(--line); }
.code-copy.done { color: var(--accent); }
.code-block pre.shiki {
  margin: 0; padding: 16px 0;
  background: transparent !important;
  overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  tab-size: 4;
}
.code-block pre code { display: block; min-width: max-content; }
.code-block .line { display: inline-block; width: 100%; padding: 0 20px; }
.code-block .line.highlighted { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.code-block .line.diff.add { background: rgba(46, 160, 67, .15); }
.code-block .line.diff.add::before { content: "+"; position: absolute; margin-left: -14px; color: #3fb950; }
.code-block .line.diff.remove { background: rgba(248, 81, 73, .13); opacity: .8; }
.code-block .line.diff.remove::before { content: "−"; position: absolute; margin-left: -14px; color: #f85149; }
.code-block .has-focused .line:not(.focused) { opacity: .35; filter: blur(.6px); transition: opacity .3s, filter .3s; }
.code-block:hover .has-focused .line:not(.focused) { opacity: 1; filter: none; }
.code-block pre::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .02); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--text); background: rgba(255, 255, 255, .04); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* task lists */
.prose .contains-task-list { list-style: none; padding-left: .2em; }
.prose .task-list-item input { accent-color: var(--accent); margin-right: .5em; transform: translateY(1px); }

/* GitHub-style alerts: > [!NOTE] */
.markdown-alert {
  margin: 0 0 1.4em; padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--alert-border, var(--line));
  background: var(--alert-bg, rgba(255, 255, 255, .04));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.markdown-alert > :last-child { margin-bottom: 0; }
.markdown-alert-title { display: flex; align-items: center; gap: 8px; margin: 0 0 .4em; font-weight: 650; font-size: 14px; letter-spacing: .02em; color: var(--alert-fg, var(--text)); }
.markdown-alert-title svg { fill: currentColor; }
.markdown-alert-note      { --alert-fg: #7aa2ff; --alert-border: rgba(77, 124, 255, .35);  --alert-bg: rgba(77, 124, 255, .08); }
.markdown-alert-tip       { --alert-fg: var(--accent); --alert-border: color-mix(in srgb, var(--accent) 35%, transparent); --alert-bg: color-mix(in srgb, var(--accent) 7%, transparent); }
.markdown-alert-important { --alert-fg: var(--violet); --alert-border: rgba(167, 139, 250, .35); --alert-bg: rgba(167, 139, 250, .08); }
.markdown-alert-warning   { --alert-fg: #fbbf24; --alert-border: rgba(251, 191, 36, .35); --alert-bg: rgba(251, 191, 36, .07); }
.markdown-alert-caution   { --alert-fg: #f87171; --alert-border: rgba(248, 113, 113, .38); --alert-bg: rgba(248, 113, 113, .08); }

/* footnotes */
.prose .footnote-ref a { text-decoration: none; font-family: var(--font-mono); font-size: .75em; }
.prose .footnotes-sep { margin: 3em 0 1.4em; }
.prose .footnotes { font-size: 14px; color: var(--text-2); }

.prose details { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .03); }
.prose summary { cursor: pointer; font-weight: 600; }

/* ---------- Diagrams (inline SVG in posts) ---------- */

.prose .diagram {
  margin: 2em 0;
  padding: 18px 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(10, 10, 12, .62);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  overflow-x: auto;
  --d-bad: #f87171;
}
.prose .diagram svg { display: block; width: 100%; min-width: 620px; height: auto; font-family: var(--font-read); }
.prose .diagram figcaption { margin-top: 12px; }
.diagram text { fill: var(--text); font-size: 14px; }
.diagram .d-panel-title { font-size: 14px; font-weight: 650; letter-spacing: .02em; }
.diagram .d-lane { font-size: 12px; fill: var(--text-3); letter-spacing: .04em; }
.diagram .d-label { font-size: 13px; }
.diagram .d-label-sm { font-size: 12px; fill: var(--text-2); }
.diagram .d-label-dark { font-size: 12px; fill: var(--on-accent); font-weight: 600; }
.diagram .d-lanes rect { fill: rgba(255, 255, 255, .03); stroke: var(--line); }
.diagram .d-guide { stroke: var(--line-strong); stroke-dasharray: 3 4; fill: none; }
.diagram .d-axis line { stroke: var(--text-3); }
.diagram .d-axis text { font-family: var(--font-mono); font-size: 11px; fill: var(--text-3); text-anchor: middle; }
.diagram .d-dot { fill: var(--text); }
.diagram .d-dot-accent { fill: var(--accent); stroke: #000; stroke-width: 2; }
.diagram .d-dot-bad { fill: var(--d-bad); stroke: #000; stroke-width: 2; }
.diagram .d-ok-bar { fill: var(--accent); opacity: .9; }
.diagram .d-stuck-bar { fill: color-mix(in srgb, var(--d-bad) 14%, transparent); stroke: var(--d-bad); stroke-dasharray: 5 4; }
.diagram .d-arrow { stroke: var(--text-2); stroke-width: 1.4; fill: none; }
.diagram .d-arrow-bad { stroke: var(--d-bad); stroke-width: 1.4; fill: none; stroke-dasharray: 4 3; }
.diagram .d-fill-muted { fill: var(--text-2); }
.diagram .d-bad { fill: var(--d-bad); }
.diagram .d-accent { fill: var(--accent); }
.diagram .d-muted { fill: var(--text-3); }
.diagram .d-state rect { fill: rgba(255, 255, 255, .05); stroke: var(--line-strong); }
.diagram .d-state rect.d-state-accent { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.diagram .d-state text { font-family: var(--font-mono); font-size: 14px; text-anchor: middle; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, var(--read)); }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .post-card-featured .post-card-link { grid-template-columns: 1fr; }
  .post-card-featured .post-card-cover { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .blob { filter: blur(80px); }
}

@media (max-width: 600px) {
  .prose { font-size: 16px; line-height: 1.8; }
  .code-block { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); border-radius: 0; border-left: 0; border-right: 0; }
  .code-block .line { padding: 0 var(--gutter); }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-older { text-align: left; }
  .heading-anchor { display: none; }
  .post-card-body { padding: 18px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}
