@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@1,400&display=swap');
/* For the subtitle */

:root {
    /* Light Theme - Warm Light Green */
    --bg: #e8f3e8;
    /* Very pale green, like old paper */
    --fg: #0d2618;
    /* Darker for accessibility */
    --dim: #4a6c56;
    /* Muted green for secondary text */
    --accent: #a37f5f;
    /* Coffee/Earth tone */
    --highlight: #2d6a45;
    /* Brighter green for active states */
    --masthead-bg: rgba(232, 243, 232, 0.75);
    --masthead-bg-scrolled: rgba(232, 243, 232, 0.9);

    --font-mono: 'Space Mono', monospace;
    --font-serif: 'Spectral', serif;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #0c1f16;
    /* Deep forest green/black */
    --fg: #d4e8dc;
    /* Soft light green text */
    --dim: #7a9a87;
    /* Muted sage for secondary text */
    --accent: #c9a882;
    /* Warmer coffee/gold tone */
    --highlight: #5cb87a;
    /* Bright mint green for active states */
    --masthead-bg: rgba(12, 31, 22, 0.85);
    --masthead-bg-scrolled: rgba(12, 31, 22, 0.95);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    color: var(--dim);
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.theme-toggle:hover {
    color: var(--highlight);
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Show sun icon in light mode (click to go dark) */
:root:not([data-theme="dark"]) .theme-toggle .icon-sun,
html:not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: block;
}

/* Show moon icon in dark mode (click to go light) */
[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

@view-transition {
    navigation: auto;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-mono);
    line-height: 1.6;
    font-size: 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Masthead - Fixed navigation bar */
.masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--masthead-bg);
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
    /* Safari support */
    box-shadow: 0 1px 0 rgba(13, 38, 24, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
}

.masthead.scrolled {
    background-color: var(--masthead-bg-scrolled);
    box-shadow: 0 2px 12px rgba(13, 38, 24, 0.1);
}

.masthead-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.container {
    max-width: 1000px;
    /* Increased for better header spacing with more tabs */
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: 8rem;
    /* Accounts for fixed masthead height + original spacing */
}

/* Site Header (inside masthead) */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    /* Full width for space-between to work */
    gap: 2rem;
    /* Minimum gap between brand and tabs */
    margin: 0;
    /* Reset margin - spacing now handled by container padding-top */
}

.brand-name {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.tab-btn {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--dim);
    /* Default state distinct but readable */
    cursor: pointer;
    padding: 5px 0;
    position: relative;
    transition: color 0.2s;
    text-decoration: none !important;
    text-transform: lowercase;
}

.tab-btn:hover {
    color: var(--highlight);
}

.tab-btn.active {
    color: var(--fg);
    /* Active state darkest */
    font-weight: 700;
}

/* Bio Grid Layout */
.bio-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.subtitle {
    font-family: var(--font-mono);
    /* Matched to site font */
    font-style: italic;
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--fg);
}

/* ASCII Mug Positioning */
.ascii-art {
    white-space: pre;
    font-size: 14px;
    /* Enlarged slightly */
    transform: scale(1.3);
    /* Further enlarged visually */
    line-height: 1.2;
    color: var(--accent);
    font-weight: bold;
    display: flex;
    justify-content: center;
}

.bio-visual {
    display: flex;
    justify-content: center;
    padding-top: 0;
    margin-top: -1rem;
    /* Pull it up slightly more to align with large subtitle */
}

/* Content Sections */
.tab-content {
    animation: fadein 0.3s ease;
}

.hidden {
    display: none;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Links */
a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--dim);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--highlight);
    text-decoration-color: var(--highlight);
    text-shadow: 0 0 5px rgba(45, 106, 69, 0.3);
}

/* Socials */
.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    /* Centered in footer */
}

.social-links a {
    text-decoration: none;
    border-bottom: 1px dotted var(--dim);
}

.social-links a:hover {
    border-bottom: 1px solid var(--highlight);
}

/* Blog List */
.year-separator {
    font-size: 1.2rem;
    margin: 2.5rem 0 1rem 0;
    color: var(--dim);
    border-bottom: 1px dashed var(--dim);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.8rem;
}

.article-title {
    text-decoration: none;
    border: none;
    color: var(--accent);
    /* distinct link color */
}

.article-title:hover {
    color: var(--highlight);
    text-shadow: 0 0 8px rgba(45, 106, 69, 0.5);
    /* Glowing green effect */
}

.article-meta {
    font-size: 0.85rem;
    color: var(--dim);
    min-width: 120px;
    text-align: right;
}

/* Internet & You */
.info-block {
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

.label {
    display: block;
    font-size: 0.8rem;
    color: var(--dim);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.value {
    font-size: 1.25rem;
    font-weight: 700;
}

.sub-info {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--dim);
    font-style: italic;
}

footer {
    margin-top: 5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--dim);
}

/* Responsive */
@media (max-width: 700px) {
    .masthead-inner {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem 1.25rem;
    }

    .container {
        padding-top: 15rem;
        /* Accounts for taller stacked masthead + theme toggle on mobile */
    }

    .site-header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        row-gap: 0.5rem;
    }

    .theme-toggle {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .bio-grid {
        grid-template-columns: 1fr;
    }

    .bio-visual {
        order: -1;
        /* Move ascii art to top on mobile */
        padding-top: 0;
        margin-bottom: 2rem;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .status-visual {
        order: -1;
        margin-bottom: 2rem;
    }
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.status-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.smooth-fade-in {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.smooth-fade-in.visible {
    opacity: 1;
}

.fade-in-item {
    opacity: 0;
    animation: fadein 0.6s ease forwards;
}