:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
    --border-color: #334155;
    --card-bg: #1e293b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent-primary);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.theme-toggle svg {
    color: white;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Header & Navigation */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

nav {
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
}

.nav-toggle {
    display: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.highlight {
    color: var(--accent-primary);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

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

.btn-secondary {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-2px);
}

.btn-primary:link,
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:focus {
    color: white;
}

.btn-secondary:link,
.btn-secondary:visited {
    color: var(--accent-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    color: white;
}

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

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

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

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.about-content p {
    margin-bottom: 1.5rem;
}

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

.skill-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    text-align: center;
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.skill-card li:last-child {
    border-bottom: none;
}

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

.project-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.project-card a:link,
.project-card a:visited {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: bold;
}

.project-card a:hover,
.project-card a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

.project-header {
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.project-header h4 {
    font: italic 1rem "Roboto", sans-serif;
    color: var(--text-secondary);
    margin: 1rem 0;
}

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

.tag {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

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

.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

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

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

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
}

.contact-link:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.contact-link svg {
    color: var(--accent-primary);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.25rem;
    }

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

    .nav-links {
        gap: 1rem;
    }

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

    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
/* Project detail pages */
.project-hero {
    padding: 5rem 0 4rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}


.project-label {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.project-template-block {
    margin-top: 1.5rem;
}

.project-kicker {
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.project-hero h1 {
    font-size: 3.25rem;
    margin-bottom: 1rem;
}

.project-lead {
    max-width: 760px;
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.detail-tags {
    margin-top: 1rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 2rem;
    align-items: start;
}

.detail-main,
.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.detail-main {
    padding: 2.5rem;
}

.detail-main h2 {
    color: var(--accent-primary);
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
}

.detail-main h2:first-child {
    margin-top: 0;
}

.detail-main p,
.detail-list li,
.detail-card p {
    color: var(--text-secondary);
}

.detail-list {
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-list li {
    margin-bottom: 0.75rem;
}

.detail-card {
    padding: 2rem;
    position: sticky;
    top: 6rem;
}

.detail-card h3 {
    color: var(--accent-primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.detail-card p {
    margin-bottom: 0.75rem;
}

.detail-btn {
    margin-top: 1rem;
    text-align: center;
    width: 100%;
}

@media (max-width: 768px) {
    .project-hero h1 {
        font-size: 2.4rem;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-card {
        position: static;
    }
}


.detail-gallery {
    width: 100%;
    padding: 2.5rem;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.project-images img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;

    object-fit: contain;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: var(--shadow);

    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 2rem;
    background: rgba(0, 0, 0, 0.85);
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;

    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;

    background: var(--bg-primary);
    color: var(--text-primary);

    border: none;
    border-radius: 50%;

    width: 44px;
    height: 44px;

    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.detail-btn,
.detail-btn:link,
.detail-btn:visited,
.detail-btn:hover,
.detail-btn:focus {
    color: white;
}


/* Link state fixes */
.nav-links a:visited {
    color: var(--text-primary);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--accent-primary);
}

/* Responsive mobile layout */
@media (max-width: 768px) {

    .nav-content {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
        margin-left: auto;

        padding: 0.65rem 0.9rem;
        background: var(--bg-secondary);
        border: none;
        border-radius: 0.5rem;
        color: var(--text-primary);
        box-shadow: var(--shadow);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.6rem;

        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(128, 128, 128, 0.15);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.85rem 1rem;

        background: var(--bg-secondary);
        border: none;
        border-radius: 0.5rem;
        color: var(--text-primary);
        box-shadow: var(--shadow);

        text-decoration: none;
    }

    .nav-links a:hover,
    .nav-links a:focus {
        background: var(--accent-primary);
        color: #ffffff;
        transform: translateX(4px);
    }

    .theme-toggle {
        bottom: 16px;
        right: 16px;
    }
}