/* ========================================================= */
/* DESIGN SYSTEM & TOKENS (Premium / Dark Mode First)        */
/* ========================================================= */
:root {
  /* Paleta de Cores (Zinc & Yellow) */
  --bg-base: #09090b;
  --bg-soft: #18181b;
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  
  --primary: #FACC15;
  --primary-glow: rgba(250, 204, 21, 0.15);
  --secondary: #EAB308;
  
  /* Superfícies & Vidro (Glassmorphism) */
  --card-bg: rgba(24, 24, 27, 0.65);
  --glass: rgba(255, 255, 255, 0.03);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(250, 204, 21, 0.3);
  
  /* Geometria & Sombras */
  --radius: 16px;
  --shadow-base: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.8);
  --grid-color: rgba(255, 255, 255, 0.03);

  /* Curvas de Animação Sênior (Buttery Smooth) */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* TEMA CLARO */
:root[data-theme="light"] {
  --bg-base: #fafafa;
  --bg-soft: #ffffff;
  --text-main: #09090b;
  --text-muted: #52525b;
  --primary: #eab308;
  --primary-glow: rgba(234, 179, 8, 0.15);
  --card-bg: rgba(255, 255, 255, 0.8);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(234, 179, 8, 0.4);
  --grid-color: rgba(0, 0, 0, 0.03);
  --shadow-base: 0 4px 20px -8px rgba(0, 0, 0, 0.08);
}

/* ========================================================= */
/* RESET, BASE & ACESSIBILIDADE                              */
/* ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  scroll-behavior: smooth; 
  scroll-padding-top: 100px; 
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--primary-glow), transparent),
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-position: top center, center center, center center;
  background-attachment: fixed;
  
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Foco Acessível (A11y Master) */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Scrollbar Customizada Premium */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { 
  background: #3f3f46; 
  border-radius: 10px; 
  border: 2px solid var(--bg-base); 
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
::selection { background: var(--primary); color: #000; }

.container { width: min(1100px, 92%); margin: 0 auto; }

/* ========================================================= */
/* TIPOGRAFIA FLUIDA & ESPAÇAMENTOS                          */
/* ========================================================= */
h1, h2, h3 { 
  letter-spacing: -0.03em; 
  text-wrap: balance; 
  display: block; 
  margin-top: 0; 
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px !important;
  background: linear-gradient(to right bottom, #ffffff 20%, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
:root[data-theme="light"] h1 {
  background: linear-gradient(to right bottom, #09090b 20%, #52525b);
  -webkit-background-clip: text; background-clip: text;
}

h2 { 
  font-size: clamp(1.75rem, 4vw, 2.5rem); 
  font-weight: 700; 
  line-height: 1.2;
  margin-bottom: 16px !important; 
}

.sub { 
  font-size: 1.125rem; 
  color: var(--text-muted); 
  display: block;
  margin-top: 0 !important;
  margin-bottom: 48px !important; 
  line-height: 1.6;
}

main.section h1 { margin-bottom: 16px !important; }
main.section .sub { margin-bottom: 56px !important; }

/* ========================================================= */
/* NAVBAR E MENU MOBILE (Blur Suave)                         */
/* ========================================================= */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-base) 80%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.navbar .inner { display: flex; align-items: center; padding: 16px 0; }

.brand .logo { width: 36px; transition: transform 0.4s var(--ease-spring); }
.brand:hover .logo { transform: scale(1.15) rotate(8deg); }

.nav-links { display: flex; gap: 28px; align-items: center; margin-left: auto; }
.nav-links a { 
  position: relative; color: var(--text-muted); text-decoration: none; 
  font-weight: 500; font-size: 0.95rem; transition: color 0.3s ease; 
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }
.nav-links a::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--primary); transform: translateX(-50%) scale(0);
  transition: transform 0.3s var(--ease-spring);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: translateX(-50%) scale(1); }

.theme-toggle {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 20px;
  background: none; border: none; cursor: pointer; color: var(--text-main);
  border-radius: 10px; transition: background 0.3s ease;
}
.theme-toggle:hover { background: var(--glass); color: var(--primary); }
.theme-toggle svg {
  position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
  transition: opacity .3s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.theme-toggle .sun { opacity: 1; transform: rotate(0deg); }
.theme-toggle .moon { opacity: 0; transform: rotate(-90deg); }
:root[data-theme="light"] .theme-toggle .sun { opacity: 0; transform: rotate(90deg); }
:root[data-theme="light"] .theme-toggle .moon { opacity: 1; transform: rotate(0deg); }
:root[data-theme="light"] .theme-toggle { color: #111; }

.nav-toggle { display: none; background: transparent; border: 0; padding: 8px 12px; border-radius: 12px; outline: none; color: var(--text-main); cursor: pointer; }
.nav-toggle svg { width: 24px; height: 24px; stroke: currentColor; }

@media (max-width: 820px) {
  .theme-toggle { margin-left: auto; margin-right: 12px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; background: var(--glass); border: 1px solid var(--border-light); }
  .nav-links { 
    position: absolute; top: 75px; left: 16px; right: 16px; 
    background: var(--bg-soft); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light); border-radius: 20px; padding: 24px; 
    flex-direction: column; gap: 20px; box-shadow: var(--shadow-hover); 
    opacity: 0; visibility: hidden; transform: translateY(-10px); 
    transition: all 0.4s var(--ease-spring); 
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); display: flex;}
}

/* ========================================================= */
/* GRIDS & LAYOUT                                            */
/* ========================================================= */
.section { padding: 80px 0; }
.section h2, .section .sub { text-align: center; }

.grid { display: grid; gap: 24px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; }
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 32px; }
#project-filters { margin-bottom: 48px !important; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;}

/* ========================================================= */
/* CARDS COM INTERAÇÃO MAGNÉTICA (SPOTLIGHT)                 */
/* ========================================================= */
.card {
  position: relative;
  background: var(--card-bg); 
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light); 
  border-radius: var(--radius);
  padding: 32px !important;
  box-shadow: var(--shadow-base);
  display: flex !important; flex-direction: column !important; gap: 20px !important; 
  justify-content: flex-start; align-items: stretch;
  overflow: hidden; /* Mantém o brilho contido */
  transition: transform 0.4s var(--ease-spring), border-color 0.4s ease, box-shadow 0.4s ease;
  will-change: transform; /* Hardware acceleration */
}

