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

:root {
    /* Base dark theme */
    --bg-color: #0b0f19;
    --bg-color-2: #1e293b;
    --font-color: #e2e8f0;
    --font-color-2nd: #94a3b8;

    --card-color: rgba(30, 41, 59, 0.4);
    --card-border-color: rgba(255, 255, 255, 0.08);

    --text-highlight: #4ade80;
    /* Emerald */
    --color-bright: #38bdf8;
    /* Blue bright highlight */

    /* Modern Gradients */
    --bg-gradient-1: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    --bg-gradient-2: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --bg-gradient-3: linear-gradient(135deg, #4ade80 0%, #10b981 100%);
    --gradient-text: linear-gradient(to right, #38bdf8, #a855f7, #4ade80);

    --shadow-glow: rgba(56, 189, 248, 0.2);
    --font-size: clamp(14px, 1.2vw, 18px);
}

::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--bg-color-2);
    border-radius: 6px;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--font-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--font-size);
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

highlight {
    color: var(--text-highlight);
    font-weight: 600;
}

.font-mono {
    font-family: 'Fira Code', monospace;
}

/* Background Blobs */
.bg-gradient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.35;
    animation: floatBlob 25s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--bg-gradient-1);
}

.blob-2 {
    top: 40%;
    right: -20%;
    width: 40vw;
    height: 40vw;
    background: var(--bg-gradient-2);
    animation-direction: reverse;
    animation-duration: 30s;
}

.blob-3 {
    bottom: -10%;
    left: 20%;
    width: 60vw;
    height: 40vw;
    background: var(--bg-gradient-3);
    animation-duration: 20s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1.0);
    }

    50% {
        transform: translate(5%, 10%) scale(1.1);
    }

    100% {
        transform: translate(-5%, -5%) scale(0.9);
    }
}

