/* ========================================
   MB Company Site - Pure CSS
   Light/Dark Theme Support
   ======================================== */

/* CSS Variables */
:root {
    /* Light mode colors (default) */
    --color-bg: #fafafa;
    --color-bg-80: rgba(250, 250, 250, 0.8);
    --color-bg-95: rgba(250, 250, 250, 0.95);
    --color-surface-50: #f4f4f5;
    --color-surface-100: #e4e4e7;
    --color-text: #18181b;
    --color-text-muted: #52525b;
    --color-text-subtle: #71717a;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-input: rgba(0, 0, 0, 0.15);

    /* Accent colors */
    --color-accent-purple: #a855f7;
    --color-accent-pink: #ec4899;
    --color-accent-orange: #f97316;
    --color-accent-blue: #3b82f6;

    /* Gradients */
    --gradient-accent: linear-gradient(
        135deg,
        #a855f7 0%,
        #ec4899 50%,
        #f97316 100%
    );
    --gradient-subtle: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.1) 0%,
        rgba(236, 72, 153, 0.1) 100%
    );

    /* Show/hide glow */
    --glow-opacity: 0;
    --grid-opacity: 0;
}

/* Dark mode */
.dark {
    --color-bg: #0a0a0b;
    --color-bg-80: rgba(10, 10, 11, 0.8);
    --color-bg-95: rgba(10, 10, 11, 0.95);
    --color-surface-50: #18181b;
    --color-surface-100: #1f1f23;
    --color-text: #fafafa;
    --color-text-muted: #a1a1aa;
    --color-text-subtle: #71717a;
    --color-border: rgba(255, 255, 255, 0.05);
    --color-border-input: rgba(255, 255, 255, 0.1);
    --glow-opacity: 1;
    --grid-opacity: 0.6;
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family:
        "DM Sans",
        system-ui,
        -apple-system,
        sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    transition:
        background-color 0.3s,
        color 0.3s;
}

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

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   Utility Classes
   ======================================== */
.container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--gradient-accent);
    color: white;
    border-radius: 0.5rem;
}

/* ========================================
   Background Effects
   ======================================== */
.bg-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(
        600px circle at 50% 50%,
        rgba(168, 85, 247, 0.06),
        transparent 40%
    );
    pointer-events: none;
    opacity: var(--glow-opacity);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgyNTUsMjU1LDI1NSwwLjAyKSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+");
    pointer-events: none;
    opacity: var(--grid-opacity);
}

/* ========================================
   Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 40;
    background-color: var(--color-bg-80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

/* Header brand text — appears on scroll */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-0.5rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.header-brand-text.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.header-brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}

