/* ======================================
 * CSS Otimizado para um Portfólio Profissional
 * ====================================== */

/* =========================
 * Variáveis / Paleta
 * ========================= */
:root {
    --bg: #101010;
    --surface: rgba(30, 30, 40, 0.7);
    --surface-strong: rgba(30, 30, 40, 0.85);
    --line: rgba(255, 255, 255, 0.06);
    --text: #f5f5f5;
    --muted: #b6b6b6;
    --primary: #007bff;
    --accent: #d4af37;
    --card-bg: #f5f5f5;
    --card-text: #181818;
    --radius: 18px;
    --shadow-sm: 0 2px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.22);
    --max-width: 1200px;
}

/* ======================================
 * Estilos Globais e do Corpo da Página
 * ====================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg);
    position: relative;
    min-height: 100vh;
    font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
    color: var(--text);
}

/* Estrelas de fundo fixas */
#stars-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: block;
    background: var(--bg);
    pointer-events: none;
    overflow: hidden;
}

/* Garante que o conteúdo principal fique sobre o fundo */
body,
main,
header,
section,
.container,
.row,
.card {
    position: relative;
    z-index: 1;
}

/* Container padrão para alinhamento */
.container {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(12px, 3vw, 48px);
}

/* Estilos gerais para todos os títulos (H1-H6) */

h1.destaque-frase {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.4rem;
    font-style: italic;
    font-weight: 900;
    color: #d4af37;
    text-align: center;
    margin: 56px auto 32px auto;
    max-width: 800px;
    letter-spacing: 1.5px;
    line-height: 1.3;
    background: none;
    border: none;
    padding: 0 18px;
    text-shadow: 0 4px 24px rgba(212, 175, 55, 0.18);
    border-bottom: 2px solid #d4af37;
    border-radius: 0 0 18px 18px;
}

h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text);
    margin: 0 0 0.5em 0;
    text-align: center;
}

h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

h5 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

h6 {
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
}

.destaque-frase {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.4rem;
    font-style: italic;
    font-weight: 900;
    color: #d4af37;
    text-align: center;
    margin: 56px auto 32px auto;
    max-width: 800px;
    letter-spacing: 1.5px;
    line-height: 1.3;
    background: none;
    border: none;
    padding: 0 18px;
    text-shadow: 0 4px 24px rgba(212, 175, 55, 0.18);
    border-bottom: 2px solid #d4af37;
    border-radius: 0 0 18px 18px;
}

/* Espaçamento entre seções principais */
main>section {
    margin-top: 120px;
    margin-bottom: 120px;
    scroll-margin-top: 100px;
}

/* Espaçamento extra para a seção de skills */
#skills {
    margin-top: 140px;
    margin-bottom: 140px;
}


/* Espaçamento extra para a seção de skills */
#skills {
    margin-top: 96px;
    margin-bottom: 96px;
}


h1 {
    font-size: 2.6rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.3rem;
}

h5 {
    font-size: 1.08rem;
}

h6 {
    font-size: 0.98rem;
}

/* Estilo para parágrafos e listas */
p,
ul {
    color: var(--muted);
    line-height: 1.6;
}

/* ======================================
 * Seções e Componentes Específicos
 * ====================================== */

/* Títulos das seções "Skills" e "Contato" sem a linha */
.skills h2,
#contact h2 {
    font-size: 1.5rem;
    margin-bottom: 1.125rem;
    margin-top: 0;
}

.skills h2::after,
#contact h2::after {
    display: none;
}

/* Barra de navegação customizada */
.custom-navbar {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    background: var(--surface-strong);
    padding: 24px 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.custom-navbar a {
    text-decoration: none;
    color: #e0e0e0;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0 8px;
}

.custom-navbar a:hover,
.custom-navbar a:focus-visible {
    color: var(--accent);
    outline: none;
}

/* ======================================
 * Seção "Sobre Mim"
 * ====================================== */
.about-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 28px;
    padding: 28px 18px;
    max-width: 900px;
    /* Harmonizado com skills */
    margin: 40px auto;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    transition: max-width 0.3s, padding 0.3s;
}

@media (max-width: 800px) {
    .about-content {
        grid-template-columns: 1fr;
        align-items: center;
        max-width: 98vw;
        padding: 18px 6px;
    }

    .profile-image {
        width: 160px;
        height: 210px;
    }

    .profile-text {
        min-height: unset;
    }
}


.about-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    max-width: 200px;
}

.about-left h2 {
    margin-bottom: 40px;
}


