/* Fonte hospedada localmente: elimina a requisição externa a
   fonts.googleapis.com/fonts.gstatic.com (cadeia crítica de bloqueio de
   renderização apontada no relatório de performance). Um único arquivo
   variável cobre os pesos 400/500/700 — o navegador escolhe a instância. */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin.woff2") format("woff2");
}

:root {
  --paper:    #ffffff;
  --surface:  #ffffff;
  --soft:     #f8f9fa;
  --ink:      #202124;
  --muted:    #5f6368;
  --faint:    #6b6f73;
  --border:   #dadce0;
  --accent:   #1a73e8;
  --accent-2: #1b66c9;
  --maxw: 980px;
  --r: 12px;
  --shadow: 0 1px 2px rgba(60,64,67,.08), 0 8px 24px rgba(60,64,67,.06);
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header / nav */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .2px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav ul a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav ul a:hover { color: var(--accent); }
.nav ul a[aria-current="page"] { color: var(--accent); }

/* Botão hambúrguer (só mobile) */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; margin: 0 -8px 0 0;
  background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  color: var(--ink);
}
.nav-toggle:hover { background: var(--soft); }
.nav-toggle svg { display: block; }
.nav-toggle .ic-close { display: none; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav ul {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(60,64,67,.12);
    padding: 8px 0;
    display: none;
  }
  .nav ul li { width: 100%; }
  .nav ul a {
    display: block; padding: 14px 24px; font-size: 16px; color: var(--ink);
  }
  .nav ul a:hover { background: var(--soft); }
  .site.nav-open .nav ul { display: flex; }
  .site.nav-open .nav-toggle .ic-open { display: none; }
  .site.nav-open .nav-toggle .ic-close { display: block; }

  .hero { padding-top: 30px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 15px; line-height: 1;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }

/* Hero */
.hero { padding: 30px 0 64px; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 7vw, 68px); line-height: 1.04;
  letter-spacing: -.01em; margin: 0 0 24px;
}
.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--faint); font-size: 15px; margin: 0 0 36px; }
.meta span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); display: inline-block; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--border); }
.sec-head { margin: 0 0 40px; }
.sec-kicker { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.sec-title { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 4vw, 36px); line-height: 1.12; margin: 0; letter-spacing: -.01em; }
.sec-foot { margin-top: 32px; }

.prose { max-width: 62ch; color: var(--muted); font-size: 18px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* Skills grid */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 0 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { font-size: 14px; color: var(--muted); background: var(--paper); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; }

/* Timeline */
.timeline { display: grid; gap: 4px; }
.role {
  display: grid; grid-template-columns: 160px 1fr; gap: 8px 28px;
  padding: 22px 0; border-bottom: 1px solid var(--border);
}
.role:last-child { border-bottom: 0; }
.role .when { color: var(--faint); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.role .what h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.role .what p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 600px) { .role { grid-template-columns: 1fr; gap: 4px; } }

/* Projects */
.projects { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.proj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.proj h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.proj .kind { color: var(--faint); font-size: 14px; margin: 0 0 14px; }
.proj .stack { font-size: 13px; color: var(--muted); }

/* Two-column facts */
.cols { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; gap: 32px; } }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border-bottom: 0; }
.facts .t { font-weight: 600; display: block; }
.facts .s { color: var(--muted); font-size: 15px; }

/* Contact */
.contact-card {
  background: var(--accent); color: #fff; border-radius: 20px; padding: clamp(32px, 5vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px;
}
.contact-card h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 4vw, 38px); margin: 0 0 8px; }
.contact-card p { margin: 0; color: rgba(255,255,255,.88); max-width: 42ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-card .btn-primary { background: #fff; color: var(--accent); }
.contact-card .btn-primary:hover { background: #f1f3f4; color: var(--accent); }
.btn-whatsapp { background: #25d366; color: #0b3d23; }
.btn-whatsapp:hover { background: #1ebe5b; color: #0b3d23; transform: translateY(-1px); }
.btn-whatsapp svg { width: 18px; height: 18px; }

/* Voltar ao topo */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border: 0; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.to-top.show { opacity: .3; visibility: visible; transform: none; }
.to-top.show:hover { opacity: .85; }
.to-top svg { display: block; }

/* Índice flutuante (posts com TOC) */
.toc-fab {
  position: fixed; right: 22px; bottom: 78px; z-index: 61;
  width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  box-shadow: var(--shadow);
}
.toc-fab.show { opacity: 1; visibility: visible; transform: none; }
.toc-fab:hover { opacity: .9; }
.toc-fab[aria-expanded="true"] { opacity: 1; }
.toc-fab svg { display: block; }

.toc-fab-panel {
  position: fixed; right: 22px; bottom: 130px; z-index: 61;
  width: min(320px, calc(100vw - 44px));
  max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: 0 4px 6px rgba(60,64,67,.1), 0 12px 28px rgba(60,64,67,.16);
  padding: 14px 16px; opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.toc-fab-panel.show { opacity: 1; visibility: visible; transform: none; }
.toc-fab-panel .toc-fab-title {
  font-family: var(--serif); font-weight: 700; font-size: 13px; color: var(--ink);
  margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em;
}
.toc-fab-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc-fab-panel a {
  display: block; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none;
  padding: 7px 10px; margin: 0 -10px; border-radius: 8px; transition: background .15s ease, color .15s ease;
}
.toc-fab-panel a:hover { background: var(--soft); color: var(--accent); }

@media (max-width: 600px) {
  .to-top { right: 14px; bottom: 16px; width: 40px; height: 40px; }
  .toc-fab { right: 14px; bottom: 68px; width: 40px; height: 40px; }
  .toc-fab-panel { right: 14px; left: 14px; bottom: 120px; width: auto; }
}

/* Footer */
footer.site { padding: 40px 0 56px; color: var(--faint); font-size: 14px; }
footer.site .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
