/* ==========================================================================
   ShitOps — site styles
   A satirical engineering blog, styled like the control plane it deserves:
   editorial typography, monospace instrumentation, and one accent that
   refuses to be subtle.
   ========================================================================== */

/* ---------- design tokens ---------- */
:root {
    color-scheme: dark;

    /* surfaces */
    --bg: #090c11;
    --bg-elevated: #10151d;
    --bg-inset: #161d27;
    --bg-code: #0b0f15;

    /* lines */
    --border: #212b38;
    --border-strong: #34455c;

    /* type */
    --text: #e8eef7;
    --text-muted: #b3bfce;
    --text-faint: #93a2b6;

    /* accents */
    --accent: #b8f36b;
    --accent-ink: #0d1405;
    --accent-soft: rgba(184, 243, 107, 0.12);
    --accent-line: rgba(184, 243, 107, 0.32);
    --accent-2: #86c8fa;
    --warn: #e0b978;
    --grug: #d7b06b;
    --danger: #ff8b8b;

    /* radii */
    --radius-xs: 4px;
    --radius-sm: 7px;
    --radius: 12px;
    --radius-lg: 18px;
    --pill: 999px;

    /* depth */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.5);

    /* type stacks — system only, no network fonts */
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;

    /* layout */
    --max-width: 1160px;
    --prose-width: 42rem;
    --header-height: 68px;
    --gutter: clamp(1.25rem, 4vw, 2rem);
    --section-gap: clamp(3rem, 7vw, 5rem);

    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f4ee;
    --bg-elevated: #ffffff;
    --bg-inset: #eceae1;
    --bg-code: #10151d;

    --border: #d9d7ca;
    --border-strong: #b6b3a3;

    --text: #15181d;
    --text-muted: #48525f;
    --text-faint: #5a6675;

    --accent: #17653a;
    --accent-ink: #ffffff;
    --accent-soft: rgba(23, 101, 58, 0.09);
    --accent-line: rgba(23, 101, 58, 0.4);
    --accent-2: #12558f;
    --warn: #7a5410;
    --grug: #7d5d22;
    --danger: #b02a2a;

    --shadow-sm: 0 1px 2px rgba(30, 40, 30, 0.09);
    --shadow: 0 14px 34px rgba(30, 40, 30, 0.12);
    --shadow-lg: 0 26px 70px rgba(30, 40, 30, 0.18);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1.5rem);
    background-color: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 520px at 50% -8%, var(--accent-soft), transparent 62%),
        linear-gradient(rgba(140, 165, 200, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 165, 200, 0.045) 1px, transparent 1px);
    background-size: 100% 100%, 72px 72px, 72px 72px;
    background-repeat: no-repeat, repeat, repeat;
    overflow-wrap: break-word;
}

[data-theme="light"] body {
    background-image:
        radial-gradient(1100px 520px at 50% -8%, rgba(23, 101, 58, 0.07), transparent 62%),
        linear-gradient(rgba(40, 60, 50, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 60, 50, 0.04) 1px, transparent 1px);
}

img,
svg {
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration: underline;
}

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

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

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1100;
    padding: 0.8em 1.3em;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------- shared type helpers ---------- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    flex: 0 0 auto;
    background: currentColor;
}

.section-kicker {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.section-note {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-right: 0.35rem;
    align-self: center;
}

.heading-meta {
    margin: 1.1rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px) saturate(140%);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    border-bottom: 1px solid var(--border);
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: var(--header-height);
    padding: 0.5rem var(--gutter);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.025em;
    font-size: 1.17rem;
    flex: 0 0 auto;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-weight: 700;
    transform: rotate(-6deg);
    box-shadow: 2px 2px 0 var(--accent-line);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.brand:hover .brand-mark {
    transform: rotate(6deg) scale(1.05);
    box-shadow: -2px 2px 0 var(--accent-line);
}

.brand-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0.1rem 0.3rem;
    transform: translateY(-1px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    margin-left: auto;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.66rem;
    border-radius: var(--radius-sm);
    min-height: 40px;
    transition: border-color 0.15s ease, transform 0.15s var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-inset);
    text-decoration: none;
}

.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.66rem;
    right: 0.66rem;
    bottom: 0.18rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.rss-link {
    color: var(--text-faint);
    padding-inline: 0.5rem;
}

.nav-extra {
    display: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.45rem;
    min-width: 40px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.3s var(--ease);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--border);
    transform: rotate(18deg);
}

/* search */
.site-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 3px 3px 3px 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-search input {
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    padding: 0.42rem 0;
    width: 150px;
    transition: width 0.22s var(--ease);
}

.site-search input::placeholder {
    color: var(--text-faint);
    opacity: 1;
}

.site-search input:focus {
    outline: none;
    width: 196px;
}

.site-search button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--pill);
    background: var(--accent);
    color: var(--accent-ink);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.site-search button:hover {
    filter: brightness(1.08);
    transform: scale(1.04);
}

