/* ===== Global Reset for Perfect Viewport Fit ===== */
html {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ===== CSS Variables for Theme Support ===== */
:root {
    /* Light Theme Colors */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    /* Animation */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-code: 'Fira Code', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
}

/* Dark Theme Colors */
[data-theme="dark"], .dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-overlay: rgba(15, 23, 42, 0.95);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #1e293b;
    
    --border-color: #334155;
    --border-hover: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* ========================================
   MULTI-DIRECTIONAL SCROLL LAYOUT
======================================== */

.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.scroll-wrapper {
    display: grid;
    grid-template-columns: 100vw 100vw 100vw;
    grid-template-rows: 100vh 100vh 100vh 100vh;
    width: 300vw;
    height: 400vh;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Section positioning for multi-directional flow */
.section-full {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
}

.section-full .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 1vh 2vw;
    box-sizing: border-box;
}

/* Grid positions for directional flow */
.position-1 { grid-column: 1; grid-row: 1; } /* Start: Home */
.position-2 { grid-column: 1; grid-row: 2; } /* Down: About */
.position-3 { grid-column: 2; grid-row: 2; } /* Right: Portfolio */
.position-4 { grid-column: 2; grid-row: 3; } /* Down: Services */
.position-5 { grid-column: 1; grid-row: 3; } /* Left: CV */
.position-6 { grid-column: 1; grid-row: 4; } /* Down: Contact */

/* Navigation indicators - Hidden for clean viewport fit */
.scroll-nav {
    display: none !important;
}

.scroll-nav-item {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.scroll-nav-item.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.scroll-nav-item::after {
    content: attr(data-direction);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.scroll-nav-item:hover::after {
    opacity: 1;
}

/* Hide scroll navigation on mobile */
@media (max-width: 768px) {
    .scroll-nav { display: none !important; }
}

/* Ensure sections take full viewport */
.hero, .about, .portfolio, .services, .cv, .contact {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8vh 0 2vh 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Container adjustments for viewport sections */
.section-full .container {
    max-width: 90vw;
    margin: 0 auto;
    padding: 1vh 2vw;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Specific section adjustments */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2vw;
    align-items: center;
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
}

.portfolio-grid {
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25vw, 1fr));
    gap: 1vw;
    align-content: center;
}

.services-grid {
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25vw, 1fr));
    gap: 1vw;
    align-content: center;
}

.cv-container {
    display: grid;
    grid-template-columns: 30vw 1fr;
    gap: 2vw;
    height: 80vh;
    max-height: 80vh;
    overflow: hidden;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5vw; /* Reduced gap */
    align-items: start;
    height: 85vh; /* Further reduced height */
    max-height: 85vh;
    overflow: hidden;
    padding: 0.5vh 0; /* Minimal padding */
}

.contact-info,
.contact-form-container {
    height: 100%;
    max-height: 84vh; /* Fit within parent with buffer */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start from top to prevent cut-off */
    padding: 0;
}

/* Hide footer in scroll mode */
.footer {
    display: none;
}

/* Adjust navbar for fixed positioning */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    height: 8vh;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-full .container {
        padding: 0.5vh; /* Minimal padding */
        max-height: 100vh;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 0.5vh; /* Minimal gap */
        height: 85vh; /* Fit without scrolling */
        max-height: 85vh;
        overflow: hidden;
        padding: 0.2vh 0; /* Minimal padding */
    }
    
    .contact-info,
    .contact-form-container {
        height: auto;
        max-height: 40vh; /* Split height evenly */
        overflow: hidden;
        justify-content: flex-start;
    }
    
    .form-group {
        margin-bottom: 0.3vh; /* Ultra-tight spacing on mobile */
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        height: 4.5vh; /* Same height for all mobile fields */
        min-height: 4.5vh;
        max-height: 4.5vh;
    }
    
    .form-group textarea {
        height: 4.5vh; /* Same as other fields on mobile */
        min-height: 4.5vh;
        max-height: 4.5vh;
    }
    
    .contact-method {
        margin-bottom: 0.3vh; /* Minimal spacing */
    }
    
    .contact-info h3 {
        margin-bottom: 0.3vh;
    }
    
    .contact-info p {
        margin-bottom: 0.3vh;
    }
}
    
    .cv-container {
        grid-template-columns: 1fr;
        gap: 1vh;
        height: 85vh;
    }
    
    .cv-sidebar,
    .cv-main {
        height: 40vh;
    }
    
    .portfolio-grid,
    .services-grid {
        grid-template-columns: 1fr 1fr;
        height: 75vh;
    }
}

/* ========================================
   SECTION CONTENT OPTIMIZATION - VIEWPORT FIT
======================================== */

