/* Emanuel Cararo — protótipo local */
:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #1c2826;
  --muted: #5a6865;
  --line: #e3ddd0;
  --accent: #1f5f5b;      /* água de riacho */
  --accent-soft: #dce9e6;
  --leaf: #a85d1e;        /* folhiço */
  --leaf-soft: #f3e3d2;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111816;
  --surface: #172120;
  --ink: #e6ebe8;
  --muted: #9db0ab;
  --line: #2a3735;
  --accent: #74c0b5;
  --accent-soft: #1e3532;
  --leaf: #e39a5a;
  --leaf-soft: #3a2a1c;
  color-scheme: dark;
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--leaf); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 4px; }

/* idioma: esconde o que não está ativo */
html[data-lang="pt"] [lang="en"]:not(html),
html[data-lang="en"] [lang="pt"]:not(html) { display: none !important; }

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

/* cabeçalho */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--leaf); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  white-space: nowrap;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tools { display: flex; gap: 8px; align-items: center; }
.toggle {
  font: 600 13px/1 var(--sans); letter-spacing: .04em;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 11px; cursor: pointer; transition: border-color .2s; white-space: nowrap;
}
.toggle:hover { border-color: var(--accent); }
.toggle .on { color: var(--accent); }
.toggle .off { color: var(--muted); font-weight: 500; }
.menu-btn { display: none; }

/* hero */
.hero { padding: 72px 0 120px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.avatar {
  width: 168px; height: 168px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), var(--accent));
  display: grid; place-items: center; color: #fff;
  font: 600 52px/1 var(--serif); box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--line);
}
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--leaf); margin: 0 0 8px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 5vw, 58px); line-height: 1.08; margin: 0 0 12px; letter-spacing: -.01em; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); margin: 0 0 18px; }
.affil { margin: 0 0 20px; color: var(--muted); font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; text-decoration: none; transition: border-color .2s, transform .2s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.stream { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; opacity: .55; pointer-events: none; }
.stream path { fill: none; stroke-width: 1.5; }
.stream .s1 { stroke: var(--accent); animation: drift 14s linear infinite; }
.stream .s2 { stroke: var(--leaf); opacity: .7; animation: drift 20s linear infinite reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .stream path { animation: none; } @view-transition { navigation: none; } }

/* seções */
section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0; letter-spacing: -.01em; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.3; margin: 0 0 6px; }
.more { font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.lead { font-family: var(--serif); font-size: 21px; line-height: 1.6; margin: 0; }
.quote { border-left: 3px solid var(--leaf); padding: 4px 0 4px 20px; margin: 32px 0 0; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); }
.quote cite { display: block; font-style: normal; font-family: var(--sans); font-size: 14px; margin-top: 6px; }
.page-title { padding-top: 56px; padding-bottom: 8px; }
.page-title h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 4.5vw, 48px); margin: 0 0 8px; }
.page-title p { color: var(--muted); margin: 0; font-size: 18px; max-width: 640px; }

/* cartões */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px -18px rgba(0,0,0,.35); }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .refs { margin-top: 12px; font-size: 13px; color: var(--leaf); font-weight: 500; }

/* lista de posts */
.posts { list-style: none; margin: 0; padding: 0; }
.post { padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.post:last-child { border-bottom: 1px solid var(--line); }
.meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--leaf); background: var(--leaf-soft); padding: 2px 10px; border-radius: 999px; }
.post h3 a { color: var(--ink); text-decoration: none; }
.post h3 a:hover { color: var(--accent); }
.post p { margin: 0; color: var(--muted); }
.soon h3 { color: var(--muted); }
.soon .badge { font-size: 12px; font-weight: 600; border: 1px dashed var(--muted); color: var(--muted); padding: 1px 9px; border-radius: 999px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.chip { font: 500 14px var(--sans); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* publicações */
.search { width: 100%; max-width: 420px; font: 16px var(--sans); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); margin: 20px 0 8px; }
.year { font-family: var(--serif); font-size: 26px; color: var(--accent); margin: 36px 0 8px; }
.pub { padding: 16px 0; border-top: 1px solid var(--line); }
.pub .title { font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--ink); margin: 0 0 4px; }
.pub .authors { font-size: 14.5px; color: var(--muted); margin: 0 0 4px; }
.pub .authors b { color: var(--ink); }
.pub .venue { font-size: 14.5px; margin: 0; }
.pub .venue i { color: var(--ink); }
.first { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--leaf); margin-left: 8px; }
.stats { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 24px; }
.stat b { display: block; font-family: var(--serif); font-size: 34px; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }

