:root {
    /* Default (White/Engineer) - Clean, high contrast but not harsh */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #444444;
    --link-color: #000000;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
    --border-color: #e5e5e5;
    --btn-bg: #f3f4f6;
    --btn-text: #1a1a1a;
    --btn-hover-bg: #000000;
    --btn-hover-text: #ffffff;
}

/* Mint Theme - Fresh, calming, nature-inspired */
body.mint-theme {
    --bg-color: #e8f5e9;
    --text-color: #1b5e20;
    --accent-color: #2e7d32;
    --link-color: #004d40;
    --border-color: #c8e6c9;
    --btn-bg: #c8e6c9;
    --btn-text: #1b5e20;
    --btn-hover-bg: #1b5e20;
    --btn-hover-text: #ffffff;
}

/* Dark Theme (Night) - Slate/Authour blue-grey, not pure black */
body.dark-theme {
    --bg-color: #0f172a;
    /* Slate 900 */
    --text-color: #e2e8f0;
    /* Slate 200 */
    --accent-color: #94a3b8;
    /* Slate 400 */
    --link-color: #38bdf8;
    /* Sky 400 */
    --border-color: #1e293b;
    /* Slate 800 */
    --btn-bg: #1e293b;
    --btn-text: #e2e8f0;
    --btn-hover-bg: #e2e8f0;
    --btn-hover-text: #0f172a;
}

/* Sepia Theme (Paper) - Warm, reading mode */
body.sepia-theme {
    --bg-color: #fdf6e3;
    --text-color: #433422;
    --accent-color: #8b6f4e;
    --link-color: #a05a2c;
    --border-color: #efe2cf;
    --btn-bg: #efe2cf;
    --btn-text: #5c4b3f;
    --btn-hover-bg: #5c4b3f;
    --btn-hover-text: #fdf6e3;
}

/* Theme Toggle Button */
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    margin-left: 1rem;
    color: var(--text-color);
}

.profile-brand {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
    text-decoration: none;
}

.profile-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.profile-circle:hover {
    transform: scale(1.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

/* Global Link Styles */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}

a:visited {
    color: var(--link-color);
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Navbar */
header {
    margin-bottom: 6rem;
}

nav {
    display: flex;
    justify-content: flex-end;
    /* Align links to right like a typical portfolio, or left? Screenshot doesn't show nav clearly but usually minimal. Let's keep distinct. */
    gap: 2rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Removed border bottom from nav to match screenshot style cleaner */
    flex-wrap: wrap;
}

nav a {
    color: #888;
    text-decoration: none;
    border: none;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--text-color);
}

nav .brand {
    margin-right: auto;
    color: var(--text-color);
    font-weight: 700;
}

/* Typography & Layout */
h1,
h2,
h3 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Home Page specific mimicry */
.intro {
    max-width: 800px;
    margin-top: 4rem;
}

.intro-label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background-color: var(--btn-bg);
    /* Use button bg for consistency */
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    /* Slight pill for the label */
}

.intro h1 {
    font-size: 3.5rem;
    /* Big impact font */
    margin-top: 0;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.intro-text {
    font-size: 1.25rem;
    color: var(--accent-color);
    /* Updated to use accent color for better contrast checks */
    max-width: 650px;
    margin-bottom: 3rem;
    line-height: 1.8;
}

/* Buttons / Pills */
.btn-pill {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 1rem;
    /* Spacing for multiple buttons */
    margin-bottom: 1rem;
}

.btn-pill:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-bg);
}

/* Blog List (Writing Page) */
.blog-header {
    margin-bottom: 4rem;
}

.blog-subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-year-group {
    display: flex;
    gap: 4rem;
    /* Space between year and articles */
}

.blog-year {
    font-family: var(--font-main);
    font-size: 1.1rem;
    opacity: 0.9;
    min-width: 60px;
    /* Fixed width for alignment */
    padding-top: 0.2rem;
    /* Align with first article */
}

.blog-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.blog-item {
    display: flex;
    gap: 2rem;
    align-items: baseline;
}

.blog-date {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.6;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}

.blog-title {
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.blog-title:hover {
    border-bottom-color: var(--text-color);
}

@media (max-width: 768px) {
    .blog-year-group {
        flex-direction: column;
        gap: 1rem;
    }

    .blog-year {
        font-weight: bold;
        opacity: 1;
        margin-bottom: 0.5rem;
    }

    .blog-item {
        gap: 1rem;
    }

    /* Mobile Improvements */
    .container {
        padding: 2rem 1.5rem;
    }

    header {
        margin-bottom: 3rem;
    }

    nav {
        justify-content: center;
        gap: 1.5rem;
    }

    .intro h1 {
        font-size: 2.5rem;
    }

    .intro-text {
        font-size: 1.1rem;
    }

    .blog-header {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .intro h1 {
        font-size: 2rem;
    }
}

/* Research Link Card */
.research-link-container {
    margin-top: 3rem;
    max-width: 600px;
}

.research-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--btn-bg);
    /* Use theme button bg */
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    /* Tabular look */
    border-left: 4px solid var(--accent-color);
}

.research-card:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--border-color);
}

.research-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.research-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.research-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.research-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.research-arrow {
    font-size: 1.2rem;
    margin-left: 1rem;
}

/* Article List */
.article-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.article-list li {
    display: flex;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.article-list .date {
    font-family: var(--font-main);
    color: #888;
    width: 120px;
    flex-shrink: 0;
    font-size: 0.9em;
}

.article-list a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: none;
}

.article-list a:hover {
    text-decoration: underline;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    border: 2px solid #000;
    /* Strict border for engineer feel */
    padding: 1.5rem;
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0px #000;
}

.project-card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.project-card h2 a {
    text-decoration: none;
    color: inherit;
    border: none;
}

.project-stack {
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
    font-family: var(--font-main);
}

/* Code Highlighting */
.highlight {
    background: #f8f8f8;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #eee;
    margin: 2rem 0;
    overflow-x: auto;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-icons {
    display: flex;
    gap: 1rem;
}

.footer-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* Circle */
    background-color: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-size: 0;
    /* Hide text, show icon (using text as icon surrogate for now or simple SVG later, here simple box) */
    position: relative;
    transition: all 0.2s;
}

/* Hack to show first letter or icon if we don't use FA */
.footer-icon-btn::after {
    content: attr(href);
    /* Temp */
    font-size: 12px;
}

/* Better styling for text-based icons if no SVG */
.footer-icon-btn {
    width: auto;
    height: auto;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.footer-icon-btn::after {
    content: none;
}

.footer-icon-btn:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-bg);
}