/* =========================================================================
   Otávio Barbosa — sistema de estilos
   Identidade: datasheet de componente. Monoespaçada para nome, rótulos,
   datas e números; acento cobre (trilha de PCB) sobre neutros azulados.
   ========================================================================= */

/* ---------- tokens ---------- */

:root {
  --bg: #E9ECF1;
  --surface: #FFFFFF;
  --surface-2: #F2F5F8;
  --ink: #111823;
  --ink-2: #3D4756;
  --muted: #67717F;
  --line: #D2D8E0;
  --line-soft: #E1E6EC;
  --accent: #A85A2C;
  --accent-bright: #C2703D;
  --accent-wash: rgba(168, 90, 44, .10);
  --shadow: 0 1px 2px rgba(17, 24, 35, .05), 0 10px 28px -16px rgba(17, 24, 35, .28);

  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1119;
    --surface: #121A24;
    --surface-2: #17212D;
    --ink: #E7ECF3;
    --ink-2: #BAC4D0;
    --muted: #8C99A8;
    --line: #233040;
    --line-soft: #1B2532;
    --accent: #E08A4E;
    --accent-bright: #F0A268;
    --accent-wash: rgba(224, 138, 78, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px -18px rgba(0, 0, 0, .85);
  }
}

:root[data-theme="dark"] {
  --bg: #0C1119;
  --surface: #121A24;
  --surface-2: #17212D;
  --ink: #E7ECF3;
  --ink-2: #BAC4D0;
  --muted: #8C99A8;
  --line: #233040;
  --line-soft: #1B2532;
  --accent: #E08A4E;
  --accent-bright: #F0A268;
  --accent-wash: rgba(224, 138, 78, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px -18px rgba(0, 0, 0, .85);
}

:root[data-theme="light"] {
  --bg: #E9ECF1;
  --surface: #FFFFFF;
  --surface-2: #F2F5F8;
  --ink: #111823;
  --ink-2: #3D4756;
  --muted: #67717F;
  --line: #D2D8E0;
  --line-soft: #E1E6EC;
  --accent: #A85A2C;
  --accent-bright: #C2703D;
  --accent-wash: rgba(168, 90, 44, .10);
  --shadow: 0 1px 2px rgba(17, 24, 35, .05), 0 10px 28px -16px rgba(17, 24, 35, .28);
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #FFF;
  padding: .65rem 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  text-decoration: none;
}

.skip:focus { left: .5rem; top: .5rem; }

/* ---------- bilíngue ---------- */

.en { display: none; }
:root[data-lang="en"] .en { display: revert; }
:root[data-lang="en"] .pt { display: none; }

/* ---------- shell ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-narrow {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- topo ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
}

.sig {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.sig b { color: var(--accent); font-weight: 700; }

.nav {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* Em telas estreitas os atalhos de âncora saem, mas Portfólio e Artigos
   continuam acessíveis — o menu nunca desaparece por completo. */
@media (max-width: 860px) {
  .nav { gap: 1rem; }
  .nav .nav-anchor { display: none; }
}

@media (max-width: 430px) {
  .sig { font-size: .6875rem; letter-spacing: .05em; }
  .nav { gap: .8rem; font-size: .6875rem; }
  .topbar-inner { gap: .6rem; }
}

.langswitch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.langswitch button {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  padding: .35rem .7rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.langswitch button[aria-pressed="true"] { background: var(--accent); color: #FFF; }

/* ---------- hero do portfólio ---------- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--line);
  opacity: .7;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  pointer-events: none;
}

.traces {
  position: absolute;
  top: 0;
  right: -4rem;
  width: 30rem;
  height: 100%;
  color: var(--accent);
  opacity: .5;
  pointer-events: none;
}

.traces path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: draw 2.2s cubic-bezier(.6, .05, .3, 1) forwards;
}

.traces path:nth-child(2) { animation-delay: .15s; }
.traces path:nth-child(3) { animation-delay: .3s; }
.traces path:nth-child(4) { animation-delay: .45s; }
.traces path:nth-child(5) { animation-delay: .6s; }

.traces circle {
  fill: var(--bg);
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0;
  animation: pop .5s ease forwards 1.4s;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }

@media (max-width: 900px) { .traces { display: none; } }

.hero-inner {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

/* Com retrato, o hero vira duas colunas em tela larga. Abaixo disso o
   texto vem primeiro e a foto desce, sem empurrar o nome para fora da tela. */
@media (min-width: 1000px) {
  .hero-inner.has-portrait { grid-template-columns: minmax(0, 1fr) auto; }
}

.hero-portrait {
  position: relative;
  margin: 0;
  width: clamp(190px, 24vw, 280px);
  justify-self: start;
}

@media (min-width: 1000px) { .hero-portrait { justify-self: end; } }

/* Moldura deslocada em cobre: o retrato lido como componente sobre a placa. */
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  translate: 13px 13px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  pointer-events: none;
}

.hero-portrait img {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--accent); }

.name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.1rem, 7.5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin-top: 1.25rem;
  text-wrap: balance;
}

