/* ============================================
   TOKENS / VARIABLES
   ============================================ */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f6f7f9;
  --surface:   #ffffff;
  --ink:       #0a0a0b;   /* preto principal */
  --ink-soft:  #3a3d42;   /* cinza escuro texto */
  --muted:     #6b7280;   /* medium gray */
  --line:      #e5e7eb;   /* bordas */
  --accent:    #2563eb;   /* electric blue */
  --accent-2:  #1d4ed8;   /* azul hover */
  --accent-soft: rgba(37, 99, 235, 0.08);
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 4px 24px rgba(10, 10, 11, 0.06);
  --shadow-lg: 0 16px 48px rgba(10, 10, 11, 0.12);
  --maxw:      1080px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0a0a0b;
    --bg-alt:   #111114;
    --surface:  #15151a;
    --ink:      #f4f4f5;
    --ink-soft: #c8cace;
    --muted:    #8b8f96;
    --line:     #26262c;
    --accent:   #3b82f6;
    --accent-2: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink-soft);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.accent { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200; transition: width 0.1s linear;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: var(--maxw); margin: 0 auto;
  transition: padding 0.3s var(--ease);
}
.nav.scrolled {
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  left: 50%; transform: translateX(-50%); width: 100%;
}
.nav__logo {
  font-weight: 800; font-size: 1.4rem; color: var(--ink); letter-spacing: -0.5px;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a {
  font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  position: relative; transition: color 0.2s;
}
.nav__links a:not(.nav__cta)::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:not(.nav__cta):hover { color: var(--ink); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  background: var(--ink); color: var(--bg) !important;
  padding: 9px 18px; border-radius: 999px; font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.nav__cta:hover { background: var(--accent); transform: translateY(-2px); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.3s var(--ease); }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px circle at 75% 30%, var(--accent-soft), transparent 60%),
    radial-gradient(500px circle at 15% 80%, var(--accent-soft), transparent 55%);
}
.hero__bg::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.5;
}
.hero__inner { max-width: 820px; }
.hero__eyebrow {
  font-family: 'JetBrains Mono', monospace; color: var(--accent);
  font-size: 0.95rem; font-weight: 500; margin-bottom: 18px; letter-spacing: 0.5px;
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.1; font-weight: 800;
  color: var(--ink); letter-spacing: -1.5px; margin-bottom: 24px;
}
.hero__rotator {
  color: var(--accent); position: relative; display: inline-block;
  border-right: 3px solid var(--accent); padding-right: 4px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { border-color: transparent; } }
.hero__subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted);
  max-width: 600px; margin-bottom: 36px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 64px; }