/* Section headers spacing - viewport relative */
.section-header {
    margin-bottom: 3vh;
    text-align: center;
}

.section-title {
    font-size: clamp(1.5rem, 5vh, 3rem);
    margin-bottom: 1vh;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(0.8rem, 2.5vh, 1.2rem);
    opacity: 0.8;
    line-height: 1.3;
}

/* About section - perfectly fit viewport */
.about-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.about-text h3 {
    font-size: clamp(1.2rem, 4vh, 2rem);
    margin-bottom: 1vh;
    line-height: 1.2;
}

.about-text p {
    font-size: clamp(0.7rem, 2vh, 1rem);
    line-height: 1.4;
    margin-bottom: 2vh;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15vw, 1fr));
    gap: 1vh;
    margin-top: 1vh;
}

.skill-category {
    padding: 1vh;
}

.skill-category h4 {
    font-size: clamp(0.8rem, 2.5vh, 1.1rem);
    margin-bottom: 0.5vh;
    line-height: 1.2;
}

.skill-category ul {
    margin: 0;
    padding: 0;
}

.skill-category ul li {
    font-size: clamp(0.6rem, 1.8vh, 0.85rem);
    padding: 0.2vh 0;
    line-height: 1.2;
}

/* About stats - viewport fit */
.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12vw, 1fr));
    gap: 1vh;
    margin-top: 2vh;
    height: 100%;
    align-content: center;
}

.stat-item {
    text-align: center;
    padding: 1vh;
}

.stat-number {
    font-size: clamp(1.2rem, 4vh, 2.2rem);
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5vh;
    line-height: 1;
}

.stat-label {
    font-size: clamp(0.6rem, 1.8vh, 0.9rem);
    opacity: 0.8;
    line-height: 1.2;
}

