:root {
    --bg-color: #030305;
    --text-primary: #ffffff;
    --text-secondary: #8c8c9a;
    --card-bg: rgba(20, 20, 25, 0.4);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    --glow-color: rgba(100, 100, 255, 0.08);
    --transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
    background-color: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Remove rolagem global */
    position: relative;
}

.portal-container {
    width: 100%;
    max-width: 1100px;
    height: 100vh;
    padding: 2vh 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Centraliza tudo no eixo vertical */
    align-items: center;
    z-index: 1;
}

.portal-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInDown 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.portal-main-logo {
    max-width: 290px;
    width: 90%;
    height: auto;
    margin-bottom: 7rem;
    margin-top: 4rem;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.5));
}

.projects-grid {
    display: grid;
    /* 3 columns side by side */
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    width: 100%;
    max-width: 900px;
    margin: 1vh 0;
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.project-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    perspective: 1200px;
    /* Ativação da física 3D do Tech-Vibe */
}

.project-card {
    position: relative;
    /* Efeito Glassmorphism Pesado */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: inset 1px 1px 20px rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(13, 161, 181, 0.2);
    /* Tech outline mais presente */
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    /* Artinprint Wobbly Lines */
    aspect-ratio: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Tracking Glare (Lanterna tech reativa ao mouse) */
.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouseX, 50%) var(--mouseY, 50%), rgba(254, 228, 114, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 5;
}

.card-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    transition: var(--transition);
    z-index: 1;
    transform: translateZ(40px);
    /* O logo salta em 3D pra fora do vidro */
}

.project-logo {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
    transition: var(--transition);
}

.artcodev-logo {
    max-width: 70%;
}

.incanvas-logo {
    max-width: 85%;
}

.artinprint-logo {
    max-width: 85%;
}

/* Dynamic Info Area */
.dynamic-info-area {
    position: relative;
    width: 100%;
    max-width: 650px;
    min-height: 90px;
    margin-top: 1.5rem;
}

.project-info {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    text-align: center;
    /* Volta ao centro, ultra minimalista */
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Cinematic Blur Reveal (Premium Tech) */
    transform: translate(-50%, 20px) scale(0.98);
    filter: blur(8px);
}

.project-info.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
}

.project-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 3px;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(13, 161, 181, 0.4);
    /* Glow tech do fundo */
    margin: 0;
}

/* Moldura sintática minimalista em amarelo sketch */
.project-desc::before {
    content: "[ ";
    color: #fee472;
    opacity: 0.9;
    margin-right: 12px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(254, 228, 114, 0.5);
}

.project-desc::after {
    content: " ]";
    color: #fee472;
    opacity: 0.9;
    margin-left: 12px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(254, 228, 114, 0.5);
}

/* Modifier para Introdução Estática (sem as amarras do hover interactivo) */
.project-info.static-intro {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
    visibility: visible;
    filter: none;
    transform: none;
    margin-bottom: 3rem;
    margin-top: -3.5rem;
    max-width: 900px;
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s both;
}

.static-intro .project-desc {
    font-size: 1rem;
    /* Levemente menor para não brigar com a leitura de hover */
    letter-spacing: 2.5px;
    text-shadow: 0 0 10px rgba(13, 161, 181, 0.6);
}

/* Badge Neon Em Construção dentro do Card */
.card-badge {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateZ(40px);
    /* Usando Z pra saltar do vidro 3D */
    font-size: 0.70rem;
    color: #111;
    background-color: #fee472;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(254, 228, 114, 0.4);
    animation: pulseGlow 2s infinite;
    z-index: 10;
    pointer-events: none;
    /* Não atrapalha o hover do mouse no card */
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(254, 228, 114, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(254, 228, 114, 0.8);
    }
}

/* Interactions */
.project-card:hover {
    border-color: rgba(254, 228, 114, 0.8);
    /* Sketch Yellow Stroke */
    box-shadow: 8px 8px 0px rgba(254, 228, 114, 0.8),
        /* Sombra sólida Brutalist/Artinprint */
        0 0 60px rgba(13, 161, 181, 0.15);
    /* Tech Glow de fundo */
    border-radius: 15px 255px 15px 225px / 255px 15px 225px 15px;
    /* Inverte o wobble on hover pseudo-anim</>) */
}

.project-card:hover::after {
    opacity: 1;
    /* Acende a lanterna reativa */
}

.project-card:hover .project-logo {
    transform: scale(1.15) translateZ(60px);
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
}

.project-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .portal-container {
        padding: 3rem 1.5rem;
    }

    .project-title {
        font-size: 1.4rem;
    }

    .project-desc {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
        /* Permite rolagem no mobile */
    }

    .portal-container {
        height: auto;
        padding: 4rem 1.5rem 2rem 1.5rem;
        gap: 3rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .project-card {
        max-width: 320px;
        margin: 0 auto;
    }

    .dynamic-info-area {
        min-height: 150px;
    }
}

@media (max-width: 500px) {
    .portal-title {
        font-size: 2.8rem;
    }
}

/* --- Footer Styles --- */
.portal-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    padding-top: 0;
    border-top: none;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.footer-contact {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: #fee472;
    /* Amarelo sketch */
    color: #111;
    border: 1.5px solid #111;
    /* Borda irregular para efeito hand-drawn sketch da imagem */
    border-radius: 2px 7px 3px 9px / 8px 3px 10px 4px;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    transition: var(--transition);
}

.contact-link:hover .contact-icon {
    transform: translateY(-4px) rotate(-4deg);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.9);
    background-color: #ffeb8c;
}

.contact-link:hover span {
    color: #fee472;
}

.footer-bottom {
    width: 100%;
    text-align: center;
    padding-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.70rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 300;
}

@media (max-width: 600px) {
    .footer-contact {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}