/* Variáveis e reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

:root {
    --primary: #ffffff;
    --secondary: #0a0a0a;
    --primary-light: #ffffff;
    --text: #efefef;
    --background: #0c0c0c;
    --card-bg: #1a1a1a;
    --accent: #ffffff;
    --grid-color: rgba(68, 68, 68, 0.15);
    --border-color: rgba(255, 255, 255, 0.3);
    --primary-very-light: rgba(255, 255, 255, 0.1);
}

.bold-text {
    background: linear-gradient(90deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter'%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E"), linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

/* Elementos gráficos decorativos */
.graphic-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.2;
}

.grid-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    perspective: 500px;
    transform-style: preserve-3d;
}

.grid-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 90%, rgba(255, 255, 255, 0.1) 100%), linear-gradient(90deg, transparent 90%, rgba(255, 255, 255, 0.1) 100%);
    transform: rotateX(60deg) translateZ(-50px);
    opacity: 0.3;
}

.ribbon-line {
    position: absolute;
    height: 2px;
    width: 150%;
    opacity: 0.2;
    transform: rotate(-25deg);
    top: 30%;
    left: -25%;
    animation: waveMove 15s linear infinite;
    z-index: 1;
}

.ribbon-line::before, .ribbon-line::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.ribbon-line::before {
    top: -2px;
    opacity: 0.7;
    filter: blur(1px);
}

.ribbon-line::after {
    top: 2px;
    opacity: 0.5;
    filter: blur(2px);
}

.ribbon-line.delay-1 {
    top: 60%;
    animation-delay: 5s;
    animation-duration: 18s;
    transform: rotate(15deg);
}

.ribbon-line.delay-2 {
    top: 80%;
    animation-delay: 10s;
    animation-duration: 20s;
    transform: rotate(-10deg);
}

.ribbon-line.delay-3 {
    top: 40%;
    left: -30%;
    animation-delay: 3s;
    animation-duration: 12s;
    transform: rotate(5deg);
}

.ribbon-line.delay-4 {
    top: 70%;
    left: -20%;
    animation-delay: 8s;
    animation-duration: 17s;
    transform: rotate(-15deg);
}

@keyframes waveMove {
    0% {
        left: -25%;
    }
    100% {
        left: 100%;
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes nebulaPulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.2;
    }
}

@keyframes nebulaFloat {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Botão de retorno futurista */
.back-button {
    position: fixed;
    top: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 15px;
    background: rgba(27, 27, 27, 0.7);
    color: var(--text);
    text-decoration: none;
    border-radius: 0 25px 25px 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-left: none;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(204, 204, 204, 0.3), rgba(255, 255, 255, 0.3));
    background-size: 200% 200%;
    z-index: -1;
    animation: gradientShift 4s ease infinite;
}

.back-button:hover {
    left: 0;
    background: rgba(27, 27, 27, 0.85);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.back-button:hover::before {
    animation: gradientShift 2s ease infinite;
}

.back-button i {
    transition: transform 0.3s ease;
}

.back-button:hover i {
    transform: translateX(3px);
}

/* Container principal */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-top: -15px;
}

/* Seção do portfólio com fundo especial */
#portfolio {
    min-height: 100vh;
    padding: 80px 0;
    position: relative;
    isolation: isolate;
    background: radial-gradient(
                  ellipse at 20% 30%, 
                  rgba(255, 255, 255, 0.1) 0%, 
                  transparent 60%
              ),
              radial-gradient(
                  ellipse at 80% 70%, 
                  rgba(255, 255, 255, 0.1) 0%, 
                  transparent 60%
              ),
              var(--secondary);
}
#portfolio::before {
    display: none;
}

/* Cabeçalho do portfólio */
.portfolio-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.portfolio-header h1 {
    font-family: 'Agrandir', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.portfolio-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Grid de portfólio - MODIFICADO PARA 3 COLUNAS */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}

/* Cards de projeto - ESTILO ORIGINAL */
.portfolio-card {
    background: linear-gradient(to bottom, rgba(27, 27, 27, 0.8), rgba(27, 27, 27, 0.6));
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(95, 95, 95, 0.3);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
    height: 300px;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.view-project {
    padding: 10px 20px;
    background: var(--primary);
    color: #000000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease;
}

.view-project:hover {
    background: #e6e6e6;
    transform: scale(1.05);
}

.portfolio-info {
    padding: 20px;
}

.portfolio-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary);
    font-family: 'Agrandir', sans-serif;
    font-weight: 700;
}