/* Portfolio items - fit viewport perfectly */
.portfolio-item {
    height: auto;
    max-height: 32vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.portfolio-item img {
    width: 100%;
    height: 20vh;
    object-fit: cover;
    flex-shrink: 0;
}

.portfolio-item-content {
    padding: 1vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portfolio-item h3 {
    font-size: clamp(0.8rem, 2.5vh, 1.1rem);
    margin-bottom: 0.5vh;
    line-height: 1.2;
}

.portfolio-item p {
    font-size: clamp(0.6rem, 1.8vh, 0.85rem);
    line-height: 1.3;
    flex: 1;
}

/* Service cards - viewport fit */
.service-card {
    padding: 1.5vh 1vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 32vh;
    max-height: 32vh;
    overflow: hidden;
}

.service-card h3 {
    font-size: clamp(0.9rem, 3vh, 1.2rem);
    margin-bottom: 1vh;
    line-height: 1.2;
}

.service-card p {
    font-size: clamp(0.7rem, 2vh, 0.9rem);
    line-height: 1.3;
    flex: 1;
}

.service-card .price {
    font-size: clamp(0.8rem, 2.5vh, 1.1rem);
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 1vh;
}

/* CV section - perfect viewport fit */
.cv-sidebar {
    padding: 1vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cv-sidebar .profile-photo {
    width: 12vh;
    height: 12vh;
    margin: 0 auto 2vh auto;
    flex-shrink: 0;
}

.cv-section {
    margin-bottom: 2vh;
    flex-shrink: 0;
}

.cv-section h3 {
    font-size: clamp(0.8rem, 2.5vh, 1.2rem);
    margin-bottom: 1vh;
    line-height: 1.2;
}

.cv-section h4 {
    font-size: clamp(0.7rem, 2vh, 1rem);
    line-height: 1.2;
    margin-bottom: 0.5vh;
}

.cv-section p,
.cv-section li {
    font-size: clamp(0.6rem, 1.8vh, 0.85rem);
    line-height: 1.3;
    margin-bottom: 0.5vh;
}

.experience-item,
.education-item {
    margin-bottom: 1.5vh;
    padding-bottom: 1vh;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.experience-item h4,
.education-item h4 {
    font-size: clamp(0.8rem, 2.5vh, 1.1rem);
    margin-bottom: 0.5vh;
    line-height: 1.2;
}

.experience-item .company,
.education-item .school {
    font-size: clamp(0.7rem, 2vh, 0.9rem);
    color: var(--primary-color);
    margin-bottom: 0.5vh;
}

.experience-item .duration,
.education-item .duration {
    font-size: clamp(0.6rem, 1.8vh, 0.8rem);
    opacity: 0.7;
    margin-bottom: 0.5vh;
}

/* Contact section - larger, bolder styling */
.contact-info h3 {
    font-size: clamp(1.4rem, 4vh, 1.8rem);
    margin-bottom: 1.5vh; /* More spacious margin */
    line-height: 1.2;
    font-weight: 700; /* Bolder heading */
}

.contact-info p {
    font-size: clamp(0.9rem, 2.5vh, 1.1rem);
    line-height: 1.4;
    margin-bottom: 1.2vh; /* More spacious margin */
}

.contact-method {
    display: flex;
    align-items: center;
    margin-bottom: 1.2vh; /* More spacious margin */
}

.contact-method .method-icon {
    width: 4vh; /* Larger icons */
    height: 4vh;
    margin-right: 1.2vw;
    flex-shrink: 0;
}

.contact-method h4 {
    font-size: clamp(0.9rem, 2.5vh, 1.1rem);
    margin-bottom: 0.4vh; /* More margin */
    line-height: 1.2;
    font-weight: 600; /* Bolder text */
}

.contact-method p {
    font-size: clamp(0.8rem, 2.2vh, 1rem);
    line-height: 1.3;
    margin: 0;
}

/* Contact form optimization */
.contact-form {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start from top */
    gap: 0.5vh; /* Minimal gap */
    padding: 0;
}

.form-group {
    margin-bottom: 1.5vh; /* More spacious margin */
    flex-shrink: 0;
}

.form-group label {
    font-size: clamp(0.9rem, 2.5vh, 1.1rem); /* Larger, bolder font */
    line-height: 1.2;
    margin-bottom: 0.8vh; /* More margin for breathing room */
    display: block;
    font-weight: 600; /* Make labels bolder */
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    font-size: clamp(0.85rem, 2.2vh, 1rem); /* Larger font */
    padding: 1.2vh 1.5vw; /* More padding for better UX */
    height: 5vh; /* Same height for all fields */
    width: 100%;
    box-sizing: border-box;
    resize: none; /* Prevent textarea resizing */
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    height: 5vh; /* Same as other fields */
    resize: none;
    min-height: 5vh;
    max-height: 5vh; /* Prevent expansion */
}

/* Social links */
.social-links h4 {
    font-size: clamp(0.8rem, 2.5vh, 1rem);
    margin-bottom: 1vh;
}

/* ========================================
   BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* ===== Main Content Reveal Animation ===== */
body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow: hidden; /* Prevent all scrollbars for perfect viewport fit */
    opacity: 1;
    transform: translateY(0);
    margin: 0;
    padding: 0;
    height: 100vh;
    max-height: 100vh;
}

/* ===== Loading Screen ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000011 0%, #001122 30%, #000033 70%, #000011 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: none;
    overflow: hidden;
}

#loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}

#loading-screen.hidden {
    animation: backgroundSlideUp 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Background slides up to reveal main content */
@keyframes backgroundSlideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
    }
}

.loader {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    z-index: 2;
}

.loader-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2.5rem;
    font-weight: 700;
    animation: logoSlideUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform: translateY(80px);
    opacity: 0;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

.loader-logo .logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-family: var(--font-code);
    font-weight: 700;
    line-height: 1;
    animation: futuristicPulse 2s ease-in-out infinite 2.5s;
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.6),
        0 0 40px rgba(99, 102, 241, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.loader-logo .logo-word {
    font-family: var(--font-code);
    color: #ffffff;
    text-shadow: 
        0 0 10px rgba(99, 102, 241, 0.8),
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 30px rgba(99, 102, 241, 0.2);
}

.loader-progress {
    width: 100%;
    animation: progressFadeIn 0.8s ease-out 2s forwards;
    opacity: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-family: var(--font-code);
    font-size: 0.875rem;
    color: #94a3b8;
}

.progress-text {
    color: #e2e8f0;
    text-shadow: 0 0 10px rgba(226, 232, 240, 0.5);
}

.progress-percent {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #0f172a, #1e293b, #0f172a);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 0 10px rgba(99, 102, 241, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: scanLine 2s linear infinite;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color), 
        var(--secondary-color), 
        #10b981,
        var(--secondary-color),
        var(--primary-color)
    );
    background-size: 200% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.8),
        0 0 40px rgba(99, 102, 241, 0.4),
        inset 0 0 5px rgba(255, 255, 255, 0.2);
    animation: holographicFlow 3s linear infinite;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    text-align: left;
    width: 100%;
}

.step {
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 20px;
    text-shadow: 0 0 5px rgba(100, 116, 139, 0.5);
}

