/* Preloader Core */
#preloader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preloader-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.preloader-counter {
    font-family: var(--font-heading);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 800;
    color: var(--fg);
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -5px;
}

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

.preloader-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s ease;
}

.preloader-status {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--fg-muted);
    text-transform: uppercase;
}

/* Configuration & Variables */
:root {
    --bg: #000000;
    --fg: #ffffff;
    --fg-muted: #888888;
    --accent: #0066ff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --header-height: 6rem;
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default for custom cursor */
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 4vw;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    /* Prioritize the first column slightly */
    gap: 8vw;
    align-items: center;
}

.about .grid-2 {
    grid-template-columns: 1.5fr 1fr;
    /* Give image section massive space */
}

/* Custom Cursor */
.cursor {
    width: 10px;
    height: 10px;
    background: var(--fg);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--fg-muted);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--fg);
    letter-spacing: -1px;
}

.brand span {
    font-size: 0.8rem;
    vertical-align: top;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--fg-muted);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.btn-minimal {
    border: 1px solid var(--border);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-bottom: 8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: visible;
    padding-top: 0;
    /* hero-content handles top offset */
}

.hero-content {
    padding-top: calc(var(--header-height) + 1rem);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.glow-sphere {
    position: absolute;
    top: 20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.15) 0%, transparent 70%);
    filter: blur(100px);
}

.hero-tagline {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--fg-muted);
    display: block;
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 0.85;
    letter-spacing: -4px;
}

.title-row {
    display: block;
}

.outline {
    -webkit-text-stroke: 1px var(--fg);
    color: transparent;
}

