@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("./assets/fonts/source-sans-3/SourceSans3VF-Upright.ttf.woff2?v=2026-10-06T19%3A08%3A09.367Z") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url("./assets/fonts/source-sans-3/SourceSans3VF-Italic.ttf.woff2?v=2026-10-06T19%3A08%3A09.367Z") format("woff2");
}

:root {
    color-scheme: light;
    --bg: #fcfcfc;
    --surface: #ffffff;
    --surface-soft: #ececec;
    --text: #0d0d0d;
    --muted: #555555;
    --border: #c8c8c8;
    --border-strong: #222222;
    --link: #666666;
    --link-hover: #262626;
    --code-bg: #eeeeee;
    --inline-code-bg: #e8e8e8;
    --inline-code-text: #0d0d0d;
    --switch-track: #0d0d0d;
    --switch-track-checked: #ffffff;
    --switch-border: #0d0d0d;
    --switch-border-checked: #ffffff;
    --switch-knob: #fcfcfc;
    --switch-knob-border: #0d0d0d;
    --switch-knob-checked: #000000;
    --switch-knob-border-checked: #000000;
    --play-button-bg: #0d0d0d;
    --play-button-text: #fcfcfc;
    --measure: 750px;
    --font-body: "Source Sans 3", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-ui: var(--font-body);
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --surface: #101010;
    --surface-soft: #181818;
    --text: #ffffff;
    --muted: #bdbdbd;
    --border: #555555;
    --border-strong: #ffffff;
    --link: #999999;
    --link-hover: #d9d9d9;
    --code-bg: #171717;
    --inline-code-bg: #222222;
    --inline-code-text: #ffffff;
    --switch-track: #000000;
    --switch-track-checked: #ffffff;
    --switch-border: #555555;
    --switch-border-checked: #ffffff;
    --switch-knob: #ffffff;
    --switch-knob-border: #555555;
    --switch-knob-checked: #000000;
    --switch-knob-border-checked: #000000;
    --play-button-bg: #ffffff;
    --play-button-text: #000000;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.2vw + 0.95rem, 1.125rem);
    font-weight: 400;
    line-height: 1.75;
}

a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover,
a:focus-visible {
    color: var(--link-hover);
}

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

button,
input {
    font: inherit;
}

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

.page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.site-header {
    background: transparent;
}

.site-header__inner,
.site-main,
.site-footer__inner {
    width: min(var(--measure), calc(100% - 2rem));
    margin: 0 auto;
}

.site-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding: 1rem 0 1.25rem;
}

.site-title {
    min-width: 0;
    margin: 0;
    line-height: 1;
    text-align: center;
}

.site-logo-link {
    display: block;
    color: inherit;
}

.site-logo-link:hover,
.site-logo-link:focus-visible {
    color: inherit;
    text-decoration: none;
}

.site-logo-link:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
}

.site-logo {
    display: block;
    width: 100%;
    height: auto;
    filter: invert(1);
    transition: filter 0.2s ease;
}

html[data-theme="dark"] .site-logo {
    filter: none;
}

.theme-switch {
    position: absolute;
    top: 1rem;
    right: 0;
    z-index: 1;
    display: inline-flex;
    width: 2.9rem;
    height: 1.7rem;
    cursor: pointer;
}