.step::before {
    content: '◦';
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.step.active {
    color: #e2e8f0;
    text-shadow: 0 0 10px rgba(226, 232, 240, 0.8);
}

.step.active::before {
    content: '◉';
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(99, 102, 241, 1);
    animation: stepPulse 1s ease-in-out infinite;
}

.step.completed {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.step.completed::before {
    content: '✦';
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 1);
}

@keyframes logoSlideUp {
    0% {
        transform: translateY(80px);
        opacity: 0;
        filter: blur(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes progressFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes futuristicPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.6),
            0 0 40px rgba(99, 102, 241, 0.3),
            inset 0 0 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 
            0 0 30px rgba(99, 102, 241, 0.9),
            0 0 60px rgba(99, 102, 241, 0.5),
            0 0 90px rgba(99, 102, 241, 0.2),
            inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
}

@keyframes holographicFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes scanLine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes stepPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ===== Particle Background ===== */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
    opacity: 0.6;
    transition: opacity var(--transition-normal), 
                width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-radius 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar.scrolled:hover {
    opacity: 1;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Desktop-only: shrink and center navbar when scrolled */
@media (min-width: 1025px) {
    .navbar.scrolled {
        width: 700px;
        height: 80px;
        top: 20px; /* margin from top when scrolled */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border-radius: 14px;
        border: 1px solid var(--border-color);
        background: var(--bg-overlay);
    }
    .navbar.scrolled .nav-container {
        max-width: none;
        width: 100%;
        height: 80px;
        padding: 0 16px;
        gap: 12px;
    }
    .navbar.scrolled .nav-logo .logo-text { font-size: var(--font-size-lg); }
    .navbar.scrolled .nav-menu { gap: var(--space-md); }
    .navbar.scrolled .theme-toggle { width: 36px; height: 36px; }
}

.nav-logo .logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: font-size 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff;
    font-family: var(--font-code);
    font-weight: 700;
    line-height: 1;
    animation: logoPulse 1.4s ease-in-out infinite;
}

.logo-word {
    font-family: var(--font-code);
    color: var(--text-primary);
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99,102,241,0.7); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    transition: gap 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal), 
                width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(15deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all var(--transition-normal);
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--space-3xl) var(--space-lg);
    position: relative;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    width: 100%;
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
}

.title-line {
    display: block;
    color: var(--text-secondary);
}

.title-name {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2em;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: var(--space-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    min-height: 35px; /* Ensure minimum touch target */
}

/* Contact form specific button sizing */
.contact-form .btn {
    font-size: clamp(0.9rem, 2.5vh, 1.1rem); /* Larger font */
    padding: 1.8vh 2vw; /* More vertical padding for height */
    margin: 1vh 0; /* More margin for spacing */
    min-height: 50px; /* Ensure good minimum height */
    font-weight: 600; /* Bolder text */
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-slow);
}

.profile-image:hover {
    transform: scale(1.05);
}

.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: var(--gradient-primary);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}

.scroll-indicator {
    position: absolute;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

.scroll-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ===== Common Section Styles ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

.about-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.about-text p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: 1.8;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
}

.skill-category h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--primary-color);
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-lg);
}

.skill-category li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.stat-item {
    text-align: center;
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Portfolio Section ===== */
/* New modern portfolio reel */
.portfolio-reel { display: flex; flex-direction: column; gap: var(--space-xl); }

.reel-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; }
.portfolio-filters { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.filter-btn { padding: 8px 14px; border: 2px solid var(--border-color); background: transparent; color: var(--text-primary); border-radius: 999px; cursor: pointer; transition: all var(--transition-normal); font-weight: 600; }
.filter-btn:hover, .filter-btn.active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; box-shadow: var(--shadow-md); }

.reel-nav { display: flex; align-items: center; gap: 12px; }
.reel-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); cursor: pointer; display: grid; place-items: center; transition: all var(--transition-normal); }
.reel-btn:hover { border-color: var(--primary-color); color: var(--primary-color); transform: translateY(-2px); }
.reel-dots { display: flex; align-items: center; gap: 8px; }
.reel-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-color); transition: all var(--transition-fast); }
.reel-dots .dot.active { background: var(--primary-color); transform: scale(1.4); }

.reel-viewport { 
    position: relative; 
    overflow: hidden;
    pointer-events: none; /* Allow events to pass through */
}

.reel-track { 
    display: grid; 
    grid-auto-flow: column; 
    grid-auto-columns: 1050px; 
    gap: var(--space-xl); 
    padding: 10px 0 4px 0; 
    scroll-snap-type: x mandatory; 
    overflow-x: auto; 
    overflow-y: visible; 
    -webkit-overflow-scrolling: touch; 
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    pointer-events: auto; /* Re-enable for horizontal scrolling */
    cursor: grab;
    user-select: none; /* Prevent text selection during drag */
    transition: scroll-behavior 0.1s ease; /* Smooth transition for scroll behavior changes */
}

