/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #050508;
    --text-color: #e0e0e0;
    --primary: #00f3ff;
    /* Cyan */
    --secondary: #bc13fe;
    /* Neon Purple */
    --accent-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --terminal-green: #00ff41;
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    zoom: 1;
    /* Fix for some browsers */
}

/* --- Animated Background --- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-45deg);
}

.star {
    --star-color: var(--primary);
    --star-tail-length: 6em;
    --star-tail-height: 2px;
    --star-width: calc(var(--star-tail-length) / 6);
    --fall-duration: 9s;
    --fall-delay: 0s;
    position: absolute;
    top: var(--top-offset);
    left: var(--left-offset);
    width: var(--star-tail-length);
    height: var(--star-tail-height);
    color: var(--star-color);
    background: linear-gradient(45deg, currentColor, transparent);
    border-radius: 50%;
    filter: drop-shadow(0 0 6px currentColor);
    transform: translate3d(104em, 0, 0);
    animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--fall-duration) var(--fall-delay) ease-out infinite;
    opacity: 0;
}

@media screen and (max-width: 750px) {
    .star {
        animation: fall var(--fall-duration) var(--fall-delay) linear infinite;
    }
}

@keyframes fall {
    to {
        transform: translate3d(-30em, 0, 0);
    }
}

@keyframes tail-fade {

    0%,
    50% {
        width: var(--star-tail-length);
        opacity: 1;
    }

    70%,
    80% {
        width: 0;
        opacity: 0.4;
    }

    100% {
        width: 0;
        opacity: 0;
    }
}

/* Static stars for depth */
.static-stars {
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: 1744px 122px #FFF, 134px 1321px #FFF, 92px 859px #FFF;
    /* Simplified for brevity, will rely on a generating function in standard CSS if possible, but hardcoding a few for effect */
    animation: animStar 50s linear infinite;
}

.static-stars::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: 1744px 122px #FFF, 134px 1321px #FFF, 92px 859px #FFF;
}

@keyframes animStar {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-2000px);
    }
}

/* --- Layout Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

/* --- Typography & Glitch Effect --- */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.highlight-cyan {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
}

.highlight-purple {
    color: var(--secondary);
    text-shadow: 0 0 15px rgba(188, 19, 254, 0.6);
}

.highlight-white {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Glitch Animation for Name */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    position: relative;
    color: var(--text-color);
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--primary);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--terminal-green);
    border: 1px solid var(--terminal-green);
    padding: 5px 12px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    transition: all 0.3s;
}

.logo:hover {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    background: rgba(0, 255, 65, 0.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-links a {
    color: #888;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.resume-btn {
    border: 1px solid var(--glass-border);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.resume-btn:hover {
    border-color: var(--primary);
    background: rgba(0, 243, 255, 0.05);
}

/* Mobile Menu */
#menu-toggle {
    display: none;
}

.menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .menu-btn {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 8, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid var(--glass-border);
    }

    #menu-toggle:checked~.nav-links {
        transform: translateY(0);
    }

    .glitch {
        font-size: 2.5rem;
    }
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
    animation-delay: 0.1s;
}

.profile-img-container {
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 40px rgba(188, 19, 254, 0.3);
    margin-bottom: 2rem;
    position: relative;
}

.profile-img-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    filter: blur(10px);
    z-index: -1;
    animation: rotateGlow 5s linear infinite;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid var(--bg-color);
    object-fit: cover;
    display: block;
}

.intro-text {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 4px;
    color: var(--primary);
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #888;
    margin-bottom: 3rem;
    margin-top: 1rem;
}

/* Terminal Input */
.terminal-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 18px 30px;
    border-radius: 50px;
    width: 100%;
    max-width: 550px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    color: #aaa;
    margin-bottom: 3.5rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.terminal-input:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 25px rgba(188, 19, 254, 0.15);
    transform: translateY(-2px);
}

.blink {
    animation: blink 1s step-end infinite;
}