/* Brilho interativo guiado pelo rato via JavaScript (--mx, --my) */
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(250, 204, 21, 0.08), transparent 40%);
  opacity: 0; transition: opacity 0.5s ease; z-index: 0; pointer-events: none;
}

.card:hover { 
  transform: translateY(-8px); 
  border-color: var(--border-hover); 
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.1); 
}
.card:hover::before { opacity: 1; }

.card > * { position: relative; z-index: 1; margin: 0 !important; }
.card h3 { font-size: 1.4rem; font-weight: 800; color: var(--text-main); line-height: 1.3; }
.card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }

/* Otimização Premium das Imagens dos Projetos */
.project-card img { 
  width: 100%; height: 200px; object-fit: cover; 
  border-radius: 12px; border: 1px solid var(--border-light); 
  transition: transform 0.6s var(--ease-out); 
  content-visibility: auto; /* Performance boost */
}
.project-card:hover img { transform: scale(1.03); }
.project-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.card .btn, .card .actions { margin-top: auto !important; align-self: flex-start; }

/* Certificados */
.credential-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.credential-code { 
  background: var(--glass); padding: 12px; border-radius: 8px; 
  border: 1px solid var(--border-light); font-family: 'JetBrains Mono', monospace; 
  font-size: 0.85rem; word-break: break-all; color: var(--text-muted);
}

/* ========================================================= */
/* BOTÕES MAGNÉTICOS & VARIAÇÕES                             */
/* ========================================================= */
.actions { display: flex; gap: 16px; flex-wrap: wrap; }
.section .actions { justify-content: center; }
.project-actions { margin-top: 48px !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; font-weight: 600; font-size: 0.95rem; border-radius: 12px;
  text-decoration: none; cursor: pointer; transition: all 0.3s var(--ease-spring);
  border: 1px solid transparent; overflow: hidden; position: relative;
}

