/* --- CODINOME STUDIO: CORE STYLES --- */

/* 1. Variáveis e Reset */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-purple: #8A2BE2;
    --accent-cyan: #00FFFF;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Three.js Canvas */
#universe-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
}

/* Scrollbar */
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: #0a0a0a; }
body::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
body::-webkit-scrollbar-thumb:hover { background: var(--accent-purple); }

/* Header */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
}

.logo { display: flex; align-items: center; }
.header-logo-img { height: 35px; width: auto; object-fit: contain; }

nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; align-items: center; }
nav a { text-decoration: none; color: #ccc; font-size: 0.9rem; transition: 0.3s; }
nav a:hover { color: #fff; }
.btn-contato {
    background: var(--accent-purple);
    padding: 8px 20px; border-radius: 20px; color: white; font-weight: 600;
}

/* 4. Estrutura */
.scroller-container { min-height: 100vh; position: relative; z-index: 1; }
.stage {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100vh;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    perspective: 1200px; /* Perspectiva aumentada para efeito 3D melhor */
    z-index: 2;
}

.layer {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    will-change: transform, opacity;
}
.layer.active { opacity: 1; visibility: visible; }

/* 5. Conteúdo */
.content-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 90vw; /* Permitir mais largura para o portfólio */
    width: 100%;
    padding: 20px;
    /* Ajuste de Sombra: Mais difusa e posicionada atrás para não cobrir letras */
    text-shadow: 0 4px 30px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2, h3 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; font-weight: 800; }
p { font-size: 1.2rem; color: #aaa; line-height: 1.6; margin-bottom: 30px; max-width: 800px; }

.gradient-text {
    background: linear-gradient(90deg, #fff, var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-button {
    display: inline-block; padding: 15px 40px; background: white; color: black;
    text-decoration: none; font-weight: bold; border-radius: 30px; transition: transform 0.3s;
}
.cta-button:hover { transform: scale(1.05); }

/* Vetores */
.vector-bg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60vw; height: 60vw;
    z-index: 1; pointer-events: none; opacity: 0.3;
}
.vector-bg svg { width: 100%; height: 100%; stroke: var(--accent-purple); stroke-width: 1; fill: none; }

/* Seções Específicas */
.problem-grid {
    border: 1px solid var(--glass-border);
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    max-width: 800px;
}
.text-highlight { color: var(--accent-purple); font-weight: bold; text-decoration: underline; }

.cards-row { display: flex; gap: 20px; margin-top: 40px; justify-content: center; flex-wrap: wrap; }
.mini-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 15px;
    width: 200px;
    text-align: left;
}
.card-num { font-size: 2rem; color: var(--accent-cyan); font-weight: bold; margin-bottom: 10px; display: block;}

/* =========================================
    PORTFÓLIO IMERSIVO & NAV
    ========================================= */
.portfolio-showcase {
    display: flex;
    gap: 20px; /* Gap menor para um visual mais coeso */
    perspective: 2000px; /* Profundidade aumentada */
    justify-content: flex-start; /* Alinhamento inicial para scroll funcionar bem */
    align-items: center;
    flex-wrap: nowrap; /* FORÇA A LINHA */
    padding: 60px 40px;
    width: 100%;
    overflow-x: auto; /* Permite scroll se necessário, mas escondemos scrollbar abaixo */
    scroll-behavior: smooth; /* Rolagem nativa suave */
    
    /* Esconder Scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Esconder Scrollbar Chrome/Safari/Opera */
.portfolio-showcase::-webkit-scrollbar {
    display: none;
}

/* Botões de Navegação */
.portfolio-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--accent-cyan);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 200; /* Acima dos cards */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.portfolio-nav-btn:hover {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
    border-color: var(--accent-purple);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Responsivo para botões */
@media (max-width: 768px) {
    .portfolio-nav-btn {
        width: 40px; height: 40px;
        font-size: 1.2rem;
        background: rgba(0,0,0,0.8);
    }
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }
}


.project-wrapper { 
    position: relative; 
    flex: 0 0 auto; /* Impede que os itens encolham */
    transition: z-index 0.3s;
}

/* Eleva o z-index do wrapper ao passar o mouse para garantir sobreposição correta */
.project-wrapper:hover {
    z-index: 100;
}

.project-item {
    width: 320px; /* Largura um pouco maior para desktop */
    height: 450px; 
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    
    /* ESTADO INICIAL: Rotacionado e Preto e Branco */
    transform: rotateY(25deg) scale(0.9);
    filter: grayscale(100%); 
    
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -10px 10px 20px rgba(0,0,0,0.5);
    z-index: 1;
}

/* Efeito Hover/Touch - O Destaque */
.project-item:hover, .project-item:active {
    /* Fica de frente, cresce e ganha cor */
    transform: rotateY(0deg) scale(1.15);
    filter: grayscale(0%);
    border-color: var(--accent-purple);
    box-shadow: 0 20px 50px rgba(138, 43, 226, 0.4);
}

/* Container do Iframe para Zoom Negativo */
.iframe-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #000;
}

/* O "Zoom Negativo" acontece aqui */
.iframe-container iframe {
    width: 200%;  /* Dobra o tamanho renderizado */
    height: 200%; /* Dobra a altura renderizada */
    border: none;
    transform: scale(0.5); /* Reduz pela metade para caber no container original */
    transform-origin: 0 0; /* Escala a partir do topo esquerdo */
    
    /* Por padrão, não permite interação para não atrapalhar o scroll */
    pointer-events: none; 
    transition: opacity 0.3s;
}

/* Permite interagir com o site (rolar, clicar) apenas quando o mouse está sobre o card */
.project-item:hover .iframe-container iframe {
    pointer-events: auto;
}

.project-name-outside { 
    margin-top: 15px; 
    font-size: 1rem; 
    color: #fff; 
    letter-spacing: 1px; 
    text-align: center;
    opacity: 0.5; /* Mais apagado quando não focado */
    transition: 0.3s;
}

.project-wrapper:hover .project-name-outside {
    opacity: 1;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transform: translateY(5px);
}

/* Final */
.final-logo-container { margin-bottom: 20px; }
.final-logo-img { width: 250px; max-width: 80%; height: auto; display: block; margin: 0 auto; }
.whatsapp-btn { background: #25D366; color: white; border: none; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }

/* Mobile */
@media (max-width: 768px) {
    h2, h3 { font-size: 2.2rem; }
    .vector-bg { width: 90vw; height: 90vw; }
    .cards-row { flex-direction: column; align-items: center; }
    
    header { padding: 10px 20px; }
    .header-logo-img { height: 25px; }
    nav ul { display: none; }

    /* LAYOUT DE PORTFÓLIO EM LINHA NO MOBILE */
    .portfolio-showcase { 
        padding-left: 20px; /* Espaçamento inicial */
        padding-right: 20px;
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
        gap: 20px;
    }

    .project-wrapper {
        flex: 0 0 auto; /* Não encolhe nem cresce */
        margin-right: 0;
    }

    .project-item { 
        /* No mobile, removemos rotação e preto/branco para UX melhor */
        transform: none !important; 
        filter: none !important;
        width: 80vw; /* Item ocupa quase toda a tela */
        height: 50vh; 
        margin-bottom: 10px; 
    }
    
    .project-item:hover, .project-item:active {
            transform: none !important;
            scale: 1 !important;
    }
}