:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    letter-spacing: -1px;
    text-decoration: none;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-cv-link {
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-left: 1.5rem !important;
}

.nav-cv-link:hover {
    background: var(--primary);
    color: white !important;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    margin: 5px 0;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    width: 100%;
    max-width: 1200px;
}

.hero-content {
    flex: 1;
    text-align: left;
    animation: fadeInUp 1s ease-out;
}

.hero-image {
    flex: 0 0 400px;
    position: relative;
    animation: fadeInUp 1.2s ease-out;
    background: var(--bg-dark);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.hero-image img {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
}

.photo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130%;
    height: 130%;
    background: var(--accent-gradient);
    filter: blur(60px);
    opacity: 0.2;
    z-index: -1;
}

.hero h1.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

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

.page-shell {
    padding-top: 150px;
    padding-bottom: 70px;
}

.page-shell--narrow {
    max-width: 1040px;
}

.subpage-hero {
    margin-bottom: 3rem;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.16), transparent 42%),
                rgba(255, 255, 255, 0.02);
    padding: clamp(1.5rem, 3vw, 3rem);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.subpage-hero__eyebrow {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.subpage-hero__title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.08;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subpage-hero__copy {
    max-width: 760px;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.8;
}

.page-intro {
    max-width: 780px;
    margin: 0 auto 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.08rem;
}

.content-stack {
    display: grid;
    gap: 2rem;
}

.content-card {
    max-width: 1000px;
    margin: 0 auto;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.content-title {
    color: var(--text-main);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin-bottom: 1rem;
}

.content-copy {
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.85;
}

.panel-title {
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.panel-copy {
    color: var(--text-muted);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
    text-align: center;
}

.cta-button.outline {
    background: transparent;
    border-color: var(--primary);
}

.cta-button.ghost {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

/* Sections */
section {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Cards (Projects, Experience) */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding-top: 10px;
}

.card {
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    background: var(--glass-bg);
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
}

.card p {
    margin-top: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    padding: 50px 5%;
    border-top: 1px solid var(--glass-border);
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: var(--text-muted);
    margin-left: 1.5rem;
    text-decoration: none;
}

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

    .nav-links {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 80px;
        background: rgba(2, 6, 23, 0.95);
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem 5%;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links a {
        margin: 0 0 0.8rem;
    }

    .nav-links.is-open {
        display: flex;
    }

    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .subpage-hero {
        text-align: center;
    }

    .subpage-hero__copy {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .hero-image img {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .visitor-badge {
        margin: 1rem auto 0;
    }
}

/* Visitor Counter Badge */
.visitor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 0.55rem 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    animation: fadeInUp 1.4s ease-out;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    user-select: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.visitor-badge:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

.visitor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.75);
    }
}

.visitor-icon {
    width: 15px;
    height: 15px;
    color: var(--primary);
    flex-shrink: 0;
}

.visitor-label {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.visitor-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Chatbot */
.chatbot-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
}

.chatbot-button {
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1.25rem;
    background: var(--chatbot-accent-gradient, var(--accent-gradient));
    color: #fff;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 18px 40px var(--chatbot-shadow, rgba(99, 102, 241, 0.28));
    cursor: pointer;
}

.chatbot-button[data-topic="cv"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --chatbot-shadow: rgba(59, 130, 246, 0.28);
}

.chatbot-button[data-topic="experience"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
    --chatbot-shadow: rgba(14, 165, 233, 0.28);
}

.chatbot-button[data-topic="skills"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --chatbot-shadow: rgba(16, 185, 129, 0.28);
}

.chatbot-button[data-topic="projects"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #f59e0b 0%, #fb7185 100%);
    --chatbot-shadow: rgba(245, 158, 11, 0.28);
}

.chatbot-button[data-topic="contact"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    --chatbot-shadow: rgba(236, 72, 153, 0.28);
}

.chatbot-button[data-topic="education"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --chatbot-shadow: rgba(168, 85, 247, 0.28);
}

.chatbot-button[data-topic="general"] {
    --chatbot-accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --chatbot-shadow: rgba(99, 102, 241, 0.28);
}

.chatbot-window {
    --chatbot-accent-start: #6366f1;
    --chatbot-accent-end: #a855f7;
    --chatbot-accent-soft: rgba(99, 102, 241, 0.12);
    --chatbot-accent-border: rgba(99, 102, 241, 0.35);
    --chatbot-accent-text: #e0e7ff;
    --chatbot-shadow: rgba(99, 102, 241, 0.28);
    --chatbot-accent-gradient: linear-gradient(135deg, var(--chatbot-accent-start) 0%, var(--chatbot-accent-end) 100%);
    --chatbot-glow: rgba(99, 102, 241, 0.24);
    position: fixed;
    right: 24px;
    bottom: 84px;
    width: min(380px, calc(100vw - 32px));
    background: rgba(2, 6, 23, 0.96);
    border: 1px solid var(--chatbot-accent-border);
    border-radius: 24px;
    box-shadow: 0 30px 80px color-mix(in srgb, var(--chatbot-shadow) 55%, black);
    backdrop-filter: blur(16px);
    overflow: hidden;
    display: none;
    z-index: 1200;
}

.chatbot-window::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 220px;
    background: radial-gradient(circle, var(--chatbot-glow) 0%, transparent 72%);
    filter: blur(18px);
    opacity: 0.85;
    pointer-events: none;
    animation: chatbot-glow-pulse 4.5s ease-in-out infinite;
}

.chatbot-window.open {
    display: flex;
    flex-direction: column;
}

.chatbot-window > * {
    position: relative;
    z-index: 1;
}

@keyframes chatbot-glow-pulse {
    0%, 100% {
        transform: scale(0.98);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

.chatbot-window[data-topic="cv"] {
    --chatbot-accent-start: #3b82f6;
    --chatbot-accent-end: #06b6d4;
    --chatbot-accent-soft: rgba(59, 130, 246, 0.12);
    --chatbot-accent-border: rgba(59, 130, 246, 0.35);
    --chatbot-glow: rgba(59, 130, 246, 0.24);
}

.chatbot-window[data-topic="experience"] {
    --chatbot-accent-start: #0ea5e9;
    --chatbot-accent-end: #22d3ee;
    --chatbot-accent-soft: rgba(14, 165, 233, 0.12);
    --chatbot-accent-border: rgba(14, 165, 233, 0.35);
    --chatbot-glow: rgba(14, 165, 233, 0.24);
}

.chatbot-window[data-topic="skills"] {
    --chatbot-accent-start: #10b981;
    --chatbot-accent-end: #34d399;
    --chatbot-accent-soft: rgba(16, 185, 129, 0.12);
    --chatbot-accent-border: rgba(16, 185, 129, 0.35);
    --chatbot-glow: rgba(16, 185, 129, 0.24);
}

.chatbot-window[data-topic="projects"] {
    --chatbot-accent-start: #f59e0b;
    --chatbot-accent-end: #fb7185;
    --chatbot-accent-soft: rgba(245, 158, 11, 0.12);
    --chatbot-accent-border: rgba(245, 158, 11, 0.35);
    --chatbot-glow: rgba(245, 158, 11, 0.24);
}

.chatbot-window[data-topic="contact"] {
    --chatbot-accent-start: #ec4899;
    --chatbot-accent-end: #f43f5e;
    --chatbot-accent-soft: rgba(236, 72, 153, 0.12);
    --chatbot-accent-border: rgba(236, 72, 153, 0.35);
    --chatbot-glow: rgba(236, 72, 153, 0.24);
}

.chatbot-window[data-topic="education"] {
    --chatbot-accent-start: #a855f7;
    --chatbot-accent-end: #ec4899;
    --chatbot-accent-soft: rgba(168, 85, 247, 0.12);
    --chatbot-accent-border: rgba(168, 85, 247, 0.35);
    --chatbot-glow: rgba(168, 85, 247, 0.24);
}

.chatbot-window[data-topic="general"] {
    --chatbot-accent-start: #6366f1;
    --chatbot-accent-end: #a855f7;
    --chatbot-accent-soft: rgba(99, 102, 241, 0.12);
    --chatbot-accent-border: rgba(99, 102, 241, 0.35);
    --chatbot-glow: rgba(99, 102, 241, 0.24);
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid var(--chatbot-accent-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--chatbot-accent-soft) 18%, transparent), transparent);
}

.chatbot-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.chatbot-subtitle {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.chatbot-close {
    border: 0;
    background: transparent;
    color: var(--chatbot-accent-text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.chatbot-messages {
    max-height: 320px;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    gap: 0.7rem;
}

.chat-message {
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message.user {
    background: var(--chatbot-accent-soft);
    border: 1px solid var(--chatbot-accent-border);
    color: var(--chatbot-accent-text);
    justify-self: end;
}

.chat-message.bot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    justify-self: start;
}

.chat-message.chat-suggestion {
    color: color-mix(in srgb, var(--chatbot-accent-text) 85%, white);
    font-size: 0.9rem;
    background: color-mix(in srgb, var(--chatbot-accent-soft) 65%, transparent);
}

.chat-suggestion-chip {
    justify-self: start;
    border: 1px solid var(--chatbot-accent-border);
    border-radius: 999px;
    background: var(--chatbot-accent-soft);
    color: var(--chatbot-accent-text);
    padding: 0.7rem 0.95rem;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.chat-suggestion-chip:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--chatbot-accent-soft) 75%, white);
    border-color: color-mix(in srgb, var(--chatbot-accent-border) 70%, white);
}

.chat-suggestion-chip.topic-cv {
    --chatbot-accent-start: #3b82f6;
    --chatbot-accent-end: #06b6d4;
    --chatbot-accent-soft: rgba(59, 130, 246, 0.12);
    --chatbot-accent-border: rgba(59, 130, 246, 0.35);
}

.chat-suggestion-chip.topic-experience {
    --chatbot-accent-start: #0ea5e9;
    --chatbot-accent-end: #22d3ee;
    --chatbot-accent-soft: rgba(14, 165, 233, 0.12);
    --chatbot-accent-border: rgba(14, 165, 233, 0.35);
}

.chat-suggestion-chip.topic-skills {
    --chatbot-accent-start: #10b981;
    --chatbot-accent-end: #34d399;
    --chatbot-accent-soft: rgba(16, 185, 129, 0.12);
    --chatbot-accent-border: rgba(16, 185, 129, 0.35);
}

.chat-suggestion-chip.topic-projects {
    --chatbot-accent-start: #f59e0b;
    --chatbot-accent-end: #fb7185;
    --chatbot-accent-soft: rgba(245, 158, 11, 0.12);
    --chatbot-accent-border: rgba(245, 158, 11, 0.35);
}

.chat-suggestion-chip.topic-contact {
    --chatbot-accent-start: #ec4899;
    --chatbot-accent-end: #f43f5e;
    --chatbot-accent-soft: rgba(236, 72, 153, 0.12);
    --chatbot-accent-border: rgba(236, 72, 153, 0.35);
}

.chat-suggestion-chip.topic-education {
    --chatbot-accent-start: #a855f7;
    --chatbot-accent-end: #ec4899;
    --chatbot-accent-soft: rgba(168, 85, 247, 0.12);
    --chatbot-accent-border: rgba(168, 85, 247, 0.35);
}

.chat-suggestion-chip.topic-general {
    --chatbot-accent-start: #94a3b8;
    --chatbot-accent-end: #64748b;
    --chatbot-accent-soft: rgba(148, 163, 184, 0.12);
    --chatbot-accent-border: rgba(148, 163, 184, 0.35);
}

.typing-indicator {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.chatbot-input-row {
    display: flex;
    gap: 0.6rem;
    padding: 1rem;
    border-top: 1px solid var(--chatbot-accent-border);
}

.chatbot-input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--chatbot-accent-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chatbot-accent-soft) 35%, rgba(255, 255, 255, 0.04));
    color: var(--text-main);
    padding: 0.78rem 1rem;
    font: inherit;
}

.chatbot-input-row button {
    border: 0;
    border-radius: 999px;
    padding: 0.78rem 1rem;
    background: var(--chatbot-accent-gradient, var(--accent-gradient));
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 768px) {
    .chatbot-launcher {
        right: 16px;
        bottom: 16px;
    }

    .chatbot-window {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 76px;
    }
}
