/* One typeface, one size, two text colors. Shared by every page. */

:root {
    --bg: #0a0a0a;
    --text: #ededed;
    --muted: #8a8a8a;
    --border: #2a2a2a;
}

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

html {
    font-size: 14px;
}

body {
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1rem;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Background: slow color wash plus the star field built by stars.js */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 128, 255, 0.1) 0%, transparent 50%);
    z-index: -2;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    33% {
        transform: translateX(-20px) translateY(-10px);
    }

    66% {
        transform: translateX(20px) translateY(10px);
    }
}

.stars {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: #fff;
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

h1,
h2,
h3 {
    font-size: 1rem;
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease;
}

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

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

/* Layout: a narrow column pinned to the top-left */
.page {
    max-width: 60rem;
    padding: 4rem 3rem 6rem;
}

/* Long-form text keeps a readable line length */
.essay-body {
    max-width: 40rem;
}

/* Home */
.name+p {
    color: var(--muted);
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: 1.7rem;
}

/* Essays */
.back-link {
    color: var(--muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.page-header {
    margin: 1.7rem 0;
}

.essays-list {
    display: flex;
    flex-direction: column;
    gap: 1.7rem;
}

.essay-meta,
.essay-preview {
    color: var(--muted);
}

.essay-body>*+* {
    margin-top: 1.7rem;
}

.essay-body h2,
.essay-body h3 {
    margin-top: 3.4rem;
}

.essay-body strong {
    font-weight: 600;
}

.essay-body ul,
.essay-body ol {
    padding-left: 2ch;
}

.essay-body blockquote {
    border-left: 1px solid var(--muted);
    padding-left: 2ch;
    color: var(--muted);
}

.essay-body code {
    color: var(--muted);
}

.essay-body pre {
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
}

.essay-body hr {
    border: none;
    border-top: 1px solid var(--border);
}

.essay-body figcaption {
    color: var(--muted);
}

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

.essay-footer {
    margin-top: 3.4rem;
}

@media (max-width: 640px) {
    .page {
        padding: 2.5rem 1.25rem 4rem;
    }
}
