@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --accent: #f093fb;
    --bg-darker: #060614;
    --bg-dark: #0c0c24;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(5, 5, 16, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    width: 100%;
}

html::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, and Opera */
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
}

/* Background Elements */

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 85% 20%, rgba(79, 172, 254, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(240, 147, 251, 0.06) 0%, transparent 60%),
        radial-gradient(circle at 80% 85%, rgba(0, 242, 254, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(79, 172, 254, 0.08) 0%, transparent 55%);
    background-color: var(--bg-darker);
    z-index: -2;
    pointer-events: none;
}

/* Elegant Tech Grid Overlay */
.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
    mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
    opacity: 0.8;
}

/* 3D Starfield Container */
.stars-3d-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    perspective: 800px;
    z-index: -1;
}

/* 3D Star Layers */
.stars-layer {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

.stars-layer-1 {
    background-image: 
        radial-gradient(1px 1px at 15% 15%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 35% 45%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1.5px 1.5px at 55% 25%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 75% 65%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 95% 35%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 20% 85%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 45% 75%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1.5px 1.5px at 65% 90%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 85% 70%, rgba(255, 255, 255, 0.3), transparent);
    background-repeat: repeat;
    background-size: 300px 300px;
    animation: zoomStars 28s linear infinite;
    opacity: 0.6;
}

.stars-layer-2 {
    background-image: 
        radial-gradient(1.5px 1.5px at 25% 10%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 45% 55%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 70% 20%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 80% 60%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 15% 75%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 50% 80%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(2px 2px at 85% 85%, rgba(255, 255, 255, 0.5), transparent);
    background-repeat: repeat;
    background-size: 400px 400px;
    animation: zoomStars 20s linear infinite;
    animation-delay: -7s;
    opacity: 0.7;
}

.stars-layer-3 {
    background-image: 
        radial-gradient(2px 2px at 10% 30%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2.5px 2.5px at 50% 30%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2.5px 2.5px at 30% 70%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 70% 80%, rgba(255, 255, 255, 0.5), transparent);
    background-repeat: repeat;
    background-size: 500px 500px;
    animation: zoomStars 14s linear infinite;
    animation-delay: -9.3s;
    opacity: 0.8;
}

/* GPU-Accelerated 3D Zoom Effect */
@keyframes zoomStars {
    0% {
        transform: translate3d(0, 0, -800px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 0, 400px);
        opacity: 0;
    }
}

/* Typography Customization */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
/* Navigation Redesign */
nav {
    position: fixed;
    top: 1.5rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 90%;
    max-width: 1200px;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 10, 32, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: all 0.4s var(--transition);
}

nav.scrolled {
    top: 0.5rem;
    width: 95%;
    background: rgba(5, 5, 16, 0.98);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
}

.mobile-toggle .bar {
    width: 25px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: 0.3s var(--transition);
}

.mobile-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: var(--primary);
}

.mobile-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--primary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    transition: 0.3s var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(0, 242, 254, 0.1);
}

.nav-links a.active {
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
    background: rgba(0, 242, 254, 0.15);
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s var(--transition);
    box-shadow: 0 0 10px var(--primary);
}

.nav-links a.active::before {
    width: 40%;
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-header,
.mobile-menu-footer {
    display: none;
}

.nav-cta .btn-secondary {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
}

.nav-cta .btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 0 4rem 0;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 700px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.image-wrapper {
    width: auto;
    /* Shrink wrap width to match the image precisely */
    max-width: 380px;
    height: 380px;
    border-radius: 12px;
    /* Tiny rounded corners */
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 2px;
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.2);
    /* Performance & Smoothness stuff */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Fix for overflow: hidden + border-radius */
    transition: transform 0.5s var(--transition), box-shadow 0.5s var(--transition);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Show full image without cropping */
    background: var(--bg-darker);
    /* Fill any empty space with background color so the border doesn't look completely empty */
    border-radius: 10px;
    /* Slightly smaller rounded corners to fit inside the wrapper */
    /* Ensure image also gets hardware acceleration */
    transform: translateZ(0);
    will-change: transform;
}