/* hamburger */
.hamburger {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.6rem;
    width: 44px;
    height: 44px;
}

.hamburger:hover {
    border-color: var(--border);
    background: var(--bg-inset);
}

.bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- layout ---------- */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.75rem var(--gutter) var(--section-gap);
}

/* ---------- buttons ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.72rem 1.25rem;
    font-weight: 700;
    font-size: 0.97rem;
    text-decoration: none;
    transition: transform 0.15s var(--ease), filter 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 18px var(--accent-soft);
}

.button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.72rem 1.25rem;
    font-weight: 600;
    font-size: 0.97rem;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.button-ghost:hover {
    text-decoration: none;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* ---------- hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.7fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.75rem);
}

.hero-copy {
    max-width: 46rem;
}

.hero-copy > * {
    animation: rise 0.55s var(--ease) both;
}

.hero-copy > *:nth-child(2) {
    animation-delay: 0.06s;
}

.hero-copy > *:nth-child(3) {
    animation-delay: 0.12s;
}

.hero-copy > *:nth-child(4) {
    animation-delay: 0.18s;
}

.hero-eyebrow {
    margin-bottom: 1.15rem;
}

.hero-title {
    font-size: clamp(2.3rem, 4.05vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    margin: 0 0 1.35rem;
    font-weight: 800;
    text-wrap: pretty;
}

.hero-accent {
    color: var(--accent);
    position: relative;
    white-space: nowrap;
}

.hero-accent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0.08em;
    bottom: 0.05em;
    height: 0.07em;
    background: var(--accent);
    opacity: 0.55;
    border-radius: 2px;
}

.hero-lede {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 46ch;
    margin: 0 0 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-panel {
    position: relative;
    min-width: 0;
    padding: 1.25rem 1.35rem 1.1rem;
    background:
        linear-gradient(160deg, var(--accent-soft), transparent 55%),
        var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: rise 0.6s 0.18s var(--ease) both;
    overflow: hidden;
}

[data-theme="light"] .hero-panel {
    border-color: var(--border-strong);
}

[data-theme="light"] .hero-bars span {
    opacity: 0.7;
}

.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.75;
}

.panel-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--pill);
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: pulse 2.6s ease-in-out infinite;
}

.panel-host {
    color: var(--text);
    font-weight: 600;
}

.panel-region {
    margin-left: auto;
}

.hero-stats {
    display: grid;
    gap: 0;
    margin: 0.35rem 0 0;
    padding: 0;
}

.hero-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.62rem 0;
    border-bottom: 1px solid var(--border);
}

.hero-stat dt {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-faint);
}

.hero-stat dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text);
}

.hero-stat:first-child dd {
    color: var(--accent);
    font-size: 1.2rem;
    line-height: 1;
}

.hero-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 42px;
    margin: 0.9rem 0 0.8rem;
}

.hero-bars span {
    flex: 1;
    background: var(--accent);
    opacity: 0.55;
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    animation: bar-rise 0.7s var(--ease) both;
    transition: height 0.9s var(--ease);
}

.hero-bars span:nth-child(1) { height: 34%; animation-delay: 0.30s; }
.hero-bars span:nth-child(2) { height: 58%; animation-delay: 0.33s; }
.hero-bars span:nth-child(3) { height: 41%; animation-delay: 0.36s; }
.hero-bars span:nth-child(4) { height: 72%; animation-delay: 0.39s; }
.hero-bars span:nth-child(5) { height: 49%; animation-delay: 0.42s; }
.hero-bars span:nth-child(6) { height: 88%; animation-delay: 0.45s; }
.hero-bars span:nth-child(7) { height: 63%; animation-delay: 0.48s; }
.hero-bars span:nth-child(8) { height: 38%; animation-delay: 0.51s; }
.hero-bars span:nth-child(9) { height: 79%; animation-delay: 0.54s; }
.hero-bars span:nth-child(10) { height: 54%; animation-delay: 0.57s; }
.hero-bars span:nth-child(11) { height: 96%; animation-delay: 0.60s; }
.hero-bars span:nth-child(12) { height: 44%; animation-delay: 0.63s; }
.hero-bars span:nth-child(13) { height: 67%; animation-delay: 0.66s; }
.hero-bars span:nth-child(14) { height: 31%; animation-delay: 0.69s; }

.hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--accent) 7%, transparent) 50%, transparent 100%);
    background-size: 100% 220%;
    animation: panel-scan 7s linear infinite;
}

.panel-log {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.55rem 0 0.65rem;
    padding: 0.45rem 0.6rem;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-muted);
    min-height: 2.1rem;
}

.panel-log-prompt {
    color: var(--accent);
}

#panel-log-line {
    transition: opacity 0.2s ease;
}

#panel-log-line.is-swapping {
    opacity: 0;
}

.panel-foot b {
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.panel-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* buzzword ticker */
.buzz-strip {
    position: relative;
    overflow: hidden;
    margin: 0 0 clamp(2.5rem, 5vw, 3.5rem);
    border-block: 1px solid var(--border);
    background: var(--bg-elevated);
    background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}

