@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&display=swap");

/* =========================
   1. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS
   ========================= */
:root {
    /* Dark Theme (default) */
    --c-brand: #97edaa;
    --c-brand-dark: #7bd88f;
    --c-bg: #121212;
    --c-bg-soft: #181818;
    --c-bg-mute: #1f1f1f;
    --c-bg-input: #101010;
    --c-border: #2e2e2e;
    --c-text: #ffffff;
    --c-text-soft: #eeeeee;
    --c-text-inverse: #121212;
    --c-shadow: rgba(0, 0, 0, 0.2);
    --c-shadow-brand: rgba(151, 237, 170, 0.2);
    --c-bg-progress-bar: rgba(255, 255, 255, 0.3);
    --c-bg-header-mobile: rgba(24, 24, 24, 0.75);
}

body.light-theme {
    --c-brand: #22c55e;
    /* Verde forte para destaques */
    --c-brand-dark: #2abe61;
    /* Verde escuro para botões/títulos */
    --c-bg: #dedfe2ec;
    /* Fundo claro */
    --c-bg-soft: #f0f2f5;
    /* Cards mais neutros */
    --c-bg-mute: #e3e6ea;
    /* Fundo secundário */
    --c-bg-input: #f8fafc;
    /* Inputs com leve cinza */
    --c-border: rgba(34, 34, 34, 0.1);
    /* Bordas suaves */
    --c-text: #222;
    /* Texto principal escuro */
    --c-text-soft: #555;
    /* Texto secundário */
    --c-text-inverse: #fff;
    /* Texto invertido */
    --c-shadow: rgba(0, 0, 0, 0.06);
    /* Sombra verde forte e suave */
    --c-shadow-brand: rgba(34, 197, 94, 0.1);
    /* Sombra verde forte */
    --c-bg-progress-bar: rgba(34, 197, 94, 0.12);
    --c-bg-header-mobile: rgba(240, 242, 245, 0.75);
}

/* Elementos principais no modo claro */
body.light-theme .logo-name,
body.light-theme .tags,
body.light-theme .contact-form-container label,
body.light-theme .contact-title {
    color: var(--c-brand);
}

body.light-theme .contact-icon {
    background: var(--c-bg-soft);
    color: var(--c-brand);
    border: 1px solid var(--c-border);
}

body.light-theme .box-grid {
    background-color: var(--c-bg-soft);
    border: 1px solid var(--c-border);
    box-shadow: 0 2px 8px var(--c-shadow-brand);
}

body.light-theme .about-text {
    background: linear-gradient(135deg, var(--c-bg-soft) 85%, #d1fadf 100%);
    /* Verde claro no canto inferior direito */
    color: var(--c-text);
    box-shadow: 0 4px 32px var(--c-shadow-brand);
    border: 2px solid var(--c-brand);
}

body.light-theme .about-text:hover {
    box-shadow: 0 8px 40px var(--c-shadow-brand);
    border-color: var(--c-brand-dark);
}

body.light-theme .contact-form-container {
    background: linear-gradient(120deg, var(--c-bg-soft) 85%, #d1fadf 100%);
    box-shadow: 0 4px 32px var(--c-shadow-brand);
    border: 2px solid var(--c-brand);
}

body.light-theme .contact-form-container:focus-within {
    border-color: var(--c-brand-dark);
    box-shadow: 0 8px 40px var(--c-shadow-brand);
}

body.light-theme .contact-form-container button {
    background-color: var(--c-brand);
    color: var(--c-text-inverse);
    box-shadow: 0 4px 16px var(--c-shadow-brand);
}

body.light-theme .contact-form-container button:hover {
    background: linear-gradient(90deg, var(--c-brand-dark), var(--c-brand));
    box-shadow: 0 8px 32px var(--c-shadow-brand);
}

body.light-theme .dot {
    border: 1px solid var(--c-brand-dark);
}

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

html {
    scroll-behavior: smooth;
    /* Para Firefox */
    scrollbar-color: var(--c-brand) var(--c-bg-input);
    scrollbar-width: thin;
}

/* Para navegadores baseados em WebKit (Chrome, Safari, Edge, etc.) */
::-webkit-scrollbar {
    width: 6px;
    /* Deixa a barra de rolagem mais fina */
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--c-brand);
    border-radius: 20px;
}

body {
    background-color: var(--c-bg);
    font-family: "Archivo", sans-serif;
    color: var(--c-text);
    margin: 0;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =========================
   2. HEADER E NAVEGAÇÃO
   ========================= */
header {
    padding: 1rem 2rem;
    background-color: var(--c-bg-input);
    box-shadow: 0 1px 4px var(--c-shadow);
    position: static;
    /* Mudei para fixed para ficar sempre no topo */
    top: 0;
    left: 0;
    width: 100%;
    /* Garante que o header ocupe toda a largura */
    z-index: 99;
}

header a {
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-name {
    font-family: "Fira Code", monospace;
    font-size: 1.5rem;
    color: var(--c-brand);
    padding-left: 1.3rem;
    font-weight: 500;
    font-size: 24px;
    letter-spacing: -0.05em;
    /* Valor corrigido */
}

.nav-links {
    display: flex;
    margin-left: auto;
    list-style: none;
}


.nav-link {
    color: var(--c-text);
    cursor: pointer;
    font-size: 1rem;
    margin: 0 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--c-brand);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--c-brand);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--c-border);
    color: var(--c-text-soft);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    color: var(--c-brand);
    border-color: var(--c-brand);
}