.name .sub { display: block; color: var(--muted); }

.role {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  font-weight: 600;
  max-width: 34ch;
  text-wrap: balance;
}

.role em { font-style: normal; color: var(--accent); }

.role-sub {
  margin-top: .75rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--accent);
}

.lede { margin-top: 1rem; max-width: 56ch; color: var(--ink-2); font-size: 1.0625rem; }

.chips { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 2rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

a.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.chip svg { width: 14px; height: 14px; flex: none; }

/* ---------- números ---------- */

.stats { border-bottom: 1px solid var(--line); background: var(--surface-2); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat { padding: 1.5rem 0 1.5rem 1.25rem; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
}

.stat-n {
  font-family: var(--mono);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-l {
  margin-top: .5rem;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- seções ---------- */

.section {
  padding-block: clamp(3rem, 7vw, 4.75rem);
  border-bottom: 1px solid var(--line-soft);
}

.section:last-of-type { border-bottom: 0; }

.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }

.section-head h2 {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-head .rule { flex: 1; height: 1px; background: var(--line); }

.section-head .count {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.section-head .section-more {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.section-head .section-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.prose { max-width: var(--measure); color: var(--ink-2); display: flex; flex-direction: column; gap: 1rem; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- linha do tempo ---------- */

.timeline { display: flex; flex-direction: column; }

.tl-item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--line-soft);
}

.tl-item:first-child { border-top: 0; padding-top: 0; }

.tl-when {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: .3rem;
}

.tl-body { position: relative; padding-left: 1.75rem; border-left: 1px solid var(--line); }

.tl-body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: .55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-body h3 { font-size: 1.125rem; font-weight: 650; line-height: 1.3; }

.tl-org { font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; color: var(--accent); margin-top: .3rem; }

.tl-body p.txt { margin-top: .75rem; color: var(--ink-2); max-width: 62ch; }

@media (max-width: 700px) {
  .tl-item { grid-template-columns: 1fr; gap: .5rem; }
  .tl-when { padding-top: 0; }
}

/* ---------- tags ---------- */

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; list-style: none; }

.tags li {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .04em;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
}

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card-ref {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line-soft);
}

.card-ref b { color: var(--accent); font-weight: 600; }

.card h3 { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; text-wrap: balance; }
.card p.txt { color: var(--ink-2); font-size: .9375rem; }
.card .tags { margin-top: auto; padding-top: .75rem; }

/* ---------- competências ---------- */

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.75rem 2.5rem; }

.skillgroup h3,
.listblock h3 {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}

.skillgroup ul { list-style: none; display: flex; flex-direction: column; gap: .45rem; margin-top: .9rem; }

.skillgroup li { display: flex; gap: .6rem; align-items: baseline; color: var(--ink-2); font-size: .9375rem; }

.skillgroup li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ---------- publicações ---------- */

.pubs { list-style: none; display: flex; flex-direction: column; }

.pub { display: grid; grid-template-columns: 5rem 1fr; gap: 1.5rem; padding-block: 1.25rem; border-top: 1px solid var(--line-soft); }
.pub:first-child { border-top: 0; padding-top: 0; }

.pub-year { font-family: var(--mono); font-size: .75rem; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: .25rem; }
.pub-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.pub-meta { margin-top: .4rem; font-size: .875rem; color: var(--muted); }
.pub-meta .authors b { color: var(--ink-2); font-weight: 600; }

.pub-doi {
  display: inline-block;
  margin-top: .35rem;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .02em;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.pub-doi:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 620px) {
  .pub { grid-template-columns: 1fr; gap: .35rem; }
  .pub-year { padding-top: 0; }
}

/* ---------- listas de dados ---------- */

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem 3rem; }

.datalist { list-style: none; margin-top: .5rem; }

.datalist li {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 1rem;
  padding-block: .65rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .9375rem;
  color: var(--ink-2);
}

.datalist li:last-child { border-bottom: 0; }

.datalist .yr { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .15rem; }
.datalist .what b { color: var(--ink); font-weight: 600; }
.datalist .where { display: block; font-size: .8125rem; color: var(--muted); margin-top: .1rem; }

/* ---------- formação ---------- */

.edu { display: flex; flex-direction: column; }

.edu-item { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding-block: 1.15rem; border-top: 1px solid var(--line-soft); }
.edu-item:first-child { border-top: 0; padding-top: 0; }

.edu-when { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .2rem; }
.edu-what { font-size: 1.0625rem; font-weight: 600; }
.edu-where { font-size: .9375rem; color: var(--ink-2); margin-top: .15rem; }

@media (max-width: 620px) {
  .edu-item { grid-template-columns: 1fr; gap: .3rem; }
  .edu-when { padding-top: 0; }
  .datalist li { grid-template-columns: 3.5rem 1fr; gap: .75rem; }
}

/* ---------- contato ---------- */

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.contact-card h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 650; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; max-width: 22ch; }
.contact-card p.txt { color: var(--ink-2); margin-top: .5rem; max-width: 42ch; }
.contact-links { display: flex; flex-wrap: wrap; gap: .625rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .7rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.btn.solid { background: var(--accent); color: #FFF; }
.btn:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #FFF; }
.btn svg { width: 14px; height: 14px; }

/* =========================================================================
   BLOG
   ========================================================================= */

.blog-head {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 2.75rem);
  position: relative;
  overflow: hidden;
}

.blog-head h1 {
  font-family: var(--mono);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: uppercase;
  line-height: 1.05;
  margin-top: 1rem;
}

.blog-head .lede { margin-top: 1rem; }

/* filtro de categorias */

.catbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; list-style: none; }

