@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Roboto+Mono:wght@400;700&display=swap');

/* --- Variáveis de Cor --- */
:root {
    --bg-color: #FFFFFF;
    --text-color: #121212;
    --card-bg-color: #FAFAFA;
    --section-bg-color: #F5F7FA;
    --section-divider: #E9EEF3;
    --accent: #2563eb; 
    --accent-2: #8b5cf6;
    --header-link-color: var(--text-color);
}

body.dark-mode, html.preload-dark {
    --bg-color: #0f1115;
    --text-color: #e6e8ea;
    --card-bg-color: #151922;
    --section-bg-color: #11151d;
    --section-divider: #1b2230;
    --accent: #60a5fa;
    --accent-2: #a78bfa;
    --header-link-color: var(--text-color);
}

/* --- Estilos Base --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-color);
}

h1, h2, h3 {
    font-family: 'Roboto Mono', monospace;
}

.intro-highlight {
    position: relative;
    transition: color 240ms ease;
}
.intro-highlight::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 400ms ease;
}
.intro-line-animated .intro-highlight::after {
    width: 100%;
}

.intro-title-colored .intro-highlight {
    color: var(--accent);
}

h1 {
    margin-bottom: 0;
}

/* --- Header --- */
header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background-color: transparent;
}

nav ul {
    list-style: none;
    align-items: center;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--header-link-color);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 180ms ease;
}

nav a:hover::after {
    width: 100%;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: var(--header-link-color);
}

/* --- Seção de Introdução --- */
.intro-bg {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-color);
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro {
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
    padding: 0 32px;
    background-color: var(--bg-color);
}

.introducao {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.foto-pessoal img {
    border-radius: 50%;
    max-width: 250px;
    width: 100%;
    height: auto;
}

.botao-download {
    background-color: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    max-width: 180px;
    text-align: center;
    font-weight: 500;
    transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.botao-download:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

/* --- Seções de Blog e Projetos --- */
#blog-bg {
    padding: 40px 32px;
    background-color: var(--section-bg-color);
    border-top: 1px solid var(--section-divider);
    border-bottom: 1px solid var(--section-divider);
}

.header-blog {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.header-blog a {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.posts-blog {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.item-blog {
    text-decoration: none;
    color: var(--text-color);
}

/* --- Estilo "Glassmorphism" para os Cards --- */
.item-blog, .projeto {
    position: relative;
    padding: 1.25rem;
    border-radius: 16px;
    transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease, border-color 200ms ease;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 6%, transparent)),
        rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

body.dark-mode .item-blog, body.dark-mode .projeto, html.preload-dark .item-blog, html.preload-dark .projeto {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent-2) 5%, transparent)),
        rgba(17, 21, 29, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}
.blog-header a, .post-header a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0;
    opacity: 0.85;
    transition: opacity 150ms ease;
}

.blog-header a:hover, .post-header a:hover {
    opacity: 1;
}

.item-blog {
    max-width: 300px;
    flex: 1 1 250px;
}

.item-blog:hover, .projeto:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: none;
    border-color: var(--accent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent)),
        rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

/* Dark mode hover equivalente */
body.dark-mode .item-blog:hover, body.dark-mode .projeto:hover,
html.preload-dark .item-blog:hover, html.preload-dark .projeto:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: none;
    border-color: var(--accent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent)),
        rgba(17, 21, 29, 0.46);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

/* brilho/glare sutil ao estilo "bolha" */
.item-blog::before, .projeto::before { content: none; }

.item-blog .resumo {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    height: calc(1.5em * 3);
}

#projetos-bg {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 40px 32px;
    background-color: var(--section-bg-color);
    border-top: 1px solid var(--section-divider);
    border-bottom: 1px solid var(--section-divider);
}

#projetos-bg a {
    text-decoration: none;
    color: var(--text-color);
}

#projetos-bg h2 {
    padding: 8px 16px;
    margin: 0;
}

.projeto {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 1rem 0;
}

/* --- Página de Blog (lista completa) --- */
.blog-container { max-width: 1100px; margin: 40px auto; padding: 0 16px; }
.blog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.blog-list { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 16px; }

/* --- Página de Post Individual --- */
.post-container { max-width: 900px; margin: 40px auto; padding: 0 16px; }
.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.post-meta { color: #666; margin-bottom: 24px; }
.post-content { line-height: 1.8; }

.projeto img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* --- Rodapé --- */
footer {
    background-color: var(--section-bg-color);
    border-top: 1px solid var(--section-divider);
    display: flex;
    justify-content: center;
    padding: 16px 0;
    gap: 16px;
}

footer img {
    height: 30px;
}

body.dark-mode footer a img {
    filter: invert(1);
}

/* --- Responsividade --- */
@media (max-width: 768px) {
    .intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .foto-pessoal img {
        max-width: 200px;
    }
    .botao-download {
        max-width: 100%;
    }
    .header-blog {
        flex-direction: column;
        gap: 8px;
    }
    .posts-blog {
        flex-direction: column;
        align-items: center;
    }
    .projeto {
        flex-direction: column;
        text-align: center;
    }
    .projeto img {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}