:root {
  --bg: #0e0f12;
  --bg-alt: #16181d;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #7c9eff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(14, 15, 18, 0.6);
}

.logo { font-weight: 700; }

.navbar-right { display: flex; align-items: center; gap: 1.5rem; }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text); text-decoration: none; opacity: .85; }
.nav-links a:hover { opacity: 1; color: var(--accent); }

.lang-switch { display: flex; gap: .35rem; }
.lang-switch button {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  padding: .3rem .4rem;
  cursor: pointer;
  opacity: .5;
  filter: grayscale(.6);
  transition: opacity .2s ease, filter .2s ease, border-color .2s ease;
}
.lang-switch button:hover { opacity: .8; filter: grayscale(0); }
.lang-switch button.active {
  opacity: 1;
  filter: grayscale(0);
  border-color: rgba(124, 158, 255, 0.5);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  width: 24px; height: 2px; background: var(--text);
}

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6rem 2rem;
  text-align: center;
}

.hero { background: radial-gradient(circle at 50% 30%, var(--bg-alt), var(--bg)); }
.hero .reveal { max-width: 600px; }
.sobre { background: var(--bg-alt); }
.experiencia { background: var(--bg); }
.contato { background: var(--bg-alt); }

h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin-bottom: .5rem; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 2rem; }
.highlight { color: var(--accent); }
p { color: var(--muted); }

.sobre { overflow: hidden; }
.sobre .reveal { position: relative; z-index: 1; }
.sobre p { max-width: 640px; line-height: 1.7; }

/* --- ilustrações de fundo (estáticas, sem vídeo) espalhadas pela seção --- */
.decor {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  filter: saturate(.85);
}
.decor--code {
  width: min(190px, 22vw);
  top: 10%;
  left: 6%;
  transform: rotate(-6deg);
}
.decor--robot {
  width: min(150px, 18vw);
  bottom: 8%;
  right: 8%;
  transform: rotate(4deg);
}
.decor--site {
  width: min(170px, 20vw);
  top: 14%;
  right: 10%;
  transform: rotate(5deg);
}

.experiencia-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 680px;
  width: 100%;
}
.experiencia-item {
  text-align: left;
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
}
.experiencia-periodo {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: .35rem;
}
.experiencia-item h3 { margin: 0 0 .6rem; font-size: 1.15rem; }
.experiencia-item p { margin: 0; line-height: 1.6; }

/* --- carrossel de stack (rolagem automática e contínua) --- */
.stack-carousel { width: 100%; margin-top: 3rem; }

.stack-marquee {
  overflow: hidden;
  width: 100%;
  max-width: min(900px, 92vw);
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.stack-belt {
  display: flex;
  width: max-content;
  animation: stack-scroll 34s linear infinite;
}
.stack-carousel:hover .stack-belt { animation-play-state: paused; }

.stack-track {
  display: flex;
  gap: 1.25rem;
  padding-right: 1.25rem;
}

.stack-item {
  flex-shrink: 0;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.stack-item img {
  width: 84px;
  height: 84px;
  padding: 18px;
  border-radius: 16px;
  background: #f4f4f5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  object-fit: contain;
}
.stack-item span {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes stack-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .stack-belt { animation: none; }
}

.contato-links { margin-top: .5rem; }
.contato a { color: var(--accent); text-decoration: none; }
.contato a:hover { text-decoration: underline; }

/* --- personagens/ilustrações animados (webm transparente) --- */
.character {
  position: absolute;
  pointer-events: none;
}
.character--dev {
  position: static;
  width: min(200px, 45vw);
  margin-top: 1.5rem;
}

/* --- animações de scroll-reveal --- */
[data-reveal] {
  opacity: 0;
  transition: opacity .8s ease, transform .8s ease;
}
[data-reveal="fade-up"]    { transform: translateY(40px); }
[data-reveal="fade-in"]    { transform: scale(.9); }
[data-reveal="slide-right"]{ transform: translateX(-60px); }
[data-reveal="slide-left"] { transform: translateX(60px); }

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --- responsivo --- */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: 64px; right: 0;
    background: var(--bg-alt);
    flex-direction: column;
    padding: 1rem 2rem;
    border-radius: 0 0 0 12px;
    transform: translateX(100%);
    transition: transform .3s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .character--dev { width: min(160px, 50vw); }
  .decor { display: none; }
}
