/* --- CONFIGURAÇÕES E VARIÁVEIS --- */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

:root {
    --primary: #ff1616;
    --primary-hover: #ff0a0a;
    --primary-glow: rgba(239, 68, 68, 0.3);
    --bg-dark: #0b0b0b;
    --bg-card: rgb(20, 20, 20);
    --text-white: #ffffff;
    --text-gray: #aaaaaa;
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius-md: 8px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-hover);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -1;
}

/* --- SEÇÃO: HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 25px 8%;
    z-index: 1000;
    transition: all 0.5s;
    border-bottom: 1px solid transparent;
}

header.sticky {
    padding: 15px 8%;
    background: rgba(11, 11, 11, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-white);
    opacity: 0.7;
    font-weight: 300;
    transition: var(--transition-fast);
}

.nav-links a:hover {
    opacity: 1;
    color: var(--primary);
}

/* --- SEÇÃO: HERO --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* --- COMPONENTE: AVATAR --- */
.hero-image {
    margin-bottom: 25px;
}

.circle-gradient {
    position: relative;
    width: 216px;
    height: 216px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px var(--primary-glow);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.circle-gradient::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(from var(--angle, 0deg), transparent 70%, var(--primary) 100%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.circle-gradient.visible::before {
    opacity: 1;
}

.circle-gradient img {
    position: relative;
    z-index: 1;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-dark);
}

.circle-gradient:hover {
    transform: scale(1.08);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.6);
}

/* --- SEÇÃO: TEXTOS E BOTÕES --- */
.hero-text h1 {
    font-size: 2.8rem;
    margin: 5px 0;
    font-weight: 600;
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text .subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 35px;
    font-weight: 300;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-cv, .btn-contact {
    padding: 12px 30px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-cv {
    background: var(--primary);
    color: var(--text-white);
}

.btn-cv:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-contact {
    border: 1px solid var(--primary);
    color: var(--text-white);
}

.btn-contact:hover {
    background: rgba(243, 53, 53, 0.1);
}

/* --- SEÇÃO: SOBRE --- */

.about-section{
    padding: 80px 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 1) 100%);
    position: relative;
    text-align: center;
    z-index: 1;
}

.about-section h1{
    color: var(--text-white);
    padding-bottom: 1%;
    padding-top: 7%;
}

.about-section p{
    color: var(--text-gray);
}

/* --- SEÇÃO: SKILLS --- */

.skill-section{
    background-color: #000000;
    text-align: center;
}

.skill-section h1{
    padding-top: 8%;
}

.skills-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    padding: 0 20px;
}

.skill-card{
    background-color: #0e0e0e;
    padding: 30px 20px;
    border-radius: 12px;
    border-bottom: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: all 0.4s ease;
}

.skill-card i{
    font-size: 3em;
    color: var(--text-gray)
}

.skill-card span{
    color: var(--text-gray);
    font-size: 1.2em;
    font-weight: 600;
}

.skill-card:hover{
    transform: translateY(-10px);
    box-shadow: 0 4px 15px rgba(255, 62, 62, 0.2);
}

.skill-card:hover i{
    color: var(--primary);
    transition: all 0.3s ease;
}

/* --- SEÇÃO: PROJETOS --- */

.projects-section {
    background-color: #000000;
    padding: 80px 0;
}

.projects-section h1 {
    text-align: center;
    margin-bottom: 40px;
}

.titulo-destaque {
    display: inline-block;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 5px;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.cards-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px;
    margin-bottom: 50px;
}

.box {
    background: #0e0e0e; 
    border-bottom: 3px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-smooth);
    height: 250px;
}

.box:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    transition: var(--transition-smooth);
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: var(--transition-fast);
}

.box:hover .cover img {
    opacity: 0.8;
    transform: scale(1.1);
}

.details {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    z-index: 5;
    transition: var(--transition-smooth);
}