.header-brand-motto {
    font-size: 0.7rem;
    color: var(--color-text-subtle);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

.logo {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    transition: transform 0.2s;
}


.logo-xl {
    width: 6rem;
    height: 6rem;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
    list-style: none;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.lang-switch {
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.lang-switch:hover {
    color: var(--color-text);
}

.lang-switch.active {
    color: var(--color-accent);
    background: var(--color-surface);
}

.lang-sep {
    color: var(--color-text-muted);
    opacity: 0.4;
    font-size: 0.75rem;
}

.theme-toggle {
    padding: 0.5rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

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

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Sun icon visible in light mode */
.icon-sun {
    display: block;
}
.icon-moon {
    display: none;
}

.dark .icon-sun {
    display: none;
}
.dark .icon-moon {
    display: block;
}

/* Mobile menu */
.mobile-menu-toggle {
    display: block;
    padding: 0.5rem;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-menu-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    top: 4rem;
    background-color: var(--color-bg-95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: var(--color-text);
}

/* ========================================
   Main Content
   ======================================== */
.main {
    position: relative;
    padding-top: 5rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 4.5rem 1.5rem 2.5rem;
    }
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

@media (min-width: 768px) {
    .hero-avatar {
        width: 110px;
        height: 110px;
    }
}

@media (min-width: 1024px) {
    .hero-avatar {
        width: 140px;
        height: 140px;
    }
}

.hero-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.hero-avatar-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}


.hero-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 3.25rem;
    }
}

.hero-motto {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 0.6rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .hero-motto {
        font-size: 1.3rem;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-divider {
    max-width: 20rem;
    height: 1px;
    margin: 2rem auto 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.3) 30%,
        rgba(236, 72, 153, 0.2) 70%,
        transparent 100%
    );
}

/* ========================================
   Cards
   ======================================== */
.card {
    padding: 1.5rem;
    background-color: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
}

.card-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-accent);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.card h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.card-subtle {
    background: var(--gradient-subtle);
    border-color: rgba(168, 85, 247, 0.2);
}

/* ========================================
   Skills Grid
   ======================================== */
.skills-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Experience Timeline
   ======================================== */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.experience-item {
    padding: 1.5rem;
    background-color: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
}

.experience-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .experience-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.experience-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.experience-date {
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

.experience-company {
    font-size: 0.875rem;
    color: var(--color-accent-purple);
    margin-bottom: 0.25rem;
}

.experience-description {
    color: var(--color-text-muted);
}

/* ========================================
   Section Styles
   ======================================== */
.section {
    padding: 4rem 0;
}

.section-border {
    border-top: 1px solid var(--color-border);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-label {
    color: var(--color-accent-purple);
    font-weight: 500;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
}

/* ========================================
   About Page
   ======================================== */
.about-hero {
    display: grid;
    gap: 3rem;
    align-items: center;
    margin-bottom: 6rem;
}

@media (min-width: 768px) {
    .about-hero {
        grid-template-columns: 1fr 1fr;
    }
}

.about-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-image {
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.about-glow {
    position: absolute;
    bottom: -1rem;
    right: -1rem;
    width: 6rem;
    height: 6rem;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    filter: blur(2rem);
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 1.125rem;
    color: var(--color-text-muted);
    line-height: 1.75;
}

/* ========================================
   Contact Page
   ======================================== */
.contact-grid {
    display: grid;
    gap: 3rem;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-form {
    padding: 2rem;
    background-color: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border-input);
    border-radius: 0.75rem;
    color: var(--color-text);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-subtle);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-textarea {
    resize: none;
    min-height: 8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition:
        opacity 0.2s,
        transform 0.2s;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-accent);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   Ask AI Component
   ======================================== */
.ask-ai-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.ask-ai {
    flex: 1;
    min-width: 0;
    margin: 1rem 0;
    padding: 2rem;
    background-color: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1.5rem;
    position: relative;
}

.ask-ai-disabled-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 1.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .ask-ai-disabled-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.ask-ai-disabled-content {
    text-align: center;
    color: #fff;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 1rem;
    backdrop-filter: blur(4px);
}

.ask-ai-disabled-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    color: #fff;
}

.ask-ai-disabled-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.ask-ai-header {
    margin-bottom: 1.5rem;
}

.ask-ai-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ask-ai-info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--color-accent-purple);
    cursor: default;
    flex-shrink: 0;
    user-select: none;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.ask-ai-info-icon:hover {
    opacity: 1;
}

.ask-ai-info-tooltip {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.5rem);
    width: 280px;
    background: var(--color-bg-95);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text-muted);
    box-shadow: 0 4px 20px rgba(0,0,0,0.22);
    z-index: 100;
    pointer-events: none;
    white-space: normal;
}

.ask-ai-info-icon:hover .ask-ai-info-tooltip {
    display: block;
}

.ask-ai-subtitle {
    color: var(--color-text-muted);
}

.ask-ai-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ask-ai-input-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .ask-ai-input-row {
        flex-direction: row;
    }
}

.ask-ai-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border-input);
    border-radius: 0.75rem;
    color: var(--color-text);
    font-size: 1rem;
}

.ask-ai-input:focus {
    outline: none;
    border-color: var(--color-accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.ask-ai-btn {
    padding: 0.875rem 2rem;
    background: var(--gradient-accent);
    color: white;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.ask-ai-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.ask-ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ask-ai-chat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ask-ai-chat:empty {
    display: none;
}

.ask-ai-suggestions-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}

.ask-ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 1.25rem;
}

.ask-ai-suggestions:empty {
    display: none;
}

.ask-ai-suggestion-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
}

