:root {
    --bg: #020617;
    --card: rgba(15, 23, 42, 0.85);
    --accent: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.5);
    --cyan: #22d3ee;
    --text: #f9fafb;
    --muted: #aab4c0;
    --border: rgba(148, 163, 184, 0.15);
    --terminal-bg: #0f0f12;
}

/* Light Mode Variables */
[data-theme="light"] {
    --bg: #f1f5f9;
    --card: rgba(255, 255, 255, 0.9);
    --text: #0f172a;
    --muted: #475569;
    --border: rgba(100, 116, 139, 0.2);
    --terminal-bg: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 100vh;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- CURSOR GLOW EFFECT --- */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    opacity: 0;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 60px;
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

/* Scanline effect */
#preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 1;
}

/* CRT glow effect */
#preloader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.boot-line {
    color: #a0a0a0;
    font-size: 0.85rem;
    margin-bottom: 3px;
    opacity: 0;
    animation: fadeIn 0.1s forwards;
    position: relative;
    z-index: 2;
}

.boot-ascii {
    opacity: 0;
    animation: fadeIn 0.2s forwards;
    position: relative;
    z-index: 2;
}

.boot-ascii pre {
    color: var(--cyan);
    font-size: 0.55rem;
    line-height: 1.1;
    margin: 0 0 15px 0;
    text-shadow: 0 0 10px var(--cyan);
}

.boot-line .ok {
    color: #22c55e;
    font-weight: bold;
}

.boot-line .warn {
    color: #eab308;
    font-weight: bold;
}

.boot-line .info {
    color: var(--cyan);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
}

.glitch-logo {
    font-family: 'Exo 2', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    color: var(--cyan);
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--cyan);
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    line-height: 1;
}

.glitch-logo .highlight {
    color: #fff;
    text-shadow: 0 0 20px #fff;
}

.boot-line .success {
    color: #22c55e;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    letter-spacing: 3px;
}

.boot-line .prompt {
    color: var(--accent);
}

.cursor-block {
    display: inline-block;
    width: 10px;
    height: 1em;
    background: var(--accent);
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- NEURAL NETWORK CANVAS --- */
#neuro-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
.nav-brand,
.btn,
.tagline,
.tab {
    font-family: 'Exo 2', sans-serif;
    font-style: italic;
}

.wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* --- NAV --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 20px;
    z-index: 100;
    transition: background 0.4s, border 0.4s;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
    font-weight: 500;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--cyan);
    bottom: -5px;
    left: 0;
    box-shadow: 0 0 10px var(--cyan);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-toggle:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text);
    background: none;
    border: none;
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- HERO SECTION - TWO COLUMN --- */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Status Badges */
.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
}

.status-badge.available {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-badge.available i {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    font-family: 'Exo 2', sans-serif;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
}

.hero-description {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 500px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.social-links span {
    color: var(--muted);
    font-size: 0.9rem;
}

.social-links a {
    color: var(--muted);
    font-size: 1.2rem;
    transition: 0.3s;
}

.social-links a:hover {
    color: var(--cyan);
    transform: translateY(-3px);
}

/* WhatsApp Button */
.btn-whatsapp {
    background: #25D366 !important;
    border-color: #25D366 !important;
    color: #fff !important;
}

.btn-whatsapp:hover {
    background: #128C7E !important;
    border-color: #128C7E !important;
}

/* Profile Image Frame */
.profile-frame {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid transparent;
    background: linear-gradient(var(--card), var(--card)) padding-box,
        linear-gradient(135deg, var(--accent), var(--cyan)) border-box;
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
    transition: 0.4s ease;
}

.profile-frame:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 70px rgba(124, 58, 237, 0.4);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.profile-glow {
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.2) 0%, transparent 60%);
    pointer-events: none;
    animation: profileGlow 4s ease-in-out infinite;
}

@keyframes profileGlow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile/Desktop profile visibility */
.mobile-profile {
    display: none;
    margin: 20px 0;
}

.mobile-profile .profile-frame {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

/* --- STATS SECTION --- */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: 0.3s;
}

.stat-card:hover {
    border-color: var(--cyan);
    transform: translateY(-5px);
}

/* Make stat cards clickable */
a.stat-card {
    text-decoration: none;
    cursor: pointer;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--cyan);
    font-family: 'Exo 2', sans-serif;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* --- TECH STACK SECTION --- */
.techstack-section {
    margin-bottom: 40px;
}

.techstack-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.techstack-category {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 25px;
    transition: 0.3s;
}

.techstack-category:hover {
    border-color: var(--accent);
}

.techstack-category h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.techstack-category h3 i {
    color: var(--accent);
}

.tech-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: 0.3s;
}

.tech-item:hover {
    border-color: var(--cyan);
    transform: translateX(5px);
}

