/* ========================================================
   PORTFOLIO · STYLES
   ======================================================== */

/* --- Variáveis de tema --- */
:root {
  /* Tema claro (padrão) */
  --bg: #f5f1ea;
  --bg-elevated: #ffffff;
  --bg-soft: #ece6dc;
  --text: #1a1a1a;
  --text-soft: #5a5651;
  --text-muted: #8a8580;
  --accent: #c8553d;
  --accent-2: #2d4a3e;
  --border: rgba(26, 26, 26, 0.12);
  --border-strong: rgba(26, 26, 26, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* Tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Espaçamentos */
  --container: 1200px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Transições */
  --t-fast: 180ms ease;
  --t-med: 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tema escuro */
:root[data-theme="dark"] {
  --bg: #131210;
  --bg-elevated: #1c1a17;
  --bg-soft: #221f1c;
  --text: #f0ebe2;
  --text-soft: #b8b2a8;
  --text-muted: #7a766f;
  --accent: #e07a5f;
  --accent-2: #81b29a;
  --border: rgba(240, 235, 226, 0.10);
  --border-strong: rgba(240, 235, 226, 0.22);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: auto;
}

/* Body trava o scroll nativo — a navegação será controlada via JS */
body.slides-mode {
  overflow: hidden;
  height: 100vh;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-med), color var(--t-med);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; }
ul { list-style: none; }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 2.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-med), border-color var(--t-med);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.nav ul {
  display: flex;
  gap: 2rem;
  font-size: 0.92rem;
}

.nav a {
  position: relative;
  color: var(--text-soft);
  transition: color var(--t-fast);
}
.nav a::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--t-med);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Botão idioma */
.lang-switch { position: relative; }
.lang-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.lang-button:hover { border-color: var(--border-strong); background: var(--bg-soft); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.lang-menu li {
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--t-fast);
}
.lang-menu li:hover { background: var(--bg-soft); }

/* Botão tema */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-med);
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--bg-soft); transform: rotate(15deg); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 8rem 2.5rem 4rem;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container);
  width: 100%;
  text-align: left;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-title > span:first-child {
  display: block;
  font-style: italic;
  color: var(--text-soft);
  font-size: 0.55em;
  margin-bottom: 0.5rem;
}
.hero-name {
  display: block;
  font-weight: 800;
  color: var(--text);
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin-bottom: 2.5rem;
  max-width: 520px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--accent); color: #fff; }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--text); color: var(--bg); }

/* Decoração do hero */
.hero-decor {
  position: absolute;
  top: 50%;
  right: -10%;
  transform: translateY(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.12;
  filter: blur(40px);
  z-index: 0;
}

/* --- Slides empilhados (modo apresentação) --- */
.slides-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero,
.section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 7rem 2.5rem 4rem;

  /* CORREÇÃO DO SCROLL:
     - overflow-y: auto permite rolar dentro da seção
     - o conteúdo é centralizado pela margem automática do wrapper interno,
       NÃO por justify-content: center (que cortava topo/base) */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: block;

  /* Esconde a barra de rolagem visualmente (mantém o scroll funcional) */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge antigo */

  /* Estado padrão: fora da tela (abaixo), visível */
  transform: translateY(100%);
  opacity: 1;
  transition: transform 1100ms cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
  pointer-events: none;
}
/* Esconde a barra de rolagem no Chrome, Safari e Edge */
.hero::-webkit-scrollbar,
.section::-webkit-scrollbar {
  display: none;
}

/* Wrapper interno: centraliza o conteúdo quando ele é menor que a tela,
   mas permite que ele cresça e seja rolável quando é maior */
.section-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

/* Slide ATIVO: no centro da tela */
.hero.slide-active,
.section.slide-active {
  transform: translateY(0);
  z-index: 2;
  pointer-events: auto;
}

/* Slide ANTERIOR: empurrado pra cima (saiu por cima) */
.hero.slide-prev,
.section.slide-prev {
  transform: translateY(-100%);
  z-index: 1;
}

