@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Taste-Skill Premium Palette */
    --primary-color: #007AFF; 
    --primary-color-rgb: 0, 122, 255;
    
    --bg-color: #FAFAFC; 
    --surface-color: rgba(255, 255, 255, 0.7);
    --surface-border: rgba(255, 255, 255, 0.8);
    --surface-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.05);
    
    --text-primary: #171717; 
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    
    --border-color: rgba(0, 0, 0, 0.06);
    --hover-bg: rgba(0, 0, 0, 0.03);

    --card-bg: #FFFFFF;

    --font-main: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    /* Spring animation setup */
    --transition-spring: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1), box-shadow 0.4s ease, border-color 0.3s ease, background 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #0F172A; 
    --surface-color: rgba(30, 41, 59, 0.75);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.6);
    
    --text-primary: #F8FAFC; 
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.05);

    --card-bg: #1E293B;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Accounts for fixed topbar */
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animated Ambient Glow (Taste-Skill UI Detail) --- */
.ambient-glow {
    position: fixed;
    top: -20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.15) 0%, rgba(var(--primary-color-rgb), 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    transition: background 1s ease;
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

.main-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 24px;
}

.sidebar {
    position: sticky;
    top: 100px;
    width: 260px;
    flex-shrink: 0;
}

.content {
    flex-grow: 1;
    min-width: 0; /* Prevents flex blowout */
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Glassmorphism Utils --- */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    border-radius: var(--radius-md);
}

.hover-lift {
    transition: var(--transition-spring);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px -8px rgba(var(--primary-color-rgb), 0.2);
}

/* --- Topbar --- */
#topbar {
    position: sticky;
    top: 16px;
    margin: 0 auto;
    width: calc(100% - 32px);
    max-width: 1100px;
    z-index: 100;
}

.topbar-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--surface-color);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 24px -6px rgba(0,0,0,0.05);
}

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

#language-switcher {
    display: flex;
    gap: 4px;
    background: var(--hover-bg);
    padding: 4px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
}

.lang-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
}

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

.lang-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 8px -2px rgba(0,0,0,0.08);
    font-weight: 600;
}

/* --- Hero Section --- */
.hero {
    margin-top: 40px;
    padding: 64px 40px;
}

.hero-titles h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hero-titles h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 32px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--hover-bg);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.contact-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contact-pill i, .contact-pill svg {
    width: 16px; height: 16px;
    color: var(--text-secondary);
}

a.contact-pill:hover {
    background: var(--card-bg);
    color: var(--primary-color);
    border-color: rgba(var(--primary-color-rgb), 0.2);
}

a.contact-pill:hover i, a.contact-pill:hover svg {
    color: var(--primary-color);
}

/* --- Sidebar Nav --- */
#navbar ul {
    list-style: none;
    padding: 12px;
}

#navbar ul li {
    margin-bottom: 4px;
}

#navbar ul li:last-child {
    margin-bottom: 0;
}

#navbar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease;
}

#navbar ul li a i, #navbar ul li a svg {
    width: 18px; height: 18px;
    transition: stroke 0.2s ease;
}

#navbar ul li a:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

#navbar ul li a.active-link {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Cards / Sections --- */
.card {
    padding: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.icon-wrapper {
    width: 48px; height: 48px;
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.section-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.skills-category h4 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tags span {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: var(--transition-spring);
}

.skill-tags span:hover {
    border-color: rgba(var(--primary-color-rgb), 0.3);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.1);
}

/* --- Timeline (Experience) --- */
.timeline {
    border-left: 2px solid var(--border-color);
    padding-left: 32px;
    margin-left: 16px;
}

.experience-item {
    position: relative;
    margin-bottom: 48px;
}
.experience-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -41px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}

.company-header {
    margin-bottom: 24px;
}

.company-header h4 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tech-stack {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
    padding: 2px 12px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    margin-top: 8px;
}

.roles {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-entry {
    background: var(--hover-bg);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.role-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.role-title h5 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tag-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
    background: var(--card-bg);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

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

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px -8px rgba(0,0,0,0.04);
}
.project-card:last-child {
    margin-bottom: 0;
}

.project-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.custom-list {
    list-style: none;
}

.custom-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.custom-list li:last-child {
    margin-bottom: 0;
}

.custom-list li svg, .custom-list li i {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    opacity: 0.8;
    margin-top: 3px;
}

/* --- Education Grid --- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.edu-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-md);
}

.edu-icon {
    width: 32px; height: 32px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.edu-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.edu-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Languages --- */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.lang-name {
    font-weight: 600;
    color: var(--text-primary);
}

.lang-level {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.level-native { background: rgba(var(--primary-color-rgb), 0.1); color: var(--primary-color); }
.level-fluent { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.level-advanced { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.level-intermediate { background: rgba(99, 102, 241, 0.1); color: #6366f1; }

/* --- Footer --- */
footer {
    text-align: center;
    padding: 64px 24px 40px;
    margin-top: 40px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* --- Animations --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation delay sequentially for cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
        margin-bottom: 24px;
        position: sticky; /* Make navbar horizontally sticky on mobile */
        top: 80px;
        z-index: 90;
    }
    #navbar ul {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        white-space: nowrap;
        gap: 8px;
        scrollbar-width: none; /* Firefox */
    }
    #navbar ul::-webkit-scrollbar {
        display: none; /* Safari/Chrome */
    }
    #navbar ul li {
        margin-bottom: 0;
    }
    #navbar ul li a {
        padding: 10px 16px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 24px;
    }
    .card {
        padding: 32px 24px;
    }
    .hero-titles h1 { font-size: 2.2rem; }
    .hero-titles h2 { font-size: 1.1rem; }
    
    .role-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline {
        padding-left: 20px;
        margin-left: 8px;
    }
    .timeline-dot {
        left: -29px;
    }
    .contact-flex {
        flex-direction: column;
    }
}