@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;600;700&display=swap');

:root {
    --bg: #0A2540;
    --text: #FFFFFF;
    --text-muted: #8892b0;
    --accent: #007BFF;
    --accent-glow: rgba(9, 81, 154, 0.562);
    --accent-secondary: #ff003c;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.05);
}

body.light-mode {
    --bg: #e48571;
    --text: #0A2540;
    --text-muted: #495670;
    --accent: #D2B48C;
    --accent-glow: #C5A059;
    --accent-secondary: #C5A059;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    cursor: none;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    position: relative;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 150px 0;
}

.section-title {
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 80px;
    background: linear-gradient(90deg, var(--text), var(--text-muted), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn {
    padding: 16px 32px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1) inset;
}

.primary-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: scale(1.05);
}

.secondary-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    border-color: var(--text);
    transform: scale(1.05);
}

nav {
    position: fixed;
    width: 100%;
    top: 0;
    padding: 25px 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: 0.3s;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -1px;
    z-index: 1001;
}

.logo .dot {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1001;
}

.lang-switch {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.lang-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: 0.3s;
    padding: 5px 8px;
    border-radius: 12px;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 10px var(--accent-glow);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    transition: 0.3s;
}

#theme-toggle:hover {
    color: var(--accent);
    transform: rotate(30deg);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    transition: 0.3s;
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--accent);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pulse-glow {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--accent-glow);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 240, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
    }
}

.cyber-glitch {
    font-size: 6vw;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    color: var(--text);
    text-transform: uppercase;
    line-height: 1.2;
}

.cyber-glitch::before,
.cyber-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.cyber-glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-secondary);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.cyber-glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(16px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(89px, 9999px, 13px, 0);
    }

    80% {
        clip: rect(45px, 9999px, 56px, 0);
    }

    100% {
        clip: rect(98px, 9999px, 21px, 0);
    }
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.hero p {
    max-width: 650px;
    margin: 0 auto 50px;
    font-size: 1.3rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: border-color 0.3s;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 80px 60px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    margin-bottom: 25px;
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.5);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    text-align: center;
    position: relative;
}

.stat-box h3 {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 10px;
    transform: translateZ(30px);
    text-shadow: 0 0 20px var(--accent-glow);
}

.stat-box p {
    transform: translateZ(20px);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    perspective: 1000px;
}

.skill-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    padding: 50px 30px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.skill-card i {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 25px;
    transform: translateZ(40px);
    display: inline-block;
}

.skill-card h3 {
    transform: translateZ(30px);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.skill-card p {
    transform: translateZ(20px);
    color: var(--text-muted);
}

.glow-bg {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--accent);
    filter: blur(60px);
    opacity: 0;
    transition: 0.5s;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.skill-card:hover .glow-bg {
    opacity: 0.5;
}

.skill-card:hover {
    border-color: var(--accent);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.project-card {
    background: #000;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    overflow: visible;
}

.project-card:hover {
    border-color: var(--accent);
}

.img-wrapper {
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.project-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateZ(20px) scale(1.05);
}

.project-card:hover img {
    transform: translateZ(40px) scale(1.1);
    filter: brightness(1.2);
}

.project-content {
    padding: 30px;
    transform: translateZ(30px);
    background: linear-gradient(to top, #000 80%, transparent);
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.project-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1rem;
}

.tags {
    display: flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.tags span {
    background: rgba(0, 240, 255, 0.1);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent);
    border: 1px solid rgba(0, 240, 255, 0.3);
    text-transform: uppercase;
    font-weight: 600;
}

.project-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-glass {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: rgba(0, 0, 0, 0.6);
    padding: 70px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
}

.contact-info {
    transform: translateZ(30px);
}

.contact-info h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.info-item i {
    color: var(--accent);
    font-size: 1.5rem;
    margin-right: 15px;
}

.socials {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.socials a {
    color: var(--text);
    font-size: 2rem;
    transition: 0.3s;
}

.socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.glass-form {
    transform: translateZ(20px);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.glass-form input,
.glass-form textarea {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
}

.glass-form input:focus,
.glass-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2) inset;
    background: rgba(0, 0, 0, 0.5);
}

.fade-up {
    opacity: 0;
    transform: translateY(60px);
    transition: 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
}


/* ==========================================
   MOBILE RESPONSIVENESS (THE PREMIUM FIX)
   ========================================== */
@media (max-width: 1024px) {
    .section {
        padding: 80px 0;
        overflow: hidden;
    }

    .section-title {
        font-size: 2.5rem;
        margin-bottom: 40px;
    }

    .hero h1.cyber-glitch {
        font-size: 3rem;
        line-height: 1.2;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 15px;
    }

    .about-grid,
    .contact-glass {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .glass-panel,
    .contact-glass {
        padding: 30px 20px;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-box h3 {
        font-size: 2.5rem;
    }

    /* --- THE UPGRADE: Swipeable App-Like Horizontal Scrolling --- */
    .skills-grid,
    .projects-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 30px;
        -webkit-overflow-scrolling: touch;
        gap: 20px;
        /* Hide scrollbar for cleaner look but keep functionality */
        scrollbar-width: none;
    }

    .skills-grid::-webkit-scrollbar,
    .projects-grid::-webkit-scrollbar {
        display: none;
    }

    .skill-card,
    .project-card {
        flex: 0 0 85%;
        /* Cards take up 85% of screen width */
        scroll-snap-align: center;
        transform: none !important;
        /* Disable 3D tilt on mobile */
    }

    .project-card img {
        height: 200px;
    }

    /* --- THE UPGRADE: Apple-Style Glass Menu --- */
    .hamburger {
        display: block;
        z-index: 1002;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.7);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 25px 0;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger the menu link animations */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.5s;
    }

    .nav-links a {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
}

/* Fix Touch Devices & Add Tap Glows */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    .tilt-card {
        transform: none !important;
    }

    /* Neon flash when a user taps a card on mobile */
    .skill-card:active,
    .project-card:active,
    .btn:active {
        box-shadow: 0 0 20px var(--accent-glow);
        border-color: var(--accent);
        transform: scale(0.98) !important;
        transition: 0.1s;
    }
}