/* Glassmorphism */
.glass-panel,
.glass-card {
    background: var(--card-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-glow);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Typography elements */
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.section-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.content-wrapper {
    max-width: 1200px;
    width: 100%;
    padding: 0 5vw;
}

/* TOP BAR */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5rem;
    padding: 0 5vw;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 50;
    transition: color 500ms, background 500ms;
    color: var(--font-color);
    background: rgba(11, 15, 25, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar .name-item {
    margin-right: auto;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: #fff;
}

.top-bar .item {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.top-bar .item:hover {
    color: var(--color-bright);
}

.top-bar .item svg {
    width: 2rem;
    height: 2rem;
    margin-left: 0.5rem;
    fill: currentColor;
}

.top-bar .collapsable-menu {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    background-color: var(--bg-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: max-content;
    padding: 1rem 0;
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1), opacity 400ms;
    opacity: 1;
}

.top-bar .collapsable-menu.hidden {
    opacity: 0;
    transform: translateX(200%) scale(0.9);
    pointer-events: none;
}

.top-bar .collapsable-menu .item {
    padding: 1rem 2rem;
    justify-content: space-between;
    width: 100%;
}

.top-bar .collapsable-menu .item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.top-bar .collapsable-menu .item svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 1rem;
}

/* HERO SECTION */
.hero-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 6rem;
}

.hero-section .top {
    padding: 4rem 2rem;
    max-width: 900px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-desc {
    font-size: 1.5rem;
    color: var(--font-color-2nd);
    line-height: 1.6;
}

/* AI AGENTS SECTION - TERMINAL */
.ai-agents-section {
    padding: 6rem 0;
    text-align: center;
}

.terminal-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--card-border-color);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    position: absolute;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-buttons .close {
    background: #ff5f56;
}

.terminal-buttons .minimize {
    background: #ffbd2e;
}

.terminal-buttons .maximize {
    background: #27c93f;
}

.terminal-title {
    margin: 0 auto;
    color: var(--font-color-2nd);
    font-size: 0.85rem;
}

.terminal-body {
    padding: 2rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #e2e8f0;
    text-align: left;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.terminal-body .prompt {
    color: var(--text-highlight);
    font-weight: bold;
    margin-right: 10px;
}

.typewriter-line {
    opacity: 0;
    animation: revealLine 0.1s forwards;
    margin-bottom: 0.5rem;
}

.typewriter-line[class*="delay"] {
    opacity: 0;
}

.delay-1 {
    animation-delay: 1.5s;
}

.delay-2 {
    animation-delay: 3s;
    color: #fbbf24;
}

/* Warning color for Resolving */
.delay-3 {
    animation-delay: 5s;
    color: #4ade80;
}

/* Success patch */
.delay-4 {
    animation-delay: 6s;
}

.delay-5 {
    animation-delay: 7.5s;
}

.delay-6 {
    animation-delay: 8s;
}

@keyframes revealLine {
    to {
        opacity: 1;
    }
}

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

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

/* MICROSERVICES SECTION */
.architecture-section {
    padding: 8rem 0;
    text-align: center;
}

.microservices-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 800 / 500;
    height: auto;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 20px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.ms-node {
    position: absolute;
    transform: translateX(-50%);
    z-index: 2;
    background: var(--bg-color-2);
    border: 2px solid var(--color-bright);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    transition: transform 0.3s;
}

.ms-node:hover {
    transform: translateX(-50%) scale(1.05);
}

.client-node {
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.lb-node {
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.auth-node,
.data-node {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.db-node {
    border-color: #f43f5e;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
    width: 220px;
}

/* Producer Consumer Pattern */
.producer-consumer-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 800 / 180;
    height: auto;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 20px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.producer-node {
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.queue-node {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    background: rgba(30, 41, 59, 0.8);
}

.consumer-node {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.producer-consumer-wrapper .ms-node {
    transition: transform 0.3s;
}

.producer-consumer-wrapper .ms-node:hover {
    transform: translate(-50%, -50%) scale(1.05) !important;
}

/* SVG Animation Helpers */
.dash-anim {
    stroke-dasharray: 8 8;
    animation: dash-flow 2s linear infinite;
}

.dash-anim.reverse {
    animation-direction: reverse;
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -16;
    }
}

/* PROJECTS SECTION */
.projects-section {
    padding: 6rem 0;
    display: flex;
    flex-direction: column;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    justify-items: center;
}

.proj-card {
    padding: 2.5rem;
    text-align: left;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.proj-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.proj-desc {
    color: var(--font-color-2nd);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.tech-tags span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--font-color-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-link a {
    color: var(--color-bright);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.github-link a:hover {
    text-decoration: underline;
}


/* CONTACT SECTION */
.contact-section {
    padding: 8rem 0;
    display: flex;
    justify-content: center;
}

.contact-content {
    padding: 4rem;
    text-align: center;
    width: 100%;
    max-width: 800px;
    border: 1px solid var(--text-highlight);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.2);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.contact-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 30px;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--color-bright);
    color: var(--color-bright);
}

@media screen and (max-width: 800px) {
    .microservices-wrapper {
        width: 100%;
        transform: scale(1);
        /* Reset scale from original media query */
        height: auto;
        /* Ensure height is auto with aspect-ratio */
    }

    .ms-node {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .client-node,
    .lb-node {
        width: auto;
    }

    .db-node {
        width: 140px;
    }

    .producer-consumer-wrapper {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3rem;
        padding: 2rem 0;
        margin-top: -20px;
        transform: scale(1);
        /* Reset scale from original media query */
        height: auto;
        /* Ensure height is auto with aspect-ratio */
    }

    .producer-consumer-wrapper svg {
        display: none !important;
    }

    .producer-consumer-wrapper .ms-node {
        position: relative;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 80%;
        max-width: 300px;
        white-space: normal;
    }

    .producer-consumer-wrapper .producer-node::after,
    .producer-consumer-wrapper .queue-node::after {
        content: '↓';
        position: absolute;
        bottom: -2.3rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.5rem;
        color: var(--color-bright);
    }

    .producer-consumer-wrapper .ms-node:hover {
        transform: scale(1.05) !important;
    }

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

    .terminal-body {
        height: auto;
    }
}

@media screen and (max-width: 600px) {
    footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}