/* ==========================================================================
   MINIMALIST DESIGN SYSTEM
   ========================================================================== */
:root {
    /* Color Palette - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --border-color: #e4e4e7;
    
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    
    --accent: #09090b;
    --status-green: #10b981;

    color-scheme: light;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --max-width: 640px;
    --header-height: 80px;
}

/* The class lives on <html>, set by an inline script in <head>, so the first
   paint is already the right theme. On <body> it would flash light first. */
:root.dark {
    /* Color Palette - Dark Mode */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --border-color: #27272a;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --accent: #fafafa;

    color-scheme: dark;
}

:root.dark .site-header {
    background-color: rgba(9, 9, 11, 0.85);
}

/* ==========================================================================
   BASE & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    /* Matches the body, so overscroll bounce doesn't flash white in dark mode. */
    background-color: var(--bg-primary);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Keyboard-only escape past the nav. Invisible until focused. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 20;
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border-color);
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    background: none;
    border: none;
}

/* ==========================================================================
   LAYOUT & STRUCTURE
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 64px 0;
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.header-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.nav-list {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.theme-toggle .sun-icon {
    display: none;
}

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

:root.dark .theme-toggle .sun-icon {
    display: block;
}

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    padding: 80px 0 48px 0;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 16px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--status-green);
}

.hero-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.6px;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.65;
}

.hero-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-link-btn {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border-color);
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.hero-link-btn:hover {
    color: var(--accent);
    text-decoration-color: var(--text-primary);
}

.hero-link-secondary {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hero-link-secondary:hover {
    color: var(--text-primary);
}

.icon-arrow {
    transition: transform 0.15s ease;
}

.hero-link-secondary:hover .icon-arrow,
.contact-link:hover .icon-arrow {
    transform: translate(1px, -1px);
}

/* ==========================================================================
   ABOUT & SKILLS SECTION
   ========================================================================== */
.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.about-bio p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skills-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
}

.skills-label {
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
}

.skills-value {
    color: var(--text-secondary);
}

/* ==========================================================================
   EXPERIENCE SECTION
   ========================================================================== */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.experience-item {
    display: block;
}

.experience-details {
    display: flex;
    flex-direction: column;
}

.experience-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.experience-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 13px;
}

.experience-company {
    color: var(--text-secondary);
    font-weight: 500;
}

.experience-separator {
    color: var(--text-muted);
}

.experience-date {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 12px;
}

.experience-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-top: 6px;
}

.experience-desc + .experience-desc {
    margin-top: 10px;
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.projects-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.projects-section-header .section-title {
    margin-bottom: 0;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.project-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
}

.project-year {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 2px;
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.project-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.project-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
}

.project-links a:hover {
    color: var(--text-primary);
}

.project-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.tech-tag {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Project Image Gallery */
.project-gallery {
    margin-top: 14px;
}

.project-gallery summary {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: color 0.15s ease;
}

.project-gallery summary::-webkit-details-marker {
    display: none;
}

.project-gallery summary::before {
    content: "[+]";
    font-weight: 500;
}

.project-gallery[open] summary::before {
    content: "[−]";
}

.project-gallery summary:hover {
    color: var(--text-primary);
}

.gallery-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
    animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-content img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: border-color 0.15s ease;
}

.gallery-content img:hover {
    border-color: var(--text-muted);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border-color);
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

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

.contact-info {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    padding: 64px 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 600px) {
    .section {
        padding: 48px 0;
    }
    
    .hero-section {
        padding: 48px 0 32px 0;
    }

    .site-header {
        height: auto;
        padding: 16px 0;
    }
    
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        position: absolute;
        top: 14px;
        right: 24px;
    }
    
    .nav-list {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 12px;
    }

    .hero-links {
        flex-wrap: wrap;
        gap: 12px 16px;
    }

    .skills-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .project-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .project-year {
        color: var(--text-muted);
        font-size: 12px;
    }

    .gallery-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    .site-header,
    .theme-toggle,
    .hero-links,
    .project-links,
    .site-footer {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .section {
        padding: 20pt 0 !important;
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline !important;
        color: #000000 !important;
    }

    /* Print expandable details as open */
    details.project-gallery {
        display: block !important;
    }
    
    details.project-gallery summary {
        display: none !important;
    }
    
    details.project-gallery[open] .gallery-content,
    details.project-gallery .gallery-content {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12pt !important;
        margin-top: 12pt !important;
    }

    .gallery-content img {
        border: 1px solid #cccccc !important;
        page-break-inside: avoid;
    }
}
