/* Estilos Modernos e Limpos */

:root {
    --bg-primary: #0c0c12;
    --bg-secondary: #16161f;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent: #a78bfa;
    --accent-strong: #8b5cf6;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(22, 22, 31, 0.72);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body.light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #6366f1;
    --accent-strong: #4f46e5;
    --border: rgba(15, 23, 42, 0.08);
    --glass: rgba(255, 255, 255, 0.78);
    --shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

body {
    transition: background-color 0.35s ease, color 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    min-height: 100vh;
}

/* ===== Fundo ambiente - gradiente animado limpo ===== */
#ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-primary);
}

.ambient-blend {
    position: absolute;
    inset: -25%;
    width: 150%;
    height: 150%;
    background: linear-gradient(
        135deg,
        var(--blend-1) 0%,
        var(--blend-2) 33%,
        var(--blend-3) 66%,
        var(--blend-4) 100%
    );
    background-size: 300% 300%;
    filter: blur(72px);
    animation: color-blend 20s ease-in-out infinite;
    opacity: 0.9;
    transition: background 0.6s ease;
}

.ambient-blob {
    transition: background 0.6s ease;
}

body.dark {
    --blend-1: #4c1d95;
    --blend-2: #1e3a8a;
    --blend-3: #581c87;
    --blend-4: #312e81;
    --blob-1: rgba(139, 92, 246, 0.45);
    --blob-2: rgba(59, 130, 246, 0.35);
    --blob-3: rgba(167, 139, 250, 0.3);
}

body.light {
    --blend-1: #c7d2fe;
    --blend-2: #ddd6fe;
    --blend-3: #bfdbfe;
    --blend-4: #e0e7ff;
    --blob-1: rgba(99, 102, 241, 0.35);
    --blob-2: rgba(139, 92, 246, 0.28);
    --blob-3: rgba(96, 165, 250, 0.25);
}

@keyframes color-blend {
    0%, 100% { background-position: 0% 50%; transform: scale(1); }
    50% { background-position: 100% 50%; transform: scale(1.05); }
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

.ambient-blob-1 {
    width: 45vw;
    height: 45vw;
    max-width: 520px;
    max-height: 520px;
    top: 5%;
    left: 10%;
    background: var(--blob-1);
    animation: blob-drift-1 24s ease-in-out infinite;
}

.ambient-blob-2 {
    width: 40vw;
    height: 40vw;
    max-width: 480px;
    max-height: 480px;
    top: 40%;
    right: 5%;
    background: var(--blob-2);
    animation: blob-drift-2 28s ease-in-out infinite;
}

.ambient-blob-3 {
    width: 38vw;
    height: 38vw;
    max-width: 440px;
    max-height: 440px;
    bottom: 5%;
    left: 35%;
    background: var(--blob-3);
    animation: blob-drift-3 22s ease-in-out infinite;
}

@keyframes blob-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(8%, 12%); }
}

@keyframes blob-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10%, -8%); }
}

@keyframes blob-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(6%, -10%); }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-blend,
    .ambient-blob {
        animation: none !important;
    }
}

body.dark .ambient-blend { opacity: 0.55; }
body.light .ambient-blend { opacity: 0.42; }

/* Conte?do acima do fundo ambiente */
nav,
section,
article,
footer,
.hero-content {
    position: relative;
    z-index: 1;
}

#three-canvas {
    display: none;
}

/* Navbar */
nav,
.main-nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--glass);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

body.light nav,
body.light .main-nav {
    background: var(--glass);
}

/* Cards */
.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 15%, transparent);
}

body.light .card:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.12);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--border));
    color: var(--accent);
}

body.dark .btn-secondary {
    color: #e9d5ff;
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(139, 92, 246, 0.06);
}

.btn-secondary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: white;
    transform: translateY(-2px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-text {
        animation: none;
        background-size: 100% auto;
    }
}

/* Sections */
section {
    padding: 4rem 0;
}

/* Loading */
#loading-screen {
    background: var(--bg-primary) !important;
    z-index: 9999;
    transition: opacity 0.3s ease;
    animation: loading-fallback 2s forwards;
}

@keyframes loading-fallback {
    0%, 70% { opacity: 1; pointer-events: auto; }
    100% { opacity: 0; pointer-events: none; visibility: hidden; }
}

#loading-screen.hidden,
#loading-screen[data-removed] {
    pointer-events: none !important;
    opacity: 0 !important;
}

body.light #loading-screen {
    background: var(--bg-primary) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* Prose styles para blog */
.blog-post-content {
    padding: 1.75rem 1.5rem;
}

@media (min-width: 768px) {
    .blog-post-content {
        padding: 2rem 2.5rem;
    }
}

.blog-prose {
    max-width: 100%;
    margin: 0 auto;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.blog-prose p,
.blog-prose div,
.blog-prose li {
    line-height: 1.85;
    margin-bottom: 1.25rem;
}

.blog-prose h1, .blog-prose h2, .blog-prose h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.blog-prose ul, .blog-prose ol {
    margin-left: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 0.5rem;
}

.blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
}