.buzz-strip::before,
.buzz-strip::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    z-index: 1;
    pointer-events: none;
}

.buzz-strip::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg), transparent);
}

.buzz-strip::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg), transparent);
}

.buzz-track {
    display: flex;
    width: max-content;
    padding: 0.55rem 0;
    animation: marquee 55s linear infinite;
}

.buzz-strip:hover .buzz-track {
    animation-play-state: paused;
}

.buzz-track span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
    padding: 0 1.4rem;
}

.buzz-track span::after {
    content: "·";
    margin-left: 2.8rem;
    color: var(--border-strong);
}

/* ---------- section headings ---------- */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.6rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.section-heading h2 {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.015em;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.section-link:hover {
    color: var(--accent);
}

/* ---------- page headings ---------- */
.page-heading {
    margin-bottom: clamp(2rem, 4vw, 2.75rem);
    max-width: 62ch;
}

.page-title--roomy {
    letter-spacing: -0.005em !important;
}

.page-heading h1 {
    font-size: clamp(2rem, 4.2vw, 2.9rem);
    letter-spacing: -0.035em;
    margin: 0 0 0.75rem;
    line-height: 1.08;
    text-wrap: pretty;
}

.lead-text {
    color: var(--text-muted);
    font-size: clamp(1.02rem, 1.2vw, 1.12rem);
    line-height: 1.65;
    max-width: 62ch;
    margin: 0;
}

.lead-text + .lead-text {
    margin-top: 0.9rem;
}

.lead-text--muted {
    color: var(--text-faint);
}

/* ---------- post grid & cards ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.15rem;
    margin: 0;
}

.post-card {
    position: relative;
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.18s ease, transform 0.18s var(--ease), box-shadow 0.18s ease;
}

.post-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: left;
    transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.post-card:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.post-card:focus-within {
    border-color: var(--accent);
}

.post-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.35rem 1.4rem 1.15rem;
    width: 100%;
}

.post-card-content > .post-card-tags:first-child {
    min-height: 1.55rem;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.post-card-tags--foot:empty {
    display: none;
}

.chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    line-height: 1.5;
    padding: 0.18rem 0.55rem;
    border-radius: var(--pill);
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-inset);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s var(--ease);
}

.chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.chip-category {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.chip-category:hover {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.post-card-title {
    margin: 0;
    font-size: clamp(1.08rem, 1.05vw + 0.72rem, 1.27rem);
    line-height: 1.28;
    letter-spacing: -0.02em;
    text-wrap: pretty;
}

.post-card-title a {
    color: var(--text);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--accent);
}

.post-card-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--text-faint);
    min-width: 0;
    white-space: nowrap;
}

.post-author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date {
    flex: 0 0 auto;
}

.post-author a {
    color: var(--text-muted);
    text-decoration: none;
}

.post-author a:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-card-excerpt {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(4 * 1.6em);
}

.post-card-tags--foot {
    margin-top: auto;
    padding-top: 0.15rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.post-card-footnote {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
}

.post-card-footnote > * + *::before {
    content: "·";
    margin-right: 0.55rem;
    color: var(--text-faint);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.read-more .arrow {
    transition: transform 0.18s var(--ease);
}

.read-more:hover {
    text-decoration: none;
}

.read-more:hover .arrow {
    transform: translateX(3px);
}

/* home grid slight entrance */
.post-grid--home .post-card {
    animation: rise 0.5s var(--ease) both;
}

.post-grid--home .post-card:nth-child(2) {
    animation-delay: 0.07s;
}

.post-grid--home .post-card:nth-child(3) {
    animation-delay: 0.14s;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-muted);
}

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

.empty-kicker {
    margin: 0 0 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.empty-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.empty-hint {
    margin: 0 auto 1.4rem;
    max-width: 44ch;
    font-size: 0.92rem;
    color: var(--text-faint);
}

/* ---------- filters ---------- */
.post-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.9rem;
    padding: 0.65rem 0.8rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding-right: 0.75rem;
    border-right: 1px solid var(--border);
    margin-right: 0.1rem;
}

.filter-dropdown {
    position: relative;
}

.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    list-style: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 0.42rem 0.85rem;
    min-height: 36px;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-button::-webkit-details-marker {
    display: none;
}

.filter-button::marker {
    content: "";
}

.filter-button::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.18s var(--ease);
}