.image-wrapper:hover {
    transform: scale(1.02) translateY(-10px) translateZ(0);
    box-shadow: 0 15px 60px rgba(0, 242, 254, 0.4);
}

.hero p.tagline {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

@media (max-width: 480px) {
    .hero p.tagline {
        letter-spacing: 0.1em;
        font-size: 0.8rem;
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 10vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p.description {
    font-size: 1.25rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 2.5rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.3);
    border: 1px solid transparent;
}

.btn-primary:hover {
    box-shadow: 0 15px 35px rgba(0, 242, 254, 0.5);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: 0.6s var(--transition);
    pointer-events: none;
    opacity: 0;
}

.btn-primary:hover::after {
    left: 120%;
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

/* Section Styling */
section {
    padding: 5rem 0 6rem 0;
}

#skills {
    /* Compensation for negative margin used for sticky header sync in projects section */
    /* Value should match or exceed the negative margin in .projects-stack */
    padding-top: 500px;
    position: relative;
    z-index: 101;
    /* Stay above the sticky header of projects after it scrolls away */
    pointer-events: none; /* Let clicks pass through the padding area to the last card */
}

#skills > * {
    pointer-events: auto; /* Re-enable clicks for the actual skills content */
}
.reveal {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Sections come from left with a slight swing */
.reveal:nth-of-type(even) {
    transform: translateX(-200px) rotateY(15deg) scale(0.85);
}

/* Sections come from right with a slight swing */
.reveal:nth-of-type(odd) {
    transform: translateX(200px) rotateY(-15deg) scale(0.85);
}

.reveal.active {
    transform: none !important;
    perspective: none;
}

@media (max-width: 768px) {
    .reveal:nth-of-type(even),
    .reveal:nth-of-type(odd) {
        transform: translateY(30px) scale(0.98);
    }
}

.section-head {
    margin-bottom: 1rem;
    text-align: center;
}

.section-head h2 {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.5rem;
}

.section-head .line {
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 0 auto;
    border-radius: 2px;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s var(--transition);
}

@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(5, 5, 16, 0.7);
    transform: translateY(-5px);
}

/* Projects Stack Style */
#projects .section-head {
    position: sticky;
    top: 80px;
    z-index: 100;
    /* Higher than cards to stay visible */
    pointer-events: none;
    margin-bottom: 0;
    padding-bottom: 1rem;
    background: transparent;
}

@media (max-width: 768px) {
    #projects .section-head {
        position: sticky;
        top: 140px;
        z-index: 100;
        padding-bottom: 2rem;
        background: transparent;
        pointer-events: none;
    }
}

.projects-stack {
    display: flex;
    flex-direction: column;
    gap: 40vh;
    /* Increased gap for better stacking scroll */
    margin-top: 25vh;
    /* Increased distance from heading to first card */
    padding-bottom: 0;
    margin-bottom: -480px;
    /* Negative margin to make the section container 'end' at the top of the last card */
    /* This causes the sticky heading to scroll away with the top of the last card */
}

.stack-card {
    position: sticky;
    top: 180px;
    /* Increased offset to create more distance from the sticky title */
    width: 100%;
    height: 480px;
    /* Increased from 460px to give more breathing room */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(10 + var(--card-index, 0));
    /* Ensure later cards are visually above */
    transition: top 0.3s, transform 0.3s;

    /* Hardware acceleration to prevent scroll glitches */
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.stack-card:hover .project-inner {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.project-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    /* Reduced gap */
    width: 100%;
    height: 100%;
    padding: 2.5rem;
    /* Reduced padding */
    background: #0a0a20;
    /* Solid background to fully hide previous cards */
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    /* Stronger shadow for depth */
    border-radius: 40px;
    transition: transform 0.5s var(--transition);

    /* Hardware acceleration and layer caching to prevent glassmorphic scroll glitches */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.project-visual {
    width: 100%;
    height: 100%; /* Stretch vertically to match the card height */
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s var(--transition);
}

.stack-card:hover .project-visual img {
    transform: scale(1.05);
}

.project-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%; /* Take full vertical height of the inner container */
    padding-top: 0.5rem;
}

.project-details h3 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
    line-height: 1.2;
}

