:root {
    --bg-dark: #050505;
    --bg-card: rgba(20, 20, 20, 0.4);
    --primary: #a855f7;
    --secondary: #3b82f6;
    --accent: #ec4899;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glow: 0 0 20px rgba(168, 85, 247, 0.3);
    --font-main: 'Outfit', sans-serif;
    --font-logo: 'Syncopate', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body:not(.touch-device) * {
    cursor: none !important;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Particle Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.mesh-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    filter: blur(80px);
}

/* Custom Cursor */
.custom-cursor {
    width: 40px;
    height: 40px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.8rem 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-logo);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(var(--glow));
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8rem 2rem 6rem;
    /* Enhanced breathing room for nav */
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
}

.hero-text {
    flex: 1;
    text-align: left;
}


.hero-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.85;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: -4px;
    font-weight: 900;
    position: relative;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #fff, var(--primary), var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShine 4s linear infinite;
    display: inline-block;
}

@keyframes gradientShine {
    0% {
        background-position: 0% central;
    }

    100% {
        background-position: 200% central;
    }
}

.hero-subtitle {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 0 3.5rem;
    font-weight: 300;
    letter-spacing: 1px;
    line-height: 1.8;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

/* Admin Photo Section - Final Refined UI */
.admin-photo-section {
    flex: 0 0 420px;
}

.admin-photo-container {
    position: relative;
    width: 420px;
    height: 420px;
    margin: 0;
    perspective: 1000px;
    z-index: 10;
}

.admin-photo-frame {
    width: 100%;
    height: 100%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 3px;
    animation: morphFloat 12s ease-in-out infinite;
    position: relative;
    z-index: 2;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.admin-photo {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: top center;
    /* Better framing for portraits */
    background: var(--bg-dark);
}

.frame-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    animation: pulseAura 6s ease-in-out infinite;
}

@keyframes pulseAura {

    0%,
    100% {
        opacity: 0.1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.25;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

@keyframes crystalShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes morphFloat {

    0%,
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translateY(0);
    }

    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: translateY(-20px);
    }
}

/* Sections Global */
section {
    padding: 12rem 2rem;
    /* Increased desktop vertical rhythm */
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 6rem;
    text-align: center;
    letter-spacing: -1px;
}

/* Glassmorphic Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    padding: 3.5rem 2.5rem;
    border-radius: 3rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--inner-glow);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(192, 38, 211, 0.1), transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: rgba(192, 38, 211, 0.5);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), var(--glow);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(192, 38, 211, 0.3));
}

.skill-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.skill-description {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Project Cards */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.project-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    transform-style: preserve-3d;
}

.project-item:nth-child(even) {
    direction: rtl;
}

.project-item:nth-child(even)>* {
    direction: ltr;
}

