/* ============================================================
   Felipe Xavier — Data Scientist & AI Engineer
   Restrained dark-tech: content-first, fast, one contained 3D moment.
   Direction: "restraint on the chrome, richness in the content."
   ============================================================ */

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

:root {
  --bg: #0a0d16;
  --bg-alt: #0c1020;
  --surface: #11172a;
  --surface-2: #151d33;
  --ink: #f0f3fb;
  --ink-soft: #c0cadd;
  --muted: #7a87a2;
  --accent: #818cf8;        /* indigo (lightened for AA on dark) */
  --accent-deep: #6366f1;
  --accent-2: #22d3ee;      /* cyan — used sparingly */
  --grad: linear-gradient(110deg, var(--accent-deep), var(--accent-2));
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.13);
  --glass: rgba(255, 255, 255, 0.03);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.40);
  --radius: 16px;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Single, static, very faint ambient glow — no blur, no animation */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(50vw 45vw at 78% -8%, rgba(99,102,241,0.10), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

.container { width: min(1080px, 92%); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.14; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.8rem); color: var(--ink); }
h2 em { font-style: normal; color: var(--accent); }
h3 { font-size: 1.15rem; }
em { font-style: italic; }
::selection { background: rgba(99,102,241,0.4); color: #fff; }

/* ============ PROGRESS BAR ============ */
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--grad);
  z-index: 1000;
  transition: width .1s linear;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.15rem 4%;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .35s var(--ease), padding .35s var(--ease), border-color .35s;
  background: transparent;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 13, 22, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: .7rem 4%;
}
.nav-logo {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-size: 1.05rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
}
.nav-logo svg { color: var(--accent); }
.nav-links { display: flex; gap: 1.8rem; list-style: none; align-items: center; }
.nav-links a {
  font-size: .9rem; font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: .3rem 0;
  transition: color .25s;
}
.nav-links a:not(.cta-mini):not(.nav-icon)::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.cta-mini):not(.nav-icon):hover::after { width: 100%; }
.nav-icon { display: inline-flex; align-items: center; color: var(--ink-soft); }
.nav-icon:hover { color: var(--accent); }
.cta-mini {
  padding: .5rem 1.1rem !important;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.4);
  color: var(--ink) !important;
  border-radius: 999px;
  transition: background .25s var(--ease), border-color .25s;
}
.cta-mini:hover { background: rgba(129,140,248,0.22); border-color: var(--accent); }

.nav-toggle { display: none; width: 34px; height: 34px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: all .3s var(--ease); }
.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); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; right: 4%; left: 4%;
    flex-direction: column; gap: 1rem; align-items: flex-start;
    background: rgba(12, 16, 30, 0.97);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: all .3s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .cta-mini { width: 100%; text-align: center; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.45rem;
  border-radius: 11px;
  font-weight: 600; font-size: .92rem;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.btn-primary { background: var(--accent-deep); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent); }
.btn-primary svg { transition: transform .25s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(129,140,248,0.08); }

/* ============ HERO ============ */
/* page-wide 3D object: fixed, behind all content, never intercepts input */
.page-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 7rem 0 4rem;
  z-index: 1;
}
/* soft scrim behind the hero text so the page-wide 3D object never hurts legibility */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(72% 92% at 22% 50%, rgba(10,13,22,0.66), transparent 72%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: min(1080px, 92%); margin-inline: auto;
  min-width: 0; /* allow shrink below content min-width (flex item) — prevents mobile overflow */
}
.hero-text { max-width: 760px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono);
  font-size: .74rem; font-weight: 500; letter-spacing: 0.06em;
  color: var(--accent-2);
  padding: .4rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  margin: 1.3rem 0 1.2rem;
  line-height: 1.0;
}
.hero-title .word { display: inline-block; margin-right: .25em; opacity: 0; transform: translateY(24px); }
.hero-title .word.accent { color: var(--accent); }
.hero-text.visible .word { animation: wordIn .7s var(--ease) forwards; }
.hero-text.visible .word:nth-child(2) { animation-delay: .1s; }
@keyframes wordIn { to { opacity: 1; transform: translateY(0); } }

.hero-subtitle {
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: 2rem;
}
.hero-subtitle em { color: var(--ink); font-style: normal; font-weight: 600; }

