/*
  Mobile-first, accessible, and themeable design system.
  Light is default; dark follows the system prefers-color-scheme setting.
*/

@font-face {
    font-family: "Duplicate Ionic";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-light.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: italic;
    font-weight: 300;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-light-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-regular.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-regular-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-medium.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-medium-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-bold.woff2") format("woff2");
}

@font-face {
    font-family: "Duplicate Ionic";
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("/_releases/c798bf861f812c60666e51f8bb4be3d1a24c838d5b28cb09ba6ca11170139cf0/fonts/duplicate-ionic-bold-italic.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    /* Typography */
    --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    --font-serif: "Duplicate Ionic", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --lh-base: 1.6;
    --radius-s: 0.375rem;
    --radius-m: 0.5rem;
    --container-max: 72rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;

    /* Color (light) */
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --prose-text-color: #000000;
    --text-muted: #475569;
    --accent: #b45309;
    --border: #e2e8f0;
    --table-border: #111111;
    --code-surface: #f6f8fa;
    /* subtle light */
    --code-fg: #1f2328;
    /* readable fg */
    --code-border: #d0d7de;
    --code-accent: var(--accent);
}

/* Modern base reset for evergreen browsers */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd) {
    margin: 0;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

a {
    text-decoration-skip-ink: auto;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #0f172a;
        --surface-muted: #0b1220;
        --text: #e5e7eb;
        --prose-text-color: #e6e4de;
        --text-muted: #94a3b8;
        --accent: #c9b52a;
        --border: #334155;
        --table-border: #66748b;
        --code-surface: #0d1117;
        /* subtle dark */
        --code-fg: #c9d1d9;
        --code-border: #30363d;
        --code-accent: var(--accent);
    }
}

/* Subtle, theme-adaptive code surface and accent when supported */
@supports (background: color-mix(in oklab, white, black)) {
    :root {
        --code-surface: color-mix(in oklab, var(--surface) 88%, var(--surface-muted));
        --code-accent: color-mix(in oklab, var(--accent) 72%, var(--code-surface));
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --code-surface: color-mix(in oklab, var(--surface) 80%, var(--surface-muted));
            --code-accent: color-mix(in oklab, var(--accent) 78%, var(--code-surface));
        }
    }
}

/* Fluid type scales */
h1 {
    font-size: clamp(1.875rem, 1.2rem + 1.5vw, 2.75rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
    line-height: 1.3;
    margin: 0 0 var(--space-2);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.125rem, 0.9rem + 0.6vw, 1.5rem);
    line-height: 1.35;
}

html {
    font-family: var(--font-sans);
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    font-kerning: normal;
}

@media (min-width: 720px) {
    html {
        font-size: 18px;
    }
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--text);
    line-height: var(--lh-base);
    font-weight: 400;
    font-synthesis: none;
    /* Prevent FOUT/CLS from font loading; system fonts are default
       and webfonts only enhance when ready. */
}

/* Links */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1.5px;
}

a:hover,
a:focus-visible {
    text-decoration-thickness: 2px;
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding: var(--space-4) var(--space-6);
}

@media (max-width: 640px) {

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

.topbar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 64px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.site-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.65rem, 1.35rem + 0.9vw, 2.2rem);
    font-weight: 400;
    letter-spacing: -0.01em;
}

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

.site-title a:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-menu {
    display: flex;
    align-items: center;
}

.site-menu ul {
    list-style: none;
    display: flex;
    gap: var(--space-3);
    align-items: center;
    padding: 0;
    margin: 0;
}

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

.site-menu a:hover,
.site-menu a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

.site-menu .site-menu-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.site-menu .about-link {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    line-height: 1;
}

.site-menu .about-link:hover,
.site-menu .about-link:focus-visible,
.site-menu .about-link[aria-current="page"] {
    color: var(--text);
}

.site-menu .site-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
}

.site-menu .site-social-link svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

.site-menu .site-social-link:hover,
.site-menu .site-social-link:focus-visible {
    color: var(--text);
    text-decoration: none;
}

/* Article list */
.article-list {
    margin-top: var(--space-8);
}