.tech-item i {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.tech-item i.fa-python {
    color: #3776AB;
}

.tech-item i.fa-java {
    color: #ED8B00;
}

.tech-item i.fa-c {
    color: #A8B9CC;
}

.tech-item i.fa-code {
    color: #00599C;
}

.tech-item i.fa-html5 {
    color: #E34F26;
}

.tech-item i.fa-css3-alt {
    color: #1572B6;
}

.tech-item i.fa-js {
    color: #F7DF1E;
}

.tech-item i.fa-react {
    color: #61DAFB;
}

.tech-item span {
    color: var(--muted);
    font-size: 0.95rem;
}

/* --- SERVICES SECTION --- */
.services-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--cyan);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.service-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: 0.3s;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent);
}

.service-card h3 {
    color: var(--text);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.service-tags span {
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
}

/* --- ABOUT SECTION ENHANCED --- */
.about-text {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.about-list {
    list-style: none;
    margin-bottom: 25px;
}

.about-list li {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding-left: 5px;
}

.about-list .hash {
    color: var(--accent);
    font-weight: bold;
    margin-right: 8px;
}

/* --- CONTACT SECTION --- */
.contact-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
}

.contact-info h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-info h2 i {
    color: var(--cyan);
}

.contact-info>p {
    color: var(--muted);
    margin-bottom: 25px;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.contact-item i {
    color: var(--accent);
    width: 20px;
}

.contact-socials {
    display: flex;
    gap: 15px;
}

.contact-socials a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 1.2rem;
    transition: 0.3s;
    text-decoration: none;
}

.contact-socials a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--muted);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-links a {
    color: var(--muted);
    font-size: 1.3rem;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--cyan);
}

/* --- PROJECT CARDS ENHANCED --- */
.project-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    border-left: 3px solid var(--border);
    transition: 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-card:hover {
    border-left-color: var(--accent);
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(5px);
}

