/* CSS Files start from here. */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-main: #06070d;
    --bg-panel: rgba(15, 17, 26, 0.6);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-1: #00f0ff;
    --accent-2: #7000ff;
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(6, 7, 13, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.nav-logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    position: relative;
    letter-spacing: -0.5px;
}

.nav-logo::after {
    content: '_';
    animation: blink 1s step-end infinite;
    color: var(--accent-1);
}

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

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-1);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* Nav Toggle (Hamburger) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 101;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Main Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

/* Header/Hero Section */
.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

h1, h2 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: #fff;
    letter-spacing: -1.5px;
}

.hero .gradient-text {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-1));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.hero h2 {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 400;
    font-family: 'Fira Code', monospace;
}

.hero p {
    font-size: 1.1rem;
    max-width: 650px;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: transparent;
    color: var(--accent-1);
    border: 1px solid var(--accent-1);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    will-change: transform;
}

.btn .ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 50%;
    animation: ripple_effect 0.8s linear;
}

@keyframes ripple_effect {
    0% { width: 0; height: 0; opacity: 0.5; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

.btn:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    transform: scale(1.05);
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-2), var(--accent-1));
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 0 20px rgba(112, 0, 255, 0.5);
    transform: scale(1.05);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 240, 255, 0.3);
}

/* Skills Section */
.skills-section {
    margin-top: 4rem;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.section-title::after {
    content: '';
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
    flex-grow: 1;
    min-width: 50px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skill-category h3 {
    font-family: 'Fira Code', monospace;
    color: var(--accent-1);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-main);
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 240, 255, 0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}

.skill-tag:hover::before {
    opacity: 1;
}

.skill-tag:hover {
    border-color: var(--accent-1);
    color: #fff;
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.2);
}

/* Stats */
.stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
    transition: transform 0.3s ease;
    display: block;
}
a.stat-item:hover {
    transform: translateY(-5px);
}
.stat-item span {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-1);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.stat-item p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    flex-grow: 1;
}

.tech-stack {
    font-family: 'Fira Code', monospace;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tech-stack span {
    color: var(--accent-2);
}

.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.project-link {
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-1);
}
.project-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Repos grid */
.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.repo-card {
    padding: 1.5rem;
}

.repo-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-1);
    font-family: 'Fira Code', monospace;
}

/* Timeline for Education */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 20px;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 100%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--bg-main);
    border: 3px solid var(--accent-2);
    border-radius: 50%;
    z-index: 1;
    left: 7.5px;
    top: 15px;
    box-shadow: 0 0 10px rgba(112, 0, 255, 0.5);
}

.timeline-content {
    padding: 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    border-color: rgba(112, 0, 255, 0.3);
}

.timeline-content h3 {
    margin-bottom: 0.2rem;
    color: #fff;
    font-size: 1.4rem;
}
.timeline-content h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1rem;
}
.timeline-date {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    margin-bottom: 1.5rem;
    color: var(--accent-1);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    background: rgba(6, 7, 13, 0.8);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.social-links a {
    color: var(--text-muted);
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}
.social-links a:hover {
    color: var(--accent-1);
    transform: translateY(-3px);
    border-color: var(--accent-1);
}
.social-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Image Layout and Avatar CSS */
.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-layout:hover {
    transform: scale(1.01); /* Very subtle zoom for the entire section */
}

.hero-text {
    flex: 1;
}

.hero-image-container {
    flex: 0 0 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    animation: spin-gradient 8s linear infinite;
    z-index: 10;
}

.glow-wrap::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    filter: blur(25px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.7;
    animation: blink-glow 3s ease-in-out infinite alternate;
}

@keyframes spin-gradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes blink-glow {
    0% { opacity: 0.4; }
    100% { opacity: 0.9; }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-main);
    animation: spin-reverse 8s linear infinite;
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}


/* Responsive Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 7rem 2rem 3rem;
    }
    .hero-layout {
        gap: 2rem;
    }
    .glow-wrap {
        width: 220px;
        height: 220px;
    }
    .hero-image-container {
        flex: 0 0 220px;
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(6, 7, 13, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
        z-index: 99;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 8rem 1.5rem 2rem;
    }
    
    .hero-layout {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
        margin-top: 1rem;
    }
    .hero-text p {
        margin: 0 auto 1.5rem auto;
    }
    .hero-buttons {
        justify-content: center;
    }
    .glow-wrap {
        width: 180px;
        height: 180px;
    }
    .hero-image-container {
        flex: 0 0 180px;
    }
    
    .stats {
        justify-content: center;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    .stat-item span {
        font-size: 2.2rem;
    }
    
    .skills-grid, .projects-grid, .repos-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
        display: block; /* Switch to block to let text wrap naturally */
        line-height: 1.3;
        margin-bottom: 2rem;
    }

    .section-title::after {
        display: none;
    }

    .timeline::after { left: 15px; }
    .timeline-item::after { left: 3px; }
    .timeline-item { padding-left: 35px; padding-right: 0; }
    .timeline-content { padding: 1.5rem; }
    .timeline-content h3 { font-size: 1.2rem; }
}

/* Enhancements */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-1);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 60%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.3s;
}

.crt-scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.05) 50%,
        rgba(0, 0, 0, 0.05)
    );
    background-size: 100% 4px;
    z-index: 9998;
    pointer-events: none;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    z-index: 100000;
    box-shadow: 0 0 10px var(--accent-1);
}

.hidden-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hidden-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

.typewriter-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: charFadeUp 0.3s forwards;
}

@keyframes charFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