/* Static metrics — real numbers shown immediately, in data/mono treatment */
.hero-metrics { display: flex; flex-wrap: wrap; gap: 1.6rem 2.2rem; margin-bottom: 2.2rem; }
.metric-item { display: flex; flex-direction: column; gap: .15rem; }
.metric-item .num {
  font-family: var(--mono); font-size: 1.85rem; font-weight: 600;
  color: var(--ink); line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-item .lbl { font-size: .78rem; color: var(--muted); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.8rem; }

.hero-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.hero-links a {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .88rem; font-weight: 500; color: var(--ink-soft);
  transition: color .25s;
}
.hero-links a:hover { color: var(--accent); }
.hero-links svg { color: var(--muted); transition: color .25s; }
.hero-links a:hover svg { color: var(--accent); }

.scroll-indicator {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  width: 24px; height: 38px; border: 2px solid var(--line-strong); border-radius: 999px;
  display: grid; place-items: start center; padding-top: 7px; z-index: 3;
}
.scroll-indicator span { width: 3px; height: 7px; border-radius: 4px; background: var(--accent); animation: scrollDot 1.6s var(--ease) infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ============ SECTIONS ============ */
.section { position: relative; padding: 4.5rem 0; z-index: 1; }
.section-head { margin-bottom: 2.4rem; max-width: 680px; }
.section-tag {
  display: inline-block; font-family: var(--mono);
  font-size: .76rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--accent-2); margin-bottom: .9rem;
}
.section-head h2 { margin-bottom: .6rem; }
.section-sub { color: var(--ink-soft); font-size: .98rem; }
.section-sub a { color: var(--accent); border-bottom: 1px solid rgba(129,140,248,0.4); }
.section-sub a:hover { border-color: var(--accent); }

/* ============ REVEAL ANIMATIONS ============ */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].visible { opacity: 1; transform: translateY(0); }
[data-stagger] > * { opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-stagger].in-view > * { opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(1) { transition-delay: .04s; }
[data-stagger].in-view > *:nth-child(2) { transition-delay: .10s; }
[data-stagger].in-view > *:nth-child(3) { transition-delay: .16s; }
[data-stagger].in-view > *:nth-child(4) { transition-delay: .22s; }
[data-stagger].in-view > *:nth-child(5) { transition-delay: .28s; }
[data-stagger].in-view > *:nth-child(6) { transition-delay: .34s; }
[data-stagger].in-view > *:nth-child(7) { transition-delay: .40s; }
[data-stagger].in-view > *:nth-child(8) { transition-delay: .46s; }

/* ============ PROJETOS EM DESTAQUE (Selected Work) ============ */
.work-list { display: grid; gap: 1.4rem; }
.work-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2.1rem;
  transition: border-color .3s, transform .3s, box-shadow .3s;
}
.work-card::before {
  content: ''; position: absolute; left: 0; top: 1.8rem; bottom: 1.8rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad); opacity: 0; transition: opacity .3s;
}
.work-card:hover { border-color: rgba(129,140,248,0.4); transform: translateY(-3px); box-shadow: var(--shadow); }
.work-card:hover::before { opacity: 1; }

.work-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem 1rem; margin-bottom: .7rem; }
.work-no { font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--muted); line-height: 1.35; }
.work-kicker { display: flex; flex-direction: column; gap: .15rem; }
.work-co { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--accent-2); }
.work-period { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.work-badge {
  font-family: var(--mono); font-size: .76rem; font-weight: 600;
  color: #fff; white-space: nowrap;
  padding: .35rem .8rem; border-radius: 8px;
  background: rgba(99,102,241,0.18); border: 1px solid rgba(129,140,248,0.45);
  color: var(--accent);
  margin-left: auto;
}
.work-title { font-size: 1.35rem; margin-bottom: 1.1rem; color: var(--ink); }

.work-case { display: grid; gap: .7rem; margin-bottom: 1.3rem; }
.work-case > div { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; }
.work-case dt {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); padding-top: .15rem;
}
.work-case dd { color: var(--ink-soft); font-size: .95rem; }
.work-case dd strong { color: var(--ink); font-weight: 600; }

.tech-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tech-tag {
  font-family: var(--mono); font-size: .74rem;
  padding: .3rem .65rem; border-radius: 7px;
  background: var(--glass); color: var(--ink-soft);
  border: 1px solid var(--line);
}

.proof-links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.1rem; }
.proof-links a {
  font-size: .85rem; font-weight: 500; color: var(--accent);
  border-bottom: 1px solid rgba(129,140,248,0.35); transition: border-color .25s;
}
.proof-links a:hover { border-color: var(--accent); }

/* ============ SOBRE ============ */
.sobre-grid { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: 2.5rem; align-items: start; }
.sobre-prose { display: grid; gap: 1.1rem; max-width: 62ch; }
.sobre-lead { font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-family: var(--display); font-weight: 500; color: var(--ink); line-height: 1.45; }
.sobre-body { color: var(--ink-soft); }
.sobre-facts { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sobre-facts > div { display: grid; grid-template-columns: 58px 1fr; gap: 1rem; padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); }
.sobre-facts > div:last-child { border-bottom: 0; }
.sobre-facts dt { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: .15rem; }
.sobre-facts dd { font-size: .9rem; color: var(--ink-soft); }