.hero-bio {
    max-width: 450px;
    margin-top: 4rem;
    color: var(--fg-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

.scroll-status {
    position: absolute;
    bottom: 4rem;
    right: 4vw;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* Increased gap for better breathing room */

    /* New Styles */
    background: linear-gradient(135deg, #1e1e2e, #2a2a40);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    /* Capsule shape */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.scroll-status .line {
    width: 40px;
    height: 2px;
    /* Thicker line for visibility */
    background: #0074d9;
    /* Action color */
    box-shadow: 0 0 10px rgba(0, 116, 217, 0.5);
    /* Subtle glow */
}

.scroll-status .text {
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Optional Pulse Animation */
@keyframes pulse {
    0% {
        opacity: 0.4;
        width: 20px;
    }

    50% {
        opacity: 1;
        width: 40px;
    }

    100% {
        opacity: 0.4;
        width: 20px;
    }
}

/* Marquee Section */
.immersive-text {
    padding: 10vh 0;
    margin-top: 6rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 5rem;
    text-transform: uppercase;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* About Section */
.about {
    padding: 20vh 0;
}

.about-visual {
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 1800px;
    /* Massive size (approx 3X current look) */
    aspect-ratio: 6/7;
    /* Taller cinematic look */
    border-radius: 40px;
    overflow: visible;
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    filter: grayscale(100%) brightness(0.8);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid var(--border);
}

.image-wrapper:hover .about-image {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.02);
}

.floating-info {
    position: absolute;
    bottom: -30px;
    right: -30px;
    z-index: 5;
    min-width: 220px;
    transform: translate(0, 0);
    transition: transform 0.6s ease;
}

.status-top {
    margin-bottom: 2.5rem;
    display: inline-block;
    min-width: 280px;
}

.visual-card {
    background: linear-gradient(135deg, #1e1e2e, #2a2a40);
    /* Dark base */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    /* Depth effect */
    transition: transform 0.3s ease;
}

.card-tag {
    background: #0074d9;
    /* Blue tag */
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.visual-card p {
    color: #ffffff;
    font-weight: 500;
    margin-top: 15px;
}

.about-text p {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--fg-muted);
    margin: 2rem 0;
    line-height: 1.4;
}

.about-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.about-list li {
    font-size: 0.9rem;
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-list span {
    font-size: 1.2rem;
}

/* Work Grid */
.work {
    padding: 15vh 0;
}

.section-heading {
    margin-bottom: 10vh;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
}

.project-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10vw;
}

.project-item {
    position: relative;
}

.project-item.alt {
    margin-top: 25vh;
    /* Pushed further down for better visualization */
}

.media-box {
    width: 100%;
    aspect-ratio: 4/5;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-link:hover .media-box {
    transform: scale(1.05);
    filter: brightness(1.2);
}

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

.project-label {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    background: var(--bg);
    padding: 0.5rem 1rem;
}

.project-info {
    margin-top: 2rem;
}

.info-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--fg-muted);
}

.project-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
}

.project-desc {
    margin-top: 1rem;
    color: var(--fg-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 90%;
}

/* Skills Section */
.skills {
    padding: 15vh 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 102, 255, 0.02));
}

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

.skill-card {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 3.5rem 2.5rem;
    border-radius: 24px;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(0, 102, 255, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.skill-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--accent);
    transition: transform 0.5s ease;
}

.skill-card:hover .skill-icon {
    transform: rotateY(360deg) scale(1.1);
    background: var(--accent);
    color: var(--bg);
}

.skill-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.skill-card p {
    color: var(--fg-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
}

/* Tech Stack Section */
.tech-stack {
    padding: 10vh 0;
}

.stack-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    max-width: 1000px;
}

.stack-tag {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 700;
    color: var(--fg);
    padding: 0.8rem 2rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stack-tag:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* CTA */
.cta {
    padding: 20vh 0;
    text-align: center;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 8rem);
    margin-bottom: 4rem;
}

.accent {
    color: var(--accent);
}

.cta-btn {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 1.5rem 4rem;
    border-radius: 100px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    display: inline-block;
    z-index: 10;
    pointer-events: all;
    background: transparent;
}

.cta-btn:hover {
    background: var(--fg);
    color: var(--bg);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cta-btn:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    color: var(--fg-muted);
    font-size: 0.8rem;
}

.footer-socials {
    display: flex;
    gap: 2rem;
}

.footer-socials a {
    text-decoration: none;
    color: var(--fg);
    /* Change color for visibility */
    font-size: 1.5rem;
    /* Larger icons */
    transition: all 0.4s ease;
}

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

/* Lenis CSS */
html.lenis {
    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;
}

/* --- Mobile Responsive Enhancements --- */

/* Utility for hidden elements on mobile */
.menu-toggle {
    display: none;
}

.mobile-nav {
    display: none;
}

/* 1. Large Screen/Tablet Adjustments */
@media (max-width: 1200px) {
    .container {
        padding: 0 6vw;
    }
    .grid-2, .about .grid-2 {
        gap: 5vw;
    }
    .hero-title {
        font-size: clamp(3.5rem, 10vw, 8rem);
    }
}

/* 2. Tablet & Mobile (992px Breakpoint) */
@media (max-width: 992px) {
    :root {
        --header-height: 5rem;
    }

    /* Navigation */
    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 2001; /* Above mobile overlay */
        padding: 10px;
    }

    .menu-toggle .line {
        width: 25px;
        height: 2px;
        background: var(--fg);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

    /* Menu Open State Logic */
    .menu-open .menu-toggle .line:nth-child(1) {
        transform: translateY(4px) rotate(45deg);
    }
    .menu-open .menu-toggle .line:nth-child(2) {
        transform: translateY(-4px) rotate(-45deg);
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        z-index: 2000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        padding: 2rem;
        backdrop-filter: blur(10px);
    }

    .mobile-nav.active {
        right: 0;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .mobile-nav-link {
        font-family: var(--font-heading);
        font-size: 3rem;
        font-weight: 800;
        text-decoration: none;
        color: var(--fg);
        text-transform: uppercase;
        letter-spacing: -1px;
        transition: color 0.3s ease;
    }

    .mobile-nav-link:hover {
        color: var(--accent);
    }

    .mobile-nav-footer {
        margin-top: 5rem;
    }

    /* Sections */
    .about {
        padding: 10vh 0;
    }

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

    .about-visual {
        order: 1;
    }

    .about-content {
        order: 2;
    }

    .image-wrapper {
        aspect-ratio: 1/1;
        max-width: 500px;
        margin: 0 auto;
    }

    .project-list {
        grid-template-columns: 1fr;
        gap: 8vh;
    }

    .project-item.alt {
        margin-top: 0;
    }

    .project-title {
        font-size: 2rem;
    }

    /* Marquee/Immersive Text Overflow Fix */
    .marquee-content {
        font-size: 15vw; /* Scale with viewport instead of fixed large size */
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* 3. Small Mobile (480px Breakpoint) */
@media (max-width: 480px) {
    .container {
        padding: 0 5vw;
    }

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

    .hero-bio {
        font-size: 1.1rem;
        max-width: 100%;
    }

    .section-title {
        font-size: 2.8rem;
    }

    .cta-title {
        font-size: 3.5rem;
    }

    .cta-btn {
        padding: 1.2rem 2.5rem;
        font-size: 1.2rem;
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        text-align: center;
    }

    .scroll-status {
        bottom: 2rem;
        right: 50%;
        transform: translateX(50%);
    }

    /* Stack cards better */
    .skill-card {
        padding: 2.5rem 1.5rem;
    }

    .status-top {
        min-width: 100%;
    }
}

/* Global Fixes */
body {
    overflow-x: hidden;
}

* {
    max-width: 100%;
}