:root {
    --bg: #030303;
    /* Slightly deeper black */
    --text: #F0F0F0;
    --accent: #D4FF00;
    --secondary: #2A2A2A;
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor */
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}



#neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2;
    opacity: 0.3;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 100;

    /* HUD / Glass Effect */
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    /* Brutalist slight rounded */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    transition: all 0.3s ease;
}

nav:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 255, 0, 0.1);
}

.logo {
    font-family: var(--font-body);
    /* Tech font looks better for status */
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.blink {
    color: var(--accent);
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.menu-btn {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 2px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s;
    cursor: none;
    /* Keep custom cursor logic */
}

.menu-btn:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4rem;
    position: relative;
    overflow: hidden;
}

#robot-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Let clicks pass through to text */
}

#robot-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    /* Covers the bottom half */
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 80%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 9.5vw, 8rem);
    /* Fluid scaling: fits mobile screens perfectly */
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: clamp(-0.5px, -0.2vw, -3px);
    text-transform: uppercase;
    color: var(--text);
    transition: color 0.3s;
    max-width: 100%;
    /* Prevent overflow */
}

h1:hover {
    color: transparent;
    -webkit-text-stroke: 2px var(--accent);
}

.sub-hero {
    margin-bottom: 2rem;
    font-size: clamp(0.6rem, 2vw, 1.2rem);
    /* Fluid scaling for sub-hero */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(0.3rem, 1.5vw, 1rem);
    color: #888;
}

/* Scroll Reveal */
section.hidden {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation Delays */
.visible .project-card:nth-child(1),
.visible .edu-card:nth-child(1),
.visible .skill-tags span:nth-child(1) {
    transition-delay: 0.1s;
}

.visible .project-card:nth-child(2),
.visible .edu-card:nth-child(2),
.visible .skill-tags span:nth-child(2) {
    transition-delay: 0.2s;
}

.visible .project-card:nth-child(3),
.visible .edu-card:nth-child(3),
.visible .skill-tags span:nth-child(3) {
    transition-delay: 0.3s;
}

.visible .project-card:nth-child(4),
.visible .edu-card:nth-child(4),
.visible .skill-tags span:nth-child(4) {
    transition-delay: 0.4s;
}

.visible .project-card:nth-child(5),
.visible .edu-card:nth-child(5),
.visible .skill-tags span:nth-child(5) {
    transition-delay: 0.5s;
}

/* Enhanced Hero Animation */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-content h1 {
    animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    opacity: 0;
    /* Star hidden */
}

.hero-content h1:nth-child(2) {
    animation-delay: 0.2s;
}

/* Tech Reveal for Sections */
section.hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    filter: blur(10px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

section.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.separator {
    color: var(--accent);
}

/* Sections */
section {
    padding: 8rem 10%;
    /* increased side padding for better centering */
    min-height: 80vh;
    max-width: 1600px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 5rem;
    gap: 2rem;
}

h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
    /* Prevent breaking */
}

.line {
    flex-grow: 1;
    height: 1px;
    background: var(--secondary);
}

.about-grid {
    display: flex;
    gap: 10rem;
    align-items: flex-start;
    margin-bottom: 5rem;
}

.about-content {
    flex: 1;
    max-width: 800px;
}

.about-image {
    width: 380px;
    height: 380px;
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--secondary);
    padding: 10px;
    transition: all 0.3s ease;
}

.about-image:hover {
    border-color: var(--accent);
    box-shadow: 5px 5px 0 var(--accent);
    transform: translate(-5px, -5px);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-content p {
    font-size: 1.25rem;
    color: #ccc;
    line-height: 1.8;
}

/* Education & Skills */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-bottom: 6rem;
    border-top: 1px solid #222;
    padding-top: 3rem;
}

.edu-card {
    border-left: 1px solid var(--accent);
    /* Thinner, sharper border */
    padding-left: 2rem;
    padding-bottom: 1rem;
    transition: all 0.3s ease;
}

.edu-card:hover {
    background: linear-gradient(90deg, rgba(212, 255, 0, 0.1), transparent);
    padding-left: 2.5rem;
    border-left-color: #fff;
    box-shadow: -5px 0 20px rgba(212, 255, 0, 0.2);
}

.edu-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.edu-card:hover .edu-img {
    transform: scale(1.02);
}

.edu-card h3 {
    font-family: var(--font-heading);
    color: var(--text);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.edu-card p {
    color: #888;
    font-family: 'Space Grotesk', monospace;
    /* Keep consistent font */
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.skill-category h3 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 1px solid #222;
    padding-bottom: 1rem;
    display: inline-block;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.skill-tags span {
    border: 1px solid #333;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.skill-tags span:hover {
    border-color: var(--accent);
    color: var(--bg);
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(212, 255, 0, 0.2);
}

/* Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 255, 0, 0.1), transparent);
    transition: 0.5s;
    pointer-events: none;
    z-index: 1;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card:hover::before {
    left: 100%;
    transition: 0.7s;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 255, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    font-size: 2rem;
}

.card-tags {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.card-tags span {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

/* Card Links */
.card-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
}

.icon-link {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #888;
}

.icon-link:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.text-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #888;
    gap: 5px;
}

.text-link:hover {
    color: var(--accent);
}

.text-link .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.text-link:hover .arrow {
    transform: translate(3px, -3px);
}

/* Contact */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-links a {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
}