/* Ondinha magnética no hover */
.btn::after {
  content: ""; position: absolute; inset: 0; 
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.25), transparent 60%); 
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.btn:hover::after { opacity: 1; }

/* Estilos de Botões */
.btn:not(.secondary):not(.light) { 
  background: var(--primary); color: #000; 
  box-shadow: 0 4px 14px var(--primary-glow); 
}
.btn:not(.secondary):not(.light):hover { 
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(250, 204, 21, 0.4); background: #fde047; 
}

.btn.secondary { background: var(--glass); color: var(--text-main); border: 1px solid var(--border-light); }
.btn.secondary:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--primary); transform: translateY(-3px); }

.btn.light { background: #ffffff; color: #111111; border-color: #ffffff; }
.btn.light:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255,255,255,.15); }

:root[data-theme="light"] .btn.secondary { background: transparent; color: var(--text-main); border-color: #d4d4d8; }
:root[data-theme="light"] .btn.secondary:hover { border-color: var(--text-main); }
:root[data-theme="light"] .btn.light { background: #111111; color: #ffffff; border-color: #111111; }

/* ========================================================= */
/* TAGS, SKILLS & KPIs (Design Clean)                        */
/* ========================================================= */
.tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; padding: 6px 12px; border-radius: 6px; 
  background: var(--glass); border: 1px solid var(--border-light); color: var(--text-muted);
}
.tag.skill { display: inline-flex; align-items: center; gap: 8px; color: var(--text-main); }
.tag.skill::before { 
  content: ""; width: 8px; height: 8px; border-radius: 50%; 
  background: var(--pin, var(--text-muted)); 
  box-shadow: 0 0 10px var(--pin, transparent); 
}

.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; margin-bottom: 24px; }
.kpi {
  padding: 8px 18px; background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border-light); border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); transition: all 0.3s ease; cursor: default;
}
.kpi:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); transform: translateY(-2px); }

/* Cores Mapeadas Sênior */
.indentificador.HTML, .indentificador.html { --pin: #E34F26; } .indentificador.CSS, .indentificador.css { --pin: #1572B6; } .indentificador.JavaScript, .indentificador.javascript { --pin: #F7DF1E; } .indentificador.Java, .indentificador.java { --pin: #f89820; } .indentificador.Python, .indentificador.python { --pin: #3776AB; } .indentificador.Swift, .indentificador.swift { --pin: #F05138; } .indentificador.Kotlin, .indentificador.kotlin { --pin: #7F52FF; } .indentificador.TypeScript, .indentificador.typescript { --pin: #3178C6; } .indentificador.PostgreSQL, .indentificador.postgresql { --pin: #336791; } .indentificador.SQL, .indentificador.sql { --pin: #00618A; } .indentificador.React, .indentificador.react { --pin: #61DAFB; } .indentificador.Node, .indentificador.Node\ js, .indentificador.node { --pin: #339933; } .indentificador.AWS, .indentificador.aws { --pin: #FF9900; } .indentificador.Docker, .indentificador.docker { --pin: #2496ED; } .indentificador.Kubernetes, .indentificador.kubernetes { --pin: #326CE5; } .indentificador.Prisma, .indentificador.prisma { --pin: #0C344B; } .indentificador.Microsserviços { --pin: #FF4F8B; } .indentificador.FastAPI, .indentificador.fastapi { --pin: #009688; } .indentificador.Supabase, .indentificador.supabase { --pin: #3ECF8E; }

/* ========================================================= */
/* FORMS E INPUTS                                            */
/* ========================================================= */
form .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
form label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
input, textarea { 
  background: rgba(0, 0, 0, 0.3); color: var(--text-main); 
  border: 1px solid var(--border-light); border-radius: 12px; 
  padding: 16px; font-family: inherit; font-size: 1rem; 
  transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); 
}
input:focus, textarea:focus { 
  outline: none; background: rgba(0, 0, 0, 0.5); border-color: var(--primary); 
  box-shadow: 0 0 0 4px var(--primary-glow), inset 0 2px 4px rgba(0,0,0,0.2); 
}

