:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --text-primary: #f5f5f5;
    --text-secondary: #9ca3af;
    --accent: #fbbf24;
    --accent-secondary: #38bdf8;
    --border: #3f3f46;
    --tag-bg: rgba(251, 191, 36, 0.15);
    --tag-text: #fbbf24;
    --placeholder-bg: #3f3f46;
    --header-bg: rgba(30, 30, 30, 0.85);
}

[data-theme="light"] {
    --bg-primary: #f5f0e6;
    --bg-secondary: #ebe5d9;
    --text-primary: #2c2416;
    --text-secondary: #6b5d4d;
    --accent: #b8860b;
    --accent-secondary: #4a6670;
    --border: #d4cbbf;
    --tag-bg: rgba(184, 134, 11, 0.12);
    --tag-text: #b8860b;
    --placeholder-bg: #d4cbbf;
    --header-bg: rgba(245, 240, 230, 0.85);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Sticky Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

/* Navigation */
.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.25rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.2s ease;
}

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

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}

/* Header Logo */
.header-logo {
    position: absolute;
    left: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme Toggle */
#theme-toggle {
    position: absolute;
    right: 2rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    border-color: var(--accent-secondary);
    color: var(--text-primary);
}

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

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

[data-theme="light"] #theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] #theme-toggle .icon-sun {
    display: none;
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Sections */
section {
    margin-bottom: 4rem;
    scroll-margin-top: 5rem;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* About Section - Intro */
.about-intro {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.about-intro .profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    background-color: var(--placeholder-bg);
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.about-intro .profile-photo:hover {
    border-color: var(--accent);
}

.about-intro-text h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--accent-secondary);
}

/* About Section - Body */
.about-body p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.about-body p:last-child {
    margin-bottom: 0;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    gap: 1.5rem;
}

/* Project Card */
.project-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Project Thumbnail */
.project-thumbnail {
    width: 200px;
    height: 125px;
    object-fit: cover;
    background-color: var(--placeholder-bg);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    align-self: center;
}

.project-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.project-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.project-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    background-color: var(--tag-bg);
    color: var(--tag-text);
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.project-link {
    color: var(--accent-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.project-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .header-content {
        padding: 1rem;
    }

    .header-logo {
        left: 1rem;
    }

    #theme-toggle {
        right: 1rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .about-intro {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .about-intro .profile-photo {
        width: 120px;
        height: 120px;
    }

    .about-intro-text h1 {
        font-size: 1.75rem;
    }

    .social-links {
        justify-content: center;
    }

    .about-body {
        text-align: center;
    }

    .project-thumbnail {
        width: 140px;
        height: 87px;
    }

    .project-content {
        padding: 1rem;
    }

    .project-content h3 {
        font-size: 1rem;
    }

    .project-content p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    section {
        scroll-margin-top: 5rem;
    }
}