.theme-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.theme-switch__track {
    width: 100%;
    height: 100%;
    border: 1px solid var(--switch-border);
    border-radius: 999px;
    background: var(--switch-track);
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.theme-switch__track::before {
    position: absolute;
    top: 50%;
    left: 0.16rem;
    width: 1.16rem;
    height: 1.16rem;
    border: 1px solid var(--switch-knob-border);
    border-radius: 50%;
    background: var(--switch-knob);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    content: "";
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.theme-switch input:checked + .theme-switch__track {
    border-color: var(--switch-border-checked);
    background: var(--switch-track-checked);
}

.theme-switch input:checked + .theme-switch__track::before {
    border-color: var(--switch-knob-border-checked);
    background: var(--switch-knob-checked);
    transform: translate(1.18rem, -50%);
}

.theme-switch input:focus-visible + .theme-switch__track {
    outline: 2px solid var(--link);
    outline-offset: 3px;
}

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

.site-main {
    flex: 1;
    padding: 1rem 0 3.75rem;
}

.toc {
    margin: 0 0 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: inherit;
    line-height: 1.65;
    text-align: center;
}

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

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

.toc li {
    display: inline;
    margin: 0;
}

.toc li:not(:last-child)::after {
    color: var(--muted);
    content: " | ";
}

.article {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: inherit;
}

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

.article h1,
.article h2,
.article h3,
.article h4 {
    position: relative;
    margin: 2rem 0 1rem;
    color: var(--text);
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    scroll-margin-top: 1rem;
}

.article h1 {
    padding-bottom: 0.32rem;
    border-bottom: 1px solid var(--border);
    font-size: clamp(1.85rem, 2.6vw, 2.35rem);
}

.article h2 {
    font-size: 1.55rem;
}

.article h3 {
    font-size: 1.25rem;
}

.article h4 {
    font-size: 1.08rem;
}

.heading-link {
    display: block;
    padding-right: 2.4rem;
    color: inherit;
}

.heading-link:hover,
.heading-link:focus-visible {
    color: inherit;
    text-decoration: none;
}

.copy-link,
.copy-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.copy-link {
    position: absolute;
    top: 50%;
    right: 0;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    opacity: 0;
    transform: translateY(-50%);
}

.article h1:hover .copy-link,
.article h2:hover .copy-link,
.article h3:hover .copy-link,
.article h4:hover .copy-link,
.copy-link:focus-visible {
    opacity: 1;
}

.copy-link svg,
.copy-code svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.copy-link:hover,
.copy-code:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.copy-link:focus-visible,
.copy-code:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
}

.article p,
.article ul,
.article ol {
    margin: 0 0 1.1rem;
}

.article ul,
.article ol {
    padding-left: 1.6rem;
}

.article li {
    margin: 0.35rem 0;
}

.article code {
    padding: 0.12rem 0.32rem;
    border-radius: 5px;
    background: var(--inline-code-bg);
    box-decoration-break: clone;
    color: var(--inline-code-text);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.code-block {
    position: relative;
    margin: 1.25rem 0;
}

.code-block__header {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 1;
}

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

.copy-code {
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: var(--surface);
}

.code-block pre {
    overflow-x: auto;
    margin: 0;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--code-bg);
}

.code-block code {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
}

.table-wrap {
    margin: 1rem 0;
    overflow-x: auto;
}

.article table {
    width: auto;
    border-collapse: collapse;
    font-size: inherit;
    line-height: 1.35;
}

.article th,
.article td {
    padding: 0.24rem 2.2rem 0.24rem 0;
    text-align: left;
    vertical-align: top;
}

.article th:last-child,
.article td:last-child {
    padding-right: 0;
}

.article th {
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.article img {
    display: block;
    width: min(100%, 640px);
    height: auto;
    margin: 1.5rem auto;
    border-radius: 4px;
}

.play-row {
    margin: 1.5rem 0 2rem;
    text-align: center;
}

.play-button {
    display: inline-flex;
    min-width: 192px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: var(--play-button-bg);
    color: var(--play-button-text);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-shadow: none;
}

.play-button:hover,
.play-button:focus-visible {
    color: var(--play-button-text);
    text-decoration: none;
}

.play-button:focus-visible {
    outline: none;
}

.play-button:active,
.play-button.is-pressed {
    transform: translateY(2px);
}

.play-button__initial {
    color: inherit;
    text-shadow: none;
}

.site-footer {
    margin-top: auto;
    background: transparent;
}

.site-footer__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 0 2rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
}

.site-footer__left {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.95rem;
}

.site-footer__left p {
    margin: 0;
}

.site-footer__left p + p {
    margin-top: 0.08rem;
}

.site-footer__license-link {
    white-space: nowrap;
}

.site-footer__links {
    display: block;
    flex: 0 0 auto;
    align-self: center;
    white-space: nowrap;
    flex-wrap: wrap;
    justify-content: flex-end;
    line-height: 1.6;
    text-align: right;
}

.site-footer__separator {
    color: var(--muted);
}

@media (min-width: 721px) {
    .site-footer__copyright {
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .site-main {
        width: 100%;
        padding: 0 0 3rem;
    }

    .site-header__inner,
    .site-footer__inner {
        width: calc(100% - 2rem);
    }

    .site-header__inner {
        padding-top: 0.85rem;
    }

    .article {
        padding: 1.25rem;
    }

    .toc {
        padding: 0 1.25rem;
    }

    .copy-link {
        opacity: 1;
    }

    .site-footer__inner {
        display: block;
        padding-bottom: 1.5rem;
    }

    .site-footer__links {
        margin-top: 0.65rem;
        text-align: center;
    }
}