.hero__scroll {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--muted);
}
.hero__scroll span {
  width: 22px; height: 36px; border: 2px solid var(--muted); border-radius: 12px;
  position: relative; flex-shrink: 0;
}
.hero__scroll span::before {
  content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; background: var(--accent); border-radius: 2px;
  animation: scrollWheel 1.6s infinite;
}
@keyframes scrollWheel {
  0% { opacity: 0; transform: translate(-50%, 0); }
  40% { opacity: 1; }
  80%, 100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn--primary {
  background: var(--accent); color: #fff; box-shadow: 0 8px 24px var(--accent-soft);
}
.btn--primary:hover { background: var(--accent-2); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn--ghost {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 110px 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section__num {
  font-family: 'JetBrains Mono', monospace; color: var(--accent);
  font-size: 0.9rem; font-weight: 500; margin-bottom: 8px;
}
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--ink); font-weight: 800;
  letter-spacing: -1px; margin-bottom: 48px;
}

/* ============================================
   ABOUT
   ============================================ */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.about__text p { margin-bottom: 18px; font-size: 1.05rem; }
.about__text strong { color: var(--ink); }
.about__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.about__avatar {
  width: 72px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.about__facts { list-style: none; }
.about__facts li {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 0.95rem; color: var(--ink);
}
.about__facts li:last-child { border-bottom: 0; }
.about__facts span { color: var(--muted); }
.dot { font-style: normal; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.dot::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 44px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -28px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.timeline__item:hover .timeline__dot { transform: scale(1.25); box-shadow: 0 0 0 6px var(--accent-soft); }
.timeline__date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--accent);
  font-weight: 500;
}
.timeline__item h3 { color: var(--ink); font-size: 1.2rem; margin: 6px 0 10px; font-weight: 700; }
.timeline__company { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.timeline__item p { color: var(--muted); margin-bottom: 14px; max-width: 640px; }

/* ============================================
   TAGS
   ============================================ */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 11px; border-radius: 999px;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
/* Lone project: span the grid but stay a comfortable width instead of a narrow column */
.project:only-child { grid-column: 1 / -1; max-width: 560px; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
}
.project:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.project__icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.project__links { display: flex; gap: 14px; }
.project__links a {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--muted);
  transition: color 0.2s;
}
.project__links a:hover { color: var(--accent); }
.project h3 { color: var(--ink); font-size: 1.25rem; margin-bottom: 10px; font-weight: 700; }
.project p { color: var(--muted); margin-bottom: 18px; font-size: 0.96rem; }

/* ============================================
   SKILLS
   ============================================ */
/* Multicol instead of grid: cards stack tight instead of aligning to the tallest row */
.skills { columns: 400px; column-gap: 24px; }
.skills__group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 24px;
  break-inside: avoid; -webkit-column-break-inside: avoid;
  transition: transform 0.3s var(--ease);
}
.skills__group:last-child { margin-bottom: 0; }
.skills__group:hover { transform: translateY(-4px); }
.skills__group h3 {
  color: var(--ink); font-size: 1.05rem; margin-bottom: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.skills__group h3::before { content: ''; width: 18px; height: 3px; background: var(--accent); border-radius: 2px; }
.skills__group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.skills__group li {
  font-size: 0.9rem; color: var(--ink-soft); background: var(--bg-alt);
  border: 1px solid var(--line); padding: 7px 13px; border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}
.skills__group li:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ============================================
   CONTACT
   ============================================ */
.section--contact { text-align: center; }
.contact { display: flex; flex-direction: column; align-items: center; }
.contact .section__num, .contact .section__title { text-align: center; }
.contact__lead { color: var(--muted); max-width: 480px; margin: 0 auto 32px; font-size: 1.1rem; }
.contact__email { font-family: 'JetBrains Mono', monospace; font-size: 1rem; }
.contact__socials { display: flex; gap: 28px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }
.contact__socials a {
  font-weight: 500; color: var(--ink-soft); position: relative; transition: color 0.2s;
}
.contact__socials a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.contact__socials a:hover { color: var(--accent); }
.contact__socials a:hover::after { width: 100%; }

/* ============================================
   FOOTER
   ============================================ */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.88rem; color: var(--muted);
}

/* ============================================
   REVEAL ANIMATION (scroll)
   ============================================ */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Subtle stagger for lists/grids */
.timeline__item:nth-child(2) { transition-delay: 0.05s; }
.timeline__item:nth-child(3) { transition-delay: 0.1s; }
.timeline__item:nth-child(4) { transition-delay: 0.15s; }
.project:nth-child(2), .skills__group:nth-child(2) { transition-delay: 0.08s; }
.project:nth-child(3), .skills__group:nth-child(3) { transition-delay: 0.16s; }
.skills__group:nth-child(4) { transition-delay: 0.24s; }

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 760px) {
  .nav__links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(78%, 320px);
    flex-direction: column; justify-content: center; gap: 34px;
    background: var(--surface); border-left: 1px solid var(--line);
    transform: translateX(100%); transition: transform 0.4s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1.15rem; }
  .nav__toggle { display: flex; z-index: 110; }
  .nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.open span:nth-child(2) { opacity: 0; }
  .nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .about { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 80px 0; }
  .hero { padding: 110px 0 60px; }
  .footer__inner { justify-content: center; text-align: center; }
}
