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

:root {
    --bg: #090b10;
    --bg-card: #10131a;
    --bg-card-hover: #161a24;
    --text: #dfe3ed;
    --text-muted: #7080a0;
    --accent: #4a6080;
    --accent-light: #6889b0;
    --border: #1a2030;
    --radius: 16px;
    --nav-bg: rgba(9, 11, 16, 0.85);
    --nav-bg-mobile: rgba(9, 11, 16, 0.95);
    --tag-bg: rgba(74, 96, 128, 0.12);
    --date-bg: rgba(74, 96, 128, 0.1);
    --hover-border: #242a38;
}

[data-theme="light"] {
    --bg: #f5f6f8;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f4;
    --text: #1a1e2a;
    --text-muted: #5a6578;
    --accent: #3d5070;
    --accent-light: #3d6898;
    --border: #dde0e8;
    --nav-bg: rgba(245, 246, 248, 0.85);
    --nav-bg-mobile: rgba(245, 246, 248, 0.95);
    --tag-bg: rgba(61, 104, 152, 0.08);
    --date-bg: rgba(61, 104, 152, 0.06);
    --hover-border: #c8cdd8;
}

.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;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

/* === Theme toggle === */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--accent);
}
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* === Download CV link === */
.cv-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.cv-download:hover { color: var(--text); }

/* Smooth transitions on cards */
.timeline-item,
.skill-card,
.project-card,
.aside-card {
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

/* === Nav === */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}
.icon-close { display: none; }
.menu-toggle.open .icon-bars { display: none; }
.menu-toggle.open .icon-close { display: inline; }

/* === Sections === */
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Hero === */
.hero {
    padding: 180px 24px 120px;
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-light);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: clamp(44px, 7vw, 72px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -3px;
    margin-bottom: 24px;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-links a {
    color: var(--accent-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.hero-links a:hover { color: var(--text); }

/* === Section headings === */
.section-heading {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 60px;
    text-align: center;
}

/* === Experience === */
.experience {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    transition: background 0.2s, border-color 0.2s;
}
.timeline-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--hover-border);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.timeline-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.timeline-company {
    font-size: 15px;
    color: var(--accent-light);
    margin-top: 4px;
}

.timeline-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 4px 12px;
    background: var(--date-bg);
    border-radius: 8px;
    flex-shrink: 0;
}

.timeline-body p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}
.timeline-body p:last-child { margin-bottom: 0; }

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    background: var(--tag-bg);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

/* Sub-role within same company */
.timeline-subrole {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

/* === Skills === */
.skills {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.skill-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.skill-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--accent-light);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* === Projects === */
.projects {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: background 0.2s, border-color 0.2s;
}
.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--hover-border);
}

.project-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* === Sidebar info (education, languages, interests) === */
.aside-section {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.aside-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.aside-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.aside-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-light);
    margin-bottom: 16px;
}

.aside-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.aside-card p {
    font-size: 14px;
    color: var(--text-muted);
}

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

.aside-list li {
    font-size: 15px;
    padding: 6px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.aside-list li:last-child { border-bottom: none; }

.aside-list .lang-note {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    margin-left: 6px;
}

/* === Footer === */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
}

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

.footer-left p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

/* === Responsive === */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        top: 57px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--nav-bg-mobile);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 14px 24px;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links a:last-child { border-bottom: none; }

    .hero { padding: 140px 20px 80px; }
    .hero h1 { letter-spacing: -2px; }

    .skill-grid { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr; }
    .aside-grid { grid-template-columns: 1fr; }

    .timeline-header { flex-direction: column; }
    .timeline-date { align-self: flex-start; }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .skill-grid { grid-template-columns: repeat(2, 1fr); }
    .project-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Print / PDF === */
@media print {
    @page { margin: 8mm 10mm; size: A4; }
    nav, .theme-toggle, .cv-download, footer { display: none !important; }

    body { font-size: 11px; line-height: 1.4; }

    .hero { padding: 4px 0 8px; max-width: 100%; }
    .hero h1 { font-size: 28px; letter-spacing: -1px; margin-bottom: 8px; }
    .hero-badge { margin-bottom: 8px; font-size: 9px; padding: 3px 10px; letter-spacing: 1.5px; }
    .hero-sub { margin-bottom: 10px; font-size: 11px; line-height: 1.4; max-width: 100%; }
    .hero-links { gap: 14px; margin-bottom: 0; }
    .hero-links a { font-size: 10px; }
    .hero-links svg { width: 11px; height: 11px; }

    .experience, .skills, .projects, .aside-section { padding: 14px 0; }
    .section-heading { font-size: 20px; margin-bottom: 12px; }
    .section-inner { max-width: 100%; padding: 0; }
    .timeline, .skill-grid, .project-grid, .aside-grid { max-width: 100%; }

    .experience { border-top: 1px solid var(--border); }

    .timeline { gap: 6px; }
    .timeline-item { padding: 10px 14px; border-radius: 8px; }
    .timeline-header { margin-bottom: 6px; }
    .timeline-title { font-size: 13px; }
    .timeline-company { font-size: 11px; margin-top: 1px; }
    .timeline-date { font-size: 10px; padding: 2px 7px; border-radius: 4px; }
    .timeline-body p { font-size: 10.5px; line-height: 1.45; margin-bottom: 3px; }
    .timeline-tags { margin-top: 6px; gap: 3px; }
    .tag { font-size: 8.5px; padding: 1px 5px; border-radius: 3px; }
    .timeline-subrole { margin-top: 10px; padding-top: 10px; }

    /* Keep grids in print */
    .skill-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
    .skill-card { padding: 10px 12px; border-radius: 8px; }
    .skill-card h3 { font-size: 10.5px; margin-bottom: 5px; }
    .skill-bar { height: 3px; }

    .project-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; }
    .project-card { padding: 10px 12px; border-radius: 8px; }
    .project-card h3 { font-size: 11px; margin-bottom: 3px; }
    .project-card p { font-size: 10px; line-height: 1.4; }

    .aside-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
    .aside-card { padding: 10px 12px; border-radius: 8px; }
    .aside-label { font-size: 9px; margin-bottom: 6px; letter-spacing: 1px; }
    .aside-card h3 { font-size: 12px; }
    .aside-card p { font-size: 10px; }
    .aside-list li { font-size: 11px; padding: 2px 0; }
    .aside-list .lang-note { font-size: 10px; }
}