.reel-track:active,
.reel-track.dragging {
    cursor: grabbing;
    scroll-behavior: auto; /* Disable smooth scroll during drag */
    scroll-snap-type: none; /* Disable snap during drag for free movement */
}

/* Ensure all portfolio elements allow vertical page scrolling */
.portfolio.section-full,
.portfolio-reel,
.reel-viewport,
.reel-track,
.case-card {
    touch-action: pan-y pan-x;
}
.reel-track::-webkit-scrollbar { display: none; }
.reel-track { scrollbar-width: none; /* Firefox */ }

.case-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: var(--shadow-md); 
    scroll-snap-align: center; 
    display: flex; 
    flex-direction: column; 
    pointer-events: auto;
    width: 1050px;
    min-width: 1050px;
    max-width: 1050px;
    flex-shrink: 0;
}

/* Ensure case content allows page scrolling */
.case-card, .case-media, .case-content-overlay, .case-overlay, .case-title-overlay, .case-actions {
    overscroll-behavior: none;
}
.case-media { 
    position: relative; 
    aspect-ratio: 16 / 9; 
    background: var(--bg-tertiary); 
    background-size: cover; 
    background-position: center top; 
    background-repeat: no-repeat; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    min-height: 300px;
}
.case-content-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
}
.case-overlay { 
    position: relative; 
    display: flex; 
    align-items: flex-start; 
    justify-content: flex-end; 
    padding: 16px; 
}
.case-title-overlay {
    padding: 20px;
    color: white;
}
.case-title-overlay .case-title {
    color: white;
    font-size: clamp(1.2rem, 1.6vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.case-title-overlay .case-excerpt {
    color: rgba(255,255,255,0.9);
    font-size: clamp(0.9rem, 1vw, 1.1rem);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.case-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}
.case-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-tag { background: var(--gradient-primary); color: #fff; font-size: var(--font-size-sm); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.case-body { padding: 18px; display: grid; gap: 8px; }
.case-title { font-size: clamp(1.05rem, 1.4vw, 1.35rem); font-weight: 700; }
.case-excerpt { color: var(--text-secondary); font-size: clamp(0.9rem, 1vw, 1rem); }
.case-actions { margin-top: 6px; }

/* Hover lift */
.case-card { transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal); }
.case-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--primary-color); }
.case-card:hover .case-content-overlay { background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.9) 100%); }
.case-card:hover .case-actions { transform: translateY(-2px); }

/* Dark theme polish */
.dark-theme .case-card { border-color: rgba(148, 163, 184, 0.2); }

/* Portfolio section viewport-fit with inner horizontal scroll on mobile */
.portfolio.section-full .container { display: flex; flex-direction: column; height: 100vh; max-height: 100vh; justify-content: flex-end; }
.portfolio.section-full .section-header { flex: 0 0 auto; }
.portfolio.section-full .portfolio-reel { flex: 0 0 auto; display: flex; flex-direction: column; }
.portfolio.section-full .reel-viewport { flex: 0 0 auto; }

@media (max-width: 1024px) {
  .reel-track { grid-auto-columns: 775px; }
  .case-card { width: 775px; min-width: 775px; max-width: 775px; }
  .case-title-overlay .case-title {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
  }
}
@media (max-width: 768px) {
  .reel-track { grid-auto-columns: 675px; gap: 16px; }
  .case-card { width: 675px; min-width: 675px; max-width: 675px; }
  .reel-header { gap: 10px; }
  .case-media { min-height: 250px; }
  .case-title-overlay, .case-overlay, .case-actions {
    padding: 16px;
  }
  .case-actions {
    bottom: 16px;
    right: 16px;
  }
  .case-title-overlay .case-title {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 6px;
  }
  .case-title-overlay .case-excerpt {
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Services Section ===== */
.services {
    background: var(--bg-secondary);
    overflow: hidden;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.service-card {
    background: var(--bg-card);
    padding: var(--space-2xl);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    border: 2px solid transparent;
    transform-origin: center;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease-in-out;
    pointer-events: none;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.service-card:nth-child(even):hover {
    transform: translateY(-8px);
}

.service-card.featured {
    border-color: var(--primary-color);
    position: relative;
    box-shadow: var(--shadow-xl);
}

.service-card.featured:hover {
    transform: translateY(-8px);
}

.service-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 15px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    animation: pulse 2s infinite;
    z-index: 2;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.6s ease-out;
    transform: translate(-50%, -50%);
}

.service-card:hover .service-icon::before {
    width: 100px;
    height: 100px;
}

.service-card:hover .service-icon {
    transform: rotateY(180deg) scale(1.1);
}

.service-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    transition: color var(--transition-normal);
}

.service-card:hover h3 {
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    transition: all var(--transition-normal);
}

.service-card:hover p {
    color: var(--text-primary);
}

.service-features {
    list-style: none;
    margin-bottom: var(--space-lg);
}

.service-features li {
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-lg);
    transition: all var(--transition-normal);
    transform: translateX(0);
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    transition: all var(--transition-normal);
}

.service-card:hover .service-features li {
    transform: translateX(5px);
    color: var(--text-primary);
}

.service-card:hover .service-features li::before {
    color: var(--primary-color);
    transform: scale(1.2);
}

.service-price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease-in-out;
    z-index: 1;
}

