@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Unbounded:wght@400;600;800&display=swap');

:root {
    --bg-color: #0a0c10;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --accent-green: #00d4aa;
    --accent-purple: #7c6aff;
    --card-bg: rgba(22, 27, 34, 0.6);
    --card-border: #30363d;
    --font-heading: 'Unbounded', sans-serif;
    --font-body: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Background Grid & Noise */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.05"/%3E%3C/svg%3E');
    z-index: -1;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
}

h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.2;
    margin-bottom: 10px;
    font-weight: 800;
}

h2 {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 30px;
    color: var(--accent-green);
    display: inline-block;
    border-bottom: 2px solid var(--accent-purple);
    padding-bottom: 5px;
}

h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

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

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

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 30px 0;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

/* Sticky Nav */
nav {
    position: sticky;
    top: 0;
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
    padding: 15px 0;
}

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

.nav-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-main);
}

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

.nav-links a {
    color: var(--text-muted);
    font-size: 14px;
}

.nav-links a:hover {
    color: var(--accent-green);
}

.lang-switcher {
    display: flex;
    gap: 5px;
    margin-left: 15px;
    border-left: 1px solid var(--card-border);
    padding-left: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lang-btn:hover {
    color: var(--accent-green);
}

.lang-btn.active {
    color: var(--accent-purple);
    font-weight: bold;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 10px;
}

.hero-subtitle {
    color: var(--accent-purple);
    font-size: 18px;
    margin-bottom: 20px;
    display: block;
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--accent-green);
    width: 0;
    animation: typing 2s steps(30, end) forwards, blink 0.75s step-end infinite;
}

.hero-details {
    margin: 20px 0 30px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
}

.hero-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    border-color: var(--accent-purple);
    background: rgba(124, 106, 255, 0.1);
    transform: translateY(-2px);
}

.btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* About Section */
.about-text {
    color: var(--text-muted);
    max-width: 800px;
}

.about-text p {
    margin-bottom: 15px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.skill-category {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.1);
}

.skill-category h3 {
    color: var(--text-main);
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

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

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.skill-category:hover .tag {
    border-color: var(--accent-purple);
    color: var(--text-main);
}

/* Timeline Section */
.timeline {
    position: relative;
    padding-left: 30px;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

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

.timeline-dot {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--accent-green);
    z-index: 1;
    transition: background 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

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

.timeline-content:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(124, 106, 255, 0.1);
    transform: translateX(5px);
}

.job-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .job-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }
}

.job-title {
    color: var(--text-main);
    font-size: 18px;
    font-family: var(--font-heading);
}

.job-company {
    color: var(--accent-green);
    font-weight: 700;
}

.job-date {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 5px;
}

.job-desc {
    color: var(--text-muted);
    font-size: 14px;
}

.job-desc ul {
    list-style-type: none;
}

.job-desc li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
}

.job-desc li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-green) }
}

/* Stagger delays for sections */
#about { animation-delay: 0.2s; }
#skills { animation-delay: 0.4s; }
#experience { animation-delay: 0.6s; }
#education { animation-delay: 0.8s; }

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-purple));
    z-index: 200;
    transition: width 0.1s linear;
}

/* PDF Button */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pdf:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* Mobile Nav Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 12, 16, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--card-border);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .lang-switcher {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        margin-top: 15px;
        justify-content: center;
    }
    .typewriter {
        white-space: normal;
        border-right: none;
        width: auto;
        animation: none;
    }
    
    /* Mobile Contacts */
    .social-links {
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
    }
    .btn {
        flex: 1;
        justify-content: center;
        padding: 10px;
    }
    .btn span {
        display: none;
    }
    .btn-pdf span {
        display: none;
    }
}

/* Clean export styles — shared between @media print and .exporting-pdf */
@media print {
    *,
    *::before,
    *::after {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        text-shadow: none !important;
        border-color: #ccc !important;
    }

    @page {
        size: A4;
        margin: 15mm 12mm;
    }

    html {
        font-size: 10pt;
    }

    body {
        font-size: 10pt;
        line-height: 1.35;
        overflow: visible;
    }

    body::before,
    body::after {
        display: none !important;
    }

    /* Hide all UI chrome */
    nav,
    .scroll-progress {
        display: none !important;
    }

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

    /* Reset all animations */
    section {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        padding: 12px 0;
    }

    .hero {
        padding-top: 0;
        padding-bottom: 5px;
    }

    .hero-subtitle {
        font-size: 12pt;
        margin-bottom: 5px;
    }

    .typewriter {
        width: auto !important;
        border-right: none !important;
        animation: none !important;
        white-space: normal;
    }

    h1 {
        font-size: 20pt;
        margin-bottom: 5px;
    }

    h2 {
        font-size: 13pt;
        margin-bottom: 12px;
        padding-bottom: 3px;
    }

    h3 {
        font-size: 10pt;
        margin-bottom: 4px;
    }

    .hero-details {
        margin: 8px 0 10px;
        font-size: 9pt;
        gap: 10px;
    }

    /* Contact buttons — plain text in print */
    .social-links {
        gap: 8px;
    }

    .social-links .btn {
        padding: 3px 8px;
        font-size: 8pt;
        border: 1px solid #ccc !important;
        border-radius: 3px;
    }

    .social-links .btn span {
        display: inline !important;
    }

    .social-links .btn svg {
        display: none;
    }

    /* Skills — compact grid */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .skill-category {
        padding: 10px;
        break-inside: avoid;
        border-radius: 4px;
    }

    .skill-category h3 {
        font-size: 9pt;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }

    .tag {
        opacity: 1 !important;
        transform: none !important;
        font-size: 8pt;
        padding: 2px 6px;
    }

    .tags {
        gap: 4px;
    }

    /* Timeline — compact */
    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        width: 1px;
    }

    .timeline-dot {
        left: -25px;
        width: 8px;
        height: 8px;
    }

    .timeline-item {
        margin-bottom: 10px;
        break-inside: avoid;
    }

    .timeline-content {
        padding: 10px 12px;
        border-radius: 4px;
        transform: none !important;
    }

    .job-header {
        margin-bottom: 6px;
    }

    .job-title {
        font-size: 10pt;
    }

    .job-company {
        font-size: 9pt;
    }

    .job-date {
        font-size: 8pt;
        margin-top: 2px;
    }

    .job-desc {
        font-size: 8.5pt;
    }

    .job-desc li {
        margin-bottom: 2px;
        padding-left: 10px;
    }

    .job-desc li::before {
        content: '–';
    }

    /* Expand URLs for printed links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 7pt;
        color: #666 !important;
    }

    a[href^="mailto"]::after,
    a[href^="tel"]::after {
        content: none;
    }
}

/* html2pdf.js export mode — mirrors print but works on-screen */
.exporting-pdf,
.exporting-pdf *,
.exporting-pdf *::before,
.exporting-pdf *::after {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #ccc !important;
}

.exporting-pdf body::before,
.exporting-pdf body::after,
.exporting-pdf::before,
.exporting-pdf::after {
    display: none !important;
}

.exporting-pdf nav,
.exporting-pdf .scroll-progress {
    display: none !important;
}

.exporting-pdf section {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.exporting-pdf .typewriter {
    width: auto !important;
    border-right: none !important;
    animation: none !important;
    white-space: normal;
}

.exporting-pdf .tag {
    opacity: 1 !important;
    transform: none !important;
}

.exporting-pdf .social-links .btn svg {
    display: none;
}

.exporting-pdf .social-links .btn span {
    display: inline !important;
}

.exporting-pdf .timeline-content {
    transform: none !important;
}