/* ==========================================
   CSS Variables - Theme System
   ========================================== */
:root {
    /* Light Mode (Default) */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #64748B;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --accent-light: #DBEAFE;
    --border: #E2E8F0;
    --border-hover: #CBD5E1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --card-bg: #FFFFFF;
    --nav-bg: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --accent: #60A5FA;
    --accent-hover: #93C5FD;
    --accent-light: #1E3A5F;
    --border: #334155;
    --border-hover: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --card-bg: #1E293B;
    --nav-bg: rgba(15, 23, 42, 0.8);
}

/* ==========================================
   Base Styles & Reset
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================
   Typography
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    max-width: 70ch;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

code, pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ==========================================
   Layout & Container
   ========================================== */
.container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 6rem 0;
}

/* ==========================================
   Navigation
   ========================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

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

.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.sun-icon, .moon-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

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

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

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

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.hero-greeting {
    color: var(--accent);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.hero-name {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.6s ease 0.1s forwards;
    opacity: 0;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.hero-description {
    font-size: 1.125rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

.hero-social {
    display: flex;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease 0.5s forwards;
    opacity: 0;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ==========================================
   Social Links
   ========================================== */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.social-link.large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-tertiary);
}

/* ==========================================
   Section Titles
   ========================================== */
.section-title {
    font-size: clamp(1.75rem, 3vw, 2rem);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ==========================================
   About Section
   ========================================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ==========================================
   Experience Section (Timeline)
   ========================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    transition: transform 0.2s ease;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.3);
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.timeline-company {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
}

.timeline-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    display: block;
}

.timeline-description {
    list-style: none;
    margin-bottom: 1.25rem;
}

.timeline-description li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-description li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 6px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.timeline-tags {
    margin-top: 0.5rem;
}

/* ==========================================
   Projects Section
   ========================================== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 2rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.project-title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.project-tech {
    margin-bottom: 1.5rem;
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

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

.project-link svg {
    transition: transform 0.2s ease;
}

.project-link:hover svg {
    transform: translateX(3px);
}

/* ==========================================
   Skills Section
   ========================================== */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.skill-category-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==========================================
   Contact Section
   ========================================== */
.contact {
    text-align: center;
}

.contact-description {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
}

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

.contact-social {
    display: flex;
    gap: 1rem;
}

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

.footer p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    section {
        padding: 4rem 0;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stat {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }

    .stat-number {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    .timeline-marker {
        left: -2rem;
        width: 10px;
        height: 10px;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .projects-grid {
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-social {
        gap: 1rem;
    }

    .social-link.large {
        width: 44px;
        height: 44px;
    }

    .contact-social {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Selection color */
::selection {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