.project-details p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
    margin-bottom: 1.5rem;
    width: 100%;
    height: auto; /* Remove strictly fixed height */
    max-height: 80px; /* Limit height to prevent overflow of too many tags */
    overflow: hidden;
    /* Prevent expansion if too many tags */
    align-content: flex-start;
}

.tag {
    flex: 0 0 auto;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--primary);
    white-space: nowrap;
    transition: 0.3s;
}

.tag:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.project-actions {
    margin-top: auto; /* Push actions to the bottom */
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.project-actions .btn {
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
}

/* Tablet Media Queries (max-width: 968px) */
@media (max-width: 968px) {
    .projects-stack {
        gap: 45vh;
        margin-bottom: -500px; /* Matches card height */
    }

    .stack-card {
        top: 150px;
        height: 500px;
    }

    #skills {
        padding-top: 540px; /* Compensation */
    }

    .project-inner {
        gap: 2rem;
        padding: 2rem;
    }

    .project-details h3 {
        font-size: 1.6rem;
    }



    .tech-tags {
        max-height: 75px;
        margin-bottom: 1.25rem;
    }
}

/* Mobile Media Queries (max-width: 768px) */
@media (max-width: 768px) {
    .projects-stack {
        gap: 45vh;
        margin-top: 28vh;
        margin-bottom: -520px; /* Matches card height */
    }

    .stack-card {
        top: 210px;
        height: 520px;
    }

    #skills {
        padding-top: 560px; /* Compensation */
    }

    .project-inner {
        display: flex !important;
        flex-direction: column !important;
        padding: 1.5rem !important;
        gap: 1.25rem !important;
        border-radius: 24px !important;
        text-align: center !important;
    }

    .project-visual {
        height: 160px !important;
        margin-bottom: 0;
    }

    .project-details {
        align-items: center;
        width: 100%;
        height: calc(100% - 172.5px); /* 160px visual + 12.5px gap */
        padding-top: 0;
    }

    .project-details h3 {
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem !important;
    }

    .project-details p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.75rem !important;
    }

    .tech-tags {
        justify-content: center;
        margin-bottom: 1rem;
        max-height: 70px;
        gap: 0.4rem;
        padding: 0;
    }

    .tag {
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
    }

    .project-actions {
        margin-top: auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .project-actions .btn {
        flex: 1;
        width: auto !important;
        justify-content: center;
        padding: 0.7rem 1.2rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
    }
}

/* Small Screen Media Queries (max-width: 480px) */
@media (max-width: 480px) {
    #projects .section-head {
        top: 130px;
    }

    .projects-stack {
        gap: 40vh;
        margin-top: 26vh;
        margin-bottom: -480px; /* Matches card height */
    }

    .stack-card {
        top: 190px;
        height: 480px;
    }

    #skills {
        padding-top: 520px; /* Compensation */
    }

    .project-inner {
        padding: 1.25rem !important;
        gap: 1rem !important;
    }

    .project-visual {
        height: 130px !important;
    }

    .project-details {
        height: calc(100% - 146px); /* 130px visual + 16px gap */
    }

    .project-details h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0.4rem !important;
    }

    .project-details p {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }

    .tech-tags {
        margin-bottom: 0.75rem;
        max-height: 35px;
    }

    .tag {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }

    .project-actions {
        gap: 0.5rem !important;
    }

    .project-actions .btn {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
        gap: 0.4rem;
    }
}


/* About Section Stats */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    align-items: center;
}

.stats-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item strong {
    font-size: 1.5rem;
    display: block;
}

.stat-item span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.about-image-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 350px;
}

