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

@font-face {
    font-family: "Source Serif 4";
    src: url("/source-serif-4-latin-normal.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif 4";
    src: url("/source-serif-4-latin-italic.woff2") format("woff2");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --color-bg: #000;
    --color-text: #d0d0d0;
    --color-link: #7eb3f8;
    --color-muted: #8f8f8f;
    --color-strong: #e0e0e0;
    --color-meta: #a8a8a8;
    --color-current: #c084fc;
    --color-border: #333;
    --color-heading-anchor: #777;
    --color-heading-anchor-hover: #ccc;
    --color-code-bg: #080808;
    --color-toc-highlight: #1a1a1a;
    --color-button-bg: #111;
    --color-button-hover: #f0f0f0;
    --color-button-hover-border: #666;
    --color-focus: #7eb3f8;
    --color-copied: #b8f7c2;
    --color-copied-border: #4d7a52;
    --color-callout-border: #2f3d52;
    --color-callout-bg: #080b10;
    --color-callout-title: #dce9fb;
    --color-info-border: #2f4d77;
    --color-info-bg: #07101b;
    --color-info-title: #dce9fb;
    --color-tip-border: #426c50;
    --color-tip-bg: #09150d;
    --color-tip-title: #b8e4c4;
    --color-warning-border: #8b6a32;
    --color-warning-bg: #191307;
    --color-warning-title: #f4d18c;
    --color-danger-border: #924b4b;
    --color-danger-bg: #1b0c0c;
    --color-danger-title: #ffc1bc;
    --color-important-border: #71538f;
    --color-important-bg: #140d1c;
    --color-important-title: #dec4f5;
    --color-selection-bg: #7eb3f8;
    --color-selection-text: #000;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --color-bg: #fff;
        --color-text: #000;
        --color-link: #1f6fba;
        --color-muted: #555;
        --color-strong: #000;
        --color-meta: #555;
        --color-current: #c084fc;
        --color-border: #d0d0d0;
        --color-heading-anchor: #777;
        --color-heading-anchor-hover: #555;
        --color-code-bg: #f7f7f7;
        --color-toc-highlight: #f7f7f7;
        --color-button-bg: #fff;
        --color-button-hover: #000;
        --color-button-hover-border: #999;
        --color-focus: #7eb3f8;
        --color-copied: #2f6f3a;
        --color-copied-border: #93c99a;
        --color-callout-border: #cad8eb;
        --color-callout-bg: #fff;
        --color-callout-title: #244061;
        --color-info-border: #b7cce8;
        --color-info-bg: #fff;
        --color-info-title: #244061;
        --color-tip-border: #88ae92;
        --color-tip-bg: #f2faf4;
        --color-tip-title: #285b36;
        --color-warning-border: #b18a45;
        --color-warning-bg: #fff9eb;
        --color-warning-title: #76500e;
        --color-danger-border: #c5837e;
        --color-danger-bg: #fff4f3;
        --color-danger-title: #913c35;
        --color-important-border: #ad91c7;
        --color-important-bg: #faf5ff;
        --color-important-title: #69418c;
        --color-selection-bg: #7eb3f8;
        --color-selection-text: #000;
    }
}

html {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: "Source Serif 4", Georgia, serif;
    line-height: 1.45;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 3rem 0.5rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.section {
    width: 100%;
}

.container {
    width: min(100%, 36rem);
    margin: 0 auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.container-home {
    width: min(100%, 75rem);
}

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

.home-view {
    --home-art-width: 24.5rem;
    --home-content-width: 32rem;
    --home-gap-width: 2.75rem;
    display: grid;
    grid-template-columns:
        minmax(0, var(--home-art-width)) minmax(0, var(--home-content-width));
    column-gap: var(--home-gap-width);
    justify-content: center;
    min-height: calc(100vh - 6rem);
    align-items: center;
    align-content: center;
}

.home-banner {
    position: relative;
    width: 100%;
    min-height: 28rem;
    align-self: stretch;
}

.home-dither {
    position: absolute;
    inset: -1rem 0;
    overflow: hidden;
    color: var(--color-link);
    background-color: var(--color-bg);
    background-image: radial-gradient(currentColor 0.5px, transparent 0.5px);
    background-size: 4px 4px;
}

.home-dither canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.home-dither canvas[hidden] {
    display: none;
}

.dither-toggle {
    position: absolute;
    right: 0.75rem;
    bottom: -0.25rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-link);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
}

.home-banner:hover .dither-toggle,
.dither-toggle:focus-visible {
    opacity: 1;
}

.dither-toggle:focus-visible {
    outline: 1px solid var(--color-focus);
    outline-offset: 2px;
}

.home-content {
    width: 100%;
}

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

.home-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.home-footer p {
    margin: 0;
}

.home-footer p:last-child {
    margin-left: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--color-strong);
    font-weight: 500;
    font-family: "Source Serif 4", Georgia, serif;
}