.article-list > h2 {
    font-size: clamp(1.35rem, 1.12rem + 0.7vw, 1.75rem);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.article-directory-wrap {
    max-width: 100%;
    overflow-x: hidden;
}

.article-directory {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.article-directory-col-title {
    width: calc(100% - 11rem);
}

.article-directory-col-date {
    width: 11rem;
}

.article-directory th {
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: var(--space-3) 0;
    border-bottom: 1.5px solid var(--table-border);
}

.article-directory th:first-child {
    padding-right: var(--space-3);
}

.article-directory th:last-child {
    padding-left: var(--space-2);
}

.article-directory td {
    padding: 0;
    vertical-align: top;
}

.article-directory-meta-row td {
    padding-top: var(--space-4);
    padding-bottom: var(--space-2);
    line-height: 1.42;
}

/* Column padding is scoped through `td` to outrank the `.article-directory td`
   padding reset above, which would otherwise collapse the gutter to zero. */
.article-directory td.article-directory-title {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.3;
    font-weight: 400;
    padding-right: var(--space-4);
    overflow-wrap: anywhere;
}

.article-directory-title a {
    font-family: var(--font-serif);
    text-decoration: none;
}

.article-directory-title a:hover,
.article-directory-title a:focus-visible {
    text-decoration: underline;
}

.article-directory td.article-directory-date {
    white-space: nowrap;
    text-align: left;
    padding-left: var(--space-2);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    line-height: 1.42;
}

.article-directory-trailer-row td {
    padding-bottom: var(--space-4);
    border-bottom: 1.5px solid var(--table-border);
}

.article-directory-trailer {
    margin: 0 auto;
    max-width: 64ch;
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.55;
    font-weight: 300;
    text-align: center;
    padding-top: var(--space-2);
}

@media (max-width: 720px) {

    .article-directory-wrap {
        max-width: 100%;
    }

    .article-directory {
        width: 100%;
        table-layout: fixed;
    }

    .article-directory-col-title {
        width: calc(100% - 8.75rem);
    }

    .article-directory-col-date {
        width: 8.75rem;
    }

    .article-directory th:last-child,
    .article-directory td.article-directory-date {
        padding-left: var(--space-3);
    }

    .article-directory td.article-directory-date {
        white-space: nowrap;
        font-size: 0.84rem;
    }

    .article-directory td.article-directory-title {
        font-size: 1.03rem;
        padding-right: var(--space-4);
    }

    .article-directory-trailer {
        font-size: 0.95rem;
    }
}

/* Below this width a title and a date cannot share a row without the title
   wrapping to a sliver, so each entry stacks into a single-column block. */
@media (max-width: 560px) {

    .article-directory,
    .article-directory tbody,
    .article-directory tr,
    .article-directory td {
        display: block;
        width: auto;
    }

    .article-directory thead {
        display: none;
    }

    /* The hidden thead took the rule under the section heading with it. */
    .article-list > h2 {
        padding-bottom: var(--space-3);
        margin-bottom: 0;
        border-bottom: 1.5px solid var(--table-border);
    }

    .article-directory td.article-directory-title {
        padding-right: 0;
        font-size: 1.08rem;
    }

    .article-directory td.article-directory-date {
        padding-top: var(--space-1);
        padding-left: 0;
    }

    .article-directory-meta-row td {
        padding-bottom: 0;
    }

    .article-directory-trailer {
        margin: 0;
        max-width: none;
        text-align: left;
    }
}

.date {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0;
}

/* Prose */
.prose,
.text-content {
    max-width: 100%;
    margin-inline: auto;
    padding-block: var(--space-8);
    font-family: var(--font-serif);
    text-wrap: pretty;
    hyphens: manual;
}

@media (min-width: 640px) {

    .prose,
    .text-content {
        max-width: 68ch;
    }
}

@media (min-width: 1100px) {

    .prose,
    .text-content {
        max-width: 76ch;
    }

    .prose p,
    .text-content p {
        text-align: justify;
        text-justify: inter-word;
        text-align-last: left;
    }
}

.prose p,
.text-content p {
    margin: 0 0 var(--space-4);
}

.prose :where(p, li),
.text-content :where(p, li) {
    color: var(--prose-text-color);
    font-size: clamp(0.97rem, 0.94rem + 0.16vw, 1.04rem);
    line-height: 1.68;
    font-weight: 400;
    letter-spacing: 0.001em;
}

.prose article > p:first-of-type,
.text-content > p:first-of-type {
    font-size: clamp(1rem, 0.985rem + 0.16vw, 1.07rem);
    line-height: 1.62;
}

@media (max-width: 640px) {

    .prose :where(p, li),
    .text-content :where(p, li) {
        line-height: 1.66;
    }

    .prose article > p:first-of-type,
    .text-content > p:first-of-type {
        line-height: 1.6;
    }
}

@media (max-width: 420px) {

    .prose :where(p, li),
    .text-content :where(p, li) {
        font-size: 1.06rem;
        line-height: 1.64;
    }
}

@media (prefers-color-scheme: dark) {

    .prose :where(p, li),
    .text-content :where(p, li),
    .prose article > p:first-of-type,
    .text-content > p:first-of-type {
        font-weight: 300;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

.prose a,
.text-content a {
    font-weight: 500;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.18em;
}

.prose ul,
.prose ol,
.text-content ul,
.text-content ol {
    padding-left: 1.2rem;
}

.prose > header {
    margin-bottom: var(--space-6);
}

@media (min-width: 640px) {

    .prose > header {
        margin-bottom: var(--space-4);
    }
}

.prose > header h1 {
    font-family: var(--font-sans);
    font-size: clamp(1.7rem, 1.45rem + 0.85vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.prose > header .date,
.prose > header time {
    font-family: var(--font-sans);
}

.prose figure,
.text-content figure,
.prose p:has(> img),
.text-content p:has(> img) {
    margin: var(--space-6) 0;
}

.prose figure,
.text-content figure,
.prose p:has(> img + em),
.text-content p:has(> img + em) {
    display: grid;
    gap: var(--space-1);
}

.prose figure img,
.text-content figure img,
.prose p > img,
.text-content p > img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
}

.prose figcaption,
.text-content figcaption,
.prose p > img + em,
.text-content p > img + em {
    display: block;
    color: color-mix(in oklab, var(--prose-text-color) 78%, var(--surface));
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-style: normal;
    font-weight: 300;
    line-height: 1.35;
    text-wrap: balance;
}

.prose figcaption,
.text-content figcaption {
    padding-top: 0;
}

.prose p > img + em,
.text-content p > img + em {
    margin-top: 0;
    padding-top: 0;
}

.prose figure:has(img.article-demo-image),
.text-content figure:has(img.article-demo-image),
.prose p:has(> img.article-demo-image),
.text-content p:has(> img.article-demo-image) {
    max-width: 30rem;
    margin-inline: auto;
}

.prose p > img.article-demo-image,
.text-content p > img.article-demo-image {
    width: 100%;
    height: auto;
    margin-inline: auto;
}

.prose .reference-marker,
.text-content .reference-marker {
    font-family: var(--font-sans);
    font-size: 0.66em;
    line-height: 0;
    vertical-align: super;
    margin-left: 0.08em;
}

.prose :where(a[role="doc-noteref"], a.footnote-ref),
.text-content :where(a[role="doc-noteref"], a.footnote-ref),
.prose .reference-marker a,
.text-content .reference-marker a {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.prose :where(a[role="doc-noteref"], a.footnote-ref),
.text-content :where(a[role="doc-noteref"], a.footnote-ref) {
    font-weight: 600;
}

.prose .reference-marker a,
.text-content .reference-marker a {
    font-weight: 500;
}

.prose :where(a[role="doc-noteref"], a.footnote-ref):hover,
.prose :where(a[role="doc-noteref"], a.footnote-ref):focus-visible,
.text-content :where(a[role="doc-noteref"], a.footnote-ref):hover,
.text-content :where(a[role="doc-noteref"], a.footnote-ref):focus-visible,
.prose .reference-marker a:hover,
.prose .reference-marker a:focus-visible,
.text-content .reference-marker a:hover,
.text-content .reference-marker a:focus-visible {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.prose .footnotes,
.text-content .footnotes,
.prose ol.references,
.text-content ol.references {
    margin-top: var(--space-8);
    padding-top: var(--space-4);
    position: relative;
    font-family: var(--font-serif);
}

.prose .footnotes::before,
.text-content .footnotes::before,
.prose ol.references::before,
.text-content ol.references::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(4rem, 18%, 8rem);
    border-top: 1px solid var(--border);
}

.prose .footnotes hr,
.text-content .footnotes hr {
    display: none;
}

.prose .footnotes ol,
.text-content .footnotes ol,
.prose ol.references,
.text-content ol.references {
    margin-bottom: 0;
    padding-left: 1.1rem;
}

.prose .footnotes li,
.text-content .footnotes li,
.prose ol.references li,
.text-content ol.references li {
    margin-bottom: var(--space-2);
    color: var(--text-muted);
}

.prose .footnotes p,
.text-content .footnotes p,
.prose ol.references li,
.text-content ol.references li {
    font-size: 0.95rem;
    line-height: 1.55;
}

.prose :where(a[role="doc-backlink"], .footnote-back, .reference-backlink),
.text-content :where(a[role="doc-backlink"], .footnote-back, .reference-backlink) {
    margin-left: 0.3rem;
    text-decoration: none;
}

/* Code blocks */
pre {
    position: relative;
    border: 1px solid color-mix(in oklab, var(--code-border) 55%, transparent);
    border-radius: 0.75rem;
    overflow: auto;
    padding: calc(var(--space-3) + 0.3rem) var(--space-3) var(--space-3);
    /* extra top padding for copy button / language label */
    background-color: color-mix(in oklab, var(--surface) 88%, var(--surface-muted));
    color: var(--code-fg);
    margin-block: var(--space-6);
    box-shadow: none;
    line-height: 1.52;
    tab-size: 2;
    -moz-tab-size: 2;
}

.shiki {
    position: relative;
    padding: calc(var(--space-3) + 0.3rem) var(--space-3) var(--space-3);
    background-color: color-mix(in oklab, var(--surface) 88%, var(--surface-muted)) !important;
    /* Let Shiki keep token colors; only adjust container aesthetics */
    font-size: clamp(0.84rem, 0.82rem + 0.18vw, 0.92rem);
}

/* Shiki dual theme support - defaultColor: 'light' with dark theme via CSS variables */
@media (prefers-color-scheme: dark) {

    .shiki,
    .shiki span {
        color: var(--shiki-dark) !important;
    }

    .shiki {
        background-color: color-mix(in oklab, var(--surface) 90%, var(--surface-muted)) !important;
    }
}

@media (max-width: 640px) {

    pre,
    .shiki {
        font-size: 0.86rem;
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
}

.line {
    line-height: 1.52;
}

pre code,
.shiki code {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* Inline code (not inside pre) */
:not(pre)>code {
    background: var(--code-surface);
    color: var(--code-fg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-s);
    padding: 0.1em 0.35em;
}

/* Keyboard input styling */
kbd {
    font-family: var(--font-mono);
    font-size: 0.85em;
    border: 1px solid var(--code-border);
    border-bottom-width: 2px;
    border-radius: 0.3rem;
    padding: 0.1em 0.45em;
    background: var(--code-surface);
}

/* Optional language label injected via data attribute */
.shiki[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0.32rem;
    left: 0.55rem;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Compact single-line code blocks */
.shiki[data-single-line="true"],
pre[data-lines="1"] {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: var(--space-3);
    padding-right: calc(var(--space-3) + 1.95em);
    margin-block: var(--space-3);
}

/* Hide language label on single-line for brevity */
.shiki[data-single-line="true"][data-lang]::before {
    display: none;
}

/* Improve selection contrast inside code blocks */
.shiki ::selection,
pre ::selection {
    background: color-mix(in oklab, var(--accent) 24%, transparent);
}

.article-image-zoomable {
    cursor: pointer;
}

.image-popover {
    inset: 0;
    border: 0;
    padding: 0;
    margin: auto;
    background: transparent;
    color: var(--text);
    width: fit-content;
    min-width: 0;
    max-width: min(96vw, 90rem);
    max-height: 96vh;
    box-shadow: none;
    overflow: visible;
    opacity: 0;
    transform: translateY(0.35rem) scale(0.985);
    transition:
        opacity 280ms ease,
        transform 280ms ease,
        overlay 280ms ease allow-discrete,
        display 280ms ease allow-discrete;
}

.image-popover::backdrop {
    background: color-mix(in oklab, black 24%, transparent);
    backdrop-filter: blur(6px) saturate(0.92);
    transition: background-color 280ms ease, backdrop-filter 280ms ease;
}

.image-popover:popover-open,
.image-popover[open] {
    border: 0;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.image-popover:popover-open::backdrop,
.image-popover[open]::backdrop {
    background: color-mix(in oklab, black 36%, transparent);
    backdrop-filter: blur(10px) saturate(0.88);
}

@media (prefers-color-scheme: dark) {
    .image-popover::backdrop {
        background: color-mix(in oklab, black 16%, transparent);
        backdrop-filter: blur(6px) saturate(0.94);
    }

    .image-popover:popover-open::backdrop,
    .image-popover[open]::backdrop {
        background: color-mix(in oklab, black 26%, transparent);
        backdrop-filter: blur(9px) saturate(0.9);
    }
}

@starting-style {
    .image-popover:popover-open,
    .image-popover[open] {
        opacity: 0;
        transform: translateY(0.35rem) scale(0.985);
    }

    .image-popover:popover-open::backdrop,
    .image-popover[open]::backdrop {
        background: color-mix(in oklab, black 24%, transparent);
        backdrop-filter: blur(6px) saturate(0.92);
    }
}

@media (prefers-color-scheme: dark) {
    @starting-style {
        .image-popover:popover-open::backdrop,
        .image-popover[open]::backdrop {
            background: color-mix(in oklab, black 16%, transparent);
            backdrop-filter: blur(6px) saturate(0.94);
        }
    }
}

.image-popover__surface {
    position: relative;
    display: inline-grid;
    gap: var(--space-2);
    justify-items: center;
    width: fit-content;
    padding: var(--space-8);
}

.image-popover__image {
    display: block;
    width: auto;
    max-width: min(88vw, 84rem);
    max-height: calc(96vh - 8rem);
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.image-popover__caption {
    margin: 0;
    max-width: min(88vw, 84rem);
    color: color-mix(in oklab, var(--prose-text-color) 78%, var(--surface));
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 300;
    line-height: 1.35;
    text-wrap: balance;
}

.image-popover__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid color-mix(in oklab, var(--border) 44%, transparent);
    border-radius: 999px;
    background: color-mix(in oklab, var(--surface) 68%, transparent);
    color: color-mix(in oklab, var(--text) 78%, transparent);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.82;
    transition:
        opacity 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease;
}

.image-popover__close:hover,
.image-popover__close:focus-visible {
    opacity: 1;
    border-color: color-mix(in oklab, var(--border) 72%, transparent);
    background: color-mix(in oklab, var(--surface) 82%, transparent);
    color: var(--text);
}

@media (max-width: 640px) {
    .image-popover__surface {
        padding: var(--space-6) var(--space-4);
    }

    .image-popover__close {
        top: var(--space-3);
        right: var(--space-3);
    }

    .image-popover__image {
        max-height: calc(96vh - 6rem);
    }
}

/* Utilities */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.skip-link {
    position: fixed;
    left: 50%;
    top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
    transform: translate(-50%, -200%);
    background: var(--surface);
    color: var(--text);
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    z-index: 10000;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    width: max-content;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translate(-50%, 0);
}

/* footer removed */

/* Attribute classes */
.code_clippy {
    position: absolute;
    top: 0;
    right: 0;
    height: 1.95em;
    width: 1.95em;
    padding: 0.4em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.75;
}

.code_clippy:hover,
.code_clippy:focus-visible {
    opacity: 1;
    color: var(--accent);
}

.code_clippy svg {
    height: 100%;
    width: 100%;
    fill: currentColor;
    transition: color 0.25s ease-in-out, fill 0.25s ease-in-out;
}

svg.icon_action_success {
    fill: #22c55e;
}

/* Focus */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}