:root {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --accent-color: #818cf8; /* Brightened slightly for better AA contrast */
    --text-muted: #a1a1aa; /* Increased visibility from #888 for accessibility */
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.03);
    
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    cursor: none; /* Hide default cursor only on body */
}

::-webkit-scrollbar {
    display: none;
}

html.lenis {
  height: auto;
}

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

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

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

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 2rem 5vw;
}

.counter {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 15vw, 15rem);
    font-weight: 800;
    line-height: 0.8;
    color: var(--text-color);
}

.counter::after {
    content: '%';
    font-size: 0.5em;
}

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

.ambient-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -2;
    filter: blur(60px);
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--text-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--accent-color);
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 0 10px var(--accent-color);
}

.custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.1s;
}

.custom-cursor.hover {
    width: 24px;
    height: 24px;
    background-color: var(--accent-color);
    mix-blend-mode: difference;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
}

.section {
    padding: 15vh 0;
}

.section-title {
    font-size: clamp(3rem, 6vw, 6rem);
    margin-bottom: 4rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    z-index: 101;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 101;
}

.hamburger .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-color);
    transition: width 0.3s ease;
}

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.typewriter-cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-color);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-title {
    font-size: clamp(4rem, 9vw, 10rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.line-wrap {
    overflow: hidden;
    display: block;
}

.line {
    display: block;
    transform: translateY(100%);
}

.hero-desc {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    max-width: 600px;
    color: var(--text-muted);
    line-height: 1.5;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 5vh;
    left: 5vw;
    opacity: 0.5;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-color);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { top: 10px; opacity: 1; }
    100% { top: 25px; opacity: 0; }
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-text {
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    line-height: 1.6;
    color: var(--text-muted);
}

.about-text p {
    margin-bottom: 2rem;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

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

.stat-num {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 1rem;
    transition: transform 0.3s, background 0.3s;
    backdrop-filter: blur(10px);
}

.skill-category:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.skill-category p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Projects */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: background 0.3s;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.project-role {
    color: var(--accent-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.project-title {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 1.5rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-tags span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Hobbies Background & Parallax */
.hobbies {
    position: relative;
    overflow: hidden;
}

.hobbies-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160%; /* Even taller for more movement */
    z-index: -1;
    pointer-events: none;
    opacity: 0.12;
}

.car-bg-layer {
    position: absolute;
    width: 45%;
    height: auto;
    max-height: 80%;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.7) contrast(1.2);
    will-change: transform;
    pointer-events: none;
}

.bmw-bg-1 { left: -5%; top: 0; }
.porsche-bg-1 { right: -5%; top: 20%; }
.bmw-bg-2 { left: 20%; top: 50%; }
.porsche-bg-2 { right: 20%; top: 70%; }

.hobbies-text {
    font-size: clamp(1.2rem, 2vw, 2rem);
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 1000px;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    padding-bottom: 2rem;
}

.footer-title {
    font-size: clamp(3rem, 8vw, 8rem);
    margin-bottom: 4rem;
    text-align: center;
}

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

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    text-transform: uppercase;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

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

/* Highlighted Project Card */
.highlight-card {
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(99, 102, 241, 0.08) 100%);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
    position: relative;
    overflow: hidden;
    animation: featured-border-glow 4s infinite alternate;
}

.highlight-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.highlight-card:hover::before {
    left: 100%;
}

@keyframes featured-border-glow {
    0% { border-color: rgba(99, 102, 241, 0.3); box-shadow: 0 0 20px rgba(99, 102, 241, 0.1); }
    100% { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 50px rgba(99, 102, 241, 0.2); }
}

.highlight-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.highlight-badge i {
    margin-right: 0.5rem;
}

/* Read More Button */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-read-more i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-read-more:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.btn-read-more:hover i {
    transform: translateX(5px);
}

/* Footer Icons */
.footer-icon-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 2rem;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-icon-link:hover {
    color: var(--accent-color);
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 10vh 0;
    }
    
    .section-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
        margin-bottom: 2rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 9vw, 4rem);
        line-height: 1.1;
    }
    
    .stat-num {
        font-size: 4rem;
    }

    .navbar {
        padding: 1.5rem 5vw;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        justify-content: center;
        z-index: 100;
    }

    .nav-links.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.5rem;
        display: block;
        padding: 1rem;
    }



    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 2rem;
        margin-top: 2rem;
    }

    .stat-num {
        font-size: 3.5rem;
    }

    .custom-cursor, .custom-cursor-follower {
        display: none;
    }
    * {
        cursor: auto !important;
    }
    
    .footer-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
        margin-bottom: 2rem;
    }
    
    .footer-links {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    /* Mobile specific adjustments for new elements */
    .project-gallery-inline {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .gallery-thumb {
        width: calc(50% - 0.5rem);
        height: 80px;
    }

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

    .hobbies-bg {
        opacity: 0.08; /* Even more subtle on mobile */
    }

    .car-bg-layer {
        width: 60%;
        height: 40%;
    }

    .bmw-bg-2, .porsche-bg-2 {
        display: none; /* Hide extra layers on mobile to keep it clean */
    }
}

@media (max-width: 480px) {
    .section {
        padding: 8vh 0;
    }

    .about-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .stat-num {
        font-size: 2.8rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .project-card {
        padding: 2rem 1.5rem;
    }
}

/* New Gallery & 3D Effects */
.project-gallery-inline {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.gallery-thumb {
    width: 100px;
    height: 70px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumb:hover img {
    transform: scale(1.2);
}

.graphic-showcase {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.graphic-showcase h4 {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.design-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.design-item {
    border-radius: 0.8rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    perspective: 1000px;
}

.design-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.design-item:hover img {
    transform: rotateY(15deg) rotateX(10deg) scale(1.05);
}

.car-enthusiast-gallery {
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
    perspective: 2000px;
}

.car-card {
    flex: 1;
    position: relative;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s ease;
    transform-style: preserve-3d;
}

.car-card:hover {
    transform: rotateX(10deg) rotateY(-10deg) translateY(-20px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    background: rgba(255, 255, 255, 0.06);
}

.car-img-stack {
    position: relative;
    height: 250px;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
}

.car-img-stack img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.car-img-stack img:last-child {
    opacity: 0;
}

.car-card:hover .car-img-stack img:first-child {
    opacity: 0;
    transform: scale(1.1);
}

.car-card:hover .car-img-stack img:last-child {
    opacity: 1;
    transform: scale(1.05);
}

.car-label {
    display: block;
    margin-top: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .car-enthusiast-gallery {
        flex-direction: column;
    }
    .car-img-stack {
        height: 200px;
    }
}