body {
    font-family: "Source Serif 4", Georgia, serif;
}

h1 {
    margin-top: 3rem;
}

h2 {
    margin-top: 2.5rem;
}

h3 {
    margin-top: 2rem;
}

h4,
h5,
h6 {
    margin-top: 1.5rem;
}

p {
    margin: 1rem 0 0;
    font-weight: 400;
    font-size: 1rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.14em;
    transition: color 140ms ease;
}

a:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
}

a:focus-visible {
    outline: 1px solid var(--color-focus);
    outline-offset: 2px;
}

ul,
ol {
    margin: 1rem 0 0;
    padding-left: 1.5rem;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-top: 0.25rem;
    font-size: 1rem;
}

strong {
    color: var(--color-strong);
}

.title {
    margin-top: 0;
}

.subtitle {
    color: var(--color-meta);
}

.section-heading {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 1rem;
    align-items: baseline;
    margin-top: 2.5rem;
}

.section-heading h2 {
    margin-top: 0;
}

.section-heading p {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    margin-top: 0;
}

.home-section-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.home-section-title button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-weight: normal;
    cursor: pointer;
}

.home-section-title button:hover,
.home-section-title button[aria-pressed="true"] {
    color: var(--color-strong);
}

.home-section-title button[aria-pressed="true"] {
    font-weight: 600;
}

.home-section-title button:focus-visible {
    outline: 1px solid var(--color-focus);
    outline-offset: 2px;
}

.home-panels-ready {
    position: relative;
    display: grid;
    overflow: hidden;
}

.home-panels-ready>div {
    grid-area: 1 / 1;
    min-width: 0;
    padding: 0 3px 3px;
    transition: transform 220ms ease, visibility 220ms;
}

.home-panels-ready #home-music {
    position: absolute;
    inset: 0 0 auto;
    transform: translateX(100%);
    visibility: hidden;
}

.show-music #home-writing {
    position: absolute;
    inset: 0 0 auto;
    transform: translateX(-100%);
    visibility: hidden;
}

.show-music #home-music {
    position: static;
    transform: translateX(0);
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .home-panels-ready>div {
        transition: none;
    }
}

.section-heading p[hidden] {
    display: none;
}

.music-status {
    color: var(--color-muted);
}

.music-status:empty {
    display: none;
}

.music-list {
    margin-top: 1rem;
    padding: 0;
    list-style: none;
}

.music-track {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-top: 0.85rem;
}

.music-track:first-child {
    margin-top: 0;
}

.music-cover {
    display: grid;
    place-items: center;
    flex: 0 0 3.75rem;
    height: 3.75rem;
    overflow: hidden;
    background: var(--color-code-bg);
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
}

.music-cover>* {
    grid-area: 1 / 1;
}