.status { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.success, .error { display: none; padding: 16px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; text-align: center; width: 100%; }
.success { background: rgba(62, 207, 142, 0.15); color: #3ECF8E; border: 1px solid rgba(62, 207, 142, 0.3); }
.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ========================================================= */
/* HERO SECTION & KEYFRAMES                                  */
/* ========================================================= */
.hero { padding: 40px 0 60px; display: grid; grid-template-columns: 1fr 400px; gap: 60px; align-items: center; min-height: 85vh; }

/* Animação Orgânica (Blob) restaurada para o Avatar */
@keyframes morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%; }
  34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%; }
}

.hero .avatar { 
  width: 260px; height: 260px; 
  padding: 8px; border: 1px solid var(--border-light); 
  background: linear-gradient(135deg, var(--primary-glow), transparent); 
  box-shadow: inset 0 0 20px rgba(255,255,255,0.05), var(--shadow-hover); 
  margin: 0 auto 32px; overflow: hidden; 
  animation: morph 8s ease-in-out infinite; /* Animação aplicada */
}
.hero .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 60px;}
  .hero .avatar { margin: 0 auto 24px; width: 220px; height: 220px;}
}
@media (max-width: 768px) {
  .hero { text-align: center; } .hero .intro p { margin: 0 auto 32px; } .hero-side { grid-row: 1; }
  .actions, .kpis { justify-content: center; }
}

/* ========================================================= */
/* FOOTER & SCROLL TO TOP                                    */
/* ========================================================= */
.footer { padding: 60px 0 30px; margin-top: 60px; border-top: 1px solid var(--border-light); background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4)); }
.footer .top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer .cta h3 { font-size: 2.2rem; margin-bottom: 12px !important; }
.footer .sitemap { display: flex; flex-direction: column; gap: 12px; }
.footer .sitemap a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer .sitemap a:hover { color: var(--primary); }

.social { display: flex; gap: 16px; align-items: center; justify-self: end; }
.social a { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--glass); border: 1px solid var(--border-light); color: var(--text-main); transition: all 0.3s var(--ease-spring); }
.social a svg { width: 22px !important; height: 22px !important; fill: currentColor; }
.social a:hover { background: var(--primary); color: #000; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px var(--primary-glow); }

.footer .bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.9rem; flex-wrap: wrap; gap: 16px;}

.footer .bottom a.back-top {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; background: var(--glass); border: 1px solid var(--border-light);
  border-radius: 999px; color: var(--text-main); text-decoration: none;
  font-weight: 600; font-size: 0.85rem; transition: all 0.3s var(--ease-spring);
}
.footer .bottom a.back-top::after { content: "↑"; font-size: 1.2rem; line-height: 1; transition: transform 0.3s ease; }
.footer .bottom a.back-top:hover { background: var(--primary); color: #000; border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 8px 20px var(--primary-glow); }
.footer .bottom a.back-top:hover::after { transform: translateY(-3px); }

@media (max-width: 768px) {
  .footer .top { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .footer .social { justify-content: center; } 
  .footer .bottom { flex-direction: column; text-align: center; }
}

/* ========================================================= */
/* UTILIDADES & ANIMAÇÕES REVEAL                             */
/* ========================================================= */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); will-change: opacity, transform; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 1000; background: var(--primary); color: #000; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: bold; }

@media (prefers-reduced-motion: reduce) { 
  * { animation: none !important; transition: none !important; } 
  .reveal { opacity: 1; transform: none; } 
  html { scroll-behavior: auto; }
}

/* ========================================================= */
/* ESTILOS DE IMPRESSÃO (CTRL+P)                             */
/* ========================================================= */
@media print {
  body { background: #fff !important; color: #000 !important; background-image: none !important; }
  .navbar, .footer, .theme-toggle, .actions.reveal, .skip-link, .nav-toggle { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; background: transparent !important; color: #000 !important; page-break-inside: avoid;}
  .card h3, .card p, .cv-item-title, .cv-item-desc { color: #000 !important; }
  .tag { border: 1px solid #666 !important; color: #000 !important; background: transparent !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}