.filter-button:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.filter-dropdown[open] .filter-button {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.filter-dropdown[open] .filter-button::after {
    transform: rotate(-135deg) translateY(-1px);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    min-width: 240px;
    max-height: 330px;
    overflow-y: auto;
    padding: 0.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.dropdown-title {
    margin: 0;
    padding: 0.4rem 0.6rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.3rem;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.48rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.dropdown-content a:hover,
.dropdown-content a:focus-visible {
    background: var(--bg-inset);
    color: var(--accent);
    text-decoration: none;
}

.dropdown-arrow {
    font-family: var(--font-mono);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.dropdown-content a:hover .dropdown-arrow,
.dropdown-content a:focus-visible .dropdown-arrow {
    opacity: 1;
    transform: none;
}

.filter-count {
    margin: 0 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
    border-radius: var(--pill);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    font-size: 0.85rem;
    color: var(--text);
}

.filter-badge strong {
    color: var(--accent);
}

.filter-clear {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: var(--pill);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
}

.filter-clear:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 14%, transparent);
    text-decoration: none;
}

/* ---------- pagination ---------- */
.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s var(--ease);
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.page-link--text {
    padding: 0 0.8rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-link--edge {
    color: var(--text-faint);
}

.page-link.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}

.pagination-meta {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- post detail ---------- */
.post-detail {
    max-width: min(100%, var(--prose-width));
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2.1rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.post-header .post-card-tags {
    margin-bottom: 0.9rem;
}

.post-title {
    font-size: clamp(2rem, 4.3vw, 3.05rem);
    line-height: 1.06;
    letter-spacing: -0.038em;
    margin: 0 0 1.5rem;
    text-wrap: balance;
}

/* The generated post titles are often 20+ words long; keep them readable
   without letting the headline push the article off screen. */
.post-title--long {
    font-size: clamp(1.55rem, 3.1vw, 2.3rem);
    line-height: 1.16;
    letter-spacing: -0.028em;
}

.post-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.byline-author {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.byline-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.byline-meta > * + *::before {
    content: "·";
    margin-right: 0.9rem;
    color: var(--text-faint);
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: var(--pill);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
}

.avatar-lg {
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
}

.post-author-name {
    display: block;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.post-author-name:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-author-title {
    display: block;
    font-size: 0.78rem;
    color: var(--text-faint);
}

.post-byline .post-date {
    white-space: nowrap;
}

/* joke */
.post-joke {
    position: relative;
    margin: 2rem 0;
    padding: 1.15rem 1.35rem 1.25rem;
    background:
        linear-gradient(135deg, var(--accent-soft), transparent 58%),
        var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.post-joke::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
}

.joke-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.joke-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.joke-question {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
}

.joke-question p {
    margin: 0;
}

.joke-answer-wrap {
    margin-top: 0.85rem;
}

.joke-answer-wrap summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--pill);
    padding: 0.35rem 0.8rem;
    transition: border-color 0.15s ease;
}

.joke-answer-wrap summary::-webkit-details-marker {
    display: none;
}

.joke-answer-wrap summary::before {
    content: "+";
    font-size: 0.9em;
    color: var(--accent);
}

.joke-answer-wrap[open] summary::before {
    content: "−";
}

.joke-answer-wrap summary:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.joke-answer {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border);
    color: var(--text-muted);
}

.joke-answer p {
    margin: 0;
}

/* table of contents */
.table-of-contents {
    margin: 2.25rem 0;
    padding: 1.05rem 1.3rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table-of-contents h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-faint);
}

.table-of-contents h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

.toc-item {
    line-height: 1.45;
    margin: 0.1rem 0;
}

.toc-item a {
    display: inline-block;
    padding: 0.12rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
}

.toc-item a:hover {
    color: var(--accent);
    text-decoration: none;
}

.toc-level-1 {
    font-weight: 600;
}

.toc-level-2 {
    padding-left: 1rem;
}

.toc-level-3 {
    padding-left: 2rem;
    font-size: 0.94em;
}

/* prose */
.post-content {
    font-size: 1.1875rem;
    line-height: 1.8;
    letter-spacing: 0.002em;
    color: var(--text);
}

.post-content p {
    margin-bottom: 1.4rem;
    text-wrap: pretty;
}

.post-content li {
    margin-bottom: 0.45rem;
}

.post-content > p:first-of-type {
    font-size: 1.09em;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    line-height: 1.22;
    letter-spacing: -0.022em;
    margin: 2.6rem 0 0.85rem;
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
}

.post-content h1 {
    font-size: 1.9rem;
}

.post-content h2 {
    font-size: 1.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}

.post-content h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content table,
.post-content pre,
.post-content blockquote {
    margin: 0 0 1.25rem;
}

.post-content ul,
.post-content ol {
    padding-left: 1.4rem;
}

.post-content li {
    margin: 0.3rem 0;
}

.post-content li::marker {
    color: var(--accent);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-color: var(--accent);
}

.post-content img {
    border-radius: var(--radius);
    height: auto;
    border: 1px solid var(--border);
}

.post-content blockquote {
    margin-left: 0;
    padding: 0.55rem 0 0.55rem 1.15rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
}

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

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0.1em 0.35em;
}

.post-content pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.05rem 1.15rem;
    overflow-x: auto;
    font-size: 0.86rem;
    line-height: 1.6;
    color: #e5edf7;
}

.post-content pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    display: block;
    overflow-x: auto;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.7rem;
    text-align: left;
}

.post-content th {
    background: var(--bg-inset);
    font-weight: 600;
}

