:root {
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --card: #16161f;
  --border: #26263340;
  --text: #e7e7ef;
  --muted: #9494a8;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --radius: 16px;
  --max: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
strong { color: #fff; font-weight: 600; }

/* Fundo */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; z-index: -1;
  background: radial-gradient(circle, #8b5cf633 0%, transparent 60%);
  filter: blur(40px); pointer-events: none;
}

/* Navbar */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; max-width: var(--max); margin: 0 auto;
  transition: background .3s, padding .3s;
}
.nav.scrolled {
  background: #0a0a0fcc; backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 12px 32px;
}
.nav__logo { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 1.2rem;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.section { padding: 90px 0; }
.section__head { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.section__head--center { flex-direction: column; text-align: center; gap: 6px; }
.section__index { font-family: 'JetBrains Mono', monospace; color: var(--accent-2); font-size: 1rem; }
.section__title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }

/* Hero */
.hero {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  align-items: center; gap: 40px; padding-top: 80px;
}
.hero__hi { color: var(--accent-2); font-family: 'JetBrains Mono', monospace; font-size: 1rem; margin-bottom: 10px; }
.hero__name { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.hero__role { font-size: clamp(1.2rem, 4vw, 1.9rem); font-weight: 700; margin-top: 6px; min-height: 1.4em;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cursor { color: var(--accent-2); -webkit-text-fill-color: var(--accent-2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__desc { color: var(--muted); max-width: 480px; margin: 22px 0 28px; font-size: 1.05rem; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 22px; margin-top: 30px; }
.hero__socials a { color: var(--muted); font-size: .9rem; font-weight: 500; position: relative; transition: color .2s; }
.hero__socials a:hover { color: var(--accent-2); }

/* Botões */
.btn { display: inline-block; padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s; cursor: pointer; border: none; }
.btn--primary { background: var(--accent-grad); color: #fff; box-shadow: 0 8px 24px #8b5cf640; }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 12px 32px #8b5cf666; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--accent); background: #8b5cf615; }
.btn--lg { padding: 16px 36px; font-size: 1.05rem; font-family: 'JetBrains Mono', monospace; }

/* Code window */
.hero__card { display: flex; justify-content: center; }
.code-window { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px #00000060;
  animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.code-window__bar { display: flex; gap: 8px; padding: 14px 16px; background: #1c1c27; border-bottom: 1px solid var(--border); }
.code-window__bar span { width: 12px; height: 12px; border-radius: 50%; background: #444; }
.code-window__bar span:nth-child(1) { background: #ff5f56; }
.code-window__bar span:nth-child(2) { background: #ffbd2e; }
.code-window__bar span:nth-child(3) { background: #27c93f; }
.code-window__body { padding: 22px; font-family: 'JetBrains Mono', monospace; font-size: .9rem; line-height: 1.8; }
.c-kw { color: #c084fc; } .c-var { color: #22d3ee; } .c-prop { color: #93c5fd; }
.c-str { color: #86efac; } .c-bool { color: #fca5a5; }

/* Sobre */
.about { max-width: 760px; }
.about p { color: var(--muted); margin-bottom: 18px; font-size: 1.05rem; }
.about__stats { display: flex; gap: 40px; margin-top: 36px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-size: 2.2rem; font-weight: 800; background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--muted); font-size: .9rem; }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.tech { display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; font-weight: 500; font-size: .95rem;
  transition: transform .2s, border-color .2s; }
.tech:hover { transform: translateY(-4px); border-color: var(--accent); }
.tech__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Projetos */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.project { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; transition: transform .25s, border-color .25s, box-shadow .25s; }
.project:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 20px 40px #00000050; }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.project__icon { font-size: 1.8rem; }
.project__links { display: flex; gap: 14px; }
.project__links a { color: var(--muted); font-size: .85rem; font-weight: 600; transition: color .2s; }
.project__links a:hover { color: var(--accent-2); }
.project__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.project__desc { color: var(--muted); font-size: .95rem; flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project__tags span { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--accent-2);
  background: #22d3ee12; padding: 4px 10px; border-radius: 20px; }

/* Contato */
.section--contact { text-align: center; padding-bottom: 110px; }
.contact__text { color: var(--muted); max-width: 520px; margin: 0 auto 32px; font-size: 1.1rem; }
.contact__socials { display: flex; gap: 26px; justify-content: center; margin-top: 34px; }
.contact__socials a { color: var(--muted); font-weight: 500; transition: color .2s; }
.contact__socials a:hover { color: var(--accent-2); }

/* Footer */
.footer { text-align: center; padding: 30px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsivo */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: 110px; min-height: auto; padding-bottom: 60px; }
  .hero__card { margin-top: 30px; }
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav__links.open { display: flex; position: absolute; top: 100%; right: 16px; flex-direction: column;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 16px 24px; gap: 16px; }
}