.theme-toggle-btn .fa-sun,
.theme-toggle-btn .fa-moon {
    position: absolute;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

body:not(.light-theme) .theme-toggle-btn .fa-sun {
    transform: translateY(100%);
    opacity: 0;
}

body.light-theme .theme-toggle-btn .fa-moon {
    transform: translateY(-100%);
    opacity: 0;
}

/* =========================
   3. SEÇÕES PRINCIPAIS (HERO, ABOUT, ETC.)
   ========================= */
.hero-content {
    /* O padding-top será adicionado em 'main' para compensar o header fixo */
    padding: 4rem 2rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
    gap: 217px;
}

.scroll-down-arrow {
    display: none;
}

.content-hero {
    margin-left: auto;
    margin-right: auto;
}

.content-hero h1 {
    color: var(--c-brand);
    font-weight: 500;
    font-size: 48px;
    margin-bottom: 1rem;
}

.content-hero p {
    color: var(--c-text);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.4;
    text-align: justify;
}

.hero-text-sup p {
    font-weight: 500;
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0%;

}

.curriculo-download {
    color: var(--c-text-inverse);
    text-decoration: none;
    border: solid var(--c-brand);
    border-radius: 4px;
    background-color: var(--c-brand);
    padding: 0.5rem 1rem;
}

.curriculo-download:hover {
    color: var(--c-brand);
    background-color: var(--c-bg-mute);

}

.hero-socials {
    margin-top: 1.5rem;
    margin-bottom: 1.2rem;
    display: flex;
    gap: 1rem;
}

.hero-socials a {
    color: var(--c-text-soft);
    font-size: 1.75rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.hero-socials a:hover {
    color: var(--c-brand);
    transform: scale(1.1);
}

/* Container para o texto do 'hero' para evitar 'layout shift' durante a animação de digitação */
.hero-text-container {
    min-height: 160px;
    /* Altura mínima para acomodar todo o texto e evitar que o conteúdo abaixo se mova */
    /* Espaçamento que substitui o <br> removido */
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

/* Efeito de digitação */
.typing-effect {
    /* Garante que o elemento não colapse quando vazio, evitando saltos no layout */
    min-height: 1.2em;
}

.typing-effect.typing::after {
    content: '|';
    display: inline-block;
    animation: blink-caret 0.75s step-end infinite;
    color: var(--c-brand);
    font-weight: 300;
    margin-left: 0.2rem;
    /* Pequeno espaço entre o texto e o cursor */
}

@keyframes blink-caret {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.tags {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-brand);
    font-weight: 400;
    padding: 10px 0 15px;
    font-size: 1.875rem;
    /* Restored font size */
    z-index: 20;
}

.about-text {
    max-width: 75ch;
    /* Optimal line length for readability */
    margin: 2rem auto;
    /* Center the block */
    padding: 2.5rem;
    /* Default padding for desktop */
    background: linear-gradient(135deg, var(--c-bg-soft) 85%, #c8fadd 200%);
    border-radius: 16px;
    box-shadow: 0 4px 32px var(--c-shadow-brand);
    border: 2px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
    text-align: left;
    /* Default to left-align for readability */
    letter-spacing: 0.01em;
}

.about-text p {
    /* Styles for paragraphs inside the about-text container */
    font-family: "Archivo", sans-serif;
    font-size: 1.18rem;
    line-height: 1.85;
    color: var(--c-text);
    font-weight: 400;
}

.about-text p+p {
    /* Margin between paragraphs */
    margin-top: 1.5rem;
}

.about-text:hover {
    border-color: var(--c-brand);
    box-shadow: 0 8px 40px var(--c-shadow-brand);
}

/* Container for all contact items */
.contact-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4rem;
    padding: 2rem 1rem;
    flex-wrap: wrap;
}

/* Each contact block */
.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 170px;
    /* Largura fixa para garantir o mesmo tamanho */
    height: 200px;
    /* Fixed height to ensure consistent size */
    /* Altura mínima para todos os cards */
    padding: 1.5rem 1rem;
    /* Espaçamento interno */
    justify-content: flex-start;
    /* Alinha conteúdo no topo */

    /* Estilo de card */
    background-color: var(--c-bg-soft);
    border-radius: 12px;
    border: 1px solid var(--c-border);
    box-shadow: 0 2px 8px var(--c-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--c-shadow-brand);
}

/* Circle background and icon */
.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
    color: var(--c-brand);
    font-size: 1.6rem;
    overflow: hidden;
}

.contact-icon img,
.contact-icon svg {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    max-width: 100%;
    max-height: 100%;
}

/* Title text */
.contact-title {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--c-text);
}