.prose {
    max-width: none;
}

.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.prose h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: 2rem 0;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
}

/* Utilities */
.fade-in {
    opacity: 1 !important; /* Sempre vis?vel */
    visibility: visible !important;
}

/* Garantir que conte?do sempre apare?a */
section, 
.hero-content, 
.card,
h1, h2, h3, h4, h5, h6,
p, span, div, a {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Apenas animar se GSAP estiver dispon?vel */
body.gsap-loaded .fade-in {
    opacity: 0;
}

body.gsap-loaded .fade-in.animated {
    opacity: 1;
}

.text-accent {
    color: var(--accent);
}

.bg-accent {
    background: var(--accent);
}

/* ===== NAVBAR ===== */
.main-nav.nav-scrolled { padding-top: 0; box-shadow: var(--shadow); }
.main-nav.nav-scrolled .nav-inner { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.main-nav.nav-hidden { transform: translateY(-100%); }
.nav-link { color: var(--text-secondary); font-weight: 500; }
.nav-link.active, .nav-link:hover { color: var(--accent) !important; }
.nav-link.active { position: relative; }
.nav-link.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--accent); border-radius: 1px; }

#mobile-menu {
    background: var(--glass) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ===== HERO ===== */
.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text-secondary); text-decoration: none; font-size: 0.75rem; font-weight: 500; z-index: 10; }
.hero-avatar-ring { padding: 4px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-strong), #60a5fa); animation: pulse-ring 3s ease infinite; }
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 30%, transparent); } 50% { box-shadow: 0 0 0 12px transparent; } }
.stat-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.stat-number { font-size: 1.75rem; font-weight: 800; color: var(--accent-strong); }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* Section panels */
.section-panel {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Lucide icons */
.lucide-icon, svg.lucide {
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

/* CV dropdown */
.cv-dropdown-menu a {
    color: var(--text-primary);
    text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 1.125rem;
}

/* ===== SKILLS ===== */
.skill-filter, .tech-tag, .blog-filter { padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.8rem; cursor: pointer; transition: all 0.2s; background: transparent; color: var(--text-secondary); text-decoration: none; display: inline-block; }
.skill-filter:hover, .skill-filter.active, .tech-tag.active, .blog-filter:hover, .blog-filter.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Language switcher */
.lang-switcher { background: var(--glass); }
.lang-switch-btn { color: var(--text-secondary); text-decoration: none; }
.lang-switch-btn:hover { color: var(--text-primary); background: var(--bg-primary); }
.lang-switch-btn.active { background: var(--accent); color: #fff !important; }

/* Blog cards ? garantir cliques */
.blog-card-link { position: relative; z-index: 2; }

/* Sobre mim ? conte?do leg?vel */
.about-content-card { overflow: hidden; }
.about-content {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-width: 100%;
}
.about-content p { margin-bottom: 1rem; }
.hero-avatar-ring img { display: block; }
.skill-bar { transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }
.skill-card .skill-icon-wrap .lucide-icon,
.skill-card .skill-icon-wrap svg.lucide {
    width: 3rem;
    height: 3rem;
    stroke-width: 1.5;
}
.skill-card .skill-icon-emoji {
    font-size: 2.75rem;
    line-height: 1;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs { display: none !important; }

/* ===== CASE STUDY ===== */
.case-block { padding: 1.5rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--border); border-left: 3px solid var(--accent); box-shadow: var(--shadow); }
.case-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.5rem; }

/* ===== SHARE ===== */
.share-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.share-btn { padding: 0.4rem 1rem; border-radius: 8px; font-size: 0.8rem; border: 1px solid var(--border); background: var(--glass); color: var(--text-primary); cursor: pointer; text-decoration: none; transition: all 0.2s; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== PAGINATION ===== */
.pagination-btn { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border); font-size: 0.85rem; text-decoration: none; color: var(--text-secondary); transition: all 0.2s; }
.pagination-btn:hover, .pagination-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== LIGHTBOX ===== */
.lightbox { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.lightbox.hidden { display: none; }
.lightbox-image { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 1rem; right: 1.5rem; font-size: 2rem; color: white; background: none; border: none; cursor: pointer; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1.25rem; border-radius: 8px; font-size: 0.875rem; transform: translateX(120%); transition: transform 0.3s; max-width: 320px; }
.toast.show { transform: translateX(0); }
.toast-success { background: #065f46; color: #d1fae5; border: 1px solid #10b981; }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }

/* ===== FORM ===== */
.form-input.input-error { border-color: #ef4444 !important; }
.field-error:not(.hidden) { display: block; margin-top: 0.25rem; }

/* ===== TOOLTIP ===== */
.tooltip-popup { position: fixed; z-index: 9999; padding: 0.5rem 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; font-size: 0.8rem; max-width: 220px; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

