/* Nebula Noir - Advanced Design System */

:root {
    --bg: #050505;
    --text: #ffffff;
    --accent: #00ffff;
    /* Cyan */
    --accent-2: #ff00ff;
    /* Magenta */
    --void: #0a0a0a;
    --grid-line: rgba(255, 255, 255, 0.05);

    --font-display: 'Syncopate', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor everywhere */
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    width: 100vw;
}

/* --- WebGL Canvas --- */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* --- Custom Cursor --- */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--text);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: difference;
    transition: transform 0.15s ease-out;
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.counter {
    font-family: var(--font-display);
    font-size: 8vw;
    font-weight: 700;
    color: var(--text);
}

.loader-line {
    width: 0%;
    height: 2px;
    background: var(--text);
    margin-top: 20px;
}

/* --- Navigation --- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    mix-blend-mode: difference;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.menu-btn {
    width: 40px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    position: absolute;
    transition: 0.3s;
}

.menu-btn span:first-child {
    top: 0;
}

.menu-btn span:last-child {
    bottom: 0;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.5s ease;
}

.nav-overlay ul {
    list-style: none;
    text-align: center;
}

.nav-overlay ul li {
    overflow: hidden;
    margin: 10px 0;
}

.nav-link {
    display: block;
    font-family: var(--font-display);
    font-size: 4rem;
    color: transparent;
    -webkit-text-stroke: 1px var(--text);
    text-decoration: none;
    transform: translateY(100%);
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--accent);
    -webkit-text-stroke: 0px;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5vw;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 10vw;
    line-height: 0.9;
    font-weight: 700;
    perspective: 1000px;
}

.hero-title .line {
    display: block;
    opacity: 0;
    /* Animated in via JS */
}

.hero-title .indent {
    margin-left: 15vw;
    color: transparent;
    -webkit-text-stroke: 2px var(--text);
}

.hero-title .outlined {
    color: transparent;
    -webkit-text-stroke: 2px var(--text);
    margin-left: 5vw;
}

.hero-content {
    margin-bottom: 15vh;
    /* Lift content up to prevent overlap */
    position: relative;
    z-index: 2;
}

.hero-sub {
    margin-top: 40px;
    font-family: var(--font-body);
    font-size: 1.2rem;
    display: flex;
    gap: 30px;
    opacity: 0;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0.9;
    /* Increased visibility */
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-family: var(--font-display);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    /* Better contrast against stars */
    z-index: 10;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: var(--text);
}

/* --- Work Section (Horizontal) --- */
.work {
    height: 100vh;
    /* Will be pinned */
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.work-header {
    padding: 0 5vw;
    margin-bottom: 5vh;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 20px;
}

.work-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
}

.projects-track {
    display: flex;
    gap: 5vw;
    padding-left: 5vw;
    width: max-content;
    /* Ensure horizontal scroll */
}

.project-card {
    width: 35vw;
    height: 50vh;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--grid-line);
    backdrop-filter: blur(10px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.3s;
}

.project-card:hover {
    background: var(--accent);
    color: var(--bg);
}

.card-num {
    font-family: var(--font-display);
    font-size: 4rem;
    opacity: 0.2;
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 10px;
}

.project-card a {
    margin-top: auto;
    text-decoration: none;
    font-weight: 700;
    color: inherit;
    border: 1px solid currentColor;
    padding: 10px 20px;
    display: inline-block;
    width: fit-content;
    text-align: center;
}

/* --- About Section --- */
.about {
    min-height: 100vh;
    padding: 100px 5vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.bio-text h2 {
    font-family: var(--font-display);
    font-size: 4rem;
    margin-bottom: 30px;
}

.lead {
    font-size: 1.5rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.stats {
    display: flex;
    gap: 50px;
    margin-top: 40px;
}

.stats h3 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--accent-2);
}

.skill-list {
    list-style: none;
    margin-top: 20px;
}

.skills-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skill-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    z-index: 10;
}

.skills-sphere {
    width: 100%;
    min-height: 400px;
    /* Force height for TagCloud */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    position: relative;
    z-index: 5;
}

/* TagCloud Items */
.tagcloud {
    display: inline-block;
    margin: 0 auto;
}

.tagcloud--item {
    cursor: pointer;
    transition: color 0.3s;
}

.tagcloud--item:hover {
    color: var(--text);
    text-shadow: 0 0 10px var(--accent-2);
}

/* --- Contact Section --- */
.contact {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 100px 5vw 40px;
}

.contact h2 {
    font-family: var(--font-display);
    font-size: 8vw;
    line-height: 0.9;
    margin-bottom: 50px;
}

.minimal-form {
    max-width: 600px;
}