.contact-links a:hover {
    color: var(--accent);
    /* Removed margin-left shift */
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

/* Touch Device Detection - Hide custom cursor on mobile */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    #cursor,
    #cursor-blur {
        display: none !important;
    }
}

/* Tablet and Below (max-width: 1024px) */
@media (max-width: 1024px) {
    section {
        padding: 6rem 5%;
    }



    h2 {
        font-size: 3rem;
    }

    .contact-links a {
        font-size: 4rem;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {

    /* Navigation */
    nav {
        top: 1rem;
        width: 92%;
        padding: 1rem 1.25rem;
    }

    .logo {
        font-size: 0.8rem;
        gap: 6px;
        flex-wrap: wrap;
    }

    /* Hero Section - Keep desktop styling, just adjust padding */
    #hero {
        padding: 0 1rem;
        min-height: 100vh;
        min-height: 100dvh;
    }

    /* Sections */
    section {
        padding: 4rem 1.5rem;
        min-height: auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 3rem;
    }

    h2 {
        font-size: 2rem;
        white-space: normal;
        line-height: 1.2;
    }

    .line {
        width: 100%;
    }

    /* About Content */
    .about-grid {
        flex-direction: column;
        gap: 3rem;
        margin-bottom: 3rem;
    }

    .about-content {
        margin-bottom: 0;
        max-width: 100%;
    }

    .about-image {
        width: 100%;
        max-width: 300px;
        height: 300px;
        /* Keep 1:1 aspect ratio */
        margin: 0 auto;
        /* Center it */
    }

    .about-content p {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Education Grid */
    .education-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 4rem;
        padding-top: 2rem;
    }

    .edu-card {
        padding-left: 1.5rem;
    }

    .edu-card:hover {
        padding-left: 1.5rem;
        /* Disable slide effect on mobile */
    }

    .edu-img {
        height: 180px;
    }

    .edu-card h3 {
        font-size: 1.25rem;
    }

    .edu-card p {
        font-size: 0.85rem;
    }

    /* Skills */
    .skills-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .skill-category h3 {
        font-size: 0.8rem;
        letter-spacing: 2px;
        margin-bottom: 1.5rem;
    }

    .skill-tags {
        gap: 0.8rem;
    }

    .skill-tags span {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    /* Project Grid */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 2rem 1.5rem;
    }

    .project-card:hover {
        transform: none;
        /* Disable float on touch */
    }

    .card-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        font-size: 1.5rem;
    }

    .card-tags {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-tags span {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    /* Contact Links */
    .contact-links {
        gap: 0.5rem;
    }

    .contact-links a {
        font-size: 2.25rem;
        padding: 0.75rem 0;
        display: block;
        transition: all 0.2s ease;
    }

    .contact-links a:hover {
        margin-left: 0;
        /* Disable slide on mobile */
        color: var(--accent);
    }

    /* Active state for touch */
    .contact-links a:active {
        color: var(--accent);
        transform: scale(0.98);
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    nav {
        top: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .logo {
        font-size: 0.7rem;
    }

    #hero {
        padding: 0 1rem;
    }



    section {
        padding: 3rem 1rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .about-content p {
        font-size: 0.95rem;
    }

    .edu-img {
        height: 150px;
    }

    .edu-card h3 {
        font-size: 1.1rem;
    }

    .edu-card p {
        font-size: 0.8rem;
    }

    .skill-tags span {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .project-card {
        padding: 1.5rem 1.25rem;
    }

    .card-header {
        font-size: 1.25rem;
    }

    .contact-links a {
        font-size: 1.75rem;
        padding: 0.6rem 0;
    }
}

/* Extra Small Mobile (max-width: 380px) */
@media (max-width: 380px) {
    .logo {
        font-size: 0.65rem;
    }



    .contact-links a {
        font-size: 1.5rem;
    }

    .skill-tags span {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #hero {
        min-height: 100vh;
        padding-top: 4rem;
    }

    h1 {
        font-size: 3rem;
    }

    .sub-hero {
        margin-bottom: 1rem;
    }

    nav {
        top: 0.5rem;
        padding: 0.5rem 1rem;
    }
}

/* Safe Area Insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    section {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    #contact {
        padding-bottom: max(4rem, calc(env(safe-area-inset-bottom) + 2rem));
    }
}

/* Email Box Design - Cyberpunk Style */
.email-container {
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.email-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem;
    font-family: 'Space Grotesk', monospace;
    font-size: 1.2rem;
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(212, 255, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* Glitch/Tech Border styling with pseudo-elements */
.email-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 255, 0, 0.2), transparent);
    transition: 0.5s;
}

.email-box::after {
    content: 'OPEN MAIL';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 5;
}

.email-box:hover {
    box-shadow: 0 0 20px rgba(212, 255, 0, 0.15);
    border-color: var(--accent);
    transform: scale(1.05);
}

.email-box:hover::before {
    left: 100%;
}

.email-box:hover::after {
    transform: translateY(0);
}

/* Add a corner decoration */
.email-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    transition: 0.3s;
}

.email-container::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    transition: 0.3s;
}

.email-container:hover::before,
.email-container:hover::after {
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    opacity: 0;
}

/* Mobile Responsiveness for Email Box */
@media (max-width: 768px) {
    .email-container {
        margin-bottom: 2rem;
        width: 100%;
    }

    .email-box {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    display: none;
}

html {
    scrollbar-width: none;
}

/* Top Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10000;
    background: transparent;
}

.progress-bar {
    height: 100%;
    background: white;
    width: 0%;
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    transition: width 0.1s ease-out;
}