/* Details text */
.contact-detail {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--c-text-soft);
    word-break: break-word;
    max-width: 140px;
}

/* =========================
   4. COMPONENTES (CARDS, BOTÕES, ETC.
   ========================= */

/* --- Grid de Projetos --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    align-items: start;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* --- Card de Projeto --- */
.project-card {
    background: var(--c-bg-soft);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--c-border);
    box-shadow: 0 2px 8px var(--c-shadow);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--c-shadow-brand);
}

/* Imagem do projeto */
.project-image {
    width: 100%;
    height: 160px;
    background: var(--c-bg-mute);
    color: var(--c-brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Imagem cobre todo o espaço mantendo proporção */
    display: block;
}

/* Título e tecnologias alinhados à esquerda */
.project-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    text-align: left;
}

.project-techs {
    font-size: 0.95rem;
    color: var(--c-brand-dark);
    margin-bottom: 1rem;
    text-align: left;
}

/* Botões alinhados à esquerda */
.project-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 0.5rem;
}

/* Botões */
.project-buttons .access-project,
.project-buttons .access-repo {
    padding: 0.4rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
    min-width: 150px;
    border: 1.5px solid var(--c-brand-dark);
    user-select: none;
    text-decoration: none;
    text-align: center;
}

.project-buttons .access-project {
    background-color: var(--c-brand-dark);
    color: var(--c-text-inverse);
}

.project-buttons .access-project:hover {
    background-color: var(--c-bg-mute);
    color: var(--c-brand-dark);
}

.project-buttons .access-repo {
    background-color: transparent;
    color: var(--c-brand);
}

.project-buttons .access-repo:hover {
    background-color: var(--c-brand);
    border-color: var(--c-brand-dark);
    color: var(--c-text-inverse);
}

/* --- Seção de Serviços (Desktop) --- */
.servicos-container {
    display: flex;
    justify-content: center;
    /* Centraliza o conjunto de cards */
    gap: 1.25rem;
    /* 20px */
    max-width: 1280px;
    /* Aumenta a largura para garantir que caibam */
    margin: 2rem auto;
    padding: 0 1rem;
    flex-wrap: nowrap;
    /* Garante que todos os cards fiquem em uma linha */
}