/* CV */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 26px 34px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline .when { font-size: 13px; font-weight: 600; color: var(--leaf); letter-spacing: .04em; }
.timeline h3 { margin: 2px 0; font-size: 19px; }
.timeline p { margin: 0; color: var(--muted); font-size: 15.5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.note { background: var(--leaf-soft); border-radius: var(--radius); padding: 14px 18px; font-size: 15px; color: var(--ink); }

/* post */
.article { padding: 56px 0 24px; }
.article h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 4.4vw, 46px); line-height: 1.15; margin: 10px 0 14px; }
.prose { font-family: var(--serif); font-size: 20px; line-height: 1.75; }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-size: 27px; margin: 1.6em 0 .6em; }
.formula { font-family: var(--serif); font-size: 21px; text-align: center; padding: 18px; margin: 1.4em 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
figure { margin: 1.6em 0; }
figure svg { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
figcaption { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 8px; }
.chart .noise { stroke: var(--muted); }
.chart .walk { stroke: var(--leaf); }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font: 12px var(--sans); }
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--leaf); width: 0; z-index: 20; }

/* rodapé */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* entrada suave */
.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; } }

/* celular */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  section { padding: 32px 0; }
  .site-header .wrap { gap: 10px; }
  .menu-btn { display: inline-block; margin-left: auto; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .hero { padding: 40px 0 100px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .avatar { width: 112px; height: 112px; font-size: 36px; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  .prose { font-size: 18px; }
}

/* achados por linha de pesquisa */
a.card-link { display: block; color: inherit; text-decoration: none; }
a.card-link:hover h3 { color: var(--accent); }
.muted-lead { color: var(--muted); margin: 0 0 8px; }
.finding-block { padding: 28px 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.finding-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.finding-head .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.finding-head h3 { margin: 0; }
.findings { margin: 0; padding-left: 20px; }
.findings li { margin: 0 0 12px; font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.findings li::marker { color: var(--leaf); }
.cites { font-family: var(--sans); font-size: 14px; color: var(--muted); white-space: normal; }
.finding-block:target .finding-head h3 { color: var(--leaf); }

/* pesquisa atual e trajetória */
.status { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--leaf); margin: 0 0 6px !important; }
.past-link { margin-top: 22px; color: var(--muted); }
details.past { border-top: 1px solid var(--line); scroll-margin-top: 80px; }
details.past:last-of-type { border-bottom: 1px solid var(--line); }
details.past summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 0; }
details.past summary::-webkit-details-marker { display: none; }
details.past summary::after { content: "+"; margin-left: auto; font-size: 24px; color: var(--muted); transition: transform .25s; }
details.past[open] summary::after { transform: rotate(45deg); color: var(--leaf); }
details.past summary .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
details.past summary h3 { margin: 0; }
details.past summary:hover h3 { color: var(--accent); }
details.past .when { font-size: 13px; font-weight: 600; color: var(--leaf); letter-spacing: .03em; }
details.past .findings { padding-bottom: 12px; }

/* capa do topo (colagem duotone das fotos de campo) */
.cover { position: relative; height: clamp(170px, 26vw, 320px); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; display: block; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, var(--bg) 100%); }
[data-theme="dark"] .cover img { filter: brightness(.7) saturate(.9); }

/* sobre mim (página inicial) */
.about { padding-top: 44px; }
.about-wrap { max-width: 760px; display: flex; flex-direction: column; align-items: center; }
.about .avatar { width: 180px; height: 180px; margin-bottom: 26px; }
.about .eyebrow { text-align: center; margin-bottom: 14px; }
.about-text { text-align: left; }
.about .quote { align-self: stretch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 820px) {
  .about { padding-top: 32px; }
  .about .avatar { width: 136px; height: 136px; }
  .about-text { font-size: 19px; }
}

/* ícones dos perfis no topo */
.social { display: flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.social a { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; color: var(--muted); }
.social a:hover { color: var(--accent); background: var(--accent-soft); }
.social svg { width: 18px; height: 18px; fill: currentColor; }
.social svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* nome completo no topo: o menu vira ☰ mais cedo para caber */
@media (max-width: 1080px) {
  .menu-btn { display: inline-block; margin-left: auto; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .social { margin: 8px 0 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); gap: 6px; }
  .social a { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .site-header .wrap { gap: 8px; }
  .brand { font-size: 16px; white-space: normal; line-height: 1.15; max-width: 150px; }
  .toggle { padding: 7px 9px; }
}
@media (max-width: 820px) {
  .social { margin: 8px 0 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); gap: 6px; }
  .social a { width: 40px; height: 40px; }
}

/* trajetória em linha do tempo */
.journey { list-style: none; padding: 0; margin: 28px 0 0; position: relative; }
.journey::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.stage { position: relative; padding: 0 0 36px 38px; }
.stage::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.stage:last-child::before { background: var(--accent); }
.stage-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-meta .when { font-size: 13px; font-weight: 600; color: var(--leaf); letter-spacing: .04em; }
.stage h3 { margin: 6px 0 2px; font-size: 21px; }
.stage .where { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.stage > p:not(.where) { margin: 0 0 10px; }
.stage details.past:last-of-type { border-bottom: 1px solid var(--line); }
.stage-link { font-size: 15px; }
img.avatar { object-fit: cover; background: var(--accent-soft); }

/* espaçamentos (em vez de style="", que a política de segurança bloqueia) */
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin: 20px 0 0; }
section.pt-0 { padding-top: 0; }
