:root {
    --bg: #0b0f14;
    --card: #0f1720;
    --muted: #9aa6b2;
    --accent: #4fc3f7;
    --glass: rgba(255, 255, 255, 0.03);
    --green-glow: #00ff88;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #e6eef6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1:hover,
h2:hover,
h3:hover,
p:hover,
.small:hover,
.meta:hover,
.badge:hover {
    color: var(--green-glow) !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6), 0 0 12px rgba(0, 255, 136, 0.4);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: default;
}

.code-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><text x="0" y="8" style="font-size:10px;fill:%231a2c3a;">01</text></svg>');
    background-repeat: repeat;
    background-attachment: fixed;
    filter: hue-rotate(150deg) brightness(0.7) saturate(0.8);
    opacity: 0.15;
    pointer-events: none;
}

.code-background:hover {
    opacity: 0.3;
    background-size: 110% 110%;
    filter: hue-rotate(150deg) brightness(1.0) saturate(1.0);
    animation: codeBackgroundPan 120s infinite linear;
}

@keyframes codeBackgroundPan {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* HEADER E ANIMAÇÃO DE FUNDO SCANLINE */
header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    /* CORREÇÃO APLICADA: Z-INDEX MAXIMO PARA SOBREPOR TUDO */
    z-index: 9999;
    background: linear-gradient(180deg, rgba(11, 15, 20, 0.6), rgba(11, 15, 20, 0.2));
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 2;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            rgba(79, 195, 247, 0.05) 1px,
            transparent 3px);
    opacity: 0.1;
    pointer-events: none;
    animation: scanlinePulse 8s infinite linear;
}

@keyframes scanlinePulse {
    0% {
        transform: translateY(0);
    }

    50% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-100%);
        opacity: 0.1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 2;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.logo {
    width: 90px;
    height: 70px;
    border-radius: 10px;
    background: linear-gradient(135deg, hex(--accent), #0b0f1499);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0f1499;
    font-weight: 700;
}

/* ESTILO PADRÃO DE NAVEGAÇÃO DESKTOP */
nav ul {
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* LINKS DE NAVEGAÇÃO COM EFEITO DE HOVER */
nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.8);
}

/* Estilo do botão CTA fora da lista (DESKTOP) */
.cta {
    background: linear-gradient(90deg, var(--accent), #2aa8e6);
    padding: 10px 14px;
    border-radius: 10px;
    color: #021826;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    /* Garante que o CTA desktop funcione como bloco */
}

/* Oculta o item de menu mobile-CTA no Desktop */
.cta-mobile-item {
    display: none;
}

/* Hamburger menu styles (ESTILOS ATUALIZADOS) */
#hamburgerBtn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    /* Removido borda */
    background: none;
    /* Removido fundo */
    padding: 0;
    cursor: pointer;
}

#hamburgerBtn span {
    display: block;
    height: 0.15rem;
    /* Levemente mais espesso */
    background-color: #fff;
    /* Cor branca */
    border-radius: 2px;
    /* box-shadow removido */
    transition: all 0.3s ease;
}

#hamburgerBtn.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.3125rem, 0.3125rem);
}

#hamburgerBtn.active span:nth-child(2) {
    opacity: 0;
}

#hamburgerBtn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.4375rem, -0.375rem);
}

#mobileMenu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--card);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    z-index: 40;
}

#mobileMenu:not(.hidden) {
    display: flex;
}

#mobileMenu a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

#mobileMenu a:hover {
    color: var(--accent);
}

.desktop-nav {
    display: flex;
}

@media(max-width:700px) {
    .desktop-nav {
        display: none;
    }

    #hamburgerBtn {
        display: flex;
    }

    .cta {
        display: none;
        /* Hide desktop CTA in mobile */
    }

    .hero {
        padding-top: 134px;
        grid-template-columns: 1fr;
    }

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

    .container {
        padding: 0 16px;
    }

    .hero-content-box {
        padding: 18px;
    }
}

main {
    padding-top: 0;
}

/* Margem para o cabeçalho fixo não esconder o conteúdo no scroll */
section[id] {
    scroll-margin-top: 90px;
}

.video-background-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -2;
    overflow: hidden;
}

.background-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.background-slide.active {
    opacity: 1;
}

.video-background-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgba(0, 0, 0, 0.45);

    mask-image: linear-gradient(to bottom,
            black 80%,
            transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            black 80%,
            transparent 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.hero {
    padding: 64px 0;
    padding-top: 174px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 32px;
    align-items: center;
    transition: transform 0.3s ease-out;
    perspective: 1000px;
}

.hero h1 {
    font-size: 36px;
    margin: 0 0 12px;
    color: #fff;
}

.hero p {
    color: var(--muted);
    line-height: 1.6;
}

.badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.badge {
    background: var(--glass);
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

.hero-content-box {
    background: var(--glass);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 18px;
    border-radius: 14px;
    transition: all 0.3s ease;
    transform: translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(79, 195, 247, 0.15);
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.05), rgba(79, 195, 247, 0.03));
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

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

@media(max-width:700px) {

    /* AJUSTES MOBILE: HERO, GRID e CONTAINER */
    .hero {
        padding-top: 134px;
        grid-template-columns: 1fr;
    }

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

    .container {
        padding: 0 16px;
    }

    .hero-content-box {
        padding: 18px;
    }
}

/* ESTILOS DO CARROSSEL/SLIDER (para a seção de projetos) */
.slider-wrapper {
    position: relative;
}

.slider-container {
    overflow-x: scroll;
    white-space: nowrap;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    display: flex;
    gap: 18px;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-item {
    display: inline-block;
    width: 320px;
    white-space: normal;
    flex-shrink: 0;
}

@media(max-width:700px) {
    .slider-item {
        width: 90%;
    }
}

.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 10px));
    background: rgba(15, 23, 32, 0.8);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 24px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.slider-nav-btn:hover {
    opacity: 1;
    background: var(--accent);
    color: var(--bg);
    transform: translateY(calc(-50% - 10px)) scale(1.1);
}