@media (max-width: 480px) {
    .about-grid {
        gap: 2rem;
    }

    .stats-container {
        justify-content: space-between;
    }

    .about-image-card {
        height: 280px;
    }
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

@media (max-width: 768px) {
    .contact-grid {
        gap: 2rem;
    }
}


/* The Skills 3D Wheel Drum Style (Cylindrical Auto-Scroll) */
.skills-wheel-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 400px;
    margin: 3rem auto 0 auto;
    background: transparent; /* Seamless floating container */
    border: none;
    overflow: hidden;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    
    /* Transparent gradient mask to fade out items at the top and bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
}

.skills-wheel-container:active {
    cursor: grabbing;
}

/* The mask creates the inward-curved cylinder profile (concave circle) on the right side */
.skills-wheel-mask {
    content: '';
    position: absolute;
    top: -10%;
    right: -130px;
    width: 260px;
    height: 120%;
    background: transparent; /* Fully transparent so background gradients show through */
    border-radius: 50%;
    border-left: 2px solid var(--primary); /* Neon primary curved boundary line */
    box-shadow: -15px 0 35px rgba(0, 242, 254, 0.15); /* Soft outer glow */
    z-index: 15;
    pointer-events: none;
}

.skills-wheel {
    position: relative;
    width: 80%;
    height: 80px; /* Base item height */
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.skills-wheel-item {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 80px;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle dividers */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent; /* Floating look */
}

.skills-wheel-item-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    padding: 0 1.5rem;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center center;
}

.skills-wheel-item-content i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.15));
}

.skills-wheel-item-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Tablet & Mobile responsive sizes */
@media (max-width: 768px) {
    .skills-wheel-container {
        height: 340px;
        border-radius: 28px;
    }

    .skills-wheel-mask {
        right: -100px;
        width: 200px;
    }

    .skills-wheel-item {
        height: 65px;
    }

    .skills-wheel {
        height: 65px;
    }

    .skills-wheel-item-content i {
        font-size: 1.6rem;
    }

    .skills-wheel-item-content h3 {
        font-size: 1.1rem;
        letter-spacing: 1.5px;
    }
}