.input-group {
    position: relative;
    margin-bottom: 40px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 0;
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-body);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.input-group label {
    position: absolute;
    left: 0;
    top: 10px;
    pointer-events: none;
    transition: 0.3s;
    font-size: 1rem;
    color: var(--text);
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--accent);
}

.send-btn {
    background: white;
    color: black;
    border: none;
    padding: 15px 40px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    cursor: none;
    transition: 0.3s;
}

.send-btn:hover {
    background: var(--accent-2);
    color: white;
}

.contact-links {
    margin-top: 50px;
    display: flex;
    gap: 30px;
}

.contact-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-family: var(--font-display);
}

.contact-links a:hover {
    color: white;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .nav-link {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 10vw;
    }

    /* Reduced from 12vw */
    .project-card {
        width: 80vw;
    }

    .about {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-right,
    .status-block {
        align-items: center;
        width: 100%;
        margin-top: 20px;
    }

    .footer .social-links {
        justify-content: center;
        margin-bottom: 20px;
    }
}

/* Main Footer */
.footer {
    padding: 80px 5vw 40px;
    background: var(--void);
    border-top: 1px solid var(--grid-line);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.copyright {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body);
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.footer .social-links {
    display: flex;
    gap: 30px;
}

.footer .social-links a {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1rem;
    position: relative;
    transition: color 0.3s;
}

.footer .social-links a:hover {
    color: var(--accent);
}

.footer .social-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

.footer .social-links a:hover::after {
    width: 100%;
}

.status {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Cleaned up previous media query to avoid duplication */

/* --- PRO FEATURES --- */

/* 1. Resume Fixed Button */
.resume-btn-fixed {
    position: fixed;
    top: 30px;
    right: 120px;
    /* Left of the hamburger menu */
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    z-index: 1100;
    transition: 0.3s;
    mix-blend-mode: difference;
}

.resume-btn-fixed:hover {
    background: var(--text);
    color: var(--bg);
}

/* 2. Terminal Overlay */
#terminal-overlay.hidden,
#project-modal.hidden {
    display: none;
}

#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 12000;
    /* Highest */
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 600px;
    height: 400px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-header {
    background: #252525;
    padding: 10px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.title {
    color: #999;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.8rem;
}

.terminal-body {
    flex: 1;
    padding: 15px;
    color: #00ff00;
    overflow-y: auto;
    font-size: 0.9rem;
}

.terminal-input-line {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #333;
    background: #1a1a1a;
}

.prompt {
    color: #00ff00;
    margin-right: 10px;
}

#terminal-input {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    flex: 1;
    outline: none;
}

/* 3. Modal */
#project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--accent);
    padding: 40px;
    width: 70vw;
    max-width: 900px;
    position: relative;
    color: white;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--accent-2);
}

.modal-body-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.modal-content h2 {
    font-family: var(--font-display);
    color: var(--accent);
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 15px;
}

.modal-content h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent-2);
    margin-top: 20px;
    margin-bottom: 10px;
}

/* 4. Footer Widgets */
.status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.local-time {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

.sound-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: var(--font-display);
}

.sound-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hint-text {
    font-size: 0.7rem;
    opacity: 0.4;
    margin-top: 5px;
}

/* 5. Glitch Effect Class */
.glitch-active {
    position: relative;
}

.glitch-active::before,
.glitch-active::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-active::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch-active::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 80px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(90px, 9999px, 100px, 0);
    }

    100% {
        clip: rect(10px, 9999px, 60px, 0);
    }
}

/* --- MOBILE TWEAKS FINAL --- */
/* --- MOBILE TWEAKS FINAL --- */
@media (max-width: 900px) {

    /* 1. Typography Adjustments */
    .hero-title {
        font-size: 10vw;
    }

    .nav-link {
        font-size: 2rem;
    }

    .contact h2 {
        font-size: 12vw;
        margin-top: 50px;
    }

    /* Prevent overlap */

    /* 2. Layout Adjustments */
    .project-card {
        width: 85vw;
        height: auto;
        min-height: 400px;
    }

    .about {
        grid-template-columns: 1fr;
        padding-top: 50px;
    }

    .contact {
        padding-top: 150px;
    }

    /* Push down to avoid nav overlap */

    /* 3. Footer Fixes */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-right,
    .status-block {
        align-items: center;
        width: 100%;
    }

    .footer .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* 4. Hide Desktop Elements */
    .resume-btn-fixed {
        display: none !important;
    }

    /* 5. Nav Adjustments */
    .main-nav {
        padding: 20px;
        background: rgba(5, 5, 5, 0.8);
        backdrop-filter: blur(10px);
    }

    .logo {
        font-size: 1.2rem;
    }
}