/* Lenis Smooth Scroll CSS */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

:root {
    --bg-dark: #030712;
    --bg-surface: #111827;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-tech: 'Orbitron', sans-serif;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-bg: rgba(3, 7, 18, 0.8);
    --hero-gradient: linear-gradient(to bottom right, #fff 50%, #94a3b8);
    --glow: rgba(99, 102, 241, 0.7);
    --glow-secondary: rgba(14, 165, 233, 0.4);
}

body.light-mode {
    --bg-dark: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(248, 250, 252, 0.8);
    --hero-gradient: linear-gradient(to bottom right, #0f172a 50%, #334155);
    --glow: rgba(14, 165, 233, 0.7);
    --glow-secondary: rgba(99, 102, 241, 0.2);
}

/* 3D Tilt Container */
.featured-project {
    perspective: 1000px;
}

.project-info-modern, .mockup-showcase {
    transition: transform 0.2s ease-out;
}

/* Cyber Loader */
.cyber-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #030712;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s;
}

.loader-content {
    text-align: center;
    width: 300px;
}

.loader-logo {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.loader-logo-img {
    height: 350px;
    width: auto;
    filter: invert(1) hue-rotate(180deg) brightness(1.5) contrast(1.2);
    mix-blend-mode: screen;
    margin: -100px 0;
    display: block;
    opacity: 1 !important;
}

body.light-mode .loader-logo-img {
    filter: none;
    mix-blend-mode: multiply;
}

.loader-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    box-shadow: 0 0 15px var(--primary);
}

.loader-status {
    font-family: var(--font-tech);
    font-size: 0.7rem;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Scanline effect for loader */
.cyber-loader::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
}

body.light-mode #starfield {
    opacity: 0;
}

body.light-mode .cyber-loader {
    background: #f8fafc;
}

body.light-mode .loader-logo { color: #0f172a; }

body.light-mode::before {
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 40%);
}