/* Slide PRÓXIMO: posicionado abaixo, esperando */
.hero.slide-next,
.section.slide-next {
  transform: translateY(100%);
  z-index: 1;
}

/* ============================================
   CASCATA INTERNA DOS ELEMENTOS DENTRO DO SLIDE
   ============================================ */
.section-inner > .section-head,
.section-inner > .about-grid,
.section-inner > .skills-grid,
.section-inner > .projects-grid,
.section-inner > .contact-lead,
.section-inner > .contact-grid,
.hero > .hero-inner {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-active .section-inner > .section-head,
.slide-active .section-inner > .about-grid,
.slide-active .section-inner > .skills-grid,
.slide-active .section-inner > .projects-grid,
.slide-active .section-inner > .contact-lead,
.slide-active .section-inner > .contact-grid,
.slide-active > .hero-inner {
  opacity: 1;
  transform: translateY(0);
}

/* Atrasos para criar a cascata (de cima para baixo na entrada) */
.slide-active .section-inner > *:nth-child(1) { transition-delay: 250ms; }
.slide-active .section-inner > *:nth-child(2) { transition-delay: 400ms; }
.slide-active .section-inner > *:nth-child(3) { transition-delay: 550ms; }

/* Slide ANTERIOR: filhos saem em cascata */
.slide-prev .section-inner > .section-head,
.slide-prev .section-inner > .about-grid,
.slide-prev .section-inner > .skills-grid,
.slide-prev .section-inner > .projects-grid,
.slide-prev .section-inner > .contact-lead,
.slide-prev .section-inner > .contact-grid,
.slide-prev > .hero-inner {
  opacity: 0;
  transform: translateY(-60px);
}

/* Slide PRÓXIMO: filhos no estado inicial */
.slide-next .section-inner > .section-head,
.slide-next .section-inner > .about-grid,
.slide-next .section-inner > .skills-grid,
.slide-next .section-inner > .projects-grid,
.slide-next .section-inner > .contact-lead,
.slide-next .section-inner > .contact-grid,
.slide-next > .hero-inner {
  opacity: 0;
  transform: translateY(60px);
  transition-delay: 0ms !important;
}

/* Hero mantém comportamento próprio */
.hero {
  padding: 8rem 2.5rem 4rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* --- SOBRE --- */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity var(--t-med);
}
.photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-med);
}
.about-photo.no-photo .photo-placeholder { opacity: 1; }

