:root {
    --primary: #3b82f6;
    --primary-dim: rgba(59, 130, 246, 0.15);
    --bg: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --text: #e5e5e5;
    --text-dim: #888;
    --text-bright: #fff;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === LIGHT THEME === */
[data-theme="light"] {
    --bg: #f5f5f7; --bg-card: #ffffff; --bg-card-hover: #f0f0f2;
    --text: #374151; --text-dim: #6b7280; --text-bright: #111827;
    --border: rgba(0, 0, 0, 0.1); --primary-dim: rgba(59, 130, 246, 0.1);
}
.theme-toggle-float {
    position: fixed; bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px;
    border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; display: flex; align-items: center;
    justify-content: center; z-index: 1000; transition: all 0.2s;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.theme-toggle-float:hover { color: var(--text-bright); transform: scale(1.1); }
@media print { .theme-toggle-float { display: none !important; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === NAV === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-bright);
    text-decoration: none;
}
.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-bright);
    background: var(--bg-card);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* === HERO === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 3rem;
    position: relative;
}
.hero-content { max-width: 680px; }
.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 0.375rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}
.hero-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.1;
    margin-bottom: 0.75rem;
}
.hero-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1.25rem;
    min-height: 1.8em;
}
.typewriter { border-right: 2px solid var(--primary); padding-right: 2px; }
.hero-bio {
    font-size: 1.05rem;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; margin-bottom: 2.5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-dim); background: var(--bg-card); }

/* Social icons */
.hero-social, .contact-social { display: flex; gap: 0.75rem; justify-content: center; }
.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.social-icon:hover { color: var(--primary); border-color: var(--primary); transform: scale(1.1); }

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.hero-scroll span { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.15em; }
.scroll-indicator {
    width: 20px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 10px;
    position: relative;
}
.scroll-indicator::after {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 1; top: 4px; }
    50% { opacity: 0.3; top: 16px; }
}

/* === SECTIONS === */
.section { padding: 5rem 1.5rem; }
.section:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.container { max-width: 900px; margin: 0 auto; }
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* === ABOUT === */
.about-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: start;
}
.about-avatar {
    width: 180px;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border);
}
.about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-text { color: var(--text-dim); font-size: 1.05rem; line-height: 1.8; margin-bottom: 2rem; }
.about-stats { display: flex; gap: 2.5rem; }
.stat { display: flex; flex-direction: column; }
.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.375rem; }

/* === TIMELINE === */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--text-dim);
    z-index: 1;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.timeline-dot.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim);
}
.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.3s;
}
.timeline-content:hover { border-color: rgba(255, 255, 255, 0.15); }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.375rem; flex-wrap: wrap; }
.timeline-role { font-size: 1.1rem; font-weight: 600; color: var(--text-bright); }
.timeline-date { font-size: 0.8rem; color: var(--primary); font-weight: 500; white-space: nowrap; }
.timeline-company { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.timeline-desc { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; }

/* === SKILLS === */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}
.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}
.skill-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.skill-item { margin-bottom: 1.25rem; }
.skill-item:last-child { margin-bottom: 0; }
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.skill-name { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.skill-pct { font-size: 0.8rem; color: var(--text-dim); font-weight: 500; }
.skill-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.skill-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill-fill.animated { width: var(--level); }

/* === PROJECTS === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
}
.project-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.15); }
.project-image { aspect-ratio: 16 / 10; overflow: hidden; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.project-card:hover .project-image img { transform: scale(1.05); }
.project-info { padding: 1.5rem; }
.project-title { font-size: 1.1rem; font-weight: 600; color: var(--text-bright); margin-bottom: 0.5rem; }
.project-title a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.375rem; }
.project-title a:hover { color: var(--primary); }
.project-title svg { opacity: 0.5; }
.project-desc { font-size: 0.875rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 1rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    background: var(--primary-dim);
    color: var(--primary);
}

/* === CONTACT === */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s;
}
a.contact-item:hover { border-color: var(--primary); }
.contact-item svg { color: var(--primary); flex-shrink: 0; }
.contact-label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.125rem; }
.contact-value { display: block; font-size: 0.95rem; font-weight: 500; color: var(--text-bright); }
.contact-social { margin-top: 2rem; }

/* === LANGUAGES === */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.language-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.3s;
}
.language-item:hover { border-color: rgba(255, 255, 255, 0.15); }
.language-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.language-name { font-size: 0.95rem; font-weight: 600; color: var(--text-bright); }
.language-level { font-size: 0.85rem; color: var(--primary); font-weight: 500; }
.language-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.language-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* === ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 0.75rem 1rem; }
    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .about-avatar { width: 140px; height: 140px; margin: 0 auto; }
    .about-stats { justify-content: center; }
    .hero-cta { flex-direction: column; align-items: center; }
    .section { padding: 3.5rem 1.25rem; }
    .timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -1.5rem; }
    .timeline-header { flex-direction: column; gap: 0.25rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .languages-grid { grid-template-columns: 1fr; }
}

/* === PRINT === */
@media print {
    * { background: #fff !important; color: #111 !important; box-shadow: none !important; }
    .nav, .hero-scroll, .hero-cta, .contact-social, .btn { display: none !important; }
    .hero { min-height: auto; padding: 2rem 0; }
    .hero-name { font-size: 2rem; }
    .hero-title { color: #555 !important; }
    .typewriter { border: none; }
    .section { padding: 1.5rem 0; page-break-inside: avoid; }
    .section:nth-child(even) { background: transparent !important; }
    .timeline-content, .skill-group, .project-card, .contact-item {
        border: 1px solid #ddd !important;
        background: #fafafa !important;
    }
    .skill-fill { background: #333 !important; width: var(--level) !important; }
    .skill-bar { background: #eee !important; }
    .fade-in { opacity: 1 !important; transform: none !important; }
    .tag { background: #eee !important; color: #333 !important; }
    a { text-decoration: none; }
}