.project-card h4 {
    color: var(--text);
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.project-card h4 i {
    font-size: 0.9rem;
    opacity: 0;
    transition: 0.3s;
}

.project-card:hover h4 i {
    opacity: 1;
    transform: translateX(5px);
}

.project-card small {
    color: var(--cyan);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 992px) {
    .hero-section {
        display: flex;
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        order: 1;
        align-items: center;
    }

    .hero-visual.desktop-profile {
        display: none;
    }

    .mobile-profile {
        display: block;
    }

    .hero-description {
        max-width: 100%;
    }

    .status-badges {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .techstack-grid {
        grid-template-columns: 1fr;
    }

    .contact-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--card);
        padding: 20px;
        border-radius: 15px;
        flex-direction: column;
        border: 1px solid var(--border);
        width: 200px;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s, transform 0.3s;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .tilt-card {
        transform: none !important;
    }

    .cursor-glow {
        display: none;
    }

    /* Keep nav brand left aligned on mobile */
    nav {
        justify-content: space-between;
    }

    .nav-brand {
        text-align: left;
        justify-content: flex-start;
    }

    /* Hero section mobile fixes */
    .hero-section {
        text-align: left;
    }

    .hero-content {
        text-align: left;
        align-items: flex-start;
    }

    .status-badges {
        justify-content: flex-start;
    }

    .btn-group {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .social-links {
        justify-content: flex-start;
    }

    .profile-frame {
        width: 280px;
        height: 280px;
        margin: 0 auto;
    }

    .tech-items {
        grid-template-columns: 1fr;
    }

    #preloader {
        padding: 20px;
        align-items: flex-start;
    }

    .glitch-logo {
        font-size: 3rem;
        text-align: left;
        margin-bottom: 20px;
    }

    /* Scale down ASCII art for mobile */
    .boot-ascii pre {
        font-size: 3px !important;
        line-height: 4px !important;
        white-space: pre;
        overflow-x: hidden;
    }
}

h1 {
    font-size: 3.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(to right, #fff, var(--muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(to right, #1e293b, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
}

.typing-area {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
    margin-bottom: 25px;
    height: 1.5em;
    display: flex;
    align-items: center;
}

.cursor {
    width: 8px;
    height: 18px;
    background: var(--accent);
    animation: blink 1s infinite;
    margin-left: 5px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.meta-icons {
    display: flex;
    gap: 15px;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.meta-icons span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn:hover:not(.btn-primary) {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Copy Button Feedback */
.btn.copied {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #fff !important;
}

/* --- TERMINAL --- */
.terminal-wrapper {
    background: var(--terminal-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateZ(20px);
    min-height: 320px;
    position: relative;
    transition: background 0.4s, border 0.4s;
}

.terminal-wrapper::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.terminal-title {
    margin-left: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
}

.code-area {
    padding: 25px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    flex-grow: 1;
    color: #a5b3ce;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.c-k {
    color: #c678dd;
}

.c-f {
    color: #61afef;
}

.c-s {
    color: #98c379;
}

.c-c {
    color: #e5c07b;
}

.c-o {
    color: #56b6c2;
}

.c-cmt {
    color: #5c6370;
    font-style: italic;
}

.code-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--cyan);
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

/* --- MAIN CONTENT --- */
.main-stack {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Tilt Card */
.tilt-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    scroll-margin-top: 100px;
    transition: transform 0.1s, background 0.4s, border 0.4s;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2 i {
    color: var(--cyan);
}

/* ANIME SECTION */
.anime-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.anime-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.anime-item:hover {
    background: rgba(124, 58, 237, 0.2);
    transform: translateX(5px);
}

.anime-name {
    font-weight: 500;
    font-size: 1rem;
}

.anime-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
}

/* PROJECTS & SKILLS */
.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    padding: 6px 15px;
    font-size: 0.85rem;
    border-radius: 20px;
    background: rgba(34, 211, 238, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.project-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    border-left: 3px solid var(--border);
    transition: 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-card:hover {
    border-left-color: var(--accent);
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(5px);
}

.project-card h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card h4 i {
    font-size: 0.9rem;
    opacity: 0;
    transition: 0.3s;
}

.project-card:hover h4 i {
    opacity: 1;
    transform: translateX(5px);
}

/* QUALIFICATIONS - TRAIN ANIMATION */
.qual-timeline {
    border-left: 3px solid var(--border);
    padding-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    margin-left: 10px;
}

/* Railway Track Effect */
.qual-timeline::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 7px;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 8px,
            var(--border) 8px,
            var(--border) 12px);
    opacity: 0.5;
}

/* The Train */
.qual-train {
    position: absolute;
    left: -22px;
    top: 0;
    font-size: 1.2rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.qual-timeline.animate .qual-train {
    opacity: 1;
    animation: trainMove 3s ease-out forwards;
}

@keyframes trainMove {
    0% {
        top: 0;
    }

    100% {
        top: calc(100% - 20px);
    }
}

/* Train Trail/Glow Effect */
.qual-timeline.animate::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 5px;
    height: 0;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    animation: trailGrow 3s ease-out forwards;
    opacity: 0.6;
}

@keyframes trailGrow {
    0% {
        height: 0;
    }

    100% {
        height: 100%;
    }
}

.qual-item {
    position: relative;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

/* Current station highlight */
.qual-item.current {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

/* Station Dots - Centered on track */
.qual-item::before {
    content: '';
    position: absolute;
    left: -43px;
    top: 12px;
    width: 14px;
    height: 14px;
    background: var(--bg);
    border: 3px solid var(--border);
    border-radius: 50%;
    z-index: 3;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.4s;
}

/* Current station dot always glowing */
.qual-item.current::before {
    border-color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
    background: var(--cyan);
}

/* Animate stations when train passes */
.qual-timeline.animate .qual-item {
    animation: stationPulse 0.5s ease forwards;
    animation-delay: calc(var(--index) * 0.7s);
}

.qual-timeline.animate .qual-item::before {
    animation: stationLight 0.5s ease forwards;
    animation-delay: calc(var(--index) * 0.7s);
}

@keyframes stationLight {
    0% {
        border-color: var(--border);
        box-shadow: none;
    }

    50% {
        border-color: var(--cyan);
        box-shadow: 0 0 15px var(--cyan);
        transform: scale(1.3);
    }

    100% {
        border-color: var(--cyan);
        box-shadow: 0 0 8px var(--cyan);
        transform: scale(1);
    }
}

@keyframes stationPulse {
    0% {
        opacity: 0.5;
        transform: translateX(-10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CONTACT CTA */
.contact-cta {
    text-align: center;
    padding: 60px 20px;
    margin-top: 20px;
}

.contact-cta h2 {
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--card);
        padding: 20px;
        border-radius: 15px;
        flex-direction: column;
        border: 1px solid var(--border);
        width: 200px;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s, transform 0.3s;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    .tilt-card {
        transform: none !important;
    }

    .github-stats img {
        width: 100%;
    }

    .cursor-glow {
        display: none;
    }
}

/* --- AI CHAT WIDGET STYLES --- */
.ai-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header {
    background: var(--accent);
    padding: 15px;
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    max-width: 80%;
    line-height: 1.4;
}

.message.bot {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-bottom-left-radius: 2px;
    align-self: flex-start;
}

.message.user {
    background: var(--cyan);
    color: #000;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 20px;
    color: var(--text);
    outline: none;
}

.chat-input-area button {
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        right: -20px;
    }
}

/* --- SCROLL TO TOP BTN --- */
.scroll-top-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--card);
    border: 1px solid var(--cyan);
    border-radius: 50%;
    color: var(--cyan);
    font-size: 1.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.scroll-top-btn:hover {
    background: var(--cyan);
    color: #000;
    transform: translateY(-5px);
}