.about-text p {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.about-meta {
  display: grid;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.about-meta li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  font-size: 0.95rem;
}
.about-meta strong {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- HABILIDADES --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform var(--t-med), border-color var(--t-fast), box-shadow var(--t-med);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.skill-icon {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 0.45rem 0.7rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  color: var(--accent);
}
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.skill-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* --- PROJETOS --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Grid otimizado pra exatamente 2 projetos */
.projects-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 760px) {
  .projects-grid-2 { grid-template-columns: 1fr; }
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--t-med), border-color var(--t-fast), box-shadow var(--t-med);
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.project-visual {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   VISUAL 1 — FILA DE MÚSICAS (Song Request)
   ============================================ */
.project-visual-queue {
  background: linear-gradient(135deg, #9146FF 0%, #6441A5 100%);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.project-visual-queue .window-bar {
  display: flex;
  gap: 6px;
  padding-bottom: 0.4rem;
}
.project-visual-queue .window-bar span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
}
.project-visual-queue .queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.project-visual-queue .queue-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  background: rgba(255,255,255,0.13);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  animation: queueSlide 3s ease-in-out infinite;
}
.project-visual-queue .queue-item:nth-child(1) { animation-delay: 0s; }
.project-visual-queue .queue-item:nth-child(2) { animation-delay: 0.3s; }
.project-visual-queue .queue-item:nth-child(3) { animation-delay: 0.6s; }
.project-visual-queue .queue-thumb {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ff6b9d, #feca57);
  flex-shrink: 0;
}
.project-visual-queue .queue-thumb.alt {
  background: linear-gradient(135deg, #48dbfb, #1dd1a1);
}
.project-visual-queue .queue-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-visual-queue .queue-lines span {
  height: 6px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
}
.project-visual-queue .queue-lines span:nth-child(1) { width: 85%; }
.project-visual-queue .queue-lines span:nth-child(2) { width: 60%; background: rgba(255,255,255,0.4); }
.project-visual-queue .queue-play {
  color: white;
  font-size: 0.7rem;
  opacity: 0.85;
}
@keyframes queueSlide {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(3px); opacity: 0.85; }
}

/* ============================================
   VISUAL 2 — DISCO + ONDAS (Spotify API Command)
   ============================================ */
.project-visual-spotify {
  background: radial-gradient(circle at 50% 60%, #1ed760 0%, #0d6332 70%, #0a3d20 100%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.project-visual-spotify .spotify-disc {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
}
.project-visual-spotify .disc-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  animation: spin 5s linear infinite;
}
.project-visual-spotify .disc-ring:nth-child(1) {
  width: 100%;
  height: 100%;
  border-top-color: white;
}
.project-visual-spotify .disc-ring.inner {
  width: 65%;
  height: 65%;
  border-style: dashed;
  animation-duration: 8s;
  animation-direction: reverse;
}
.project-visual-spotify .disc-center {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}
.project-visual-spotify .spotify-wave {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
}
.project-visual-spotify .spotify-wave i {
  width: 3px;
  background: white;
  border-radius: 2px;
  animation: waveBar 1.2s ease-in-out infinite;
}
.project-visual-spotify .spotify-wave i:nth-child(1) { height: 50%; animation-delay: 0s; }
.project-visual-spotify .spotify-wave i:nth-child(2) { height: 80%; animation-delay: 0.1s; }
.project-visual-spotify .spotify-wave i:nth-child(3) { height: 35%; animation-delay: 0.2s; }
.project-visual-spotify .spotify-wave i:nth-child(4) { height: 95%; animation-delay: 0.3s; }
.project-visual-spotify .spotify-wave i:nth-child(5) { height: 55%; animation-delay: 0.4s; }
.project-visual-spotify .spotify-wave i:nth-child(6) { height: 75%; animation-delay: 0.5s; }
.project-visual-spotify .spotify-wave i:nth-child(7) { height: 40%; animation-delay: 0.6s; }
@keyframes waveBar {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ============================================
   VISUAL 3 — PÓDIO DE RANKING (Rank LoL)
   ============================================ */
.project-visual-rank {
  background: linear-gradient(160deg, #1e2a4a 0%, #0a1228 70%, #060b1a 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-visual-rank .rank-podium {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 18px;
}
.project-visual-rank .podium-bar {
  width: 52px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  animation: podiumRise 2.6s ease-in-out infinite;
}
.project-visual-rank .podium-bar.first {
  height: 96px;
  background: linear-gradient(180deg, #ffd75e, #e0a32e);
  animation-delay: 0.3s;
}
.project-visual-rank .podium-bar.second {
  height: 68px;
  background: linear-gradient(180deg, #d4dae6, #9aa3b5);
  animation-delay: 0s;
}
.project-visual-rank .podium-bar.third {
  height: 48px;
  background: linear-gradient(180deg, #d68a52, #a55f30);
  animation-delay: 0.6s;
}
.project-visual-rank .rank-crown {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: #ffd75e;
  text-shadow: 0 0 18px rgba(255, 215, 94, 0.7);
  animation: crownFloat 3s ease-in-out infinite;
}
@keyframes podiumRise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes crownFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.project-body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.project-body h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.project-body p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex: 1;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.project-stack span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-soft);
  border-radius: 999px;
  color: var(--text-soft);
}
.project-link {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  transition: transform var(--t-fast);
}
.project-card:hover .project-link { transform: translateX(4px); }

/* --- CONTATO --- */
.contact-lead {
  font-size: 1.2rem;
  color: var(--text-soft);
  margin-bottom: 3rem;
  max-width: 640px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.contact-card {
  padding: 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--t-med), border-color var(--t-fast), background var(--t-fast);
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--bg-soft);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.contact-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
}

/* --- FOOTER (dentro da seção de contato) --- */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.footer-small {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* --- Botão voltar ao topo (opacidade controlada via JS) --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: background var(--t-fast);
  z-index: 90;
  will-change: opacity, transform;
}
.back-to-top:hover { background: var(--accent); }

/* ========================================================
   MODO SCROLL (CELULAR) — sobrescreve o modo slides
   Ativado pelo JS via body.scroll-mode quando é mobile.
   As seções voltam ao fluxo normal e a página rola.
   ======================================================== */
body.scroll-mode {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

/* Garante que html/body rolem normalmente no celular */
html:has(body.scroll-mode),
html.scroll-mode-html {
  height: auto;
  overflow-y: auto;
}

/* O container deixa de "prender" os slides */
body.scroll-mode .slides-container {
  height: auto;
  min-height: auto;
  overflow: visible;
}

/* As seções voltam ao fluxo normal: empilhadas, altura natural */
body.scroll-mode .hero,
body.scroll-mode .section {
  position: relative;
  top: auto;
  left: auto;
  height: auto;
  min-height: auto;
  overflow: visible;

  /* Desfaz o estado de slide */
  transform: none;
  opacity: 1;
  pointer-events: auto;
  /* IMPORTANTE: sem will-change e sem transição de transform na própria
     seção — isso causava tremor ao rolar com o dedo no celular */
  will-change: auto;
  transition: opacity 600ms ease;
}

/* Cada seção entra suavemente ao rolar (cascata de seção) */
body.scroll-mode .reveal-section {
  opacity: 0;
}
body.scroll-mode .reveal-section.in-view {
  opacity: 1;
}
/* O hero aparece imediatamente (é a primeira coisa visível) */
body.scroll-mode .hero.reveal-section {
  opacity: 1;
}

/* O conteúdo interno aparece junto da seção, sem depender de slide-active */
body.scroll-mode .section-inner > .section-head,
body.scroll-mode .section-inner > .about-grid,
body.scroll-mode .section-inner > .skills-grid,
body.scroll-mode .section-inner > .projects-grid,
body.scroll-mode .section-inner > .contact-lead,
body.scroll-mode .section-inner > .contact-grid,
body.scroll-mode .hero > .hero-inner {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Cards individuais — cascata só com fade (sem transform) para
   não causar tremor durante o scroll com o dedo no celular */
body.scroll-mode .reveal {
  opacity: 0;
  transform: none;
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
body.scroll-mode .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Espaçamento entre seções no modo scroll (altura natural, sem 100vh) */
body.scroll-mode .section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
/* A primeira seção (hero) precisa folgar do header fixo */
body.scroll-mode .hero {
  padding-top: 7.5rem;
  padding-bottom: 3.5rem;
}
/* O wrapper interno não precisa centralizar verticalmente no scroll */
body.scroll-mode .section-inner {
  min-height: auto;
  justify-content: flex-start;
}

/* ========================================================
   RESPONSIVO
   Otimizado para Samsung M14 5G e Androids comuns
   (largura CSS efetiva ~360px) e também tablets.
   ======================================================== */

/* --- TABLET / TELAS MÉDIAS (até 860px) --- */
@media (max-width: 860px) {
  .site-header {
    padding: 0.85rem 1.25rem;
    flex-wrap: wrap;
  }
  .nav { order: 3; flex-basis: 100%; }
  .nav ul {
    gap: 1.4rem;
    font-size: 0.9rem;
    justify-content: center;
    padding-top: 0.6rem;
  }

  .hero { padding: 9rem 1.5rem 3rem; }
  .section { padding: 9rem 1.5rem 4rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-photo { max-width: 260px; margin: 0 auto; }
  .about-meta li { grid-template-columns: 1fr; gap: 0.25rem; }

  .section-head { margin-bottom: 2rem; }

  .back-to-top { bottom: 1.25rem; right: 1.25rem; }
}

/* --- CELULAR (até 560px — inclui o Samsung M14 5G ~360px) --- */
@media (max-width: 560px) {
  /* Texto base um pouco menor pra caber bem em tela estreita */
  body { font-size: 16px; }

  /* HEADER — compacto, logo e ferramentas na 1ª linha, menu na 2ª */
  .site-header {
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }
  .logo { font-size: 1rem; }
  .logo .logo-icon { width: 26px; height: 26px; border-radius: 6px; }

  .nav ul {
    gap: 1rem;
    font-size: 0.82rem;
    padding-top: 0.5rem;
    flex-wrap: wrap;
  }

  .lang-button { padding: 0.4rem 0.65rem; font-size: 0.72rem; }
  .theme-toggle { width: 34px; height: 34px; }

  /* SEÇÕES — padding lateral menor, topo ajustado ao header de 2 linhas */
  .hero { padding: 8.5rem 1.15rem 2.5rem; }
  .section { padding: 8.5rem 1.15rem 3rem; }

  /* HERO — título proporcional à tela estreita */
  .hero-eyebrow { font-size: 0.7rem; margin-bottom: 1rem; }
  .hero-title { margin-bottom: 1rem; }
  .hero-role { font-size: 1rem; margin-bottom: 1.75rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.9rem 1.5rem;
  }
  /* Decoração do hero menor pra não estourar a largura */
  .hero-decor { width: 320px; height: 320px; right: -25%; }

  /* SEÇÃO — cabeçalho */
  .section-head {
    gap: 0.85rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
  }
  .section-head h2 { font-size: clamp(2rem, 11vw, 2.6rem); }

  /* SOBRE */
  .about-grid { gap: 1.75rem; }
  .about-photo { max-width: 200px; }
  .about-text p { font-size: 1.02rem; margin-bottom: 1.5rem; }
  .about-meta { padding-top: 1.5rem; gap: 0.85rem; }

  /* HABILIDADES — uma coluna, cards mais compactos */
  .skills-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .skill-card { padding: 1.5rem; }
  .skill-icon { margin-bottom: 0.85rem; }
  .skill-card h3 { font-size: 1.2rem; }

  /* PROJETOS — uma coluna */
  .projects-grid,
  .projects-grid-2 { grid-template-columns: 1fr; gap: 1rem; }
  .project-body { padding: 1.4rem; }
  .project-body h3 { font-size: 1.3rem; }

  /* CONTATO — uma coluna, cards confortáveis pro toque */
  .contact-lead { font-size: 1.05rem; margin-bottom: 2rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .contact-card { padding: 1.35rem; }
  .contact-value { font-size: 1rem; word-break: break-word; }

  /* FOOTER */
  .site-footer { font-size: 0.8rem; margin-top: 2rem; padding-top: 1.5rem; }
  .footer-small { font-size: 0.72rem; }

  /* Botão voltar ao topo — alvo de toque maior e fora do caminho */
  .back-to-top {
    width: 48px;
    height: 48px;
    bottom: 1rem;
    right: 1rem;
  }
}

/* --- TELAS MUITO ESTREITAS (até 360px — limite inferior do M14) --- */
@media (max-width: 360px) {
  .nav ul { gap: 0.7rem; font-size: 0.78rem; }
  .logo { font-size: 0.92rem; }
  .hero { padding: 8rem 1rem 2rem; }
  .section { padding: 8rem 1rem 2.5rem; }
  .section-head h2 { font-size: 1.9rem; }
  .skill-card,
  .project-body,
  .contact-card { padding: 1.2rem; }
}

/* --- Reveal dos cards --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 700ms cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Respeita usuários que pediram menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