.service-card:hover .service-price::before {
    left: 0;
}

.service-card:hover .service-price {
    color: white;
    transform: scale(1.05);
}

.service-price span {
    position: relative;
    z-index: 2;
}

/* ===== CV Section ===== */
.cv-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-3xl);
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    min-height: fit-content; /* Let content determine height */
    align-items: start; /* Align items to top */
}

.cv-sidebar {
    background: var(--bg-secondary);
    padding: var(--space-2xl);
    height: fit-content; /* Fit content height instead of 100% */
    min-height: 100%; /* Ensure it fills at least the full height if content is short */
}

.cv-main {
    padding: var(--space-2xl);
    height: fit-content; /* Let main content determine its own height */
}

.cv-photo {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.cv-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.cv-contact h3,
.cv-skills h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--primary-color);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.contact-item i {
    color: var(--primary-color);
    width: 20px;
}

.skill-item {
    margin-bottom: var(--space-lg);
}

.skill-name {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.skill-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 2s ease-in-out;
}

.cv-section {
    margin-bottom: var(--space-2xl);
}

.cv-section h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--space-sm);
}

.experience-item,
.education-item {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.experience-header,
.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.experience-header h4,
.education-header h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.experience-period,
.education-period {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: var(--primary-color);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 15px;
}

.experience-company,
.education-institution {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.experience-description {
    list-style: none;
}

.experience-description li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.experience-description li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.certifications-list {
    list-style: none;
}

.certifications-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.cv-download {
    text-align: center;
    margin-top: var(--space-2xl);
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-info h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.contact-info p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: 1.7;
}

.contact-methods {
    margin-bottom: var(--space-2xl);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.method-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
}

.method-details h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.method-details p {
    color: var(--text-secondary);
    margin: 0;
}

.social-links h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    gap: var(--space-md);
}

.social-icon {
    width: 50px;
    height: 50px;
    background: transparent; /* Same transparent background as secondary button */
    color: var(--text-primary); /* Same text color as secondary button */
    border: 2px solid var(--border-color); /* Same border as secondary button */
    border-radius: 50px; /* Rounded like buttons */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600; /* Same font weight as buttons */
    transition: all var(--transition-fast) !important;
    position: relative;
    overflow: hidden; /* Same as buttons */
    cursor: pointer;
    min-height: 50px; /* Consistent with button sizing */
    font-size: 1.1rem; /* Slightly larger icons */
}

.social-icon:hover {
    border-color: var(--primary-color) !important; /* Same border color change as secondary button */
    color: var(--primary-color) !important; /* Same text color change as secondary button */
    transform: translateY(-2px) !important; /* Same lift as secondary button */
    box-shadow: var(--shadow-lg) !important; /* Same shadow effect as secondary button */
    transition: all var(--transition-fast) !important; /* Force fast transition on hover too */
}

.contact-form-container {
    background: var(--bg-card);
    padding: var(--space-2xl);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-tertiary);
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-text p {
    margin: 0;
    color: var(--text-secondary);
}

.footer-text i {
    color: var(--danger-color);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.back-to-top.visible {
    transform: translateY(0);
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-2xl);
    }
    
    /* About section: fit fully to viewport on mobile */
    .about.section-full { min-height: 100vh; height: 100vh; }
    .about.section-full .container {
        height: calc(100vh - 120px); /* account for mobile header and padding */
        max-height: calc(100vh - 120px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    .about.section-full .section-header { flex: 0 0 auto; margin-bottom: 12px; }
    .about.section-full .about-content {
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-content: start;
        min-height: 0; /* allow inner scroll if needed */
    }
    .about.section-full .about-text {
        overflow: auto; /* permits reading longer copy without breaking 100vh */
        padding-right: 6px; /* space for scrollbar */
    }
    .about.section-full .about-stats { flex-direction: row; gap: 8px; }
    .about.section-full .stat-item { padding: 12px; }

    .about-text h3 { font-size: clamp(1.1rem, 5.5vw, 1.4rem); margin-bottom: 8px; }
    .about-text p { font-size: clamp(0.9rem, 3.8vw, 1rem); margin-bottom: 10px; line-height: 1.6; }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
    
    .cv-content {
        grid-template-columns: 1fr;
    }
    
    .cv-sidebar {
        padding: var(--space-lg);
    }
}

@media (max-width: 768px) {
    /* Make header higher on mobile */
    .navbar { height: 90px; }
    .nav-container { height: 90px; }

    .nav-menu {
        position: fixed;
        top: 90px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 90px);
        background: var(--bg-overlay);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: start;
        align-items: center;
        padding: var(--space-2xl);
        transition: left var(--transition-normal);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    /* Hero adjustments to fit all content on mobile */
    .hero {
        min-height: 100vh; /* keep full viewport cell */
        padding: 100px 16px 16px; /* clear under fixed header and reduce side/bottom */
    }

    .hero-content {
        height: auto;
        max-height: calc(100vh - 120px); /* account for header + padding */
        gap: 14px;
        justify-items: center;
        align-items: start;
    }

    .hero-title {
        font-size: clamp(1.6rem, 6.5vw, 2.25rem);
        margin-bottom: 8px;
    }
    
    .hero-subtitle {
        font-size: clamp(0.95rem, 3.8vw, 1.05rem);
        max-width: 100%;
        margin-bottom: 16px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .image-container {
        width: min(70vw, 260px);
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .scroll-indicator { bottom: 12px; }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* Portfolio section: fit fully to viewport on mobile */
    .portfolio.section-full { min-height: 100vh; height: 100vh; }
    .portfolio.section-full .container {
        height: calc(100vh - 120px); /* account for mobile header and padding */
        max-height: calc(100vh - 120px);
        display: flex;
        flex-direction: column;
    }
    .portfolio.section-full .section-header { flex: 0 0 auto; margin-bottom: 10px; }
    .portfolio.section-full .portfolio-filters {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }
    .portfolio.section-full .portfolio-grid {
        flex: 1 1 auto;
        min-height: 0; /* enable inner scrolling */
        overflow: auto;
        gap: 12px;
        padding-right: 6px; /* space for scrollbar */
    }
    .portfolio.section-full .portfolio-image img { width: 100%; height: auto; }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-md);
    }
    
    /* Ensure hero also clears header on very small phones */
    .hero { padding: 100px 12px 12px; }
    
    .container {
        padding: 0 var(--space-md);
    }
    
    section {
        padding: var(--space-2xl) 0;
    }
    
    .hero-title { font-size: clamp(1.5rem, 7vw, 2rem); }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .image-container {
        width: min(75vw, 220px);
        aspect-ratio: 1 / 1;
        height: auto;
    }

    /* Hide scroll hint on very short screens */
    @media (max-height: 640px) {
        .scroll-indicator { display: none; }
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-filters {
        gap: var(--space-sm);
    }
    
    .filter-btn {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-sm);
    }
    
    .experience-header,
    .education-header {
        flex-direction: column;
        align-items: start;
        gap: var(--space-sm);
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.visible { visibility: visible; }

/* ===== Enhanced Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Vertical Scroll Animations */
.slide-up {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-down {
    opacity: 0;
    transform: translateY(-60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-down.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Horizontal Scroll Animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(80px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Diagonal and Complex Animations */
.slide-diagonal-left {
    opacity: 0;
    transform: translate(-60px, 40px) rotate(-5deg);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-diagonal-left.visible {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
}

.slide-diagonal-right {
    opacity: 0;
    transform: translate(60px, 40px) rotate(5deg);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-diagonal-right.visible {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
}

/* Scale and Rotate Animations */
.scale-in {
    opacity: 0;
    transform: scale(0.7) rotate(-10deg);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.scale-up {
    opacity: 0;
    transform: scale(1.2);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-up.visible {
    opacity: 1;
    transform: scale(1);
}

/* Flip Animations */
.flip-in-x {
    opacity: 0;
    transform: perspective(400px) rotateX(-90deg);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-in-x.visible {
    opacity: 1;
    transform: perspective(400px) rotateX(0deg);
}

.flip-in-y {
    opacity: 0;
    transform: perspective(400px) rotateY(-90deg);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-in-y.visible {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
}

/* Bounce and Elastic Effects */
.bounce-in {
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bounce-in.visible {
    opacity: 1;
    transform: scale(1);
}

.elastic-in {
    opacity: 0;
    transform: scale(0.1);
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.elastic-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Wave Animation for Multiple Elements */
.wave-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.wave-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for wave effects */
.wave-item:nth-child(1) { transition-delay: 0.1s; }
.wave-item:nth-child(2) { transition-delay: 0.2s; }
.wave-item:nth-child(3) { transition-delay: 0.3s; }
.wave-item:nth-child(4) { transition-delay: 0.4s; }
.wave-item:nth-child(5) { transition-delay: 0.5s; }
.wave-item:nth-child(6) { transition-delay: 0.6s; }

/* Parallax-style animations */
.parallax-slow {
    transition: transform 0.1s linear;
}

.parallax-medium {
    transition: transform 0.05s linear;
}

.parallax-fast {
    transition: transform 0.02s linear;
}

/* ========================================
   Services hover consistency override
   Ensures hover lift wins over animation transforms (slide-up/down)
======================================== */
.services .service-card { will-change: transform; }
.services .service-card:hover,
.services .service-card.featured:hover,
.services .service-card:nth-child(even):hover {
    transform: translateY(-8px) !important;
}

/* ========================================
   SERVICES: strict viewport-fit overrides
   Ensures 6 cards fit in 2 rows (desktop) and 2x3 on tablet/mobile
======================================== */
.services.section-full .container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 2vh 2vw;
}

.services.section-full .section-header {
    flex: 0 0 16vh;
    margin-bottom: 1.5vh;
    display: grid;
    place-content: center;
}

.services.section-full .services-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5vh 1.2vw;
    height: auto;
    max-height: none;
    align-items: stretch;
    padding: 1vh 1vw; /* add inner safe-space so hover lift isn't clipped */
    box-sizing: border-box;
}

.services.section-full .service-card {
    height: 100%;
    max-height: 100%;
    padding: 1.2vh 1vw;
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* icon, title, body, price */
    row-gap: 0.6vh;
    align-content: start;
}

@media (max-width: 1200px) {
    .services.section-full .section-header { flex-basis: 18vh; }
}

@media (max-width: 1024px) {
    .services.section-full .services-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 1.2vh 2vw;
        padding: 1vh 2vw;
    }
}

@media (max-width: 600px) {
    .services.section-full .container { padding: 1.2vh 3vw; }
    .services.section-full .section-header { flex-basis: 18vh; }
    .services.section-full .services-grid { gap: 1vh 3vw; padding: 1vh 3vw; }
    .services.section-full .service-card { padding: 1vh 2.5vw; }
}

/* Keep price indicators fully visible and a bit higher */
.services.section-full .service-price {
    align-self: end;
    margin-top: 0.4vh;
}

.services.section-full .service-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0.4vh;
}

.services.section-full .service-card h3 {
    margin-bottom: 0.2vh;
}

.services.section-full .service-card p {
    margin-bottom: 0.6vh;
}

.services.section-full .service-features {
    margin-bottom: 0.4vh;
}

.services.section-full .service-features li {
    padding: 0.2vh 0 0.2vh var(--space-lg);
    line-height: 1.2;
}

/* ========================================
    CV: scroll only inside main column
    - Keep section 100vh
    - Header fixed height within section
    - Only .cv-main scrolls; sidebar stays static
    - Ensure proper height containment for scrolling
======================================== */
.cv.section-full .container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 2vh 2vw;
    box-sizing: border-box;
}

.cv.section-full .section-header {
    flex: 0 0 16vh;
    margin-bottom: 1.5vh;
    display: grid;
    place-content: center;
}

.cv.section-full .cv-content {
    flex: 1 1 auto;
    min-height: 0; /* allow child to shrink for overflow */
    overflow: hidden; /* prevent outer card from scrolling */
}

/* Sidebar stays static; main becomes the scroll area */
.cv.section-full .cv-content .cv-sidebar {
    overflow-y: auto;
    height: 100%;
}

.cv.section-full .cv-content .cv-main {
    overflow: auto;
    max-height: 100%;
    min-height: 0;
}

/* Optional: nicer scrollbar for the CV main column only */
.cv.section-full .cv-content .cv-main::-webkit-scrollbar {
    width: 10px;
}
.cv.section-full .cv-content .cv-main::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
.cv.section-full .cv-content .cv-main::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}
.cv.section-full .cv-content .cv-main::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ========================================
     Desktop-only: add 30px top margin to content
     and reduce container height accordingly to keep 100vh fit
======================================== */
@media (min-width: 1025px) {
    .section-full .container {
        margin-top: 30px;
        height: calc(100vh - 30px);
    }
    /* Sections with explicit container heights: match the calc height */
    .services.section-full .container,
    .cv.section-full .container {
        height: calc(100vh - 30px);
    }
}