.music-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.music-details {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.music-time,
.music-playing {
    flex-shrink: 0;
    align-self: flex-start;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.music-details> :not([hidden]) {
    display: block;
}

.music-artist {
    color: var(--color-meta);
    font-size: 0.9rem;
}

.music-album {
    color: var(--color-muted);
    font-size: 0.8rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.breadcrumbs span {
    color: var(--color-muted);
}

.breadcrumbs a {
    font-size: inherit;
}

.post-navigation {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-navigation .breadcrumbs {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.post-pagination {
    display: flex;
    flex-shrink: 0;
    gap: 0.75rem;
}

.post-pagination a:hover,
.post-pagination a:focus-visible {
    color: var(--color-strong);
    text-decoration: none;
}

.post-pagination span {
    color: var(--color-muted);
    opacity: 0.45;
}

.all-posts-header {
    text-align: left;
}

.all-posts-header h1 {
    margin-top: 0;
}

.all-posts-header p {
    margin-top: 0.25rem;
    color: var(--color-meta);
    font-size: 1rem;
}

.all-posts-header a {
    font-size: inherit;
}

.all-post-list {
    margin-top: 2.5rem;
    padding-left: 0;
    list-style: none;
}

.post-year-group {
    margin-top: 2rem;
}

.post-year-group:first-child {
    margin-top: 0;
}

.post-year-group h3 {
    margin-top: 0;
}

.post-year-group ul {
    margin-top: 0.75rem;
    padding-left: 0;
    list-style: none;
}

.post-year-group li {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 1rem;
    align-items: baseline;
    margin-top: 0.45rem;
    font-size: 1rem;
    line-height: 1.35;
}

.post-year-group a {
    font-size: inherit;
}

.post-year-group time {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.post-header h1 {
    margin-top: 0;
}

.post-header {
    margin-bottom: 1.25rem;
}

.not-found {
    width: 100%;
}

.not-found h1 {
    margin-top: 0;
}

.not-found p {
    max-width: 32rem;
}

.not-found-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 2rem;
}

.not-found-links a {
    font-size: 1rem;
}

.post-header p {
    margin-top: 0.4rem;
    color: var(--color-meta);
}

.post-header .post-meta {
    margin-top: 0.35rem;
    color: var(--color-muted);
}

.post-header time {
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

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

.post-body {
    position: relative;
}

.reading-toc-slot {
    display: none;
}

@media (min-width: 72rem) {
    .reading-toc-slot {
        display: block;
        position: absolute;
        top: 0;
        right: calc(100% + 2rem);
        bottom: 0;
        width: 14rem;
    }
}

.reading-toc {
    position: sticky;
    top: 2rem;
    display: grid;
    grid-template-columns: 2px minmax(0, 1fr);
    gap: 0.75rem;
    max-height: calc(100vh - 4rem);
    overflow: hidden auto;
    padding: 0.25rem;
}

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

.reading-toc__progress-track {
    position: relative;
    background: var(--color-border);
}

.reading-toc__progress-fill {
    position: absolute;
    inset: 0;
    background: var(--color-link);
    transform: scaleY(var(--reading-progress, 0));
    transform-origin: top;
}

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

.reading-toc__list li {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
}

.reading-toc__link {
    display: block;
    padding: 0.4rem 0.35rem;
    color: var(--color-muted);
    border-radius: 0.375rem;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.reading-toc__level-3 a {
    padding-left: 1rem;
}

.reading-toc__level-4 a {
    padding-left: 1.65rem;
}

.reading-toc__link:hover,
.reading-toc__link:focus-visible {
    color: var(--color-strong);
    background: var(--color-toc-highlight);
}

.reading-toc__link[aria-current] {
    color: var(--color-link);
    background: var(--color-toc-highlight);
    transform: translateX(2px);
}

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

    .reading-toc__link,
    .reading-toc__progress-fill {
        transition: none;
    }

    .reading-toc__link[aria-current] {
        transform: none;
    }
}

@media print {

    .reading-toc-slot,
    .reading-toc-end-space {
        display: none;
    }
}

.post-content h2[id],
.post-content h3[id],
.post-content h4[id] {
    scroll-margin-top: min(25vh, 10rem);
}

.heading-anchor {
    margin-left: 0.35rem;
    color: var(--color-heading-anchor);
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition:
        color 0.2s,
        opacity 0.2s;
}

.post-content h2[id]:hover .heading-anchor,
.post-content h3[id]:hover .heading-anchor,
.post-content h4[id]:hover .heading-anchor,
.post-content h2[id]:focus-within .heading-anchor,
.post-content h3[id]:focus-within .heading-anchor,
.post-content h4[id]:focus-within .heading-anchor {
    opacity: 1;
}

.heading-anchor:hover,
.heading-anchor:focus-visible {
    color: var(--color-heading-anchor-hover);
    opacity: 1;
    text-decoration: none;
}

pre,
code {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

pre {
    margin: 1.5rem 0;
    padding: 0.5rem;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    background: var(--color-code-bg);
}

.code-block {
    position: relative;
    margin-top: 1.5rem;
}

.code-block pre {
    margin: 0;
    padding: 1rem 3.75rem 1rem 1rem;
}

.code-copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    background: var(--color-button-bg);
    color: var(--color-meta);
    font: inherit;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
    border-color: var(--color-button-hover-border);
    color: var(--color-button-hover);
}

.code-copy-button:focus-visible {
    outline: 1px solid var(--color-focus);
    outline-offset: 1px;
}

.code-copy-button[data-copied="true"] {
    border-color: var(--color-copied-border);
    color: var(--color-copied);
}

code:not(pre code) {
    padding: 0 0.2rem;
    background: var(--color-code-bg);
    color: var(--color-strong);
}

table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
    font-size: 1rem;
}

th,
td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--color-strong);
}

.callout {
    margin: 1.75rem 0;
    padding: 0.85rem 1rem 0.95rem;
    border: 1px solid var(--color-callout-border);
    border-radius: 0.375rem;
    background: var(--color-callout-bg);
}

.callout-title {
    margin: 0;
    color: var(--color-callout-title);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.callout-body> :first-child {
    margin-top: 0.5rem;
}

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

.callout-info,
.callout-note {
    --color-callout-title: var(--color-info-title);
    border-color: var(--color-info-border);
    background: var(--color-info-bg);
}

.callout-tip {
    --color-callout-border: var(--color-tip-border);
    --color-callout-bg: var(--color-tip-bg);
    --color-callout-title: var(--color-tip-title);
}

.callout-warning {
    --color-callout-border: var(--color-warning-border);
    --color-callout-bg: var(--color-warning-bg);
    --color-callout-title: var(--color-warning-title);
}

.callout-danger,
.callout-caution {
    --color-callout-border: var(--color-danger-border);
    --color-callout-bg: var(--color-danger-bg);
    --color-callout-title: var(--color-danger-title);
}

.callout-important {
    --color-callout-border: var(--color-important-border);
    --color-callout-bg: var(--color-important-bg);
    --color-callout-title: var(--color-important-title);
}

img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
}

hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

h1+hr,
h2+hr,
h3+hr,
.section-heading+hr {
    margin-top: 0.35rem;
}

p+hr,
ul+hr,
ol+hr {
    margin-top: 1.25rem;
}

.post-list {
    margin-top: 1rem;
    padding-left: 0;
    list-style: none;
}

.post-list li {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 1rem;
    align-items: baseline;
    margin-top: 0.45rem;
}

.post-list p {
    margin-top: 0.15rem;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.25;
}

.post-list time {
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

.post-list a,
.post-year-group a {
    transition:
        color 140ms ease,
        opacity 140ms ease;
}

.post-list a:hover,
.post-year-group a:hover,
.breadcrumbs a:hover,
.all-posts-header a:hover,
.section-heading a:not(.music-profile):hover {
    color: var(--color-strong);
}

@media (max-width: 40rem) {
    .container-home {
        width: min(100%, 36rem);
    }

    .home-view {
        display: block;
        min-height: auto;
        transform: none;
    }

    .home-banner {
        display: none;
    }

    .home-content {
        margin-top: 0;
    }
}

@media (max-width: 36rem) {
    .section-heading {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .post-list li,
    .post-year-group li {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .post-year-group time {
        color: var(--color-muted);
    }
}

@media (max-width: 74rem) {}

::selection {
    background: var(--color-selection-bg);
    color: var(--color-selection-text);
}