@media (max-width: 1024px) {
    .projects-bento {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-bento {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }

    .bento-item.wide,
    .bento-item {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .projects-bento {
        grid-template-columns: 1fr;
    }

    .bento-item.wide,
    .bento-item {
        grid-column: span 1;
    }
}


@keyframes floating {

    0%,
    100% {
        transform: translateY(-50%);
    }

    50% {
        transform: translateY(calc(-50% - 10px));
    }
}

@media (max-width: 1100px) {
    .hint-left {
        left: -50px;
        background: rgba(10, 10, 32, 0.8);
    }

    .hint-right {
        right: -50px;
        background: rgba(10, 10, 32, 0.8);
    }

    .scroll-hint {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 968px) {
    .hint-left {
        background: rgba(10, 10, 32, 0.9);
    }

    .hint-right {
        background: rgba(10, 10, 32, 0.9);
    }
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

/* Education Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
}

@media (max-width: 768px) {
    .timeline-item {
        padding: 1.5rem;
    }
}

/* Admin Dashboard Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(15px);
}

.admin-sidebar-toggle,
.admin-sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.admin-sidebar-toggle:hover,
.admin-sidebar-close:hover {
    color: var(--primary);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.admin-sidebar-close {
    display: none;
}

.sidebar {
    width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    position: fixed;
    height: 100vh;
}

.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    min-width: 0;
    /* Prevent overflow */
}

/* Responsive Grid Utilities */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-grid-3-auto {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
    align-items: end;
}

.admin-grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.admin-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {

    .admin-grid-2,
    .admin-grid-3-auto {
        grid-template-columns: 1fr;
    }

    .admin-grid-3-auto .btn {
        width: 100%;
        margin-top: 1rem;
    }

    .admin-flex-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card {
        padding: 2rem 1.5rem;
        width: 90%;
    }
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: 0.3s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--glass-bg);
    color: var(--primary);
}

/* Login Page */
.login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a3a 0%, #050510 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    outline: none;
    transition: 0.3s;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive */
@media (max-width: 968px) {
    nav {
        width: 95%;
        padding: 0.6rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 7rem;
        gap: 3rem;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 0.8rem;
        width: 100%;
        margin-top: 2rem;
    }

    .hero-btns .btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.85rem;
        flex: 1 1 140px;
        min-width: 0;
        justify-content: center;
        white-space: nowrap;
    }

    .hero p.description {
        margin: 0 auto 2.5rem auto;
        font-size: 1.1rem;
        width: 100%;
    }

    .hero-image {
        margin-bottom: 2rem;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .image-wrapper {
        width: auto;
        height: 240px;
        max-width: 80vw;
        max-height: 80vw;
        border-radius: 12px;
    }

    .image-wrapper img {
        border-radius: 10px;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 10vw, 3.8rem);
        word-break: break-word;
        letter-spacing: -1px;
    }

    .logo {
        font-size: 0.9rem !important;
        letter-spacing: 0;
    }

    nav {
        padding: 0.6rem 1rem !important;
        width: 94% !important;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 2000;
        transition: 0.4s var(--transition);
        background: var(--bg-dark);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .admin-sidebar-close {
        display: block;
    }

    .admin-mobile-header {
        display: flex;
    }

    .admin-main {
        margin-left: 0;
        padding: 2rem;
        padding-top: 100px;
    }

    .admin-main header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .admin-main header .btn {
        width: 100%;
        justify-content: center;
    }

    footer {
        padding: 3rem 1rem !important;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: radial-gradient(circle at top right, #1a1a3a, var(--bg-darker));
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        transition: 0.6s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1000;
        padding: 6rem 2rem 2rem 2rem;
        border-radius: 0;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: all;
    }

    .mobile-menu-header {
        display: block;
        margin-bottom: 3rem;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 1rem;
        width: 100%;
    }

    .mobile-menu-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: auto;
        padding-top: 2rem;
        border-top: 1px solid var(--glass-border);
        width: 100%;
    }

    .mobile-menu-footer p {
        font-size: 0.9rem;
        color: var(--text-dim);
        margin-bottom: 1rem;
    }

    .mobile-menu-footer .social-links {
        display: flex;
        gap: 1.5rem;
    }

    .mobile-menu-footer .social-links a {
        padding: 0;
        width: auto;
        font-size: 1.2rem;
        color: var(--text-dim);
        background: transparent;
    }

    .nav-links a {
        font-size: 1.2rem;
        width: 100%;
        text-align: left;
        padding: 1.25rem 1rem;
        display: flex;
        align-items: center;
        gap: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
        transform: translateX(30px);
        opacity: 0;
        transition: 0.4s var(--transition);
    }

    .nav-links.active a {
        transform: translateX(0);
        opacity: 1;
    }

    /* Staggered animation */
    .nav-links.active a:nth-child(2) {
        transition-delay: 0.1s;
    }

    .nav-links.active a:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links.active a:nth-child(4) {
        transition-delay: 0.3s;
    }

    .nav-links.active a:nth-child(5) {
        transition-delay: 0.4s;
    }

    .nav-links.active a:nth-child(6) {
        transition-delay: 0.5s;
    }

    .nav-links.active a:nth-child(7) {
        transition-delay: 0.6s;
    }

    .nav-links a i {
        font-size: 1rem;
        color: var(--primary);
        width: 20px;
        text-align: center;
    }

    .nav-links a.active {
        background: rgba(0, 242, 254, 0.05);
        color: var(--primary);
    }

    .nav-links a.active::before {
        display: none;
    }

    .logo {
        font-size: 1.1rem;
    }

    nav {
        width: 92%;
        left: 0;
        right: 0;
        margin: 0 auto;
        transform: none;
        justify-content: space-between;
        border-radius: 100px;
        padding: 0.6rem 1.5rem;
    }
}