.portfolio-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Botão CTA */
.cta-container {
    text-align: center;
    margin-top: 50px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Agrandir', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 1rem;
    background: linear-gradient(90deg, #ffffff, #cccccc);
    color: #000000;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4), 
                0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);
    transition: 0.5s;
}

.cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.6), 
                0 15px 40px rgba(0, 0, 0, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: scale(0.97);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 80%;
    max-width: 1000px;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

#modalImage {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(32, 32, 32, 0.5);
}

.modal-info {
    background: linear-gradient(to bottom, rgba(27, 27, 27, 0.9), rgba(27, 27, 27, 0.8));
    padding: 20px;
    border-radius: 0 0 4px 4px;
    border: 1px solid var(--border-color);
    border-top: none;
}

.modal-info h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-family: 'Agrandir', sans-serif;
}

.modal-info p {
    opacity: 0.9;
    margin: 0;
}

/* Responsividade - ATUALIZADA PARA 3 COLUNAS */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio-header h1 {
        font-size: 2.5rem;
    }
    
    .portfolio-header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .back-button {
        font-size: 14px;
        padding: 10px 18px 10px 13px;
    }
    
    .ribbon-line, .grid-pattern {
        display: none;
    }
}

@media (max-width: 576px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .portfolio-header h1 {
        font-size: 2rem;
    }
    
    .portfolio-image {
        height: 200px;
    }
    
    .modal-content {
        margin: 15% auto;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-info h2 {
        font-size: 1.5rem;
    }
    
    .back-button {
        padding: 8px 16px 8px 12px;
        font-size: 13px;
    }
    
    .back-button:hover {
        left: 0;
    }
}
/* Seção de Stacks de Tecnologia */
.tech-stacks {
    margin: 60px 0;
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(to bottom, rgba(27, 27, 27, 0.3), rgba(27, 27, 27, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.tech-stacks::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
}

.tech-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    font-family: 'Agrandir', sans-serif;
    font-weight: 700;
}

.tech-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.tech-item {
    background: linear-gradient(to bottom, rgba(27, 27, 27, 0.8), rgba(27, 27, 27, 0.6));
    padding: 30px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tech-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(39, 39, 39, 0.1), transparent);
    transition: 0.5s;
}

.tech-item:hover::before {
    left: 100%;
}

.tech-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.tech-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.tech-icon .fa-html5 {
    color: #e34f26;
}

.tech-icon .fa-css3-alt {
    color: #1572b6;
}

.tech-icon .fa-js-square {
    color: #f7df1e;
}

.tech-item h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
    font-family: 'Agrandir', sans-serif;
    font-weight: 700;
}

.tech-item p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Responsividade para a seção de tecnologias */
@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }
    
    .tech-header h2 {
        font-size: 2rem;
    }
    
    .tech-header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .tech-item {
        padding: 25px 15px;
    }
    
    .tech-icon {
        font-size: 3rem;
    }

}

@media (max-width: 576px) {
    .tech-stacks {
        margin: 40px 0;
        padding: 30px 0;
    }
    
    .tech-header h2 {
        font-size: 1.8rem;
    }
    
    .tech-item h3 {
        font-size: 1.2rem;
    }
    
    .tech-item p {
        font-size: 0.9rem;
    }
}
/* Esconder botão de retorno quando o modal estiver aberto */
.modal.show {
    display: block;
    opacity: 1;
}

/* Quando o modal estiver aberto, esconder o botão de retorno */
.modal.show ~ .back-button,
body:has(.modal.show) .back-button {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-100%);
    transition: all 0.3s ease;
}

/* Estilo normal do botão de retorno */
.back-button {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: all 0.3s ease 0.1s;
}

/* Alternativa para navegadores que não suportam :has() */
.modal.show + .back-button {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-100%);
}

/* Garantir que o modal fique acima de tudo */
.modal {
    z-index: 1001;
}

.back-button {
    z-index: 1000;
}