/* --- Variables & Reset --- */
:root {
    --bg-color: #101618;
    --surface-color: #151d20;
    --text-color: #e9eef0;
    --text-muted: #b2bcc3;
    --accent-color: #8fc7d6;
    --border-color: #28353a;
    --focus-color: #9bdceb;
    --max-width: 750px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

:root[data-theme="light"] {
    --bg-color: #fcfcfc;
    --surface-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #555;
    --accent-color: #1f3a44;
    --border-color: #eaeaea;
    --focus-color: #2c6375;
}

:root[data-theme="dark"] {
    --bg-color: #101618;
    --surface-color: #151d20;
    --text-color: #e9eef0;
    --text-muted: #b2bcc3;
    --accent-color: #8fc7d6;
    --border-color: #28353a;
    --focus-color: #9bdceb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.7;
    font-size: 1.1rem;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Navigation --- */
.site-nav {
    padding: 2.5rem 0;
}

.site-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--text-color);
}

.logo-name {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 1.2rem;
    line-height: 1.1;
}

.logo-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.logo:hover .logo-name {
    color: var(--accent-color);
}

.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-muted);
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.theme-toggle-icon {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* --- Content Layout --- */
.hero {
    padding: 4rem 0 3rem 0;
}

.hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.intro {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.section-content {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.section-content > h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Typography for text-heavy pages */
.text-body h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem 0;
    color: var(--accent-color);
}

.text-body p {
    margin-bottom: 1.5rem;
}

.text-body ul {
    margin: 0 0 1.5rem 1.5rem;
}

.text-body li {
    margin-bottom: 0.5rem;
}

/* --- Common Elements --- */
.text-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.text-link:hover {
    text-decoration: underline;
}

.article-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
}

.article-links .text-link {
    margin-top: 0;
}

.project-list {
    list-style: none;
    margin: 1.5rem 0;
}

.project-list li {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.project-list strong {
    font-size: 1.05rem;
    color: var(--text-color);
}

.project-link {
    color: inherit;
    text-decoration: none;
}

.project-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.project-list span {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Footer --- */
.site-footer {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* --- Mobile --- */
@media (max-width: 600px) {
    .site-nav .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}
