:root {
    --popup-bg-color: #332c5372;
    --popup-line-color: #453555;
}

body {
    margin: 0;
    min-height: 100vh; /* Usar min-height para permitir que o conteúdo cresça */
    display: flex;
    flex-direction: column; 
    align-items: center;
    /* justify-content: center; Removido para permitir alinhamento ao topo */
    font-family: sans-serif;
    overflow-x: hidden;
    user-select: none;
    background-color: #230046;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Mundo dos Cubos de Fundo */
.background-world {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    perspective: 1000px;
    background: radial-gradient(ellipse at center, rgba(0, 40, 49, 0.641) 0%, rgba(11, 14, 13, 0.853) 70%, #000000 100%);
}

.bg-cube-wrapper {
    position: absolute;
    transform-style: preserve-3d;
}

.bg-cube {
    --bg-cube-size: 60px; /* Default */
    width: var(--bg-cube-size);
    height: var(--bg-cube-size);
    position: relative;
    transform-style: preserve-3d;
}

.bg-cube-rotator {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
}

.bg-cube__face {
    position: absolute;
    width: var(--bg-cube-size);
    height: var(--bg-cube-size);
    background-color: rgba(100, 110, 130, 0.05);
    border: 1px solid rgba(130, 140, 160, 0.08);
    opacity: 0.7;
    box-sizing: border-box;
}

.bg-cube__face--front  { transform: rotateY(  0deg) translateZ(calc(var(--bg-cube-size) / 2)); }
.bg-cube__face--back   { transform: rotateY(180deg) translateZ(calc(var(--bg-cube-size) / 2)); }
.bg-cube__face--right  { transform: rotateY( 90deg) translateZ(calc(var(--bg-cube-size) / 2)); }
.bg-cube__face--left   { transform: rotateY(-90deg) translateZ(calc(var(--bg-cube-size) / 2)); }
.bg-cube__face--top    { transform: rotateX( 90deg) translateZ(calc(var(--bg-cube-size) / 2)); }
.bg-cube__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--bg-cube-size) / 2)); }

@keyframes bgCubeRotate1 { from { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); } to { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); } }
@keyframes bgCubeRotate2 { from { transform: rotateX(0deg) rotateY(0deg); } to { transform: rotateX(-360deg) rotateY(360deg); } }
@keyframes bgCubeFloat { 0% { transform: translateY(0px) rotateX(5deg) rotateY(-5deg); } 50% { transform: translateY(-15px) rotateX(-5deg) rotateY(5deg); } 100% { transform: translateY(0px) rotateX(5deg) rotateY(-5deg); } }

.bg-cube-rotator.anim-rotate1 { animation-name: bgCubeRotate1; animation-timing-function: linear; animation-iteration-count: infinite; }
.bg-cube-rotator.anim-rotate2 { animation-name: bgCubeRotate2; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; }
.bg-cube-rotator.anim-float   { animation-name: bgCubeFloat; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }


/* ===== NOVA ESTRUTURA PARA ISOLAR O CUBO ===== */
.hero-container {
    position: relative; /* Necessário para posicionar a .scene dentro dele */
    width: 50%;
    height: 250px; /* Altura fixa para o bloco do cubo, ajustável */
    perspective: 1000px; /* A perspectiva agora vive aqui */
    perspective-origin: center;
    margin-top: 50px;
}

.scene { 
    /* Agora posicionado absolutamente no centro do hero-container */
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    transform-style: preserve-3d;
    /* Esta transformação agora é apenas para centralizar, a rotação vem do JS */
    transform: translate(-50%, -50%);
    /* Margens não são mais necessárias aqui */
}

.cube { 
    width: 100%;
    height: 100%;
    position: relative; 
    transform-style: preserve-3d; 
}
.cube__face { 
    position: absolute; 
    width: 220px;
    height: 220px;
    background-color: rgba(150,150,150,0.7); 
    display: flex; flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    font-size: 20px; 
    color: #fff; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2); 
    box-sizing: border-box; 
}
.cube__face a { text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 10px; }
.cube__face img { max-width: 90%; max-height: 70%; margin-bottom: 15px; pointer-events: none; border-radius: 5px; }
.cube__face span { pointer-events: none; }

