@font-face {
    font-family: "Reddit Mono";
    src: url("/fonts/RedditMono-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --paper: #fffdf8;
    --ink: #1c1c24;
    --muted: #6f6f7c;
    --accent: #8880ff;
    --link: #5a52c9;
    --line: #deddd8;
    --code: #f2f0e9;
    --measure: 58rem;
    --reading-measure: 44rem;
    --mono:
        "Reddit Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
    background: var(--paper);
    color: var(--ink);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--mono);
    font-size: 1rem;
    line-height: 1.75;
}

a {
    color: inherit;
}

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

.site-shell {
    width: min(var(--measure), calc(100% - 3rem));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.25rem 0 5rem;
}

.site-identity {
    display: inline-flex;
    align-items: baseline;
    gap: 0.8rem;
    text-decoration: none;
}

.site-mark {
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.12em;
}

.site-title {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--muted);
    font-size: 0.78rem;
}

nav a,
.site-footer a {
    text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--link);
}

main {
    padding-bottom: 5rem;
}

.home-intro {
    max-width: var(--reading-measure);
    margin-bottom: 5rem;
}

h1,
h2,
h3 {
    line-height: 1.25;
    font-weight: 500;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 6vw, 2.5rem);
    letter-spacing: -0.02em;
}

.home-intro .prose {
    max-width: 36rem;
    margin-bottom: 0;
    color: var(--muted);
}

.section-label,
.eyebrow {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.post-list {
    border-top: 1px solid var(--line);
}

.post-link {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
    text-decoration: none;
}

.post-link time,
.post-header time {
    color: var(--muted);
    font-size: 0.9rem;
}

.post-link span {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.2em;
    transition: text-decoration-color 0.15s ease;
}

.post-link:hover span,
.post-link:focus-visible span {
    text-decoration-color: var(--accent);
}

.empty-state {
    color: var(--muted);
}

.page-header,
.post-header {
    max-width: var(--reading-measure);
    margin-bottom: 3rem;
}

.post-header h1,
.page-header h1,
.not-found h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.prose {
    max-width: var(--reading-measure);
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
    margin: 0 0 1.5rem;
}

.prose h2,
.prose h3 {
    margin: 2.75rem 0 0.9rem;
}

.prose a,
.back-link a,
.not-found a {
    color: var(--link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

.prose blockquote {
    border-left: 2px solid var(--accent);
    margin-left: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.prose code {
    padding: 0.12em 0.3em;
    background: var(--code);
    font-size: 0.9em;
}

.prose pre {
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    background: var(--code);
}

.prose pre code {
    padding: 0;
    background: transparent;
}

.prose table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.prose th,
.prose td {
    border: 1px solid var(--line);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
}

.back-link {
    margin-top: 3rem;
    font-size: 0.85rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.25rem 0 3rem;
    color: var(--muted);
    font-size: 0.75rem;
}

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

@media (max-width: 680px) {
    .site-shell {
        width: min(var(--measure), calc(100% - 2rem));
    }

    .site-header {
        align-items: flex-start;
        padding-bottom: 3.5rem;
    }

    .site-identity {
        align-items: flex-start;
    }

    nav {
        justify-content: flex-end;
        gap: 0.65rem 1rem;
    }

    .post-link {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
