/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Japandi-inspired light theme (cooler neutral) */
    --primary-color: #6f5b3e; /* muted taupe */
    --secondary-color: #947a5a; /* earthy accent */
    --text-dark: #1c1917; /* near-black warm */
    --text-light: #6b7280; /* cooler gray */
    --bg-light: #eeeeee; /* light gray */
    --bg-white: #ffffff; /* pure white */
    --border-color: #e5e7eb; /* cool light border */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    /* Controls */
    --button-bg: #1c1917;
    --button-text: #faf7f2;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    /* Minimal black & white */
    --primary-color: #ffffff;
    --secondary-color: #e5e5e5;
    --text-dark: #ffffff;
    --text-light: #d1d5db;
    --bg-light: #0f0f0f;
    --bg-white: #000000;
    --border-color: #262626;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
    --button-bg: #ffffff;
    --button-text: #000000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scroll Progress Indicator (inline near theme toggle) */
#scroll-progress {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-light);
    min-width: 3ch; /* prevents layout shift */
    text-align: right;
    margin-right: 0.25rem;
}
[data-theme="dark"] #scroll-progress { color: #d1d5db; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s, transform 0.2s;
    margin: 0;
}

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

[data-theme="dark"] .theme-toggle:hover {
    background-color: var(--bg-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    /* Subtle neutral background for Japandi look */
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    color: var(--text-dark);
    padding: 6rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.typewriter-text {
    display: inline-block;
}

.cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: var(--text-dark);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-white);
    border-radius: 0.75rem;
    padding: 0;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Make entire card clickable without default link styles */
.project-card-link {
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    display: block;
}

.project-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.project-card .project-header,
.project-card .project-description,
.project-card .project-tags {
    padding-left: 2rem;
    padding-right: 2rem;
}

.project-card .project-header { padding-top: 1.25rem; }
.project-card .project-description { padding-top: 0.25rem; }
.project-card .project-tags { padding-top: 0.5rem; padding-bottom: 1.5rem; }

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.project-tag {
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.contact-link:hover {
    transform: translateY(-2px);
}

.contact-email-btn.copied {
    background-color: var(--primary-color);
}

.contact-email-btn.copied:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .footer {
    background-color: #0a0e1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-right {
        gap: 0.5rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .theme-toggle { display: block; }
    #scroll-progress { font-weight: 600; letter-spacing: 0.04em; }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }
}