.box-grid {
    background-color: var(--c-bg-soft);
    /* Cor de fundo do design */
    border: 1px solid var(--c-bg-input);
    /* Borda sutil como no design */
    border-radius: 1px;
    box-shadow: var(--c-brand) 0px 1px;
    transition: border-color 0.3s ease;
    /* Tamanho fixo para garantir que todos sejam idênticos */
    width: 225px;
    /* Aumentando a largura dos cards */
    height: 155px;
    /* Aumenta a altura para acomodar o layout vertical */
    flex-shrink: 0;
    /* Impede que os cards encolham */
}

.box-grid-inner {
    width: 100%;
    height: 100%;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.3s ease;
}

.box-grid:hover {
    border-color: var(--c-brand);
    /* Efeito de elevação sutil */
}

.box-grid:hover .box-grid-inner {
    transform: translateY(-4px);
}

.box-grid .box-icon {
    width: 48px;
    /* Ícone um pouco menor para melhor balanço */
    height: 48px;
    flex-shrink: 0;
}

.box-grid h2 {
    font-family: "Archivo", sans-serif;
    font-weight: 500;
    font-size: 1.30rem;
    /* Tamanho de fonte ajustado para o design */
    line-height: 1.3;
    color: var(--c-text-soft);
    text-align: left;
    /* Alinha o texto à esquerda */
    letter-spacing: 0%;
    opacity: 1;
    margin: 0;
    /* Remove margens padrão do h2 */
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.skill-box {
    width: 110px;
    height: 110px;
    background: var(--c-bg-soft);
    /* Quadrado escuro */
    border: 1px solid var(--c-border);
    /* Borda mais clara */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    /* Essencial para o tooltip */
}

.skill-box:hover {
    transform: translateY(-5px);
    border-color: var(--c-brand);
    box-shadow: 0 4px 15px var(--c-shadow);
}

.skill-box img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    filter: brightness(1.2) saturate(1.2);
}


/* ===========================
    FORM
 =========================== */

.contact-form-container {
    display: flex;
    flex-direction: column;
    /* O gap foi removido, o espaçamento agora é controlado pelo margin-top do .form-group */
    width: 100%;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Novos estilos para estrutura e acessibilidade do formulário */
.form-group {
    position: relative;
    /* Crucial para o posicionamento absoluto do label */
    margin-top: 1.5rem;
    /* Espaçamento entre os campos */
    width: 100%;
}

/* Estado inicial do label (dentro do campo, agindo como placeholder) */
.contact-form-container label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--c-text-soft);
    opacity: 0.7;
    pointer-events: none;
    /* Permite cliques através do label para o input */
    transition: all 0.2s ease-out;
}

/* Estado ativo do label (acima, "cortando" a borda) */
.contact-form-container input:focus+label,
.contact-form-container input:not(:placeholder-shown)+label,
.contact-form-container textarea:focus+label,
.contact-form-container textarea:not(:placeholder-shown)+label {
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--c-brand);
    opacity: 1;
    background-color: var(--c-bg);
    /* Cor de fundo do body (desktop) */
    padding: 0 0.4rem;
}

.required-indicator {
    color: var(--c-brand);
    font-weight: 600;
    margin-left: 2px;
}

/* Campo "Honeypot" para spam: visualmente oculto, mas disponível para bots */
.honeypot-field {
    display: none;
}

.contact-form-container input,
.contact-form-container textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background-color: var(--c-bg-input);
    color: var(--c-text);
    font-family: 'Archivo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--c-shadow);
}

.contact-form-container input:focus,
.contact-form-container textarea:focus {
    outline: none;
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px var(--c-shadow-brand);
    transform: translateY(-2px);
}

/* Estilo para campos de formulário inválidos (controlado via JS) */
.contact-form-container .invalid-field {
    border-color: #ff8a8a !important;
    box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.3) !important;
}

.contact-form-container textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.contact-form-container button {
    padding: 1rem 2rem;
    border-radius: 8px;
    border: none;
    background-color: var(--c-brand);
    color: var(--c-text-inverse);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px var(--c-shadow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-form-container button:hover {
    background-color: var(--c-brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--c-shadow);
}

.contact-form-container button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--c-shadow);
}

/* Estilos para a mensagem de status do formulário (sucesso/erro) */
#form-status {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
    /* Oculto por padrão, controlado via JS */
    transition: opacity 0.3s ease;
}