.cube__face--front  { transform: rotateY(  0deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }
.cube__face--back   { transform: rotateY(180deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }
.cube__face--right  { transform: rotateY( 90deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }
.cube__face--left   { transform: rotateY(-90deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }
.cube__face--top    { transform: rotateX( 90deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(110px); background-color: rgba(240, 240, 240, 0.9); }


.animated-description-container { position: fixed; display: flex; align-items: center; opacity: 0; visibility: hidden; pointer-events: none; z-index: 1000; transition: opacity 0.3s ease, visibility 0s linear 0.3s; min-width: 300px; max-width: 400px; /* Largura máxima geral aumentada */ }
.animated-description-container.visible { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s linear 0s; }
.animated-description-container.popup-orient-right { flex-direction: row; }
.animated-description-container.popup-orient-right .circuit-line-svg { transform: scaleX(1); }
.animated-description-container.popup-orient-right .description-box { margin-left: -5px; }
.animated-description-container.popup-orient-left { flex-direction: row-reverse; }
.animated-description-container.popup-orient-left .circuit-line-svg { transform: scaleX(-1); }
.animated-description-container.popup-orient-left .description-box { margin-right: -5px; }

.circuit-line-svg { width: 120px; height: 70px; flex-shrink: 0; }
#circuit-path { stroke: var(--popup-line-color); stroke-width: 2.5px; stroke-linecap: round; fill: none; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.animated-description-container.visible #circuit-path { animation: drawCircuitLine 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
@keyframes drawCircuitLine { to { stroke-dashoffset: 0; } }

.description-box { 
    background-color: var(--popup-bg-color); 
    backdrop-filter: blur(5px);
    color: #e0e0e0; 
    padding: 12px 18px; 
    border-radius: 10px; 
    border: 1px solid var(--popup-border-color); 
    max-width: 320px; /* --- ALTERAÇÃO: Aumentado de 280px para 320px --- */
    font-size: 0.9em; 
    opacity: 0; 
    transform-origin: center;
}
/* --- ALTERAÇÃO: Duração da animação aumentada de 0.6s para 0.9s --- */
.animated-description-container.visible .description-box { animation: showDescriptionBox 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards; animation-delay: 0.4s; }

/* NOVA ANIMAÇÃO para o Description Box */
@keyframes showDescriptionBox { 
    from {
        opacity: 0;
        transform: scale(0.9) ;
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* --- NOVOS ESTILOS PARA PARTÍCULAS --- */
#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.particle {
    position: absolute;
    background-color: var(--popup-line-color);
    border-radius: 50%;
    opacity: 0;
    animation: particle-effect 0.8s ease-out forwards;
}

@keyframes particle-effect {
    0% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translate(var(--translateX), var(--translateY));
    }
}


footer {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    color: rgba(200,200,220,0.7);
    font-size: 0.6em;
    letter-spacing: 0.5px;
    margin-top: auto;
    font-family: monospace;

}
footer p { margin: 0; }

.projects-section {
    padding: 180px 40px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    position: relative;
    /* margin-top não é mais necessário, o espaçamento vem do hero-container */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin-top: 50px;
}

.project-card {
    /* backdrop-filter: blur(15px); */
    /* -webkit-backdrop-filter: blur(15px); */
    /* border-radius: 10px; */
    border: none;
    /* overflow: hidden; */ /* <-- REMOVA ESTA LINHA */
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card:hover {
    transform: scale(1.05);
    /* box-shadow: 0 20px 60px 0 rgba(0, 0, 0, 0.5); */
}

.project-card__image {
    width: 100%;
    height: 280px;
    /* overflow: hidden; */ /* <-- REMOVA ESTA LINHA */
    position: relative;   /* <-- ADICIONE ESTA LINHA */
    z-index: 1;           /* <-- ADICIONE ESTA LINHA */
}

.project-card__image img {
    margin-top: 20px;
    margin-left: 10%;
    width: 80%;
    height: 80%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card__image img {
    transform: scale(1.5);
}

.project-card__content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-card__logo1 {
    max-height: 120px;
    width: auto;
    margin-bottom: 20px;
    margin-top: -50px;
    opacity: 0.8;
}

.project-card__logo {
    max-height: 120px;
    width: auto;
    margin-bottom: 20px;
    margin-top: -50px;
    /* margin-left: 10%; */
}


.project-card__description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
    min-height: 80px;
    text-align: center;
    color: #e5e5e5;
}

.project-card__button {
    display: inline-block;
    padding: 10px 25px;
    /* border: 2px solid #fff; */
    border-radius: 50px;
    text-decoration: none;
    color: #e5e5e5;
    /* font-weight: regular; */
    transition: background-color 0.3s, color 0.3s;
    background-color: #5b3f75;
    
}

.project-card__button:hover {
    background-color: #fff;
    color: #1a1a1a;
}

@media (max-width: 768px) {
    .hero-container {
        height: 350px; /* Menor altura para o cubo em telas pequenas */
    }
    .projects-section {
        padding: 60px 20px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-card:hover {
        transform: scale(1.03);
    }
}

/* --- Header --- */
.site-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 30px;
    padding: 20px 40px;
    display: flex;
    /* ALTERADO: Isso vai empurrar o logo para a esquerda e a navegação para a direita */
    justify-content: space-between; 
    align-items: center;
    position: relative;
    z-index: 100;
    box-sizing: border-box;
}

/* NOVO: Estilo para o logo no header */
.header-logo img {
    height: 50px; 
    width: 56px;
    display: block; /* Garante que a imagem não tenha espaços extras */
}

.nav-links {
    list-style: none;
    padding: 0;
    display: flex;
    margin: 0; /* ALTERADO: Removemos a margem à direita que não é mais necessária */
}

.nav-links li {
    margin-left: 35px; /* Mantém o espaçamento entre "Account" e "Who are we?" */
}

.nav-links a {
    text-decoration: none;
    color: rgba(229, 229, 229, 0.8);
    font-size: 0.8em;
    font-weight: normal;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

/* --- Ajustes para telas menores (Responsivo) --- */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        padding: 20px;
    }

    .header-logo {
        margin-bottom: 15px;
    }

    .nav-links li {
        margin-left: 15px;  /* AJUSTE: Menor margem em telas pequenas */
        margin-right: 15px;
    }
}

/* ===== ESTILOS DO MODAL ABOUT ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 0, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;

    /* Animação de fade */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

.modal-content {
    background: rgba(32, 33, 43, 0.8);
    padding: 30px 40px;
    border-radius: 12px;
    /* border: 1px solid var(--popup-line-color, #453555); */
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);

    /* Animação de escala */
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-top: 0;
    color: #fff;
    font-size: 1.8em;
    border-bottom: 1px solid var(--popup-line-color, #453555);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-content p {
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.close-modal:hover {
    opacity: 1;
    transform: rotate(90deg);
}