.profile-image {
    width: 200px;
    height: 260px;
    object-fit: cover;
    border-radius: 18px;
    border: 4px solid var(--accent);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    background: #222;
}

.profile-caption span {
    font-size: 0.98rem;
    color: var(--muted);
    font-style: italic;
}

.profile-text {
    font-size: 1.08rem;
    color: var(--muted);
    line-height: 1.7;
    text-align: left;
    margin: 0;
    min-height: 260px;
    padding-left: 0;
}

/* ======================================
 * Cards / Projetos
 * ====================================== */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    justify-content: center;
    padding: 32px 24px;
    max-width: var(--max-width);
    margin: 0 auto 48px auto;
}

.card {
    min-height: 220px;
    max-width: 380px;
    padding: 22px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    border: 1px solid rgba(24, 24, 24, 0.15);
    /* Borda inicial suave */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.18s;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transform: translateY(-6px) scale(1.01);
    border-color: var(--accent);
    /* Corrigido para variável */
}

/* Imagens dos cards de projetos */
.card-img-top-main,
.card-img-top {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: #222;
    border-radius: 10px;
    margin-bottom: 22px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.card-img-top-main {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: #222;
    border-radius: 10px;
    margin-bottom: 22px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Divisor entre imagem e conteúdo */
.card-divider {
    width: 80%;
    height: 2px;
    background: var(--accent);
    margin: 12px auto;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.18);
    border-radius: 2px;
}

.card-title {
    font-size: 1.05rem;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--card-text);
    text-align: center;
}

.card-text {
    font-size: 0.95rem;
    color: var(--card-text);
    margin-bottom: 10px;
    text-align: center;
}

.card-footer {
    width: 100%;
    text-align: center;
}

.btn.btn-primary {
    font-size: 1.12rem;
    font-weight: 700;
    padding: 16px 0;
    border-radius: 16px;
    width: 96%;
    text-align: center;
    display: block;
    margin: 20px auto 24px auto;
    background: linear-gradient(90deg, #e5bf4c 0%, #d4af37 100%);
    color: #181818;
    border: none;
    text-decoration: none !important;
    letter-spacing: 0.7px;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.14);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background: linear-gradient(90deg, #d4af37 0%, #e5bf4c 100%);
    color: #181818;
    box-shadow: 0 12px 32px rgba(229, 191, 76, 0.18);
    transform: translateY(-3px) scale(1.06);
}

/* ======================================
 * Carrossel de Projetos
 * ====================================== */
.carousel-projects {
    position: relative;
    max-width: 520px;
    margin: 0 auto 48px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
}

.carousel-track {
    display: flex;
    overflow: hidden;
    width: 100%;
    min-height: 340px;
    position: relative;
}

.carousel-track .card {
    min-width: 100%;
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.32, 1);
    margin: 0;
    box-sizing: border-box;
}

.carousel-arrow {
    background: rgba(212, 175, 55, 0.85);
    border: none;
    color: var(--card-text);
    font-size: 2.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    transition: background 0.2s;
}

.carousel-arrow.left {
    left: -56px;
}

.carousel-arrow.right {
    right: -56px;
}

.carousel-arrow:hover {
    background: #fff8dc;
    color: var(--accent);
}

/* ======================================
 * Seção de Habilidades (Skills) – Ajuste de Aparência
 * ====================================== */
.skills {
    max-width: 500px;
    /* menor largura para ficar mais compacto */
    margin: 48px auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 24px 18px;
    text-align: center;
    border: 1px solid var(--line);
}


.skills {
    max-width: 900px;
    /* Mais largo para harmonia com o layout */
    margin: 48px auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--line);
}

.skills ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 12px;
    padding: 0;
    list-style: none;
    justify-items: center;
    align-items: stretch;
}

.skills li {
    background: #222;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s;
    width: 100%;
    /* ocupa espaço proporcional na coluna */
    max-width: 130px;
    /* evita que fiquem muito largos */
    box-sizing: border-box;
    text-align: center;
}

.skills li:hover {
    background-color: #333;
}

.skills li i {
    font-size: 1.4em;
    /* leve redução para ficar proporcional */
    margin-right: 6px;
    vertical-align: middle;
    color: var(--accent);
    text-shadow: 0 0 4px rgba(166, 140, 44, 0.25);
}

/* ======================================
 * Responsividade – Skills
 * ====================================== */