/* ============ EXPERIÊNCIA (trajectory) ============ */
.exp-timeline { display: grid; gap: 0; border-top: 1px solid var(--line); }
.exp-row {
  display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  transition: background .25s;
}
.exp-row:hover { background: rgba(255,255,255,0.015); }
.exp-period { font-family: var(--mono); font-size: .82rem; color: var(--muted); padding-top: .2rem; }
.exp-main h3 { font-size: 1.1rem; margin-bottom: .25rem; }
.exp-role { color: var(--ink); }
.exp-company { color: var(--accent-2); }
.exp-main p { color: var(--ink-soft); font-size: .92rem; }

/* ============ SKILLS ============ */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; }
.skill-group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem;
}
.skill-group h3 { margin-bottom: 1.1rem; font-size: 1rem; color: var(--ink); }
.skills-grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.skill {
  font-family: var(--mono); font-size: .8rem;
  padding: .42rem .8rem; border-radius: 8px;
  background: var(--glass); border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  transition: border-color .25s, color .25s;
}
.skill:hover { border-color: var(--accent); color: var(--ink); }

/* ============ FORMAÇÃO ============ */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.edu-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.6rem;
  transition: border-color .25s;
}
.edu-card:hover { border-color: rgba(34,211,238,0.4); }
.edu-kind { font-family: var(--mono); font-size: .72rem; color: var(--accent-2); }
.edu-card h3 { margin: .4rem 0 .25rem; font-size: 1.05rem; }
.edu-card p { color: var(--ink-soft); font-size: .9rem; }

/* Certifications */
.cert-block { display: grid; gap: 1.1rem; margin-top: 1.1rem; }
.cert-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem 1.8rem;
  transition: border-color .25s;
}
.cert-card:hover { border-color: rgba(34,211,238,0.4); }
.cert-card h3 { margin: .35rem 0 .3rem; font-size: 1.12rem; }
.cert-meta { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.cert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.cert-verify {
  font-size: .82rem; font-weight: 600; color: var(--accent);
  border: 1px solid rgba(129,140,248,0.4); border-radius: 999px;
  padding: .4rem .9rem; white-space: nowrap;
  transition: background .25s, border-color .25s;
}
.cert-verify:hover { background: rgba(129,140,248,0.1); border-color: var(--accent); }
.cert-courses { list-style: none; display: grid; gap: .55rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.cert-courses li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .9rem; color: var(--ink-soft); }
.cert-courses li > span::before { content: '↳ '; color: var(--muted); }
.cert-courses a {
  font-family: var(--mono); font-size: .74rem; color: var(--accent);
  border-bottom: 1px solid rgba(129,140,248,0.35); white-space: nowrap;
  transition: border-color .25s;
}
.cert-courses a:hover { border-color: var(--accent); }

/* ============ CONTATO ============ */
.contato-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 3rem;
}
.contato-card h2 { margin: .7rem 0 .9rem; }
.contato-lead { color: var(--ink-soft); max-width: 52ch; margin-bottom: 2rem; }
.contact-rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin-bottom: 1.8rem; }
.contact-row {
  display: flex; align-items: center; gap: .9rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--glass);
  transition: border-color .3s, transform .3s, background .3s;
}
.contact-row:hover { border-color: var(--accent); transform: translateY(-2px); background: rgba(129,140,248,0.06); }
.contact-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(129,140,248,0.12); color: var(--accent); flex-shrink: 0; }
.contact-row small { display: block; color: var(--muted); font-size: .76rem; }
.contact-row strong { font-weight: 500; font-size: .9rem; font-family: var(--mono); color: var(--ink); }
.contato-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); padding: 2.4rem 0; position: relative; z-index: 1; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-logo { display: block; font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.footer-inner small { color: var(--muted); font-size: .84rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .skill-groups, .edu-grid, .contact-rows, .sobre-grid { grid-template-columns: 1fr; }
  .contato-card { padding: 2rem; }
  /* stronger scrim on mobile so the dim 3D object never competes with text */
  .hero::before { background: radial-gradient(125% 95% at 50% 42%, rgba(10,13,22,0.84), rgba(10,13,22,0.5) 72%); }
}
@media (max-width: 640px) {
  .section { padding: 4.5rem 0; }
  .work-card { padding: 1.5rem 1.4rem; }
  .work-case > div { grid-template-columns: 1fr; gap: .15rem; }
  .work-case dt { padding-top: 0; }
  .exp-row { grid-template-columns: 1fr; gap: .3rem; }
  .exp-period { padding-top: 0; }
  .hero-metrics { gap: 1.2rem 1.6rem; }
  .metric-item .num { font-size: 1.5rem; }
  .eyebrow { font-size: .66rem; padding: .35rem .7rem; letter-spacing: .03em; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .page-canvas { display: none; }
}
