/* --- 1. Variáveis Globais (Cyber-Minimalist Palette) --- */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-color: #38bdf8; /* Cyan Light */
  --accent-glow: rgba(56, 189, 248, 0.15);
  --font-sans: "Inter", sans-serif;
  --font-mono: "Fira Code", monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 70px;
}

body.theme-light {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-glass: rgba(0, 0, 0, 0.02);
  --border-glass: rgba(0, 0, 0, 0.05);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-color: #0284c7; /* Sky Blue Dark */
  --accent-glow: rgba(2, 132, 199, 0.1);
}

/* --- 2. Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Textura de Fundo (Granulado) */
.bg-texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 3. Utilitários & Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Efeito Glassmorphism Genérico */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}

/* --- 4. Tipografia --- */
h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: var(--accent-color);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* --- 5. Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(5, 5, 5, 0.8); /* Fallback */
  background: var(
    --bg-primary
  ); /* Sólido inicialmente, JS pode alterar transparência */
  border-bottom: 1px solid var(--border-glass);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

/* Quando rolar a página, o JS adicionará essa classe para dar efeito blur */
.navbar.scrolled {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(10px);
}
body.theme-light .navbar.scrolled {
  background: rgba(255, 255, 255, 0.7);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-logo .logo-symbol {
  color: var(--accent-color);
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent-color);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

/* Right Group (Theme, Lang, Mobile) */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-switcher button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: var(--transition);
}
.lang-switcher button.active {
  color: var(--accent-color);
}
.lang-switcher button:not(:last-child) {
  border-right: 1px solid var(--border-glass);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-glass);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.icon-sun {
  display: none;
}
body.theme-light .icon-sun {
  display: block;
}
body.theme-light .icon-moon {
  display: none;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* --- 6. Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  width: 100%;
}

.hero-title {
  font-size: 5rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(
    to right,
    var(--text-primary),
    var(--text-secondary)
  );
  -webkit-background-clip: text; /* Mantém para compatibilidade */
  background-clip: text; /* Adiciona o padrão (Correção) */
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  min-height: 2.4rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 2.5rem;
}

.typing-cursor::after {
  content: "_";
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: 1px solid var(--accent-color);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  border-color: var(--text-primary);
}

.btn i {
  margin-right: 0.5rem;
}

/* Visual Abstrato (Lado Direito do Hero) */
.hero-visual {
  display: flex;
  justify-content: flex-end;
}
.code-block-decoration {
  width: 100%;
  max-width: 400px;
  height: 250px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  position: relative;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.code-line {
  height: 12px;
  background: var(--border-glass);
  border-radius: 4px;
  width: 100%;
  animation: pulse 2s infinite ease-in-out;
}
.code-line:nth-child(1) {
  width: 60%;
}
.code-line:nth-child(2) {
  width: 90%;
  animation-delay: 0.2s;
}
.code-line:nth-child(3) {
  width: 75%;
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* --- 7. Sections Geral --- */
.content-section {
  padding: 6rem 0;
}
.bg-alternated {
  background-color: var(--bg-secondary);
}

/* --- 8. About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
}
.about-narrative p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}
.about-competencies {
  padding: 2rem;
}
.about-competencies h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.25rem;
}
.about-competencies ul li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}
.about-competencies i {
  color: var(--accent-color);
  width: 30px;
  font-size: 1.1rem;
}

/* --- 9. Philosophy Section --- */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.philosophy-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-icon {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}
.philosophy-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.philosophy-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- 10. Journey Timeline --- */
.journey-timeline {
  position: relative;
  border-left: 2px solid var(--border-glass);
  margin-left: 20px;
  padding-left: 40px;
}
.journey-item {
  margin-bottom: 3rem;
  position: relative;
}
.journey-item:last-child {
  margin-bottom: 0;
}
.journey-dot {
  width: 16px;
  height: 16px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  position: absolute;
  left: -49px;
  top: 24px;
}
.journey-content {
  padding: 2rem;
  position: relative;
}
.journey-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}
.journey-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

/* --- 11. Ecosystem --- */
.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}
.ecosystem-category h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.tech-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.tech-icons span {
  font-size: 2.5rem;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: default;
}
.tech-icons span:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

/* --- 12. Repositories (Projects) --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.project-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  height: 100%;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}
.project-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}
.project-header .fa-folder-open {
  color: var(--accent-color);
}
.project-links a {
  color: var(--text-secondary);
  margin-left: 1rem;
  font-size: 1.2rem;
}
.project-links a:hover {
  color: var(--text-primary);
}
.project-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
.project-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}
.project-stack {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Loader & Pagination */
.loader-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}
.carousel-arrow {
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}
.carousel-arrow:hover:not(:disabled) {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.pagination-dot {
  width: 8px;
  height: 8px;
  background: var(--border-glass);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.pagination-dot.active {
  background: var(--accent-color);
  transform: scale(1.2);
}

/* --- 13. Footer --- */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-glass);
  background: var(--bg-secondary);
}
.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- 14. Animações (Scroll Trigger) --- */
/* Estado inicial (invisível) */
.scroll-trigger {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Estado final (visível) - Classe adicionada via JS */
.scroll-trigger.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays para efeito cascata */
.delay-100 {
  transition-delay: 0.1s;
}
.delay-200 {
  transition-delay: 0.2s;
}
.delay-300 {
  transition-delay: 0.3s;
}
.delay-400 {
  transition-delay: 0.4s;
}

/* Variações de direção */
.fade-left {
  transform: translateX(-30px);
}
.fade-right {
  transform: translateX(30px);
}
.scroll-trigger.visible.fade-left,
.scroll-trigger.visible.fade-right {
  transform: translateX(0);
}

/* --- 15. Responsividade --- */
@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual {
    display: none; /* Simplifica no tablet */
  }
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.75rem;
  }
  .hero-title {
    font-size: 3rem;
  }

  /* Menu Mobile */
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    right: -100%;
    width: 80%;
    height: calc(100vh - var(--nav-height));
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border-glass);
  }
  .nav-menu.nav-menu-mobile-active {
    right: 0;
  }
  .nav-toggle {
    display: block;
  }
  .lang-switcher,
  .theme-toggle {
    display: none; /* Opcional: pode mover para dentro do menu mobile se quiser */
  }

  .journey-timeline {
    margin-left: 0;
    padding-left: 20px;
  }
  .journey-dot {
    left: -29px;
  }
}