.details p {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.box:hover .details {
    top: 40%;
}

.mini-languages {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.mini-languages i, .mini-languages img {
    font-size: 1.2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

.description {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 14, 14, 0.767);
    backdrop-filter: blur(5px);
    opacity: 0;
    transform: translateY(100%);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.box:hover .description {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.description p {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.description a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.description a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 10px var(--primary);
}

/* --- SEÇÃO: CONTATOS --- */
.contacts-section {
    padding: 100px 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 1) 100%);
    position: relative;
    text-align: center;
    z-index: 1;
}

.contacts-section h1 {
    color: var(--text-white);
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-gray);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.contact-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 0 20px;
}

.contact-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 22, 22, 0.05);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    width: 250px;
    text-decoration: none;
    color: var(--text-white);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.contact-card .icon-wrapper {
    width: 65px;
    height: 65px;
    background-color: rgba(255, 22, 22, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: var(--primary);
    transition: var(--transition-fast);
}

.contact-card:hover .icon-wrapper {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: 0 0 15px var(--primary-glow);
}

.contact-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.contact-card p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 30px 20px;
    background-color: #00000077;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    font-size: 0.9rem;
}

footer i {
    color: var(--primary);
}

/* --- COMPONENTE: MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    will-change: opacity;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid rgba(243, 53, 53, 0.2);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
    opacity: 0; 
    transform: translateY(40px) scale(0.95);
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    will-change: transform, opacity;
}

.modal-overlay.active .modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease; 
}

.close-modal:hover {
    opacity: 1;
}

/* --- GRID DE CONTATO --- */
.contact-grid {
    display: grid;
    margin-top: 20px;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.contact-item {
    text-decoration: none;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: rgba(243, 53, 53, 0.1);
    transform: translateY(-5px);
}

.icon-box {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.hidden{
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s ease;
}

.show{
    opacity: 1;
    transform: translateX(0);
}

/* --- MODAL DE PROJETOS --- */
.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.project-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.project-modal-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(243, 53, 53, 0.2);
    width: 90%;
    max-width: 950px;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.project-modal-content {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    flex: 1;
    overflow: hidden; 
}

.project-left-col {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.project-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.project-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-content: flex-start;
}

.project-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.project-header h3 {
    color: var(--text-white);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.close-project-modal {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 0;
    margin-left: 1rem;
}

.close-project-modal:hover {
    color: var(--primary);
}

#modal-project-date {
    display: block;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.project-scrollable-text {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.project-scrollable-text::-webkit-scrollbar {
    width: 6px;
}
.project-scrollable-text::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

#modal-project-desc {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-project {
    background-color: var(--primary);
    color: var(--text-white);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-project:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

.hidden-element {
    display: none !important;
}

.modal-tech-icons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
}

.modal-tech-icons i, 
.modal-tech-icons img {
    font-size: 1.8rem;
    color: var(--primary);
    transition: var(--transition-fast);
    cursor: help;
}

.modal-tech-icons i:hover,
.modal-tech-icons img:hover {
     transform: translateY(-3px);
     filter: drop-shadow(0 0 8px var(--primary-glow)); 
}


/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    .container {
        padding: 0 40px;
    }
    
    .cards-projects {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 850px) {
    header {
        padding: 20px 5%;
    }
    
    header.sticky {
        padding: 12px 5%;
    }

    .hero {
        padding: 0 5%;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .circle-gradient {
        width: 180px;
        height: 180px;
    }

    .circle-gradient img {
        width: 164px;
        height: 164px;
    }

    .contact-grid {
        gap: 10px;
    }

    .project-modal-card {
        padding: 1.5rem;
        max-height: 90vh; 
        overflow-y: auto; 
    }

    .project-modal-content {
        flex-direction: column; 
        gap: 1.5rem;
        overflow: visible; 
    }

    .project-left-col, .project-right-col {
        flex: auto;
    }
    
    .project-video-container.hidden-element {
        display: none !important;
    }

    .project-scrollable-text {
        max-height: none; 
        overflow-y: visible; 
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .hero-text .subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    .circle-gradient {
        width: 150px;
        height: 150px;
    }

    .circle-gradient img {
        width: 134px;
        height: 134px;
    }

    .actions {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .btn-cv, .btn-contact {
        width: 100%;
        text-align: center;
    }

    .cards-projects {
        grid-template-columns: 1fr; 
    }
    
    .box {
        height: 220px;
    }

    .modal-card {
        padding: 30px 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr; 
    }
    
    .project-modal-card {
        padding: 1.2rem;
        width: 95%; 
    }

    .project-header h3 {
        font-size: 1.3rem; 
    }

    .project-links {
        gap: 8px; 
    }

    .btn-project {
        width: 100%; 
        justify-content: center;
        padding: 0.8rem;
    }

    .modal-tech-icons {
        justify-content: center; 
        margin-top: 15px;
    }
    
    .modal-tech-icons i, 
    .modal-tech-icons img {
        font-size: 1.4rem; 
    }
}