.post-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.headerlink {
    opacity: 0;
    margin-left: 0.4rem;
    font-size: 0.65em;
    text-decoration: none;
    color: var(--text-faint);
}

.post-content h1:hover .headerlink,
.post-content h2:hover .headerlink,
.post-content h3:hover .headerlink,
.headerlink:focus-visible {
    opacity: 1;
}

.mermaid {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.audio_control {
    width: 100%;
    margin: 1rem 0;
}

.post-footer {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* prev / next */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.9rem;
    align-items: stretch;
    margin: 2.75rem 0;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.post-navigation a {
    text-decoration: none;
}

.post-nav-prev a,
.post-nav-next a {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    padding: 1rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.93rem;
    line-height: 1.4;
    transition: border-color 0.15s ease, transform 0.15s var(--ease);
}

.post-nav-prev a:hover,
.post-nav-next a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    color: var(--text);
}

.post-nav-next a {
    text-align: right;
    align-items: flex-end;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
}

.nav-title {
    color: var(--text);
}

.post-nav-all {
    align-self: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    color: var(--text-muted);
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--pill);
    background: var(--bg-elevated);
}

.post-nav-all:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

/* When a post has only one neighbour, let the archive pill take the empty
   side instead of floating in the middle. */
.post-navigation:has(.post-nav-next:empty) .post-nav-all {
    grid-column: 2 / 4;
    justify-self: end;
}

.post-navigation:has(.post-nav-prev:empty) .post-nav-all {
    grid-column: 1 / 3;
    justify-self: start;
}

/* related */
.related-posts {
    margin: 2.75rem 0;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.related-posts h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    letter-spacing: -0.015em;
}

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

.related-item {
    border-bottom: 1px solid var(--border);
}

.related-item a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0.85rem 0.15rem;
    text-decoration: none;
}

.related-title {
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.4;
}

.related-item a:hover .related-title {
    color: var(--accent);
}

.related-meta {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
}

/* comments */
.comments {
    margin-top: 2.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.comments h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    margin: 0 0 1.15rem;
}

.count-pill {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 0.05rem 0.5rem;
}

.comment {
    padding: 1rem 1.15rem 1.05rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.comment-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
}

.comment-head .comment-meta {
    margin: 0;
}

.comment-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-inset);
    border: 1px solid var(--border);
}

.comment-avatar--sm {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.comment-avatar svg {
    display: block;
    width: 100%;
    height: 100%;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.comment-meta strong {
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.86rem;
    letter-spacing: 0;
    text-transform: none;
}

.comment-meta time {
    margin-left: auto;
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-line);
    border-radius: var(--pill);
    padding: 0.05rem 0.4rem;
}

.comment-body {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.66;
    color: var(--text-muted);
    white-space: pre-line;
}

.subcomments {
    margin-top: 0.85rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-strong);
}

.subcomment {
    padding: 0.6rem 0.85rem;
    margin-top: 0.55rem;
    background: var(--bg-inset);
    border-radius: var(--radius-sm);
}

.empty-comments {
    color: var(--text-faint);
    font-size: 0.92rem;
    padding: 1rem 0;
}

/* grug */
.grug-reaction {
    position: relative;
    margin-top: 2.75rem;
    padding: 1.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.grug-reaction::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--grug) 0 14px, transparent 14px 22px);
    opacity: 0.75;
}

.grug-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.1rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

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

.grug-summary::after {
    content: "+";
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-faint);
}

.grug-reaction[open] .grug-summary::after {
    content: "\2212";
}

.grug-summary:hover,
.grug-summary:focus-visible {
    color: var(--accent);
}

.grug-reaction[open] .grug-summary {
    margin-bottom: 0.9rem;
}

.grug-source {
    margin: 0 0 1rem;
}

.grug-source a {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 0.15rem 0.6rem;
}

.grug-source a:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.grug-reaction h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 1.1rem;
    font-size: 1.25rem;
    letter-spacing: -0.015em;
}

.grug-icon {
    font-size: 1.05em;
    line-height: 1;
}

.grug-reaction h2 small {
    margin-left: auto;
}

.grug-reaction h2 a {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 0.15rem 0.6rem;
}

.grug-reaction h2 a:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.grug-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 0.9rem;
    font-family: "Comic Sans MS", "Comic Sans", var(--font-body);
}

.grug-reaction-text,
.grug-solution {
    padding: 1rem 1.15rem;
    background: var(--bg-inset);
    border-left: 3px solid var(--grug);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.grug-reaction-text h3,
.grug-solution h3 {
    margin: 0 0 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grug);
}