/* Grid Navigation */
.grid-nav {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.grid-item {
    width: 90px;
    height: 90px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grid-item i {
    font-size: 1.8rem;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.grid-item:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--primary);
    color: #fff;
    background: rgba(0, 243, 255, 0.08);
    box-shadow: 0 10px 20px rgba(0, 243, 255, 0.15);
}

.grid-item:hover i {
    color: var(--primary);
}

/* --- Social Sidebar --- */
.social-sidebar {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    z-index: 90;
}

.social-link {
    color: #666;
    font-size: 1.3rem;
    transition: all 0.3s;
}

.social-link:hover {
    color: var(--primary);
    transform: scale(1.2);
}

@media (max-width: 900px) {
    .social-sidebar {
        display: none;
    }
}

/* --- Sections & Cards --- */
.section-title {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

/* About Box */
.about-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.about-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 35px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.project-link {
    color: #666;
    font-size: 1.4rem;
    transition: 0.3s;
}

.project-link:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

.project-tags {
    margin-top: 20px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(0, 243, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 18px;
}

.skill-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 15px 10px;
    text-align: center;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.skill-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary);
    /* Grows back to the original card size on hover. */
    transform: translateY(-5px) scale(1.18);
    box-shadow: 0 10px 25px rgba(188, 19, 254, 0.15);
}

.skill-card img {
    filter: grayscale(100%);
    transition: 0.3s;
}

.skill-card:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* Chatbot starter prompts and answer area */
.starter-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.starter-chip {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.starter-chip:hover {
    background: rgba(0, 243, 255, 0.12);
    border-color: var(--primary);
}

#chat-output {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    display: flex;
}

.chat-msg-user {
    justify-content: flex-end;
}

.chat-msg-bot {
    justify-content: flex-start;
}

.chat-msg-text {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    white-space: pre-wrap;
}

.chat-msg-user .chat-msg-text {
    background: rgba(188, 19, 254, 0.12);
    border: 1px solid rgba(188, 19, 254, 0.35);
    color: #fff;
}

.chat-msg-bot .chat-msg-text {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
}

.chat-sources {
    max-width: 600px;
    margin: 0 auto;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: #888;
    text-align: left;
    padding-left: 4px;
}

@media (max-width: 600px) {
    .chat-msg-text {
        max-width: 100%;
        font-size: 0.9rem;
    }

    .starter-chip {
        font-size: 0.72rem;
        padding: 7px 11px;
    }
}

/* Skill Category Headers */
.skill-category {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(0, 243, 255, 0.55);
    text-align: left;
    margin: 2.5rem 0 1.25rem 0;
}

/* Contact CTA */
.contact-btn {
    display: inline-block;
    padding: 18px 40px;
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: all 0.3s;
    background: rgba(0, 243, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.contact-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    letter-spacing: 2px;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.6;
}

.status-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--terminal-green);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--terminal-green);
    animation: blink 2s infinite;
}

/* --- Keyframes --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes bgPulse {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 10% 10%;
    }
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(20px, 9999px, 86px, 0);
    }

    20% {
        clip: rect(60px, 9999px, 15px, 0);
    }

    40% {
        clip: rect(35px, 9999px, 140px, 0);
    }

    60% {
        clip: rect(90px, 9999px, 5px, 0);
    }

    80% {
        clip: rect(10px, 9999px, 105px, 0);
    }

    100% {
        clip: rect(75px, 9999px, 45px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(95px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 105px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 75px, 0);
    }

    60% {
        clip: rect(15px, 9999px, 130px, 0);
    }

    80% {
        clip: rect(85px, 9999px, 20px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 60px, 0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Resume viewer modal */
.resume-btn {
    cursor: pointer;
}

.resume-toggle {
    display: none;
}

.resume-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    /* Stays in layout so the iframe always has real dimensions — the embedded
       PDF viewer computes its zoom on load and won't recalc if it starts at 0x0. */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.resume-toggle:checked ~ .resume-modal {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.resume-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.resume-card {
    position: relative;
    width: min(900px, 100%);
    height: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    border: 1px solid var(--secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(188, 19, 254, 0.3);
}

.resume-toggle:checked ~ .resume-modal .resume-card {
    animation: resume-pop 0.25s ease;
}

@keyframes resume-pop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

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

.resume-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
}

.resume-card-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #aaa;
}

.resume-card-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.resume-dl {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--terminal-green);
    border: 1px solid var(--terminal-green);
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.resume-dl:hover {
    background: rgba(57, 255, 20, 0.12);
}

.resume-close {
    color: #ccc;
    font-size: 1.3rem;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.resume-close:hover {
    color: var(--secondary);
}

.resume-frame {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: none;
    background: #fff;
}