body.light-mode .featured-project {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

body.light-mode .laptop-mockup .screen,
body.light-mode .phone-mockup {
    border-color: #1e293b; /* Colore scuro per la struttura del mockup */
    background: #0f172a;   /* Sfondo scuro interno */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

body.light-mode .laptop-mockup .base {
    background: #334155;
}

body.light-mode .card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body.light-mode .contact-item {
    background: rgba(255, 255, 255, 0.7);
}

body.light-mode .img-frame {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

body.light-mode .card:hover {
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
    border-color: var(--primary);
}

.fa-sun { display: none; }
body.light-mode .fa-sun { display: block; }
body.light-mode .fa-moon { display: none; }

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

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

/* Moving Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.05) 0%, transparent 40%);
    z-index: -1;
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

section {
    padding: 8rem 0;
}

.section-title {
    font-family: var(--font-tech);
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-title.centered::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-title.centered {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.centered { text-align: center; }

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1.25rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 140px;
    width: auto;
    display: block;
    transition: var(--transition);
    margin: -50px 0;
    /* Invertiamo per rendere lo sfondo nero (poi trasparente con screen) 
       e ruotiamo la tonalità di 180° per riportare il giallo al blu/ciano */
    filter: invert(1) hue-rotate(180deg) brightness(1.5) contrast(1.2);
    mix-blend-mode: screen;
}

.logo:hover .logo-img {
    transform: scale(1.08);
}

body.light-mode .logo-img {
    filter: none;
    mix-blend-mode: multiply;
    height: 140px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.mobile-profile-container {
    display: none;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-links a:hover { 
    color: var(--primary); 
    opacity: 1;
    transform: translateY(-2px);
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.pre-title {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 6px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.hero h1 {
    font-family: var(--font-tech);
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: var(--hero-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin-bottom: 3rem;
}

.btn {
    display: inline-block;
    padding: 1.1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: var(--font-tech);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.6);
}

.btn-outline {
    border: 2px solid var(--border);
    color: var(--text-main);
    margin-left: 1.5rem;
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    transform: translateY(-5px);
}

.cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background: var(--bg-surface);
    padding: 3.5rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px -10px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--border);
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 30px 60px -15px rgba(0, 0, 0, 0.6),
        0 0 30px -5px var(--glow),
        0 0 60px -10px var(--glow-secondary);
}

.featured-project {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    align-items: center;
    background: rgba(17, 24, 39, 0.4);
    padding: 5rem;
    border: 1px solid var(--border);
    border-radius: 40px;
    margin: 6rem 0;
    backdrop-filter: blur(15px);
    transition: var(--transition);
    box-shadow: 
        0 20px 50px -10px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--border);
}

.featured-project:hover {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 
        0 40px 100px -20px rgba(0, 0, 0, 0.7),
        0 0 40px -10px var(--glow),
        0 0 80px -20px var(--glow-secondary);
}

body.light-mode .card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 
        0 10px 40px -10px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
}

body.light-mode .card:hover {
    border-color: var(--secondary);
    box-shadow: 
        0 30px 70px -15px rgba(0, 0, 0, 0.1),
        0 0 30px -5px var(--glow),
        0 0 50px -10px var(--glow-secondary);
}

body.light-mode .featured-project {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 20px 60px -15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.03);
}

body.light-mode .featured-project:hover {
    background: #ffffff;
    border-color: var(--secondary);
    box-shadow: 
        0 40px 90px -20px rgba(0, 0, 0, 0.08),
        0 0 40px -10px var(--glow),
        0 0 70px -20px var(--glow-secondary);
}

.card h3 {
    font-family: var(--font-tech);
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

.card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.card p {
    position: relative;
    z-index: 1;
}

.card:hover .icon {
    transform: scale(1.2) rotate(10deg);
}

.about .grid { grid-template-columns: 1fr 1fr; gap: 6rem; align-items: center; }

.img-frame {
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
}

.img-frame::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.img-frame img { 
    width: 100%; 
    display: block; 
    border-radius: 20px;
    transition: var(--transition);
}

.img-frame:hover img {
    transform: scale(1.05);
}

.stats { display: flex; gap: 3rem; margin-top: 3rem; }
.stat-item span { 
    display: block; 
    font-size: 2.5rem; 
    font-family: var(--font-tech); 
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.stat-item p {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.projects-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

/* Modern Project Showcase */
.featured-project.reverse {
    direction: rtl;
}

.featured-project.reverse .project-info-modern,
.featured-project.reverse .mockup-showcase {
    direction: ltr;
}

.category-tag {
    color: var(--secondary);
    font-family: var(--font-tech);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    display: block;
    font-weight: 700;
}

.project-info-modern h3 {
    font-family: var(--font-tech);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.project-features {
    list-style: none;
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.project-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.project-features i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Mockups */
.mockup-showcase {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.laptop-mockup {
    width: 100%;
    max-width: 580px;
    position: relative;
    z-index: 1;
    animation: floatLaptop 6s ease-in-out infinite;
}

@keyframes floatLaptop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.laptop-mockup .screen {
    background: #0f172a;
    border: 8px solid #334155;
    border-radius: 12px 12px 0 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.laptop-mockup .screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.laptop-mockup .base {
    height: 10px;
    background: #475569;
    width: 112%;
    margin-left: -6%;
    border-radius: 0 0 12px 12px;
}

.phone-mockup {
    width: 170px;
    height: 340px;
    background: #0f172a;
    border: 8px solid #334155;
    border-radius: 28px;
    position: absolute;
    right: -30px;
    bottom: -40px;
    z-index: 2;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    animation: floatPhone 6s ease-in-out infinite 1s;
}

@keyframes floatPhone {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(2deg); }
}

.phone-mockup .screen {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.phone-mockup .screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.phone-mockup.only-mobile {
    position: relative;
    right: auto;
    bottom: auto;
    width: 280px;
    height: 560px;
    margin: 0 auto;
    border-width: 10px;
    border-radius: 40px;
}

.project-card {
    border: 1px solid var(--border);
    padding: 2rem;
    position: relative;
    background: #111;
}

.link-neon {
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-family: var(--font-tech);
}

/* Contatti */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3.5rem;
}

.contact-item {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    padding: 1.25rem 2.5rem;
    border: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    font-family: var(--font-tech);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-item i {
    color: var(--primary);
    font-size: 1.4rem;
}

.contact-item:hover {
    border-color: var(--primary);
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.3);
    transform: translateY(-8px);
    background: rgba(99, 102, 241, 0.05);
}

/* Footer */
footer {
    padding: 6rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg-dark);
}

.social-links-footer {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.social-links-footer a {
    color: var(--text-muted);
    font-size: 1.75rem;
    transition: var(--transition);
}

.social-links-footer a:hover {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
    transform: scale(1.25) translateY(-5px);
}

footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

/* Reveal Animations */
.section-reveal {
    opacity: 0;
    transform: translateY(60px) scale(0.98);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered Reveal for children */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-reveal.active .reveal-item {
    opacity: 1;
    transform: translateY(0);
}

/* Burger Menu Styles */
.burger {
    display: none;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

.burger div {
    width: 30px;
    height: 2px;
    background-color: var(--text-main);
    margin: 6px;
    transition: var(--transition);
    border-radius: 2px;
}

.project-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

.project-link i {
    font-size: 0.8rem;
    margin-left: 5px;
    vertical-align: middle;
}

.project-details-hidden {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}

.featured-project.expanded .project-details-hidden {
    max-height: 500px; /* Valore sufficiente per contenere il testo */
    opacity: 1;
    margin-top: 1.5rem;
}

.btn-expand {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-family: var(--font-tech);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-expand:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-expand i {
    transition: transform 0.4s ease;
}

.featured-project.expanded .btn-expand i {
    transform: rotate(180deg);
}

.text-collapse { display: none; }
.featured-project.expanded .text-expand { display: none; }
.featured-project.expanded .text-collapse { display: inline; }

@media (max-width: 992px) {
    .featured-project, .featured-project.reverse {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
        gap: 4rem;
        direction: ltr;
        text-align: center;
    }

    .project-features {
        justify-content: center;
    }
    
    .mockup-showcase {
        margin-top: 3rem;
        min-height: auto;
    }

    .laptop-mockup {
        max-width: 400px;
        margin: 0 auto;
    }

    .phone-mockup {
        width: 100px;
        height: 200px;
        right: 5%;
    }
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    z-index: 1001;
}

@media (max-width: 768px) {
    section { padding: 4rem 0; }
    
    .container { padding: 0 1.5rem; }

    .section-title { font-size: 2rem; }
    .section-title::after { width: 40px; }

    .about .grid { 
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-img {
        max-width: 280px;
        margin: 0 auto;
    }

    .about-text {
        text-align: center;
    }

    .about-text .stats {
        justify-content: center;
        gap: 1.5rem;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
        margin-left: 1rem;
        font-size: 1rem;
    }

    /* Mobile Nav */
    .burger { display: block; }

    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0;
        background-color: var(--bg-surface);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        padding: 2rem;
    }

    .nav-links li {
        margin: 1.5rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 1.25rem;
        font-family: var(--font-tech);
        display: block;
        padding: 10px;
    }

    /* Mobile Profile Container */
    .mobile-profile-container {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 2rem;
        padding-top: 2rem;
    }

    .mobile-profile-pic {
        width: 200px;
        height: 200px;
        border-radius: 50%;
        border: 3px solid var(--primary);
        overflow: hidden;
        box-shadow: 0 0 20px var(--glow);
        transform: scale(0.8);
        opacity: 0;
        transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* Loader Mobile Fix */
    .loader-content {
        width: 90%;
        max-width: 300px;
    }

    .loader-logo-img {
        height: 220px;
        margin: -40px 0;
    }


    .nav-active .mobile-profile-pic {
        transform: scale(1);
        opacity: 1;
        transition-delay: 0.4s;
    }

    .mobile-profile-pic img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .nav-active {
        transform: translateX(0%);
    }

    /* Burger Animation */
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); background: var(--primary); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); background: var(--primary); }

    /* Hero Mobile */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 120px 0 60px;
        text-align: center;
    }

    .hero h1 { 
        font-size: 2.2rem; 
        margin-bottom: 1.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin: 0 auto 2.5rem;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .btn-outline { margin-left: 0; }
    
    .mockup-showcase {
        min-height: 300px;
        margin-top: 2rem;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .laptop-mockup {
        width: 85%;
        max-width: 320px;
        margin: 0 auto;
    }

    .phone-mockup {
        width: 70px;
        height: 140px;
        right: 10px;
        bottom: -15px;
    }

    /* Contact Mobile */
    .contact-links { 
        flex-direction: column; 
        gap: 1rem; 
        align-items: center;
        width: 100%;
    }
    .contact-item { 
        width: 100%;
        max-width: 300px;
        justify-content: center; 
    }

    .featured-project {
        padding: 3rem 1rem;
        margin: 3rem 0;
        gap: 3rem;
        border-radius: 20px;
        width: 100%;
        overflow: hidden; /* Ensure nothing leaks out */
    }

    .project-info-modern h3 {
        font-size: 1.8rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .mockup-showcase {
        min-height: 250px;
        margin-top: 2rem;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .laptop-mockup {
        width: 80%;
        max-width: 300px;
        margin: 0 auto;
        position: relative;
    }

    .laptop-mockup .base {
        width: 110%;
        margin-left: -5%;
    }

    .phone-mockup {
        display: block !important;
        width: 100px;
        height: 200px;
        position: absolute;
        right: 5%; /* Improved positioning for mobile */
        bottom: -15px;
        z-index: 5;
    }

    .phone-mockup.only-mobile {
        width: 220px;
        height: 440px;
        position: relative;
        right: auto;
        bottom: auto;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .stat-item span { font-size: 1.75rem; }
    .phone-mockup { 
        width: 80px;
        height: 160px;
        right: 5%;
    }
    .laptop-mockup { width: 90%; }
}