/* 1. Variables */
:root {
    --bg-color: #faf6ed;       /* Light cream */
    --text-color: #000000;     /* Black */
    --accent-color: #7d7264;   /* Warm gray */
    --border-color: #e3d9c6;
    --dot-color: #d0c4ae;      /* Warm dots */
    --link-color: #000000;

    --font-serif: 'Merriweather', serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
    --bg-color: #171411;       /* Warm deep black */
    --text-color: #d4c9ab;     /* Warm cream text */
    --accent-color: #8f836e;
    --border-color: #3a3328;
    --dot-color: #3a3328;
    --link-color: #e2d6b8;
}



/* 2. Global Resets & Body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.6;
    font-size: 14px;

    /* Dotted Paper Background Pattern (disabled)
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 24px 24px;
    */

    transition: background-color 0.3s ease, color 0.3s ease;
}


/* Custom Text Selection (Premium Feel) */
strong, b { font-weight: 400; }

::selection {
    background: #2a2520;
    color: #faf6ed;
}
[data-theme="dark"] ::selection {
    background: #e2d6b8;
    color: #171411;
}


/* 3. Layout & Navbar */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    /* Optional: Slight background if you want text to pop over dots, otherwise remove for full transparency */
    /* background-color: var(--bg-color); */
}

.container-wide {
    max-width: 1000px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    max-width: 680px;
    margin: 0 auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--accent-color);
    font-family: var(--font-mono); /* Technical Font */
    font-size: 0.85rem;
    margin-right: 15px;
    letter-spacing: -0.02em;
}

.nav-links a:hover { color: var(--text-color); }
.nav-links a.active { color: var(--text-color); font-weight: 400; border-bottom: 1px solid var(--text-color); }

/* 4. Typography */
h1, h2, h3, h4 {
    font-family: var(--font-mono); /* Technical Headers */
    letter-spacing: -0.03em;
}

h1 { font-size: 1.5rem; font-weight: 400; margin-bottom: 0.5rem; }
.subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}
h2 { font-size: 1.1rem; font-weight: 400; margin-bottom: 1rem; margin-top: 2rem; }
h3 { font-size: 0.9rem; font-weight: 400; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-color); }

/* Code Blocks */
pre {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.6;
}

code {
    font-family: var(--font-mono);
    font-size: 0.95em;
}

/* Project/Blog Article Content */
.project-content {
    font-size: 0.82rem;
    line-height: 1.8;
}
.project-content li {
    margin-bottom: 0.5rem;
}

/* Project Header Links */
.project-links {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.project-links .link-sep {
    color: var(--accent-color);
}

/* Drop Cap (Magazine Style) */
.lead::first-letter {
    float: left;
    font-size: 3.4rem;
    line-height: 0.8;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    font-weight: 400;
    color: var(--text-color);
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

/* "View All" Links */
.view-all {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-top: 1rem;
    display: inline-block;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

/* 5. Components */

/* Intro Section */
.intro-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.intro-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Socials in Intro */
.intro-socials {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.intro-socials a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    border-bottom: 1px solid transparent;
}
.intro-socials a:hover { border-bottom: 1px solid var(--text-color); }

/* Separator Slash */
.separator {
    color: var(--border-color);
    margin: 0 8px;
    user-select: none;
}

/* Teaser / Project Lists */
.teaser-item {
    display: block;
    margin-bottom: 0.6rem;
}

.teaser-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
}
.teaser-header a {
    font-family: var(--font-mono); /* Project Titles are Mono */
    font-weight: 400;
    text-decoration: none;
}
.teaser-header a:hover { text-decoration: underline; }

.teaser-header .date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-color);
}

.teaser-desc {
    font-size: 0.82rem;
    color: var(--accent-color);
    line-height: 1.8;
    margin-bottom: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.gallery-item {
    border-radius: 4px;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.caption {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    text-align: center;
}

/* Nav scroll hint - hidden on desktop */
.nav-scroll-hint {
    display: none;
}

/* Toggle Buttons */
#theme-toggle, #width-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    color: var(--text-color);
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding-bottom: 2rem;
}
.social-links {
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
}
.social-links a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}
.copyright {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-color);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .intro-content { flex-direction: column-reverse; align-items: flex-start; }
    .nav-links { font-size: 0.8rem; }
    h1 { font-size: 1.2rem; }
    h2 { font-size: 0.95rem; }
    h3 { font-size: 0.8rem; }
    body { font-size: 13px; }

    /* Stack title + date vertically on mobile */
    .teaser-header {
        flex-direction: column;
        gap: 0.2rem;
    }

    /* Resume job/education blocks use inline flex — override those too */
    .job-block [style*="display: flex"],
    .resume-section [style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.2rem;
    }
}

canvas {
    display: block;
    position: fixed; /* Stays in place while you scroll */
    top: 0;
    left: 0;
    z-index: -1; /* Behind everything */
    pointer-events: none; /* Let clicks pass through to links */
}

/* Important: Ensure your container background is transparent so you can see the canvas */
.container {
    background-color: transparent; 
}


/* Contact Form Styles */
.contact-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

input, textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--text-color); /* Darkens border on focus */
}

.submit-btn {
    background-color: var(--text-color);
    color: var(--bg-color); /* Inverted colors for contrast */
    border: 1px solid var(--text-color);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.submit-btn:hover {
    opacity: 0.8;
}

/* MOBILE NAVBAR FIX */
@media (max-width: 600px) {

    .navbar {
        padding: 1rem;
        gap: 10px;
        position: relative;
    }

    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 20px;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        padding: 5px 0;
        margin-right: 18px;
        font-size: 0.85rem;
    }

    /* Scroll hint indicator */
    .nav-scroll-hint {
        display: block;
        position: absolute;
        right: 50px;
        top: 50%;
        transform: translateY(-50%);
        font-family: var(--font-mono);
        font-size: 0.75rem;
        color: var(--accent-color);
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #theme-toggle {
        flex-shrink: 0;
    }

}
