:root {
    /* System Font Stack */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Variables - Light Mode (Default) */
    --bg-color: #fcfcfc;
    /* Very slightly off-white for paper feel */
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --text-faint: #999999;
    --accent-color: #333333;
    /* Keeping it monochrome/dark grey as the "accent" */
    --line-color: #eaeaea;

    --spacing-unit: 8px;
    --container-width: 640px;

    --font-size-base: 16px;
    --font-size-lg: 20px;
    --font-size-sm: 14px;

    --line-height-body: 1.7;
    --line-height-heading: 1.2;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111111;
        --text-color: #e5e5e5;
        --text-muted: #a0a0a0;
        --text-faint: #555555;
        --accent-color: #ffffff;
        --line-color: #222222;
    }
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: var(--line-height-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--spacing-unit) * 10) calc(var(--spacing-unit) * 4);
}

/* Layout Wrapper */
header,
main,
footer {
    width: 100%;
    max-width: var(--container-width);
}

/* Typography & Links */
h1 {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    color: var(--text-color);
}

h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

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

p {
    margin-bottom: calc(var(--spacing-unit) * 2.5);
}

strong {
    font-weight: 500;
    color: var(--accent-color);
}

a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--line-color);
    transition: all 0.2s ease;
}

a:hover {
    border-bottom-color: var(--text-color);
    opacity: 0.8;
}

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

/* Header */
.site-header {
    margin-bottom: calc(var(--spacing-unit) * 10);
}

.descriptor {
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-size: 1.15rem;
    max-width: 90%;
}

.site-nav {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    font-size: var(--font-size-sm);
}

.site-nav a {
    color: var(--text-muted);
    border-bottom: none;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--text-color);
    opacity: 1;
}

/* Sections */
.section {
    margin-bottom: calc(var(--spacing-unit) * 8);
    padding-top: calc(var(--spacing-unit) * 3);
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--line-color);
    margin: calc(var(--spacing-unit) * 0) 0 calc(var(--spacing-unit) * 4) 0;
    width: 100%;
}

/* Lists */
.clean-list {
    list-style: none;
}

.clean-list li {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    position: relative;
}

/* Specific content styles */

/* Now */
#now .meta {
    font-size: var(--font-size-sm);
    color: var(--text-faint);
    margin-top: calc(var(--spacing-unit) * 2);
}

/* Work */
#work li::before {
    content: "·";
    color: var(--text-muted);
    position: absolute;
    left: -16px;
}

/* Projects */
.project-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 3);
}

.project-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.project-name {
    font-weight: 500;
}

.project-desc {
    color: var(--text-muted);
}

.tags {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Writing */
.subtitle {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: calc(var(--spacing-unit) * 4);
    opacity: 0.8;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.writing-item {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    align-items: baseline;
}

.writing-item .date {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--text-faint);
    width: 80px;
    flex-shrink: 0;
}

/* Contact */
.email-link {
    font-size: 1.1rem;
}

.social-links {
    margin-top: calc(var(--spacing-unit) * 2);
}

.separator {
    color: var(--line-color);
    margin: 0 4px;
}

/* Footer */
.site-footer {
    margin-top: calc(var(--spacing-unit) * 8);
    padding-top: calc(var(--spacing-unit) * 4);
    border-top: 1px solid var(--line-color);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-unit);
}

.site-footer .faint {
    color: var(--text-faint);
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .project-item {
        grid-template-columns: 140px 1fr auto;
        align-items: baseline;
    }

    .tags {
        text-align: right;
        margin-top: 0;
    }
}