#form-status.success {
    background-color: var(--c-shadow-brand);
    color: var(--c-brand);
    border: 1px solid var(--c-brand);
}

#form-status.error {
    background-color: rgba(255, 100, 100, 0.15);
    color: #ff8a8a;
    border: 1px solid #ff8a8a;
}

.formspree {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* 8px */
    width: 100%;
    max-width: 31.25rem;
    /* 500px */
    align-items: center;
}

/* New Contact Section Layout */
#contato {
    padding: 3rem 2rem;
    /* Reduzido o espaçamento superior */
    margin-top: 2rem;
}

.contact-layout {
    display: flex;
    gap: 4rem;
    /* Espaço entre as colunas */
    max-width: 980px;
    /* Reduzido de 1100px para um layout mais compacto */
    margin: 2rem auto 0;
    align-items: flex-start;
}

.contact-info-left {
    flex: 1;
    max-width: 400px;
}

.contact-info-left h3 {
    font-size: 2rem;
    color: var(--c-brand);
    margin-bottom: 1rem;
    font-weight: 500;
}

.contact-form-right {
    flex: 1.5;
}

.contact-text-container {
    margin-bottom: 1.5rem;
    color: var(--c-text);
}

.contact-text-container p {
    font-size: 1.2rem;
    line-height: 1.6;
    text-align: initial;
    color: var(--c-text);
}

/* Ajustes nos botões sociais para a coluna esquerda */
#contato .social-buttons {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
}

#contato .social-btn {
    width: 100%;
    max-width: 280px;
    /* Limita a largura dos botões */
    justify-content: flex-start;
}

#contato .social-btn:hover {
    transform: scale(1.05);
    /* Leve aumento ao passar o mouse */
    transition: transform 0.3s ease;
}

/* Mostra o texto "Para um contato mais rápido, use o botão flutuante." apenas no mobile */

.only-mobile {
    display: none !important;
}

@media (max-width: 600px) {
    .only-mobile {
        display: flex !important;
    }
}

/* Esconde a separação "------OU------" no mobile */
@media (max-width: 600px) {
    .formspree-separation {
        display: none !important;
    }
}

/* Contêiner dos botões sociais */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    /* 16px */
    margin-top: 1.25rem;
    /* 20px */
    flex-direction: column;
    /* Permite que os botões quebrem a linha em telas menores */
}

/* Estilo geral dos botões sociais, alinhado com o design da página */
.social-btn {
    display: inline-flex;
    /* Usar inline-flex para melhor alinhamento */
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    /* Mesmo border-radius dos outros botões */
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: var(--c-brand);
    background-color: transparent;
    border: 1.5px solid var(--c-brand);
    transition: background-color 0.25s, color 0.25s;
}

.social-btn:hover {
    background-color: var(--c-brand);
    color: var(--c-text-inverse);
}

.social-btn,
.social-btn:visited,
.social-btn:hover,
.social-btn:focus {
    text-decoration: none !important;
}

/* FAB (Floating Action Button) */
.fab-container {
    position: fixed;
    bottom: 32px;
    right: 24px;
    z-index: 999;
    display: none;
}

@media (max-width: 900px) {
    .fab-container {
        display: block;
    }
    .desktop-only {
        display: none !important;
    }
}

.fab-toggle {
    display: none;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-brand);
    color: var(--c-text-inverse);
    border: none;
    box-shadow: 0 4px 16px var(--c-shadow-brand);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 2;
}

.fab-links {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1;
}

.fab-toggle:checked ~ .fab-links {
    opacity: 1;
    pointer-events: auto;
}

.fab-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-bg-soft);
    color: var(--c-brand-dark);
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--c-shadow-brand);
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.fab-link:hover {
    background: var(--c-brand);
    color: var(--c-text-inverse);
}

/* =========================
   RESPONSIVIDADE
   ========================= */

/* Small tweaks for smaller screen */
@media (max-width: 380px) {
    .project-card {
        max-width: 100%;
    }
}


/* Responsive for smaller screens */
@media (max-width: 600px) {
    .contact-container {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }
}

/* =========================
   RESPONSIVIDADE MOBILE
   ========================= */

