:root {
    --bg: #fafafa;
    --fg: #1a1a1a;
    --muted: #888;
    --accent: #555;
    --border: #e0e0e0;
    --code-bg: #111;
    --max-width: 38rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111;
        --fg: #d4d4d4;
        --muted: #777;
        --accent: #aaa;
        --border: #2a2a2a;
        --code-bg: #0a0a0a;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "SF Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--fg);
    background: var(--bg);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

/* header */
.site-header {
    margin-bottom: 4rem;
}

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

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

.site-header .p-name {
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.site-header ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.site-header ul a {
    color: var(--muted);
    font-size: 0.8rem;
    transition: color 0.2s;
}

.site-header ul a:hover {
    color: var(--fg);
}

/* typography */
a {
    color: var(--fg);
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

a:hover {
    text-decoration-color: var(--fg);
}

h1 {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
}

p, ul, ol, blockquote, pre { margin-bottom: 1.5rem; }
ul, ol { padding-left: 1.25rem; }

li { margin-bottom: 0.25rem; }

blockquote {
    border-left: 1px solid var(--border);
    padding-left: 1.25rem;
    color: var(--muted);
}

pre {
    background: var(--code-bg);
    color: #ccc;
    padding: 1.25rem;
    border-radius: 2px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.6;
}

code {
    font-family: inherit;
    font-size: 0.85em;
}

p code {
    background: var(--border);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

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

strong { font-weight: 500; }
em { font-style: normal; color: var(--muted); }

/* homepage article list */
.h-feed { }

.h-entry {
    margin-bottom: 2.5rem;
}

.h-entry h2 {
    margin-top: 0;
    margin-bottom: 0;
}

.h-entry h2 a {
    text-decoration: none;
    color: var(--fg);
}

.h-entry h2 a:hover {
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
}

.dt-published {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.p-summary {
    color: var(--muted);
    font-size: 0.85rem;
}

/* article page */
.e-content {
    margin-top: 2rem;
}

.e-content p:first-child {
    margin-top: 0;
}

/* tags */
.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    margin-top: 2rem;
}

.tags a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.tags a:hover {
    color: var(--fg);
}

/* footer */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

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

/* responsive */
@media (max-width: 600px) {
    body {
        padding: 2rem 1.25rem;
        font-size: 0.85rem;
    }

    .site-header {
        margin-bottom: 3rem;
    }

    .site-header nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .site-header ul {
        gap: 1rem;
    }
}
