/* ===========================================
   CSS Variables & Global Styles
   =========================================== */
:root {
    /* Colors */
    --primary: #a855f7;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --neon-green: #10b981;
    --neon-blue: #3b82f6;

    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: rgba(17, 17, 24, 0.8);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-holographic: linear-gradient(135deg,
        rgba(168, 85, 247, 0.2) 0%,
        rgba(236, 72, 153, 0.2) 50%,
        rgba(6, 182, 212, 0.2) 100%);

    /* Effects */
    --glow-primary: 0 0 20px rgba(168, 85, 247, 0.6);
    --glow-secondary: 0 0 20px rgba(236, 72, 153, 0.6);

    /* Fonts */
    --font-primary: 'Space Grotesk', sans-serif;
    --font-heading: 'Orbitron', monospace;
    --font-code: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===========================================
   Cursor Glow Effect
   =========================================== */
.cursor-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ===========================================
   Canvas Backgrounds
   =========================================== */
#neural-canvas,
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#neural-canvas {
    opacity: 0.4;
}

#matrix-canvas {
    opacity: 0.15;
}

/* ===========================================
   Navigation
   =========================================== */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

.nav-container.scrolled {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.logo-bracket {
    color: var(--primary);
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ===========================================
   Hero Section
   =========================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    z-index: 10;
}

.glitch-wrapper {
    overflow: hidden;
}

.glitch-text {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

.typing-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
    font-family: var(--font-code);
    font-size: 1.5rem;
}

.terminal-prompt {
    color: var(--neon-green);
    font-weight: 700;
}

.typed-text {
    color: var(--accent);
}

.cursor-blink {
    color: var(--primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.8);
}

.btn-secondary {
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-3px);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

/* ===========================================
   Hero Visual - System Architecture
   =========================================== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.system-architecture {
    position: relative;
    width: 500px;
    height: 500px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.arch-sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.6),
                inset 0 0 60px rgba(168, 85, 247, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

.arch-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
}

.arch-ring-1 {
    width: 250px;
    height: 250px;
    animation: rotate 10s linear infinite;
}

.arch-ring-2 {
    width: 350px;
    height: 350px;
    animation: rotate 15s linear infinite reverse;
}

.arch-ring-3 {
    width: 450px;
    height: 450px;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===========================================
   Terminal Section
   =========================================== */
.terminal-section {
    padding: 4rem 0;
}

.terminal-window {
    background: rgba(17, 17, 24, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.terminal-header {
    background: rgba(10, 10, 15, 0.95);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

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

.terminal-btn-close {
    background: #ff5f57;
}

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

.terminal-btn-maximize {
    background: #28ca42;
}

.terminal-title {
    font-family: var(--font-code);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.terminal-body {
    padding: 2rem;
    font-family: var(--font-code);
    font-size: 1rem;
    line-height: 1.8;
}

.code-block {
    margin: 0.25rem 0;
}

.code-keyword {
    color: #c678dd;
}

.code-class {
    color: #61afef;
}

.code-function {
    color: #61afef;
}

.code-string {
    color: #98c379;
}

/* ===========================================
   Contribution Banner
   =========================================== */
.highlight-section {
    padding: 4rem 0;
}

.contribution-banner {
    background: var(--gradient-holographic);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    border: 2px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
}

.banner-icon {
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.banner-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.banner-content h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.banner-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.banner-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-microsoft {
    background: linear-gradient(135deg, #00a4ef 0%, #0078d4 100%);
    color: white;
}

.badge-python {
    background: linear-gradient(135deg, #3776ab 0%, #ffd43b 100%);
    color: white;
}

.badge-mcp {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
}

.badge-opensource {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* ===========================================
   Tech Stack Section
   =========================================== */
.tech-section {
    padding: 6rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    white-space: nowrap;
}

.title-number {
    color: var(--primary);
    margin-right: 1rem;
}

.title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.5) 0%, transparent 100%);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.tech-category {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
}

.tech-category:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.3);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-icon {
    font-size: 2rem;
}

.category-header h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

.tech-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-card {
    padding: 0.5rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-card:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===========================================
   Projects Section
   =========================================== */
.projects-section {
    padding: 6rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card-3d {
    perspective: 1000px;
}

.project-hologram {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
    transform-style: preserve-3d;
}

.project-card-3d:hover .project-hologram {
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
}

.hologram-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.project-date {
    font-family: var(--font-code);
    color: var(--neon-green);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.project-hologram h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.project-hologram p {
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent);
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--secondary);
    gap: 1rem;
}

.arrow {
    transition: transform 0.3s ease;
}

.project-link:hover .arrow {
    transform: translateX(5px);
}

.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===========================================
   Writing Section
   =========================================== */
.writing-section {
    padding: 6rem 0;
}

.writing-content {
    max-width: 900px;
    margin: 0 auto;
}

.writing-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
}

.writing-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
}

.writing-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.writing-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.writing-card > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.writing-topics {
    list-style: none;
    margin-bottom: 3rem;
}

.writing-topics li {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    background: rgba(168, 85, 247, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.writing-topics li:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateX(10px);
}

.writing-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.writing-cta {
    text-align: center;
}

/* ===========================================
   Contact Section
   =========================================== */
.contact-section {
    padding: 6rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.contact-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.contact-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.contact-link:hover {
    color: var(--secondary);
    gap: 1rem;
}

.contact-quote {
    text-align: center;
    padding: 3rem;
    background: var(--gradient-holographic);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.contact-quote p {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===========================================
   Footer
   =========================================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-tech {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-visual {
        order: -1;
    }

    .system-architecture {
        width: 300px;
        height: 300px;
    }

    .glitch-text {
        font-size: 3rem;
    }

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

    .contribution-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .banner-icon {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        width: 100%;
        max-width: 300px;
        padding: 2rem;
        border-radius: 12px 0 0 12px;
        border: 1px solid rgba(168, 85, 247, 0.2);
        transition: right 0.3s ease;
    }

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

    .nav-toggle {
        display: flex;
    }

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

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

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

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

    .typing-container {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .section-title {
        font-size: 2rem;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .glitch-text {
        font-size: 2rem;
    }

    .terminal-body {
        font-size: 0.85rem;
        padding: 1rem;
    }

    .contribution-banner {
        padding: 2rem;
    }

    .banner-content h2 {
        font-size: 1.5rem;
    }

    .banner-content h3 {
        font-size: 1.2rem;
    }

    .writing-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .writing-card {
        padding: 2rem 1.5rem;
    }

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