.project-image-box {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 2rem;
    overflow: hidden;
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.project-image-box:hover {
    transform: perspective(1000px) rotateY(10deg) scale(1.02);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
}

.project-info h3 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hyper-Advanced Contact Reveal (Cyber-Glass) */
.contact-section {
    perspective: 2000px;
    overflow: hidden;
    position: relative;
    padding: 10rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.energy-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.contact-section.reveal-active .energy-ripple {
    animation: energyBlast 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes energyBlast {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(800);
        opacity: 0;
    }
}

.contact-title {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.1rem;
    position: relative;
    z-index: 2;
    font-size: 2.2rem;
    /* Ensure consistent size */
}

.contact-title span {
    display: inline-block;
    opacity: 0;
    transform: translateZ(-500px) rotateY(90deg) scale(0.5);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-title span.space {
    width: 1.5rem;
    /* Controlled space between words */
}

.contact-section.reveal-active .contact-title span {
    opacity: 1;
    transform: translateZ(0) rotateY(0) scale(1);
    transition-delay: calc(var(--char-index) * 0.05s);
}

.contact-btns {
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tilt-card {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

.tilt-card i {
    transform: translateZ(30px);
    /* Internal 3D pop */
}

.contact-section::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg,
            transparent,
            rgba(168, 85, 247, 0.1),
            transparent);
    transform: rotate(-45deg);
    pointer-events: none;
    z-index: 3;
}

.contact-section.reveal-active::before {
    animation: contactShimmer 2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes contactShimmer {
    0% {
        transform: translate(-100%, -100%) rotate(-45deg);
    }

    100% {
        transform: translate(100%, 100%) rotate(-45deg);
    }
}

/* Contact Button */
.contact-btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 3rem;
    font-family: var(--font-logo);
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: var(--transition);
    box-shadow: var(--glow);
    margin: 0;
}

.contact-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.5);
}

/* Footer */
footer {
    padding: 6rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

@media (max-width: 900px) {
    section {
        padding: 8rem 1.5rem;
        /* Reduced for better mobile flow */
    }

    .hero {
        padding: 6rem 1.5rem 4rem;
    }

    .nav-container {
        padding: 0 1.5rem;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
        padding-top: 2rem;
    }

    .hero-text {
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto 2.5rem;
    }

    .hero-btns {
        justify-content: center;
    }

    .admin-photo-container {
        width: 200px;
        height: 200px;
        margin: 1.5rem auto 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: 0.5s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 999;
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-item {
        font-size: 1.2rem;
    }

    .menu-btn {
        display: block;
        cursor: pointer;
        z-index: 1001;
        width: 30px;
        height: 20px;
        position: relative;
    }

    .menu-line,
    .menu-line::before,
    .menu-line::after {
        width: 30px;
        height: 2px;
        background: var(--text-main);
        position: absolute;
        transition: 0.3s;
    }

    .menu-line::before {
        content: '';
        top: -8px;
    }

    .menu-line::after {
        content: '';
        top: 8px;
    }

    .menu-btn.active .menu-line {
        background: transparent;
    }

    .menu-btn.active .menu-line::before {
        transform: rotate(45deg);
        top: 0;
    }

    .menu-btn.active .menu-line::after {
        transform: rotate(-45deg);
        top: 0;
    }

    .desktop-br {
        display: none;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: 0.5s;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .project-item {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* --- Premium Mobile Strengthening --- */
@media (max-width: 600px) {

    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        background: rgba(15, 15, 15, 0.7);
        backdrop-filter: blur(25px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 2rem;
        padding: 0.8rem 1.5rem;
        justify-content: space-between;
        align-items: center;
        z-index: 2000;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .bottom-nav-item {
        color: var(--text-dim);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 0.6rem;
        font-family: var(--font-mono);
        transition: var(--transition);
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
    }

    .bottom-nav-item.active {
        color: var(--primary);
        filter: drop-shadow(0 0 8px var(--primary));
    }

    /* Staggered Menu Animations */
    .nav-links.active .nav-item {
        animation: menuEntry 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
        opacity: 0;
    }

    .nav-links.active .nav-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-links.active .nav-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .nav-links.active .nav-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    @keyframes menuEntry {
        from {
            opacity: 0;
            transform: translateX(30px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Liquid Metal Border Effect */
    .skill-card::after,
    .project-image-box::after {
        content: '';
        position: absolute;
        inset: -1px;
        background: linear-gradient(90deg,
                transparent,
                rgba(168, 85, 247, 0.2),
                rgba(59, 130, 246, 0.2),
                transparent);
        background-size: 200% 100%;
        animation: liquidBorder 4s linear infinite;
        border-radius: inherit;
        z-index: -1;
        pointer-events: none;
    }

    @keyframes liquidBorder {
        0% {
            background-position: 200% 0%;
        }

        100% {
            background-position: -200% 0%;
        }
    }

    /* Hero Text Float */
    .hero-title {
        animation: floatMobile 6s ease-in-out infinite;
    }

    @keyframes floatMobile {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-10px);
        }
    }

    /* Padding for bottom nav */
    body {
        padding-bottom: 120px;
        /* Precise buffer for new bottom nav */
    }

    section {
        padding: 4rem 1.2rem;
        /* Balanced for mobile focus */
    }

    .skill-card {
        padding: 3rem 1.5rem;
        /* Balanced card internals */
        border-radius: 2rem;
    }

    .project-image-box {
        border-radius: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Vibrant Mobile Mesh Gradient */
    .mesh-gradient {
        background:
            radial-gradient(at 10% 20%, rgba(168, 85, 247, 0.3) 0px, transparent 50%),
            radial-gradient(at 90% 80%, rgba(59, 130, 246, 0.2) 0px, transparent 50%),
            radial-gradient(at 50% 50%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
        filter: blur(60px);
    }

    .skill-card {
        padding: 2.5rem 1.5rem;
        border-radius: 2rem;
    }

    .skill-title {
        font-size: 1.4rem;
        letter-spacing: -0.2px;
    }

    .section-title {
        margin-bottom: 4rem;
    }
}

.bottom-nav {
    display: none;
}