/* Garante que nada vaze lateralmente */
body,
html {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header e nav */
@media (max-width: 1024px) {
    header {
        padding: 0.7rem 1rem;
        position: fixed;
        box-shadow: 0px 0.5px 5px var(--c-brand);
    }
}

/* Hero */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        gap: 2rem;
        padding-top: 4rem;
        text-align: center;
        position: relative;
        /* Necessário para o posicionamento absoluto da seta */
        padding-bottom: 5rem;
        /* Garante espaço para a seta no final da seção */
        min-height: 90vh;
    }

    .scroll-down-arrow {
        display: block;
        position: absolute;
        bottom: 0.5rem;
        /* Posiciona a seta mais para baixo */
        left: 50%;
        transform: translateX(-50%);
    }

    .content-hero {
        margin: 0;
        /* Centraliza os elementos filhos (texto, botão, sociais) */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        /* Espaçamento consistente entre texto, botão e ícones sociais */
    }

    .avatar-img {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }

    .content-hero h1 {
        font-size: 2rem;
    }

    .content-hero p {
        font-size: 1.1rem;
    }

    .hero-text-container {
        /* Remove a margem inferior, pois o 'gap' no pai (.content-hero) já cuida do espaçamento */
        margin-bottom: 0;
    }

    .project-grid {
        padding: 1.5rem 1rem;
        /* Adiciona padding lateral em telas menores */
    }

    .project-card {
        width: 100%;
        max-width: 450px;
        /* Ajusta o tamanho máximo do card */
        margin: 0 auto;
        /* Centraliza os cards quando a grade tem 1 coluna */
    }
}

/* Skills: quadrados menores e menos espaço */
@media (max-width: 700px) {
    .skills-container {
        gap: 1.5rem;
        /* 16px */
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .skill-box {
        width: 100px;
        height: 100px;
    }

    .skill-box img {
        max-width: 48px;
        max-height: 48px;
    }
}

/* Serviços: layout em grade no mobile */
@media (max-width: 900px) {
    .servicos-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        height: auto;
        /* Altura automática */
    }

    .box-grid {
        display: block;
        /* Mostrar todos os cards */
        width: 100%;
        /* Ocupar a largura da coluna da grade */
        max-width: none;
        /* Remover largura máxima */
        min-width: 0;
        /* Remover largura mínima */
        height: 160px;
        /* Manter altura fixa se desejado, ou usar 'auto' */
        margin: 0;
        /* Remover margem automática */
        background: var(--c-bg-soft);
        border-radius: 16px;
        box-shadow: 0 2px 12px var(--c-shadow-brand);
        border: 1.5px solid var(--c-brand);
        transition: box-shadow 0.5s;
    }

    /* <-- ESTA CHAVE FECHA O @media (max-width: 900px) */

    /* Contato: layout de coluna no mobile */
    .contact-layout {
        /* Empilha as colunas */
        flex-direction: column;
        /* Centraliza as colunas no container */
        align-items: center;
        gap: 3rem;
    }

    .contact-info-left {
        /* Permite que a coluna de texto ocupe a largura necessária */
        max-width: 100%;
        /* Centraliza todo o conteúdo (título, parágrafo, botões) */
        text-align: center;
    }

    .contact-text-container p {
        /* Garante que o parágrafo também seja centralizado */
        text-align: center;
    }

    #contato .social-buttons {
        /* Centraliza os botões sociais */
        align-items: center;
    }

    .contact-form-right {
        /* Garante que a coluna do formulário ocupe toda a largura */
        width: 100%;
        padding: 0 1rem;
        /* Adiciona um respiro lateral */
    }

    /* O formulário em si já tem um max-width e margin: auto, o que é bom. */
    /* Apenas garantimos que ele tenha uma aparência de "card" no mobile. */
    .contact-form-container {
        background: var(--c-bg-soft);
        /* Um fundo para destacar */
        padding: 2rem 1.5rem;
        border-radius: 16px;
        border: 1px solid var(--c-border);
        box-shadow: 0 4px 24px var(--c-shadow);
        margin: 0 auto;
        /* Garante a centralização */
    }

    /* Ajusta a cor de fundo do label flutuante para o novo fundo do card */
    .contact-form-container input:focus+label,
    .contact-form-container input:not(:placeholder-shown)+label,
    .contact-form-container textarea:focus+label,
    .contact-form-container textarea:not(:placeholder-shown)+label {
        background-color: var(--c-bg-soft);
    }

}