#prev-slide {
    left: -20px;
}

#next-slide {
    right: -20px;
}

@media(max-width: 900px) {
    .slider-nav-btn {
        display: none;
    }
}

.project-title {
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.project-desc {
    color: var(--muted);
    margin: 0 0 6px;
    font-size: 14px;
}

.techs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tech {
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 8px;
    border-radius: 8px;
}

footer {
    padding: 36px 0;
    color: var(--muted);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 48px;
}

/* gallery */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.case img {
    width: 220px;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    background: #08121a;
}

@media(max-width:500px) {
    .case {
        flex-direction: column;
        /* Empilha imagem e texto no mobile */
        align-items: center;
        text-align: center;
    }

    .case img {
        width: 100%;
        /* Imagem full width no mobile */
        height: auto;
        max-height: 200px;
        margin-bottom: 12px;
    }

    .case .techs {
        justify-content: center;
    }
}

.meta {
    font-size: 13px;
    color: var(--muted);
}

.tag {
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 600;
}

/* contact form */
form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

form input,
form textarea {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px;
    border-radius: 10px;
    color: #eaf6ff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

form input:focus,
form textarea:focus {
    outline: none;
    border: 1px solid var(--accent);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.5);
}

form button {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent), #2aa8e6);
    border: none;
    color: #021826;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

form button:hover {
    transform: translateY(-2px);
}

@media(max-width:500px) {

    /* Formulário em uma única coluna no mobile */
    form {
        grid-template-columns: 1fr;
    }
}

.small {
    font-size: 13px;
    color: var(--muted);
}

/* CSS para Animação de Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.appear {
    opacity: 1;
    transform: translateY(0);
}

/* CHATBOT INTERATIVO - ESTILIZAÇÃO CSS (REVISADO) */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 10000;
    /* NOVO: Fundo de vidro preto para o container */
    background: var(--glass);
    backdrop-filter: blur(8px);
    /* Para o efeito de vidro */
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Borda sutil */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease-out, width 0.3s ease-out, height 0.3s ease-out;
}

/* Estado Fechado */
.chatbot-container.closed {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    bottom: 30px;
    right: 30px;
    background: var(--accent);
    /* Cor de destaque quando fechado para visibilidade */
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
    padding: 0;
}

.chatbot-container.closed .chatbot-window {
    display: none;
}

/* Estilo do Cabeçalho */
.chatbot-header {
    /* NOVO: Fundo escuro e transparente (vidro) */
    background: rgba(11, 15, 20, 0.4);
    color: #fff;
    padding: 10px 15px;
    /* Aumentei um pouco o padding */
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Cabeçalho Fechado (o círculo) */
.chatbot-container.closed .chatbot-header {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    align-items: center;
    /* Remove a borda inferior no estado fechado */
    border-bottom: none;
    /* Esconde o texto "Assistente XSolidy" no estado fechado */
    font-size: 0;
    background: none;
    box-shadow: none;
    color: var(--bg);
    /* Ícone escuro quando fechado */
}

.chatbot-container.closed .chatbot-header:hover {
    opacity: 0.9;
}

.chat-icon {
    font-size: 1.2em;
    transition: all 0.3s ease;
}

/* Tamanho e cor do ícone no estado fechado */
.chatbot-container.closed .chat-icon {
    font-size: 25px;
    color: var(--bg);
    /* Cor escura dentro do círculo ACCENT */
}

/* Janela de Conversa */
.chatbot-window {
    height: 400px;
    display: flex;
    flex-direction: column;
    /* NOVO: Fundo escuro e transparente (vidro) */
    background: transparent;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Estilo das Mensagens (Balões) - MANTIDO PARA CONTRASTE */
.message {
    max-width: 85%;
    padding: 10px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    /* NOVO: Cor de fundo de vidro */
    background: var(--glass);
    color: #e6eef6;
    align-self: flex-start;
    border-top-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.user {
    /* MANTIDO: Cor de destaque para a mensagem do usuário */
    background: var(--accent);
    color: var(--bg);
    align-self: flex-end;
    border-top-right-radius: 4px;
}

/* INDICADOR DE DIGITAÇÃO HUMANIZADO (MANTIDO) */
.message.bot.typing-indicator {
    background: rgba(79, 195, 247, 0.2);
    color: #e6eef6;
    font-style: italic;
    opacity: 0.8;
    animation: pulse 1.5s infinite ease-in-out;
    border: none;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Área de Input */
.chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 15, 20, 0.7);
    /* Fundo sutilmente mais escuro para a área de input */
}

.chatbot-input-area input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 0 0 8px;
    background: var(--bg);
    color: #fff;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.chatbot-input-area input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(79, 195, 247, 0.5);
}

.chatbot-input-area button {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 10px 10px;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    /* Ajustado para encaixar com o input */
    font-weight: 600;
    transition: background 0.3s ease;
    margin-left: -1px;
    /* Para 'grudar' no input */
}

.chatbot-input-area button:hover {
    filter: brightness(1.1);
}

/* FIM DO CHATBOT CSS REVISADO */