.catbar a {
  display: inline-block;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease;
}

.catbar a:hover { border-color: var(--accent); color: var(--accent); }
.catbar a[aria-current] { background: var(--accent); border-color: var(--accent); color: #FFF; }

/* lista de posts */

.postlist { list-style: none; display: flex; flex-direction: column; }

.postitem { border-top: 1px solid var(--line-soft); }
.postlist > .postitem:first-child { border-top: 0; }

.postitem > a {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.75rem;
  padding-block: 1.75rem;
  text-decoration: none;
  transition: background .18s ease;
}

.postitem > a:hover { background: var(--accent-wash); }

.postmeta {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: .3rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

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

/* Marcação de rascunho — só aparece na prévia local. */
.badge-rascunho {
  display: inline-block;
  align-self: flex-start;
  padding: .1rem .4rem;
  border: 1px dashed var(--muted);
  border-radius: 3px;
  font-size: .625rem;
  letter-spacing: .1em;
}

.aviso-rascunho {
  margin-top: 2rem;
  padding: .75rem 1rem;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: var(--accent-wash);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
}

.postitem h2 { font-size: clamp(1.125rem, 2.5vw, 1.4375rem); font-weight: 650; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.postitem p { color: var(--ink-2); margin-top: .5rem; max-width: 62ch; font-size: .9375rem; }

.postitem .more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .85rem;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.postitem > a:hover .more { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 700px) {
  .postitem > a { grid-template-columns: 1fr; gap: .6rem; }
  .postmeta { flex-direction: row; gap: .85rem; padding-top: 0; }
}

/* cabeçalho do artigo */

.article-head { padding-block: clamp(2.5rem, 6vw, 4rem) 0; }

.article-head .kicker {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.article-head h1 {
  font-size: clamp(1.75rem, 5.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.025em;
  margin-top: 1rem;
  text-wrap: balance;
}

.article-head .summary { margin-top: 1rem; font-size: 1.125rem; color: var(--ink-2); text-wrap: pretty; }

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* corpo do artigo */

.article-body {
  padding-block: 2.5rem 3rem;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink-2);
}

.article-body > * + * { margin-top: 1.25rem; }

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--ink);
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  text-wrap: balance;
}

.article-body h3 {
  font-size: 1.1875rem;
  font-weight: 650;
  color: var(--ink);
  margin-top: 2rem;
  text-wrap: balance;
}

.article-body p { text-wrap: pretty; }
.article-body strong { color: var(--ink); font-weight: 650; }

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.article-body ul, .article-body ol { padding-left: 1.35rem; display: flex; flex-direction: column; gap: .5rem; }
.article-body li::marker { color: var(--accent); }

.article-body blockquote {
  border-left: 2px solid var(--accent);
  padding: .25rem 0 .25rem 1.25rem;
  color: var(--ink-2);
  font-style: italic;
}

.article-body code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .1em .35em;
}

.article-body pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.6;
}