.ask-ai-suggestion-group + .ask-ai-suggestion-group {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.ask-ai-suggestion {
    background: transparent;
    border: 1.5px solid var(--color-accent-purple);
    color: var(--color-accent-purple);
    padding: 0.4rem 0.9rem;
    border-radius: 1.25rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ask-ai-suggestion:hover {
    background: var(--color-accent-purple);
    color: #fff;
    transform: translateY(-1px);
}

.chat-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.chat-tech-tag {
    background: var(--accent);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.85;
}

.chat-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.chat-followup-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 1.25rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-followup-btn:hover {
    background: var(--accent);
    color: #fff;
}

.chat-msg {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    line-height: 1.6;
    max-width: 85%;
    animation: slideUp 0.3s ease-out;
}

.chat-msg-user {
    background: var(--gradient-accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chat-msg-ai {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}
.chat-msg-ai p {
    margin: 0 0 0.5em;
}
.chat-msg-ai p:last-child {
    margin-bottom: 0;
}
.chat-msg-ai ul,
.chat-msg-ai ol {
    margin: 0.25em 0;
    padding-left: 1.5em;
}
.chat-msg-ai code {
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.chat-msg-ai pre {
    background: var(--color-surface);
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5em 0;
}
.chat-msg-ai pre code {
    background: none;
    padding: 0;
}
.chat-msg-ai strong {
    font-weight: 600;
}

.chat-msg-meta {
    font-size: 0.7rem;
    color: var(--color-text-subtle);
    margin-top: 0.375rem;
}

.ask-ai-form-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ask-ai-counter {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.ask-ai-reset {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

.ask-ai-reset:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.ask-ai-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

.ask-ai-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.ask-ai-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.ask-ai-meta {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-subtle);
}

/* Technology Sidebar — osobny box obok konwersacji */
.tech-sidebar {
    display: none;
    width: 420px;
    flex-shrink: 0;
    margin: 1rem 0;
    padding: 1.5rem;
    background-color: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1.5rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.tech-sidebar.visible {
    display: block;
}

.tech-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tech-sidebar-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin: 0;
}

.tech-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface-100);
    color: var(--color-text);
    outline: none;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.tech-search:focus {
    border-color: #a855f7;
}

.tech-search::placeholder {
    color: var(--color-text-subtle);
}

.tech-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.tech-filter-btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.tech-filter-btn:hover {
    border-color: var(--color-text-subtle);
    color: var(--color-text);
}

.tech-filter-btn.active {
    background: #a855f7;
    border-color: #a855f7;
    color: #fff;
}

.tech-show-all-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.tech-show-all-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: #a855f7;
}

.tech-sidebar-empty {
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    text-align: center;
    padding: 1rem 0;
}

.tech-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-sidebar-category {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-subtle);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.tech-sidebar-category:first-child {
    margin-top: 0;
}

.tech-item {
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    margin: 0;
    background: var(--color-surface-100);
    border: 1px solid var(--color-border);
}

.tech-item:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08);
}

.tech-sidebar-category.highlighted-category {
    color: #a855f7;
}

.tech-sidebar-separator {
    height: 1px;
    background: var(--color-border);
    margin: 0.75rem 0;
}

.tech-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.tech-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.tech-item-badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.tech-item-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tech-item-badge.inactive {
    background: rgba(113, 113, 122, 0.15);
    color: var(--color-text-subtle);
}


.tech-item-desc {
    font-size: 0.875rem;
    color: var(--color-text-subtle);
    line-height: 1.4;
}

.tech-item-chevron {
    margin-left: 0.25rem;
    color: var(--color-text-subtle);
    font-size: 0.9rem;
}

.tech-item-last-used {
    font-size: 0.7rem;
    color: var(--color-text-subtle);
    margin-top: 0.1rem;
    opacity: 0.7;
}

.tech-item-match {
    font-size: 0.825rem;
    color: #a855f7;
    font-weight: 500;
    margin-top: 0.15rem;
}

/* All Technologies Overlay */
.tech-all-overlay {
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.tech-all-overlay .tech-overlay-header,
.tech-all-overlay .tech-search,
.tech-all-overlay .tech-filters {
    flex-shrink: 0;
}

.tech-all-overlay .tech-search {
    margin-bottom: 0.5rem;
}

.tech-all-overlay .tech-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.tech-all-overlay .tech-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.tech-all-detail {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.tech-all-detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tech-all-back-btn {
    font-size: 0.8rem;
    font-weight: 500;
    color: #a855f7;
    background: none;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tech-all-back-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
}

.tech-all-detail-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-overlay-ai-banner {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.tech-overlay-ai-banner-link {
    background: none;
    border: none;
    color: #a855f7;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tech-overlay-ai-banner-link:hover {
    color: #9333ea;
}

.tech-all-detail-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.75rem;
}

/* Technology Overlay */
.tech-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.tech-overlay {
    background: var(--color-surface-50);
    border: 1px solid var(--color-border);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 640px;
    width: 92vw;
    max-height: 80vh;
    overflow-y: auto;
    animation: overlaySlideIn 0.3s ease-out;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

@keyframes overlaySlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tech-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tech-overlay-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.tech-overlay-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.tech-overlay-counter {
    font-size: 0.65rem;
    color: var(--color-text-subtle);
    margin-top: 0.15rem;
}

.tech-overlay-nav {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.2rem 0.6rem;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.tech-overlay-nav:hover:not(:disabled) {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    background: var(--color-surface-100);
}

.tech-overlay-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.tech-overlay-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.tech-overlay-close:hover {
    color: var(--color-text);
}

.tech-overlay-badge-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tech-item-badge.last-used {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}


.tech-overlay-desc {
    font-size: 0.95rem;
    color: var(--color-text-subtle);
    line-height: 1.5;
    margin: 0.75rem 0;
}

.tech-overlay-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.tech-overlay-meta-item {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: var(--color-surface-100);
    color: var(--color-text-muted);
    font-weight: 500;
}

.tech-overlay-cert {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.tech-overlay-notes {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0.25rem 0 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--color-surface-100);
    border-radius: 0.5rem;
    border-left: 2px solid #a855f7;
}

.tech-overlay-highlights {
    font-size: 0.9rem;
    color: var(--color-text-subtle);
    line-height: 1.5;
    margin: 0.5rem 0;
    font-style: italic;
}

.tech-overlay-sub-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin: 1.25rem 0 0.75rem;
}

.tech-overlay-sub-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.tech-subsection {
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--color-surface-100);
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.tech-subsection.matched {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
}

.tech-subsection-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.2rem;
    margin-bottom: 0.25rem;
}

.tech-subsection-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.tech-subsection-badges {
    display: flex;
    gap: 0.3rem;
}

.tech-subsection-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tech-subsection-badge.production {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tech-subsection-badge.frequency {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.tech-subsection-badge.last-used {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

.tech-subsection-desc {
    font-size: 0.7rem;
    color: var(--color-text-subtle);
    line-height: 1.4;
    margin-top: 0.15rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile: sidebar below chat */
@media (max-width: 768px) {
    .ask-ai-section {
        flex-direction: column;
    }

    .tech-sidebar {
        width: 100%;
        margin-top: 0;
        position: static;
    }

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

/* ========================================
   Footer
   ======================================== */
.footer {
    position: relative;
    margin-top: 8rem;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.footer-grid {
    display: grid;
    gap: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer h3 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

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

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

.back-to-top {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    transition: color 0.2s, border-color 0.2s;
}

.back-to-top:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

/* ========================================
   Page Titles
   ======================================== */
.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 3rem;
    }
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 32rem;
    margin: 0 auto;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
.tech-overlay,
.tech-all-overlay .tech-sidebar-list,
.tech-all-detail,
.tech-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.25) transparent;
}

.tech-overlay::-webkit-scrollbar,
.tech-all-overlay .tech-sidebar-list::-webkit-scrollbar,
.tech-all-detail::-webkit-scrollbar,
.tech-sidebar::-webkit-scrollbar {
    width: 6px;
}

.tech-overlay::-webkit-scrollbar-track,
.tech-all-overlay .tech-sidebar-list::-webkit-scrollbar-track,
.tech-all-detail::-webkit-scrollbar-track,
.tech-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.tech-overlay::-webkit-scrollbar-thumb,
.tech-all-overlay .tech-sidebar-list::-webkit-scrollbar-thumb,
.tech-all-detail::-webkit-scrollbar-thumb,
.tech-sidebar::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.25);
    border-radius: 3px;
}

.tech-overlay::-webkit-scrollbar-thumb:hover,
.tech-all-overlay .tech-sidebar-list::-webkit-scrollbar-thumb:hover,
.tech-all-detail::-webkit-scrollbar-thumb:hover,
.tech-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.4);
}

/* ========================
   Blog
   ======================== */
.blog-section { padding: 3rem 0; }
.blog-page-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.blog-page-subtitle { color: var(--color-text-muted); margin-bottom: 2.5rem; }
.blog-list { display: flex; flex-direction: column; gap: 1.5rem; }
.blog-card { background: var(--color-surface-50); border: 1px solid var(--color-border);
  border-radius: 0.75rem; padding: 1.5rem; transition: border-color 0.2s; }
.blog-card:hover { border-color: var(--color-accent-purple); }
.blog-card-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.blog-card-meta time { color: var(--color-text-subtle); font-size: 0.875rem; }
.blog-card-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.blog-tag { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 9999px;
  background: var(--gradient-subtle); color: var(--color-accent-purple); }
.blog-card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.blog-card-title a { color: var(--color-text); text-decoration: none; }
.blog-card-title a:hover { color: var(--color-accent-purple); }
.blog-card-desc { color: var(--color-text-muted); margin-bottom: 1rem; }
.blog-card-read-more { color: var(--color-accent-purple); font-size: 0.875rem; text-decoration: none; }

/* Blog post detail */
.blog-post { max-width: 72ch; margin: 0 auto; padding: 3rem 1.5rem; }
.blog-post-back { color: var(--color-accent-purple); text-decoration: none;
  font-size: 0.875rem; margin-bottom: 2rem; display: inline-block; }
.blog-post-header { margin-bottom: 2.5rem; }
.blog-post-title { font-size: 2rem; font-weight: 700; margin: 1rem 0; }
.blog-post-date { color: var(--color-text-subtle); font-size: 0.875rem; }
.blog-post-tags { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.blog-post-content h2 { font-size: 1.5rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.blog-post-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.blog-post-content p { margin-bottom: 1rem; line-height: 1.75; }
.blog-post-content code { background: var(--color-surface-50);
  padding: 0.15rem 0.4rem; border-radius: 0.25rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.875em; }
.blog-post-content pre { border-radius: 0.5rem; overflow-x: auto; margin: 1.5rem 0; }
.blog-post-content pre:not([class*="language-"]) { background: var(--color-surface-50);
  border: 1px solid var(--color-border); padding: 1rem; }
.blog-post-content pre code { background: none; padding: 0; }
.blog-post-content pre[class*="language-"] { border: 1px solid var(--color-border); }
.blog-post-content pre[class*="language-"] code { font-size: 0.875em; }
.blog-post-content a { color: var(--color-accent-purple); }
.blog-post-content ul, .blog-post-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.blog-post-content li { line-height: 1.75; }
.blog-post-content blockquote { border-left: 3px solid var(--color-accent-purple);
  padding-left: 1rem; color: var(--color-text-muted); margin: 1.5rem 0; }
.blog-post-content img { max-width: 100%; height: auto; border-radius: 0.5rem;
  border: 1px solid var(--color-border); margin: 1.5rem 0; display: block; }
.blog-post-content .mermaid-diagram {
  margin: 1.5rem 0; text-align: center;
  background: var(--color-surface-50); border: 1px solid var(--color-border);
  border-radius: 0.75rem; padding: 1.5rem; overflow-x: auto;
}
.blog-post-content .mermaid-diagram svg { max-width: 100%; height: auto; }
.blog-post-content .mermaid-dark { display: none; }
.dark .blog-post-content .mermaid-light { display: none; }
.dark .blog-post-content .mermaid-dark { display: block; }