/* Contatos: coluna no mobile */
@media (max-width: 700px) {
    .contact-container {
        flex-direction: column;
        gap: 1.2rem;
        align-items: stretch;
        padding: 1.5rem 1rem;
    }
}

/* Footer: empilhado no mobile */
@media (max-width: 700px) {
    footer {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.95rem;
        padding: 1rem;
        margin-top: 2rem;
        text-align: center;
        align-items: center;
        justify-content: center;
    }
}

/* Navbar Mobile */
.mobile-nav {
    display: none;
    /* Escondido por padrão */
}

/* Mobile Header */
.mobile-header {
    display: none;
    /* Hidden by default */
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99;

    /* Efeito Glassmorphism */
    background-color: var(--c-bg-header-mobile);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 4px var(--c-shadow);
}

.mobile-header .logo-name {
    font-family: "Fira Code", monospace;
    font-size: 1.5rem;
    color: var(--c-brand);
    font-weight: 500;
    font-size: 24px;
    letter-spacing: -0.05em;
}

.hamburger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--c-brand);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger-icon.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-icon.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Media query to show mobile header and hide desktop nav */
@media (max-width: 1024px) {
    header>nav {
        display: none;
        /* Hide desktop nav */
    }

    .mobile-header {
        display: flex;
        /* Show mobile header */
    }
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 0;
    /* Hidden by default */
    position: fixed;
    z-index: 100;
    /* Higher than header, lower than hamburger icon */
    top: 0;
    right: 0;
    background-color: var(--c-bg-mute);
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
}

.sidebar-menu.open {
    width: 250px;
    /* Adjust width as needed */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--c-bg-input);
    box-shadow: 0 1px 4px var(--c-shadow);
}

.sidebar-header .logo-name {
    font-family: "Fira Code", monospace;
    font-size: 1.5rem;
    color: var(--c-brand);
    font-weight: 500;
    font-size: 24px;
    letter-spacing: -0.05em;
}