.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.article-body img { border-radius: 8px; border: 1px solid var(--line); }

.article-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }

.table-scroll { overflow-x: auto; }

/* ---------- equações ---------- */

.math-block {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: .35rem;
  text-align: center;
}

/* O KaTeX herda a cor do texto; nada de preto fixo no tema escuro. */
.katex { color: var(--ink); font-size: 1.05em; }
.article-body .katex-display { margin: 0; }

/* ---------- figuras, tabelas e listagens numeradas ---------- */

.bloco {
  margin: 2rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.bloco > p { margin: 0; }

.bloco img,
.bloco svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Gráfico exportado como SVG herda a cor do texto quando preparado
   pelo script scripts/adaptar-svg.mjs. */
.bloco svg { color: var(--ink-2); }

.bloco pre { margin: 0; }
.bloco .table-scroll { margin: 0; }

.bloco figcaption {
  font-size: .875rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: left;
  padding-top: .25rem;
  border-top: 1px solid var(--line-soft);
}

.bloco-num {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* A legenda de tabela vem antes do conteúdo, como manda a convenção. */
.bloco-tabela { flex-direction: column-reverse; }

.bloco-tabela figcaption {
  border-top: 0;
  border-bottom: 1px solid var(--line-soft);
  padding-top: 0;
  padding-bottom: .5rem;
}

/* ---------- referência cruzada e citação ---------- */

.ref-cruzada,
.cite {
  color: var(--accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.ref-cruzada:hover,
.cite:hover { text-decoration: underline; text-underline-offset: 2px; }

.cite { font-family: var(--mono); font-size: .85em; }

/* Alvo de link recebe destaque momentâneo, para não se perder na página. */
.bloco:target,
.ref-item:target { animation: destaque 2s ease; }

@keyframes destaque {
  0%, 60% { background: var(--accent-wash); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .bloco:target, .ref-item:target { animation: none; background: var(--accent-wash); }
}

/* Marcações de erro: visíveis de propósito, para você notar na revisão. */
.ref-faltando,
.cite-faltando {
  background: var(--accent-wash);
  border: 1px dashed var(--accent);
  border-radius: 3px;
  padding: 0 .3em;
  font-family: var(--mono);
  font-size: .85em;
  color: var(--accent);
}

/* ---------- lista de referências ---------- */

.referencias {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.referencias h2 {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.ref-lista { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .85rem; }

.ref-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: .5rem;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--ink-2);
  border-radius: 4px;
}

.ref-num {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ref-item strong { color: var(--ink); font-weight: 600; }

.ref-doi {
  display: inline-block;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.ref-doi:hover { text-decoration: underline; text-underline-offset: 2px; }

.article-body table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.article-body th, .article-body td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line-soft); }
.article-body th { font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.article-body td { font-variant-numeric: tabular-nums; }

/* rodapé do artigo */

.article-foot {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.pager a {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color .18s ease;
}

.pager a:hover { border-color: var(--accent); }
.pager .dir { font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pager .t { font-weight: 600; line-height: 1.35; color: var(--ink); font-size: .9375rem; }
.pager .next { text-align: right; align-items: flex-end; }

@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } }

/* ---------- apoie este blog ---------- */

.support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem 2.5rem;
  margin-block: 2.5rem;
  padding: clamp(1.35rem, 3.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.support-text { flex: 1 1 18rem; }

.support h2 {
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -.01em;
  margin: 0;
  padding: 0;
  border: 0;
  text-wrap: balance;
}

.support p {
  margin-top: .6rem;
  color: var(--ink-2);
  font-size: .9375rem;
  line-height: 1.6;
  max-width: 54ch;
}

.support-key {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
  margin-top: 1rem;
}

.support-key-label {
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.support-key code {
  font-family: var(--mono);
  font-size: .8125rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .2em .5em;
  word-break: break-all;
}

.support-actions { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 1.15rem; }

.support-more { margin-top: 1rem; font-size: .8125rem; }

.support-more a {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.support-more a:hover { text-decoration: underline; text-underline-offset: 3px; }

.support-qr {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}

.support-qr svg {
  width: 168px;
  height: 168px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #FFF;
  padding: 6px;
}

.support-qr figcaption {
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  max-width: 14rem;
}

/* Estado do botão logo após copiar. */
.btn.is-copied { background: var(--accent-bright); border-color: var(--accent-bright); color: #FFF; }

/* ---------- blocos de anúncio ---------- */

.ad-slot {
  margin-block: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  min-height: 0;
}

.ad-slot::before {
  content: "Publicidade";
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-slot ins { display: block; width: 100%; }

/* ---------- rodapé ---------- */

.foot { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; margin-top: 2rem; }

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

.foot-social { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; }

.foot-social a {
  display: flex;
  width: 2.125rem;
  height: 2.125rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  transition: color .18s ease, border-color .18s ease;
}

.foot-social a:hover { color: var(--accent); border-color: var(--accent); }
.foot-social svg { width: 15px; height: 15px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- entrada ---------- */

.rise { opacity: 0; transform: translateY(12px); animation: rise .7s cubic-bezier(.2, .7, .3, 1) forwards; }

.rise:nth-child(1) { animation-delay: .05s; }
.rise:nth-child(2) { animation-delay: .13s; }
.rise:nth-child(3) { animation-delay: .21s; }
.rise:nth-child(4) { animation-delay: .29s; }
.rise:nth-child(5) { animation-delay: .37s; }

@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .traces path, .traces circle { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
  .card:hover, a.chip:hover { transform: none; }
}

@media print {
  .topbar, .traces, .hero-grid-bg, .ad-slot, .pager, .catbar { display: none; }
  .card, .contact-card { box-shadow: none; }
  .rise { opacity: 1; transform: none; animation: none; }
  body { background: #FFF; color: #000; }
}