.grug-thought p,
.grug-approach p {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.grug-thought p:last-child,
.grug-approach p:last-child {
    margin-bottom: 0;
}

.grug-thought pre,
.grug-approach pre {
    margin: 0.6rem 0 0;
    background: var(--bg-code);
    color: #e5edf7;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

/* ---------- team ---------- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
    gap: 1rem;
    align-items: stretch;
}

.team-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.3rem 1.3rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, transform 0.15s var(--ease), box-shadow 0.15s ease;
}

.team-card:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.team-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.team-posts {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
}

.team-name {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.team-name a {
    color: var(--text);
    text-decoration: none;
}

.team-name a:hover {
    color: var(--accent);
}

.team-title {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.team-bio {
    margin: 0.5rem 0 0.9rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-link {
    margin-top: auto;
    padding-top: 0.25rem;
}

/* ---------- about / prose pages ---------- */
.about-section {
    max-width: min(100%, var(--prose-width));
    margin: 0 auto;
}

.about-section--wide {
    max-width: 100%;
}

.about-section--wide .page-heading {
    max-width: 62ch;
}

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

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

.prose h2 {
    margin: 2.4rem 0 0.9rem;
    font-size: 1.45rem;
    letter-spacing: -0.025em;
    color: var(--text);
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}

.prose p {
    margin: 0 0 1.1rem;
}

.prose blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
    font-size: 1.06rem;
}

.prose blockquote p {
    margin: 0;
}

.code-block {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-code);
}

/* The about page code sample is intentionally enormous. Keep it scrollable
   instead of letting it push the disclaimer 20,000px down the page. */
#about-code {
    max-height: 62vh;
    overflow: auto;
    overscroll-behavior: contain;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.9rem;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
}

.code-language::before {
    content: "● ";
    color: var(--accent);
}

[data-theme="light"] .code-header {
    background: #171e28;
    border-bottom-color: #263140;
    color: #93a2b6;
}

.copy-button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    min-height: 28px;
}

.copy-button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.code-block .highlight,
.code-block pre {
    margin: 0;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #e5edf7;
}

[data-theme="light"] .copy-button {
    color: #b3bfce;
    border-color: #2b3746;
}

/* ---------- error ---------- */
.error-page {
    position: relative;
    max-width: 46rem;
    margin: clamp(1rem, 4vw, 3rem) auto;
    padding: clamp(2.25rem, 6vw, 3.75rem) clamp(1.25rem, 4vw, 2.5rem);
    text-align: center;
    background:
        radial-gradient(500px 220px at 50% 0%, var(--accent-soft), transparent 70%),
        var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.error-page .eyebrow {
    justify-content: center;
}

.error-code {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 15vw, 7.5rem);
    line-height: 0.95;
    margin: 0 0 0.5rem;
    color: var(--accent);
    letter-spacing: -0.06em;
    font-weight: 700;
    text-shadow: 3px 3px 0 var(--accent-soft);
}

.error-page h1 {
    margin: 0.35rem 0 0.9rem;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    letter-spacing: -0.025em;
}

.error-lead {
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.error-hint {
    color: var(--text-faint);
    font-size: 0.92rem;
    max-width: 46ch;
    margin: 0 auto 1.5rem;
}

.error-lines {
    display: flex;
    flex-direction: column;
    width: fit-content;
    gap: 0.3rem;
    text-align: left;
    margin: 0 auto 1.75rem;
    padding: 0.8rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--text-faint);
}

/* ---------- footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.75rem var(--gutter) 1.75rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    max-width: 52ch;
}

.footer-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 6px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}

.footer-content p {
    margin: 0;
    line-height: 1.55;
    color: var(--text-faint);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.footer-fineprint {
    max-width: var(--max-width);
    margin: 1.75rem auto 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- motion ---------- */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes bar-rise {
    from {
        transform: scaleY(0.12);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 0.55;
    }
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 3px var(--accent-soft);
    }
    50% {
        box-shadow: 0 0 0 6px var(--accent-soft);
    }
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
    .navbar {
        gap: 1rem;
    }

    .nav-menu {
        gap: 0.6rem;
    }

    .site-search input {
        width: 128px;
    }

    .site-search input:focus {
        width: 150px;
    }

    .nav-link {
        padding-inline: 0.5rem;
        font-size: 0.86rem;
    }
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hero-panel {
        max-width: 520px;
    }

    .hero-copy {
        max-width: 40rem;
    }

    .post-navigation .post-nav-all {
        grid-column: 1 / -1;
        justify-self: center;
    }

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