@media (max-width: 480px) {
    .skills ul {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px 6px;
    }

    .skills h2 {
        font-size: 1.4rem;
        font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
        font-weight: 600;
    }

    @media (max-width: 900px) {
        .about-content {
            grid-template-columns: 1fr;
            text-align: center;
            padding: 20px;
        }
        .profile-text {
            text-align: center;
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 400;
        }
        .carousel-arrow.left {
            left: 8px;
        }
        .carousel-arrow.right {
            right: 8px;
        }
        .skills {
            max-width: 98vw;
            padding: 18px 6px;
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 500;
        }
        .skills ul {
            grid-template-columns: repeat(2, 1fr);
            gap: 14px 8px;
        }
        .skills h2, .skills li {
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 600;
        }
        h1, h1.destaque-frase {
            font-family: 'Cormorant Garamond', serif;
            font-weight: 900;
        }
    }

    @media (max-width: 600px) {
        .skills {
            max-width: 100vw;
            padding: 10px 2px;
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 500;
        }
        .skills ul {
            grid-template-columns: 1fr;
            gap: 10px 4px;
        }
        .skills h2, .skills li {
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 600;
        }
        h1, h1.destaque-frase {
            font-family: 'Cormorant Garamond', serif;
            font-weight: 900;
        }
    }

    @media (max-width: 480px) {
        .skills ul {
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 10px 6px;
        }
        .skills h2 {
            font-size: 1.4rem;
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 600;
        }
        .skills li {
            font-size: 0.9rem;
            padding: 6px 8px;
            font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
            font-weight: 600;
        }
        .skills li i {
            font-size: 1.2em;
        }
        h1, h1.destaque-frase {
            font-family: 'Cormorant Garamond', serif;
            font-weight: 900;
        }
    }

    .skills li {
        font-size: 0.9rem;
        padding: 6px 8px;
        font-family: 'Poppins', 'Segoe UI', Arial, Helvetica, sans-serif;
        font-weight: 600;
    }

    .skills li i {
        font-size: 1.2em;
    }

    h1.destaque-frase {
        font-family: 'Cormorant Garamond', serif;
        font-weight: 900;
    }
}

/* ======================================
 * Seção de Contato
 * ====================================== */
#contact {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    max-width: 900px;
    margin: 48px auto;
    padding: 24px 18px;
    text-align: center;
    border: 1px solid var(--line);
}

.contact-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.contact-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    min-width: 180px;
    justify-content: center;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.contact-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 12px;
}

.contact-icon {
    font-size: 1.5em;
    color: var(--accent);
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.18);
    transition: color 0.12s, text-shadow 0.12s;
}

.contact-label {
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
}

.contact-sub {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.2;
    text-align: center;
    margin-top: -8px;
}

.contact-item:hover .contact-icon {
    color: #fff8dc;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.28), 0 0 24px #fff8dc;
}

.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
    background: rgba(255, 255, 255, 0.02);
}

/* ======================================
 * Botão de voltar ao topo
 * ====================================== */
#back-to-top {
    position: fixed;
    right: 32px;
    bottom: 32px;
    z-index: 99;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s, box-shadow 0.18s, transform 0.12s;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0);
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px 8px rgba(212, 175, 55, 0.22), 0 6px 18px rgba(0, 0, 0, 0.35);
}

#back-to-top svg {
    display: block;
    width: 44px;
    height: 44px;
    fill: var(--accent);
    filter: none;
}

#back-to-top:hover {
    transform: translateY(-4px) scale(1.12);
    box-shadow: 0 0 48px 16px #e5bf4c, 0 0 36px 12px rgba(212, 175, 55, 0.22);
}

#back-to-top:hover svg {
    fill: #e5bf4c;
    filter: drop-shadow(0 0 16px var(--accent)) drop-shadow(0 0 8px #fff8dc);
}

/* ======================================
 * Responsividade
 * ====================================== */
@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px;
    }

    .profile-text {
        text-align: center;
    }

    .carousel-arrow.left {
        left: 8px;
    }

    .carousel-arrow.right {
        right: 8px;
    }

    /* Responsividade específica para skills */
    .skills {
        max-width: 98vw;
        padding: 18px 6px;
    }

    .skills ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 8px;
    }
}

@media (max-width: 600px) {

    /* Responsividade ainda mais forte para skills */
    .skills {
        max-width: 100vw;
        padding: 10px 2px;
    }

    .skills ul {
        grid-template-columns: 1fr;
        gap: 10px 4px;
    }
}

/* ======================================
 * Acessibilidade e Redução de Movimento
 * ====================================== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
#back-to-top:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.12);
    outline-offset: 3px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ======================================
 * Footer
 * ====================================== */
footer {
    text-align: center;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 0;
    color: #8b949e;
    font-size: 0.9rem;
    border-top: 1px solid #2d313a;
    background: transparent;
}