/* ============================================
   MODERN RESUME - SENIOR DEVELOPER THEME
   Dark, sophisticated, code-inspired design
   ============================================ */

/* ATS-friendly hidden plain-text resume */
.ats-resume {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media print {
    .ats-resume {
        display: none !important;
    }
}

:root {
    /* Core Colors (Light) */
    --bg-primary: #f4f7fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2ff;
    --bg-card: #ffffff;
    --bg-hover: #dee9ff;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Accent Colors */
    --accent-primary: #2563eb;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #c084fc 100%);
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    /* Semantic */
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    
    /* Borders */
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(37, 99, 235, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.08);
    --shadow-md: 0 10px 30px rgba(15,23,42,0.08);
    --shadow-lg: 0 25px 70px rgba(15,23,42,0.12);
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.12);
    
    /* Nav */
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-bg-solid: rgba(255, 255, 255, 0.95);
    --bg-radial: rgba(37, 99, 235, 0.15);
    
    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --section-padding: 100px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
    }
}

[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-card: #151d2e;
    --bg-hover: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    --accent-glow: rgba(56, 189, 248, 0.15);
    
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    
    --border-color: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(56, 189, 248, 0.3);
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.1);
    
    --nav-bg: rgba(10, 14, 26, 0.8);
    --nav-bg-solid: rgba(10, 14, 26, 0.95);
    --bg-radial: rgba(56, 189, 248, 0.15);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    transition: background 0.4s ease, color 0.4s ease;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at top, var(--bg-radial), transparent 45%), var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 15px;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Background Canvas */
#bgCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
    background: var(--nav-bg-solid);
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.code-tag {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 16px;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle .moon-icon {
    opacity: 0.4;
}

.theme-toggle.active .moon-icon {
    opacity: 1;
}

.theme-toggle.active .sun-icon {
    opacity: 0.4;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.theme-toggle.active {
    color: var(--accent-primary);
    border-color: rgba(37, 99, 235, 0.4);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 60px 80px;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: var(--success);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 24px;
}

.typewriter {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    border-right: 2px solid var(--accent-primary);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--accent-primary); }
}

.hero-summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
}