@media (max-width: 880px) {
    .hamburger {
        order: 2;
    }

    .js .hamburger {
        display: block;
    }

    .brand {
        order: 1;
    }

    .navbar {
        flex-wrap: wrap;
        padding-block: 0.4rem;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        margin: 0 0 0.6rem;
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .js .nav-menu {
        display: none;
    }

    .js .nav-menu.active {
        display: flex;
        animation: rise 0.22s var(--ease) both;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-link {
        padding: 0.7rem 0.65rem;
        min-height: 44px;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .nav-link:last-of-type {
        border-bottom: 0;
    }

    .nav-link.active {
        background: var(--accent-soft);
    }

    .nav-link.active::after {
        display: none;
    }

    .rss-link {
        padding-left: 0.65rem;
        color: var(--text-muted);
    }

    .nav-extra {
        display: inline;
        margin-left: 0.15rem;
        font-family: var(--font-mono);
        font-size: 0.78rem;
    }

    .theme-toggle {
        width: auto;
        align-self: stretch;
        justify-content: flex-start;
        gap: 0.65rem;
        padding: 0.7rem 0.65rem;
        color: var(--text-muted);
        border-radius: 0;
    }

    .theme-toggle:hover {
        transform: none;
        color: var(--accent);
    }

    .theme-toggle .nav-extra {
        font-size: 0.86rem;
        font-weight: 600;
        font-family: var(--font-body);
        text-transform: none;
    }

    .site-search {
        width: 100%;
    }

    .site-search input {
        width: 100%;
        flex: 1;
        font-size: 0.95rem;
        padding: 0.45rem 0;
    }

    .site-search input:focus {
        width: 100%;
    }

    .site-search button {
        width: 36px;
        height: 36px;
    }

    .post-filters {
        padding: 0.7rem;
    }

    .filter-dropdown {
        flex: 1 1 calc(50% - 0.55rem);
    }

    .filter-button {
        width: 100%;
        justify-content: center;
    }

    .dropdown-content {
        width: 100%;
        min-width: 0;
    }

    .filter-count {
        flex: 1 1 100%;
        margin-left: 0;
        text-align: right;
    }

    .pagination-bar {
        justify-content: center;
        text-align: center;
    }

    .pagination {
        justify-content: center;
        width: 100%;
    }

    .pagination-meta {
        width: 100%;
        order: 2;
    }
}

@media (max-width: 720px) {
    main {
        padding: 2rem var(--gutter) 3.5rem;
    }

    .hero {
        padding-top: 1.75rem;
        gap: 2rem;
    }

    .hero-title {
        font-size: clamp(2.2rem, 9.5vw, 3rem);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        max-width: 320px;
    }

    .hero-panel {
        max-width: 100%;
    }

    .post-detail {
        max-width: 100%;
    }

    .post-title {
        font-size: clamp(1.75rem, 7.5vw, 2.3rem);
    }

    .byline-meta {
        margin-left: 0;
        width: 100%;
        padding-left: calc(42px + 0.85rem);
    }

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

    .post-nav-prev {
        order: 1;
    }

    .post-nav-next {
        order: 2;
    }

    .post-navigation .post-nav-all {
        order: 3;
        grid-column: 1 / -1;
        justify-self: center;
    }

    .post-nav-next a {
        text-align: left;
        align-items: flex-start;
    }

    .related-item a {
        flex-direction: column;
        gap: 0.3rem;
    }

    .related-meta {
        white-space: normal;
    }

    .post-card-content {
        padding: 1.2rem 1.2rem 1.05rem;
    }

    .page-heading h1 {
        font-size: clamp(1.75rem, 7vw, 2.2rem);
    }

    .section-heading {
        align-items: baseline;
        flex-wrap: wrap;
        gap: 0.4rem 1rem;
    }

    .section-note {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-fineprint {
        margin-top: 1.4rem;
    }

    .dropdown-content {
        max-height: 280px;
    }

    .grug-reaction {
        padding: 1.15rem;
    }

    .grug-reaction h2 {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .grug-reaction h2 small {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 1rem;
    }

    .team-card {
        padding: 1rem 1rem 0.95rem;
    }

    .team-head {
        margin-bottom: 0.2rem;
    }

    .team-bio {
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem;
    }

    .team-link {
        display: none;
    }

    .brand-tag {
        display: none;
    }

    .filter-label {
        flex: 0 0 100%;
        border-right: 0;
        padding-right: 0;
        padding-bottom: 0.1rem;
    }

    .filter-dropdown {
        flex: 1 1 calc(50% - 0.3rem);
    }

    .filter-count {
        text-align: left;
    }

    .hero-bars {
        height: 34px;
    }

    .comment-meta time {
        margin-left: 0;
    }
}

/* ---------- motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .buzz-track {
        animation: none;
        transform: none;
    }
}

@media print {
    .site-header,
    .site-footer,
    .post-navigation,
    .comments,
    .grug-reaction,
    .post-joke,
    .table-of-contents,
    .related-posts,
    .buzz-strip,
    .hero-panel {
        display: none !important;
    }

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

    .post-content a {
        color: #000;
    }
}

/* ---------- third-party content fixes ---------- */
/* The about page ships Pygments-highlighted HTML with inline colours. The
   teal comment colour is too dark for the code surface; lift it. */
#about-code span[style*="color:#007f7f"] {
    color: #63c9c9 !important;
}

/* Mermaid diagrams carry their own theme. Keep edge labels readable when the
   diagram theme and the site theme disagree. */
.mermaid .edgeLabel,
.mermaid .edgeLabel p,
.mermaid .edgeLabel span {
    color: var(--text) !important;
    background-color: var(--bg-elevated) !important;
}

.code-note {
    margin: -0.75rem 0 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* The tag vocabulary is enormous; scan it in two columns on wide screens. */
@media (min-width: 881px) {
    .filter-dropdown--tags .dropdown-content--wide {
        min-width: 440px;
        column-count: 2;
        column-gap: 0.25rem;
    }

    .filter-dropdown--tags .dropdown-content--wide a {
        break-inside: avoid;
    }

    .filter-dropdown--tags .dropdown-title {
        column-span: all;
    }
}

/* ---------- animated architecture diagrams ---------- */
.viz {
    margin: 2.25rem 0;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}

.viz figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.75rem;
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.viz-title {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

.viz-caption {
    flex: 1 1 12rem;
    min-width: 0;
    color: var(--text-faint);
}

.viz--error {
    border-style: dashed;
    border-color: var(--danger);
}

.viz--error figcaption {
    color: var(--danger);
    border-top: 0;
    margin: 0 0 0.4rem;
    padding: 0;
}

.viz--error p {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.viz-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.viz-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.viz-node rect {
    fill: var(--bg-inset);
    stroke: var(--border-strong);
    stroke-width: 1.4;
    transition: stroke 0.15s ease, fill 0.15s ease;
}

.viz-node text {
    fill: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    pointer-events: none;
}

.viz-node {
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.viz-node.is-active rect {
    stroke: var(--accent);
    fill: color-mix(in srgb, var(--accent) 10%, var(--bg-inset));
}

.viz-node.is-dimmed {
    opacity: 0.35;
}

.viz-edge {
    fill: none;
    stroke: var(--text-faint);
    stroke-width: 1.5;
    transition: stroke 0.15s ease, opacity 0.15s ease;
}

.viz-edge--async {
    stroke-dasharray: 5 4;
}

.viz-edge--failure {
    stroke: var(--danger);
}

.viz-edge--back {
    stroke-dasharray: 3 4;
    opacity: 0.85;
}

.viz-edge.is-active {
    stroke: var(--accent);
    stroke-width: 2.2;
}

.viz-edge.is-dimmed {
    opacity: 0.2;
}

.viz-edge-label {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    paint-order: stroke;
    stroke: var(--bg-elevated);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.viz-marker {
    fill: var(--text-faint);
}

.viz-marker--async {
    fill: var(--text-faint);
}

.viz-marker--failure {
    fill: var(--danger);
}

.viz-marker--back {
    fill: var(--text-faint);
}

.viz-packet {
    fill: var(--accent);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 60%, transparent));
    pointer-events: none;
}

.viz-packet--failure {
    fill: var(--danger);
}

.viz-packet--async {
    fill: var(--accent-2);
}

.viz-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.viz-zoom:hover,
.viz-zoom:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
}

.viz-zoom svg {
    flex: 0 0 auto;
}

.viz-dialog {
    width: min(96vw, 1400px);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}

.viz-dialog::backdrop {
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
}

.viz-dialog .viz {
    margin: 0;
    width: 100%;
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.viz-dialog .viz-scroll {
    max-height: 74vh;
    overflow: auto;
}

.viz-dialog .viz-svg {
    min-width: 0;
    max-height: 72vh;
}

.viz-dialog .viz-zoom {
    display: none;
}

.viz-close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-inset);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.viz-close:hover,
.viz-close:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
}

/* Diagrams are figures: let them break out of the reading column so the
   labels stay legible on desktop. */
@media (min-width: 900px) {
    .post-detail .viz {
        width: min(88vw, 64rem);
        margin-left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 700px) {
    .viz-svg {
        min-width: 540px;
    }

    .viz-dialog .viz-svg {
        min-width: 640px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .viz-packet {
        display: none;
    }
}

@media print {
    .viz-zoom,
    .viz-close,
    .viz-packet {
        display: none !important;
    }

    .viz {
        break-inside: avoid;
    }
}


/* ---------- about page ---------- */
.about-section > .page-heading {
    margin-bottom: 2rem;
}

.about-section h2 {
    margin: 2.4rem 0 0.9rem;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.about-quote {
    max-width: 72ch;
}

.about-quote blockquote {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.3rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--text);
}

.about-quote p {
    color: var(--text-muted);
}

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

.about-card {
    padding: 1.3rem 1.35rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.about-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.about-card h3 {
    margin: 0.55rem 0 0.45rem;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.about-card p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.about-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.about-rules-list li {
    padding: 0.8rem 1rem;
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.about-rules-list strong {
    color: var(--text);
}

.about-stack p,
.about-disclaimer p {
    color: var(--text-muted);
    max-width: 64ch;
}

/* ---------- initials avatars ---------- */
.comment-avatar--initials {
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.comment-avatar--sm.comment-avatar--initials {
    font-size: 0.58rem;
}

.avatar {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.avatar-lg {
    font-size: 0.98rem;
}

@keyframes panel-scan {
    0% {
        background-position: 0 -120%;
    }
    100% {
        background-position: 0 220%;
    }
}

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

    #panel-log-line {
        transition: none;
    }
}