.close-sidebar {
    font-size: 2rem;
    color: var(--c-text-soft);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-sidebar:hover {
    color: var(--c-brand);
}

.sidebar-nav-links {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.sidebar-nav-links li {
    text-align: center;
    margin: 15px 0;
}

.sidebar-nav-links li a {
    text-decoration: none;
    font-size: 1.2rem;
    color: var(--c-text-soft);
    display: block;
    padding: 10px 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-nav-links li a:hover {
    background-color: var(--c-bg-input);
    color: var(--c-brand);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
}

.sidebar-footer .theme-toggle-btn {
    width: auto;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    gap: 0.8rem;
}

.sidebar-footer .theme-toggle-btn .fa-sun,
.sidebar-footer .theme-toggle-btn .fa-moon {
    position: static;
    transform: none;
    opacity: 1;
}

body:not(.light-theme) .sidebar-footer .theme-toggle-btn .fa-sun {
    display: none;
}

body.light-theme .sidebar-footer .theme-toggle-btn .fa-moon {
    display: none;
}

footer {
    background-color: var(--c-bg-mute);
    padding: 1rem 2rem;
    margin-top: 48px;
    color: var(--c-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    position: static;
    width: 100vw;
}

.footer-text {
    margin: 0;
    font-size: 1rem;
    color: var(--c-text);
    font-family: "Archivo";
}

.footer-powered {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1rem;
    color: var(--c-text);
}

.footer-powered img {
    height: 18px;
    /* Tamanho menor para o logo */
    width: auto;
    margin-left: 0.2rem;
    vertical-align: middle;
}

main {
    /* Adiciona padding no topo para não ficar atrás do header fixo 
    padding-top: 75px;
    */
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    main {
        /* Ajusta o padding para a altura do header mobile */
        padding-top: 60px;
    }
}

/* Sobre Mim - Desktop */
.about-text {
    max-width: auto;
    margin: 2rem auto;
    padding: 2.5rem 2.5rem;
    background: linear-gradient(135deg, var(--c-bg-soft) 85%, #c8fadd 200%);
    /* verde mais leve no canto inferior direito */
    border-radius: 16px;
    box-shadow: 0 4px 32px var(--c-shadow-brand);
    font-size: 1.18rem;
    line-height: 1.85;
    color: var(--c-text);
    text-align: left;
    border: 2px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
    letter-spacing: 0.01em;
}

.about-text:hover {
    border-color: var(--c-brand);
    box-shadow: 0 8px 40px var(--c-shadow-brand);
}

/* Sobre Mim - Mobile */
@media (max-width: 600px) {
    .about-text {
        margin: 1.2rem 0.5rem;
        padding: 1.2rem 0.7rem;
        /* Keep mobile padding */
        border-radius: 12px;
        text-align: left;
        /* Change to left-align for mobile */
        background: linear-gradient(135deg, var(--c-bg-soft) 90%, var(--c-brand) 100%);
        box-shadow: 0 2px 16px var(--c-shadow-brand);
    }

    .about-text p {
        /* Adjust font size for mobile paragraphs */
        font-size: 1.05rem;
    }
}

/* Contatos - Desktop */
.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Contatos - Mobile */
@media (max-width: 600px) {
    .contact-container {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        margin-top: 1.2rem;
    }

    .contact-item {
        width: 90%;
        max-width: 350px;
        background: var(--c-bg-soft);
        border-radius: 10px;
        box-shadow: 0 1px 6px var(--c-shadow);
        padding: 1.5rem;
        /* Aumentar o padding para dar mais espaço */
        text-align: center;
        min-height: auto;
        /* Reseta a altura mínima para o conteúdo */
    }

    .contact-icon {
        width: 60px;
        /* Aumentar o tamanho do ícone */
        height: 60px;
        /* Aumentar o tamanho do ícone */
        margin-bottom: 0.75rem;
        /* Ajustar margem */
    }

    .contact-icon img,
    .contact-icon svg {
        width: 36px;
        /* Aumentar o tamanho da imagem/svg dentro do ícone */
        height: 36px;
        /* Aumentar o tamanho da imagem/svg dentro do ícone */
    }

    .contact-title {
        font-size: 1.2rem;
        /* Aumentar o tamanho da fonte do título */
    }

    .contact-detail {
        font-size: 1.05rem;
        /* Aumentar o tamanho da fonte do detalhe */
    }
}

/* Header fixo e glass effect só no desktop */
@media (min-width: 901px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        z-index: 100;
        background: transparent; /* Removido o rgba, agora é transparente */
        backdrop-filter: blur(16px) saturate(1.2);
        box-shadow: 0 2px 24px rgba(34, 197, 94, 0.08);
        border-bottom: 1.5px solid rgba(123, 216, 143, 0.12);
        transition: background 0.3s, box-shadow 0.3s;
    }
    main {
        padding-top: 84px; /* altura do header fixo */
    }
    .tags {
        scroll-margin-top: 100px;
    }
}

/* No mobile, header normal, não fixo */
@media (max-width: 900px) {
    header {
        position: static;
        background: var(--c-bg);
        backdrop-filter: none;
        box-shadow: none;
        border-bottom: none;
    }
    main {
        padding-top: 0;
    }
    .tags {
        scroll-margin-top: 32px;
    }
}

/* =========================
   Tooltip Styles
   ========================= */

/* O texto do tooltip (a "nuvem") */
.tooltip-text {
    visibility: hidden;
    /* Escondido por padrão */
    width: 120px;
    background-color: #333;
    /* Cor de fundo da nuvem */
    color: #fff;
    /* Cor do texto */
    text-align: center;
    border-radius: 6px;
    /* Bordas arredondadas */
    padding: 5px 0;

    /* Posicionamento */
    position: absolute;
    z-index: 1;
    bottom: 110%;
    /* Posição acima da imagem */
    left: 50%;
    margin-left: -60px;
    /* Metade da largura (width) para centralizar */

    /* Efeito de transição suave */
    opacity: 0;
    transition: opacity 0.3s;
}

/* Flecha para baixo (opcional, mas dá um visual legal) */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Mostra o tooltip quando o mouse passa por cima do skill-box */
.skill-box:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}