.hero-summary strong {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-bottom: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

/* Hero Code Window */
.hero-visual {
    flex: 0 0 480px;
}

.code-window {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #f87171; }
.code-dots span:nth-child(2) { background: #fbbf24; }
.code-dots span:nth-child(3) { background: #4ade80; }

.code-filename {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.code-body {
    padding: 24px 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-body pre {
    margin: 0;
    overflow-x: auto;
}

.code-keyword { color: #c084fc; }
.code-variable { color: #38bdf8; }
.code-property { color: #fbbf24; }
.code-string { color: #4ade80; }
.code-number { color: #f472b6; }
.code-boolean { color: #f87171; }

/* Section Styles */
section {
    position: relative;
    z-index: 1;
    padding: var(--section-padding) 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
}

.skill-group:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.skill-group.featured {
    border-color: rgba(192, 132, 252, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(192, 132, 252, 0.05) 100%);
}

.skill-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.skill-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--accent-primary);
}

.skill-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.skill-tag {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.skill-tag:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.skill-tag.expert {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
    color: var(--accent-primary);
}

.skill-tag.advanced {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.2);
    color: var(--accent-secondary);
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline-line {
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0.3;
}

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

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

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.timeline-item.active .timeline-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.2);
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.1); }
}

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

.timeline-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

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

.timeline-company h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 6px;
}

.timeline-achievements {
    list-style: none;
}

.timeline-achievements li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.timeline-achievements li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.timeline-achievements li strong {
    color: var(--text-primary);
}

/* Earlier Roles */
.earlier-roles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.earlier-role {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.role-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.role-company {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.role-date {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

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

.project-card.featured-project {
    border-color: rgba(56, 189, 248, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(56, 189, 248, 0.05) 100%);
}

.project-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.project-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

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

.project-tech span {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.4);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.project-link::after {
    content: '↗';
    font-size: 0.9rem;
}

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

/* Education */
.education-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.education-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.education-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.education-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.education-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Contact */
.contact {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-top: 1px solid var(--border-color);
}

.contact-content {
    text-align: center;
}

.contact-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

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

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.contact-item .contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--accent-primary);
}

.contact-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    padding: 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-year {
    font-family: var(--font-mono);
    margin-top: 8px;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-visual {
        flex: none;
        width: 100%;
        max-width: 500px;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        gap: 16px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .theme-toggle {
        margin-right: 8px;
        padding: 6px 12px;
    }
    
    .hero {
        padding: 100px 20px 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    section {
        padding: 60px 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skills-container,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-dot {
        left: -28px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-card {
        padding: 24px;
    }
    
    .earlier-roles {
        grid-template-columns: 1fr;
    }
    
    .education-card {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-date {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .code-window {
        max-width: 100vw;
        margin: 0 -4px;
    }
    
    .code-body {
        font-size: 0.75rem;
        padding: 16px 12px;
        overflow-x: auto;
    }
    
    .code-body pre {
        white-space: pre;
    }
    
    .skill-tags {
        gap: 6px;
    }
    
    .skill-tag {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .project-card {
        padding: 24px;
    }
    
    .project-tech span {
        font-size: 0.75rem;
    }
    
    .contact-item {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .hero {
        padding: 90px 16px 40px;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .hero-title {
        font-size: 1.9rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-summary {
        font-size: 0.95rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    section {
        padding: 50px 16px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-tag {
        font-size: 0.75rem;
    }
    
    .navbar {
        padding: 0 16px;
        height: 60px;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .skill-group {
        padding: 20px;
    }
    
    .timeline-card {
        padding: 20px;
    }
    
    .timeline-achievements li {
        font-size: 0.9rem;
    }
    
    .contact-title {
        font-size: 1.8rem;
    }
    
    .contact-subtitle {
        font-size: 1rem;
    }
    
    .footer {
        padding: 30px 16px;
    }
}

/* Chat Widget */
.chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 1001;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
}

.chat-toggle.hidden {
    display: none;
}

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 1002;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.chat-widget.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chat-title svg {
    color: var(--accent-primary);
}

.chat-actions {
    display: flex;
    gap: 6px;
}

.chat-settings-btn,
.chat-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-settings-btn:hover,
.chat-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-settings {
    display: none;
    padding: 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 12px;
    flex-direction: column;
}

.chat-settings.open {
    display: flex;
}

.chat-setting-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-setting-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-setting-row select,
.chat-setting-row input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-setting-row select:focus,
.chat-setting-row input:focus {
    border-color: var(--accent-primary);
}

.chat-setting-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.chat-save-settings {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.chat-save-settings:hover {
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-message.bot .chat-avatar {
    background: var(--accent-gradient);
    color: white;
}

.chat-message.user .chat-avatar {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: calc(100% - 40px);
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 2px;
}

.chat-message.user .chat-bubble {
    background: var(--accent-gradient);
    color: white;
    border-top-right-radius: 2px;
}

.chat-bubble p {
    margin: 0 0 8px;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble ul {
    margin: 8px 0;
    padding-left: 18px;
}

.chat-bubble li {
    margin-bottom: 4px;
}

.chat-bubble strong {
    font-weight: 600;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    border-color: var(--accent-primary);
}

.chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.chat-send:hover {
    opacity: 0.9;
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 480px) {
    .chat-widget {
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        max-height: none;
        border-radius: 12px;
    }
    .chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}

/* Print - A4 Optimized Resume */
@media print {
    @page {
        size: A4;
        margin: 16mm 18mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html {
        scroll-behavior: auto;
        font-size: 10pt;
    }

    body {
        background: #fff !important;
        color: #111 !important;
        font-size: 10pt;
        line-height: 1.45;
        overflow-x: visible;
    }

    /* Hide interactive & decorative elements */
    .navbar, #bgCanvas, .hero-visual, .chat-widget, .chat-toggle,
    .theme-toggle, .menu-toggle, .hero-badge, .hero-stats,
    .pulse-dot, .typewriter, .code-window, .section-tag,
    .timeline-line, .timeline-dot, .project-icon,
    .education-icon, .contact-icon, .contact-item .contact-icon,
    .skill-icon, .footer, .project-link, .btn svg,
    .hero-cta .btn-primary, .hero-cta .btn-secondary:first-of-type,
    #downloadPdfBtn, .faq {
        display: none !important;
    }

    /* Reset sections for print */
    section {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        position: static !important;
        z-index: auto !important;
        page-break-inside: avoid;
    }

    /* Hero as clean header */
    .hero {
        min-height: auto !important;
        padding: 0 0 10pt 0 !important;
        margin: 150pt 0 8pt 0 !important;
        gap: 0 !important;
        display: block !important;
        text-align: left !important;
        border-bottom: 1.5pt solid #111;
        page-break-after: avoid;
    }

    .hero-content {
        max-width: 100% !important;
    }

    .hero-title {
        font-size: 22pt !important;
        font-weight: 700 !important;
        color: #111 !important;
        margin-bottom: 4pt !important;
        line-height: 1.2 !important;
        letter-spacing: normal !important;
    }

    .gradient-text {
        -webkit-text-fill-color: #111 !important;
        color: #111 !important;
        background: none !important;
    }

    .hero-subtitle {
        font-size: 11pt !important;
        color: #333 !important;
        margin-bottom: 6pt !important;
        font-weight: 500 !important;
    }

    .hero-summary {
        font-size: 9.5pt !important;
        color: #222 !important;
        line-height: 1.45 !important;
        margin-bottom: 6pt !important;
    }

    .hero-summary strong {
        color: #111 !important;
        font-weight: 600 !important;
    }

    /* Print contact strip under hero */
    .hero::after {
        content: 'himan.verma@live.com   |   +91 8750784618   |   github.com/himanverma   |   Lucknow, India';
        display: block;
        font-size: 8.5pt;
        color: #333;
        margin-top: 6pt;
        font-family: var(--font-mono);
        letter-spacing: 0.02em;
    }

    .hero-cta {
        display: none !important;
    }

    /* Section titles */
    .section-header {
        text-align: left !important;
        margin-bottom: 6pt !important;
        margin-top: 10pt !important;
        border-bottom: 0.75pt solid #ccc;
        padding-bottom: 3pt;
        page-break-after: avoid;
    }

    .section-title {
        font-size: 12pt !important;
        font-weight: 700 !important;
        color: #111 !important;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Skills - compact horizontal */
    .skills-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6pt !important;
    }

    .skill-group {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .skill-group-header {
        margin-bottom: 3pt !important;
        gap: 4pt !important;
    }

    .skill-group h3 {
        font-size: 9.5pt !important;
        font-weight: 600 !important;
        color: #111 !important;
    }

    .skill-tags {
        gap: 3pt !important;
    }

    .skill-tag {
        font-size: 7.5pt !important;
        padding: 1.5pt 4pt !important;
        border-radius: 2pt !important;
        background: #f3f4f6 !important;
        color: #111 !important;
        border: 0.5pt solid #ddd !important;
        font-weight: 400 !important;
    }

    .skill-tag.expert {
        background: #e5e7eb !important;
        border-color: #9ca3af !important;
        color: #111 !important;
    }

    .skill-tag.advanced {
        background: #f3f4f6 !important;
        border-color: #d1d5db !important;
        color: #111 !important;
    }

    /* Experience - compact timeline */
    .timeline {
        padding-left: 0 !important;
    }

    .timeline-item {
        margin-bottom: 8pt !important;
        page-break-inside: avoid;
    }

    .timeline-card {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .timeline-header {
        margin-bottom: 3pt !important;
        flex-wrap: nowrap !important;
    }

    .timeline-company h3 {
        font-size: 10.5pt !important;
        font-weight: 600 !important;
        color: #111 !important;
    }

    .timeline-role {
        font-size: 9pt !important;
        color: #333 !important;
        font-weight: 500 !important;
    }

    .timeline-date {
        font-size: 8pt !important;
        color: #555 !important;
        background: none !important;
        padding: 0 !important;
        font-family: var(--font-mono);
        white-space: nowrap;
    }

    .timeline-achievements li {
        font-size: 8.5pt !important;
        color: #222 !important;
        margin-bottom: 1.5pt !important;
        padding-left: 10pt !important;
        line-height: 1.4 !important;
    }

    .timeline-achievements li::before {
        color: #333 !important;
        content: '>' !important;
    }

    .timeline-achievements li strong {
        color: #111 !important;
        font-weight: 600 !important;
    }

    /* Earlier roles */
    .earlier-roles {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4pt !important;
    }

    .earlier-role {
        background: #f9fafb !important;
        border: 0.5pt solid #e5e7eb !important;
        border-radius: 2pt !important;
        padding: 4pt 6pt !important;
    }

    .role-name {
        font-size: 8.5pt !important;
        font-weight: 600 !important;
        color: #111 !important;
    }

    .role-company, .role-date {
        font-size: 7.5pt !important;
        color: #444 !important;
    }

    /* Projects - compact grid */
    .projects-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8pt !important;
    }

    .project-card {
        background: none !important;
        border: 0.5pt solid #e5e7eb !important;
        border-radius: 3pt !important;
        padding: 6pt !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .project-card h3 {
        font-size: 9.5pt !important;
        font-weight: 600 !important;
        color: #111 !important;
        margin-bottom: 2pt !important;
    }

    .project-card p {
        font-size: 8pt !important;
        color: #333 !important;
        line-height: 1.35 !important;
        margin-bottom: 3pt !important;
    }

    .project-tech {
        gap: 2pt !important;
    }

    .project-tech span {
        font-size: 6.5pt !important;
        padding: 1pt 3pt !important;
        border-radius: 1.5pt !important;
        background: #f3f4f6 !important;
        color: #333 !important;
        border: 0.5pt solid #ddd !important;
        font-family: var(--font-mono);
    }

    /* Education */
    .education-card {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        max-width: 100% !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .education-content h3 {
        font-size: 10pt !important;
        font-weight: 600 !important;
        color: #111 !important;
    }

    .education-content p {
        font-size: 8.5pt !important;
        color: #333 !important;
    }

    /* Contact section hidden in print - info shown in hero header */
    .contact {
        display: none !important;
    }

    /* Fade-in animations disabled */
    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Footer hidden */
    .footer {
        display: none !important;
    }

    /* Page break controls */
    .skills {
        page-break-before: auto;
    }

    .experience {
        page-break-before: auto;
    }

    .projects {
        page-break-before: auto;
    }

    .education {
        page-break-before: auto;
    }

    .timeline-item {
        page-break-inside: avoid;
    }

    .skill-group {
        page-break-inside: avoid;
    }

    .project-card {
        page-break-inside: avoid;
    }

    .earlier-role {
        page-break-inside: avoid;
    }

    /* Online resume QR card in print - top right corner */
    .online-resume {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 110pt !important;
        padding: 0 !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }

    .online-resume .section-header {
        display: none !important;
    }

    .online-resume-card {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        flex-direction: column !important;
        gap: 4pt !important;
        align-items: flex-end !important;
        max-width: none !important;
    }

    .online-resume-qr img {
        width: 80pt !important;
        height: 80pt !important;
        border-radius: 2pt !important;
    }

    .online-resume-text {
        display: none !important;
    }

    .online-resume-link {
        color: #111 !important;
        font-size: 7pt !important;
        text-align: right !important;
        line-height: 1.3 !important;
    }
}

/* FAQ Section (AEO) */
.faq {
    padding: var(--section-padding) 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    transition: border-color 0.3s ease;
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-item summary {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-answer {
    margin-top: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .faq {
        padding: 60px 24px;
    }
    .faq-item {
        padding: 16px 20px;
    }
}

/* Online Resume / QR Code Section */
.online-resume {
    padding: var(--section-padding) 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.online-resume-card {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 700px;
    margin: 0 auto;
}

.online-resume-qr img {
    display: block;
    border-radius: 8px;
    width: 150px;
    height: 150px;
}

.online-resume-info {
    flex: 1;
}

.online-resume-text {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.online-resume-link {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    word-break: break-all;
}

.online-resume-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .online-resume {
        padding: 60px 24px;
    }
    .online-resume-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 20px;
    }
}
