/* Base da casa: tipografia, tokens, cabeçalho, celular, tema noturno e movimento do site original (site.css 1–145, tema.css, motion.css), sem alterações. */
/* Inter variável 300–600 (licença OFL), subconjuntos latin e latin-ext: cobre PT, EN e ES */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 600; font-display: swap; src: url('../fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 600; font-display: swap; src: url('../fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* --- Tokens e base --- */
:root {
  --foto-w-desk: 250px; /* largura da foto no desktop (usada também no cálculo do título) */
  --ink: #111111;
  --gray-400: #b2b2b2;
  --gray-500: #8c8c8c;
  --gray-100: #f5f5f5;
  --r: 7px; /* raio padrão: arredondamento sutil (foto principal, cards, botões, modais) */
  --gray-200: #e5e5e5;
  --white: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Espaçamento global: --gutter = margem lateral; --space-y = distância vertical entre blocos */
  --gutter: 48px;
  --space-y: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.max-w { max-width: 1024px; margin: 0 auto; }

/* --- Cabeçalho --- */
header.top-header {
  position: relative;
  padding: 16px;
}
.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  position: relative;
}
.brand-name { font-size: 15px; font-weight: 500; line-height: 1; }
.brand-location { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

.header-left { display: flex; justify-content: center; width: 100%; }
.nav-row { display: flex; align-items: center; justify-content: center; gap: 20px; }
/* seletor de idioma: bandeiras pequenas; a ativa em cor plena */
.lang-switch { display: flex; align-items: center; gap: 10px; }
.lang-btn { display: block; width: 21px; height: 15px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08); opacity: 0.35; filter: saturate(0.5); transition: opacity 0.25s var(--ease), filter 0.25s var(--ease), transform 0.25s var(--ease); }
.lang-btn svg { display: block; width: 100%; height: 100%; }
.lang-btn:hover { opacity: 0.8; filter: none; }
.lang-btn[aria-pressed="true"] { opacity: 1; filter: none; }
.lang-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* troca de idioma: caracteres ainda não resolvidos em cinza (mais claro dentro de .dim) + toque na bandeira */
.scr { color: var(--gray-400); }
.dim .scr { color: var(--gray-200); }
@keyframes lang-pop { 0% { transform: scale(1); } 40% { transform: scale(0.82); } 100% { transform: scale(1); } }
.lang-btn.is-pop { animation: lang-pop 0.38s var(--ease); }
@media (prefers-reduced-motion: reduce) { .lang-btn.is-pop { animation: none; } }

.main-nav { 
  display: flex; 
  gap: 20px; 
  justify-content: center; 
  align-items: center; 
}
.main-nav a { font-size: 14px; color: var(--gray-400); transition: color 0.25s var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.nav-ico { width: 15px; height: 15px; flex: none; }
.main-nav a.current, .main-nav a:hover { color: var(--ink); }

@media (min-width: 768px) {
  header.top-header, div.floating-header { padding-inline: var(--gutter); } /* mesma margem do conteúdo */
  .header-inner { 
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    gap: 0;
  }
  .header-left { justify-content: flex-start; }
  .nav-row { display: contents; }                                   /* casa e links viram células do grid */
  .main-nav { grid-column: 2; justify-self: center; }               /* links no centro exato da página */
  .lang-switch { grid-column: 3; justify-self: end; }               /* bandeiras rentes à margem direita do conteúdo */
}

.nav-toggle { display: none; }

/* --- Celular: cabeçalho fixo e menu --- */
@media (max-width: 767px) {
  div.floating-header { display: none !important; }
  header.top-header {
    position: sticky; top: 0; z-index: 150;
    padding: 14px var(--gutter);
    background: rgba(255,255,255,0.96);
  }
  header.top-header.menu-open { background: var(--white); }
  .top-header .header-inner { flex-direction: row; justify-content: space-between; align-items: center; position: static; }
  .top-header .header-left { justify-content: flex-start; width: auto; }

  /* ícone: 2 traços que viram X */
  .nav-toggle { display: block; position: relative; width: 28px; height: 28px; margin-right: -4px; background: none; border: 0; cursor: pointer; color: var(--ink); }
  .nav-toggle span { position: absolute; left: 4px; right: 4px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform 0.3s var(--ease), top 0.3s var(--ease); }
  .nav-toggle span:nth-child(1) { top: 10px; }
  .nav-toggle span:nth-child(2) { top: 17px; }
  .menu-open .nav-toggle span:nth-child(1) { top: 13.5px; transform: rotate(45deg); }
  .menu-open .nav-toggle span:nth-child(2) { top: 13.5px; transform: rotate(-45deg); }

  /* painel: ocupa a tela abaixo do header (ancorado no header sticky); itens centralizados */
  .top-header .nav-row {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100dvh - var(--hdr-h, 56px));
    flex-direction: column; align-items: center; justify-content: center; gap: 0;
    padding: 0 var(--gutter) var(--hdr-h, 56px); background: var(--white); /* padding-bottom = altura do header → lista no centro da tela */
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }
  .menu-open .nav-row { opacity: 1; visibility: visible; transform: none; }
  .top-header .main-nav { flex-direction: column; align-items: center; gap: 0; }
  .top-header .main-nav a { display: flex; gap: 10px; padding: 12px 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; color: var(--gray-400); }
  .top-header .main-nav a.current { color: var(--ink); }
  .top-header .main-nav .nav-ico { width: 20px; height: 20px; }
  .top-header .lang-switch { margin-top: 56px; gap: 16px; }
  .top-header .lang-btn { width: 28px; height: 20px; }
  /* entrada em cascata dos itens */
  .top-header .main-nav a, .top-header .lang-switch { opacity: 0; transform: translateY(8px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), color 0.25s var(--ease); }
  .menu-open .main-nav a, .menu-open .lang-switch { opacity: 1; transform: none; }
  .menu-open .main-nav a:nth-child(2) { transition-delay: 0.04s; }
  .menu-open .main-nav a:nth-child(3) { transition-delay: 0.08s; }
  .menu-open .main-nav a:nth-child(4) { transition-delay: 0.12s; }
  .menu-open .main-nav a:nth-child(5) { transition-delay: 0.16s; }
  .menu-open .lang-switch { transition-delay: 0.2s; }

  footer.contact-footer { padding-bottom: 40px; }
  .hero-text { align-items: center; text-align: left; } /* bloco centralizado, linhas alinhadas à esquerda */
  .hero-headline { width: fit-content; }
  .hero-headline { max-width: 100%; }
}


/* --- Cabeçalho flutuante (desktop) --- */
div.floating-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--white);
  padding: 16px;
  transform: translateY(-100%);
  transition: transform 0.35s var(--ease);
}
div.floating-header.visible { transform: translateY(0); }

/* Modo noturno: troca os tokens e corrige cores fixas. Ativado por html[data-theme="dark"] (assets/js/tema.js) */
html[data-theme="dark"] {
  color-scheme: dark;
  --white: #121212;   /* fundo */
  --ink: #ededed;     /* texto */
  --gray-100: #1c1c1c;
  --gray-200: #2c2c2c;
  --gray-400: #808080; /* contraste ≥ 4.5 sobre o fundo */
  --gray-500: #a6a6a6;
}

/* headers translúcidos */
@media (max-width: 767px) {
  html[data-theme="dark"] header.top-header { background: rgba(18,18,18,.96); }
  html[data-theme="dark"] header.top-header.menu-open { background: var(--white); }
}
html[data-theme="dark"] body.project-page > header.top-header { background: rgba(18,18,18,.97); }
html[data-theme="dark"] .mobile-top-button { background: rgba(28,28,28,.9); border-color: rgba(255,255,255,.14); }

/* logos da faixa: sem inverter cores. A versão clara (*-escuro.*, trocada por tema.js) fica em cinza claro; cor no hover */
html[data-theme="dark"] .marquee-logo img {
  filter: grayscale(var(--g, 1)) brightness(calc(1 + 0.25 * var(--g, 1)));
}

/* contadores dentro de filtros ativos (botão claro) */
html[data-theme="dark"] .pc-filter [aria-pressed="true"] span { color: rgba(0,0,0,.55); }

/* dashboards */
html[data-theme="dark"] .ds-cmp-i { background: color-mix(in srgb, var(--ac) 14%, var(--white)); }
html[data-theme="dark"] .ds-cmp-i b { color: color-mix(in srgb, var(--ac) 65%, #fff); }
html[data-theme="dark"] .ds-mbar i { background: color-mix(in srgb, var(--ac) 55%, var(--white)); }
html[data-theme="dark"] .ds-heat-c.off { background: repeating-linear-gradient(45deg, #1c1c1c 0 3px, #121212 3px 6px); }
html[data-theme="dark"] .ds-heat-c:not(.off):hover { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ac); }
html[data-theme="dark"] .ds-bub-i i { box-shadow: 0 0 0 2px var(--white); }

/* --- Ícone pixelado de tema, discreto e alinhado ao nome --- */
.header-left { align-items: center; gap: 12px; }
.theme-switch {
  position: relative; flex: none; width: min(28px, var(--ts, 36px)); height: min(28px, var(--ts, 36px)); padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; color: var(--gray-500);
  transition: color .25s var(--ease), transform .2s var(--ease);
}
.theme-switch:hover { color: var(--ink); transform: translateY(-1px); }
.theme-switch:active { transform: scale(.92); }
.theme-switch:focus-visible { outline: 1px solid var(--gray-500); outline-offset: 3px; }
html[data-theme="dark"] .theme-switch { color: var(--gray-400); background: transparent; box-shadow: none; }
.theme-switch svg {
  position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  fill: currentColor; shape-rendering: crispEdges;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .25s var(--ease);
}
.theme-switch .ts-sun  { transform: rotate(0) scale(1); opacity: 1; }
.theme-switch .ts-moon { transform: rotate(-90deg) scale(.3); opacity: 0; }
html[data-theme="dark"] .theme-switch .ts-sun  { transform: rotate(90deg) scale(.3); opacity: 0; }
html[data-theme="dark"] .theme-switch .ts-moon { transform: rotate(0) scale(1); opacity: 1; }

/* barra "Site desenhado e desenvolvido por…" (fundo fixo rgba claro no CSS base) */
html[data-theme="dark"] .credit-bar { background: rgba(28,28,28,.96); }
html[data-theme="dark"] .pv-ov { background: rgba(18,18,18,.97); }

/* --- Cabeçalho mobile: nome centralizado; sol/lua e idiomas dentro do menu --- */
.ts-menu { display: none; }
@media (max-width: 767px) {
  /* nome + cidade no centro da tela; padding compensa X + gap */
  header.top-header .header-left { flex: 1; justify-content: center; padding-left: 40px; } /* 24px do X + 16px de gap */
  header.top-header .brand-collapse-inner,
  header.top-header .project-brand { text-align: center; }
  header.top-header .header-left > .theme-switch { display: none; }
  /* Switch vertical no menu: fundo discreto com sol/lua em pixel art. */
  header.top-header .ts-menu {
    --k: 28px;
    display: block; position: absolute; left: var(--gutter);
    top: calc(50% - var(--hdr-h, 56px) / 2 - var(--k) - 3px);
    width: calc(var(--k) + 6px); height: calc(var(--k) * 2 + 6px);
    border: 0; border-radius: 999px;
    background: var(--gray-100);
    box-shadow: inset 0 0 0 1px var(--gray-200);
    opacity: 0; transition: opacity .35s var(--ease) .2s, background .3s var(--ease);
  }
  header.top-header.menu-open .ts-menu { opacity: 1; }
  header.top-header .ts-menu:hover, header.top-header .ts-menu:active { transform: none; }
  html[data-theme="dark"] header.top-header .ts-menu { background: #202020; box-shadow: inset 0 0 0 1px #383838; }
  .ts-menu .ts-knob {
    position: absolute; left: 3px; top: 3px; width: var(--k); height: var(--k);
    border: 0; border-radius: 50%; background: rgba(255,255,255,.78);
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    transition: transform .55s cubic-bezier(.34,1.56,.64,1), background .3s var(--ease), box-shadow .3s var(--ease);
  }
  html[data-theme="dark"] .ts-menu .ts-knob {
    transform: translateY(var(--k)); background: rgba(255,255,255,.08);
    box-shadow: 0 1px 3px rgba(0,0,0,.28);
  }
  /* bandeiras em coluna, no centro vertical, à direita */
  header.top-header .lang-switch {
    position: absolute; right: var(--gutter); top: calc(50% - var(--hdr-h, 56px) / 2 - 46px); /* 3×20px + 2×16px = 92px */
    flex-direction: column; gap: 16px; margin-top: 0 !important;
  }
}

/* troca de tema: esmaecimento curto (assets/js/tema.js); só o quadro inteiro, sem custo por elemento */
html.theme-vt::view-transition-old(root),
html.theme-vt::view-transition-new(root) { animation-duration: .3s; animation-timing-function: ease; }
html.theme-swap *, html.theme-swap *::before, html.theme-swap *::after { transition: none !important; }

/* Toque: links e botões de texto pequenos ganham área de toque ≥ 24 px no celular,
   sem mudar o desenho nem o espaçamento (área invisível em volta, por pseudo-elemento) */
@media (pointer: coarse) {
  :is(.section-link, .marquee-link, .credit-bar a, #certificates-btn, .project-share, .ig-more, .pc-links a, .ig-links a) { position: relative; }
  :is(.section-link, .marquee-link, .credit-bar a, #certificates-btn, .project-share, .ig-more, .pc-links a, .ig-links a)::before {
    content: ""; position: absolute; inset: -6px -4px;
  }
}

/* ============================================================
   Celular: barra flutuante inferior + pílulas de idioma e tema abaixo do nome
   (assets/js/barra.js cria a barra e controla o contato)
   ============================================================ */
.hm-dock { display: none; }
@media (max-width: 767px) {
  /* vidro: claro e pouco transparente; escuro no modo noturno */
  .hm-dock, header.top-header .lang-switch, header.top-header .ts-menu, html .hm-fab {
    background: rgba(255,255,255,.8);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.9);
  }
  html[data-theme="dark"] .hm-dock, html[data-theme="dark"] header.top-header .lang-switch,
  html[data-theme="dark"] header.top-header .ts-menu, html[data-theme="dark"] .hm-fab {
    background: rgba(30,30,30,.78); border-color: rgba(255,255,255,.08);
    box-shadow: 0 4px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  }

  /* --- barra inferior: estreita, só ícones; cresce um pouco ao rolar para cima --- */
  .hm-dock {
    display: flex; gap: 0; padding: 3px 6px; border-radius: 999px;
    position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1450;
    transform: translateX(-50%) scale(1); transform-origin: 50% 100%;
    transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .25s var(--ease);
  }
  .hm-dock.is-big { transform: translateX(-50%) scale(1.1); }
  .hm-dock a {
    display: flex; align-items: center; justify-content: center; height: 44px; min-width: 52px; padding: 0 13px; border-radius: 999px;
    color: var(--gray-400); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: color .25s var(--ease);
  }
  .hm-dock a.current { color: var(--ink); }
  .hm-dock a:focus-visible { outline: 1.5px solid var(--ink); outline-offset: -3px; }
  .hm-dock svg { width: 22px; height: 22px; display: block; flex: none; }
  /* nome ao tocar: entra dentro da barra, ao lado do ícone */
  .hm-dock .hm-tip {
    max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
    font-size: 13px; line-height: 1; color: var(--ink);
    transition: max-width .3s var(--ease), opacity .2s var(--ease), margin .3s var(--ease);
  }
  .hm-dock a.tip-on .hm-tip { max-width: 90px; opacity: 1; margin-left: 7px; }
  body[style*="overflow: hidden"] .hm-dock, body.pv-open .hm-dock { opacity: 0; pointer-events: none; } /* some sob modais e visualizador */

  /* --- contato: círculo de vidro acima da barra, à direita --- */
  .hm-fab-wrap { right: 14px !important; bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  html .hm-fab { width: 46px; height: 46px; color: var(--ink); }
  html .hm-fab:hover { transform: none; }
  html .hm-fab svg { width: 21px; height: 21px; }
  .hm-fab-wrap.is-hide { opacity: 0; transform: translateY(8px); pointer-events: none; }

  /* outros flutuantes acima da barra */
  .mobile-top-button { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  body.has-art-float .mobile-top-button { bottom: calc(124px + env(safe-area-inset-bottom)) !important; }
  /* categorias de Artigos: mesmo vidro e mesma escala da barra */
  .art-float { bottom: calc(78px + env(safe-area-inset-bottom)) !important; padding: 2px 4px !important; }
  .art-float, html[data-theme="dark"] .art-float {
    background: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.7);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.9);
  }
  html[data-theme="dark"] .art-float { background: rgba(30,30,30,.78); border-color: rgba(255,255,255,.08); box-shadow: 0 4px 16px rgba(0,0,0,.35); }
  .art-float .art-filter.art-ico { width: 38px !important; height: 30px !important; }
  .art-float .art-ico > svg { width: 16px !important; height: 16px !important; }
  html .mobile-top-button { width: 40px; height: 40px; }
  .credit-bar { padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important; }
  body.project-page { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* --- menu (2 traços): abre duas pílulas lado a lado abaixo do nome --- */
  header.top-header .nav-row {
    top: calc(100% + 4px); left: auto; right: calc(var(--gutter) - 7px); width: auto; height: auto; /* coluna centrada sob os 2 traços */
    flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 0;
    background: none; border: 0; box-shadow: none; pointer-events: none;
    transform: translateY(-6px);
  }
  header.top-header.menu-open .nav-row { transform: none; }
  header.top-header.menu-open .nav-row > * { pointer-events: auto; }
  header.top-header.menu-open { background: rgba(255,255,255,.96); }
  html[data-theme="dark"] header.top-header.menu-open { background: rgba(18,18,18,.96); }
  header.top-header .nav-row .main-nav { display: none; }
  /* pílula do tema: switch sol/lua horizontal */
  header.top-header .ts-menu {
    --k: 26px; order: 2; position: relative; left: auto; top: auto;
    width: calc(var(--k) + 8px); height: calc(var(--k) * 2 + 8px); border-radius: 999px;
  }
  .ts-menu .ts-knob { left: 4px !important; top: 4px !important; }
  html[data-theme="dark"] .ts-menu .ts-knob { transform: translateY(var(--k)); }
  .ts-menu .ts-knob svg { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
  /* pílula do idioma: as três bandeiras */
  header.top-header .lang-switch {
    order: 1; position: static; flex-direction: column; gap: 12px; width: 34px; height: auto; padding: 12px 0; border-radius: 999px;
    margin: 0 !important;
  }
  header.top-header .lang-btn { width: 22px; height: 16px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .hm-dock, .hm-dock .hm-tip, .hm-fab-wrap { transition: none; }
}

/* =========================================================================
   motion.css — animações leves, só CSS (sem bibliotecas)
   Carregamento curto, troca de página em fade, ponto do cursor e hovers discretos.
   Desligar: ?nomotion na URL ou "reduzir movimento" no sistema.
   ========================================================================= */

/* ---------- Carregamento: fundo liso + 3x3 pontos do logo; some em fade ---------- */
#mx-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--white, #fff);
  transition: opacity .5s var(--ease), visibility .5s;
  animation: mx-failsafe 0s 3s forwards; /* se o JS falhar, some sozinho */
}
#mx-loader.out { opacity: 0; visibility: hidden; }
@keyframes mx-failsafe { to { opacity: 0; visibility: hidden; } }
html.mx-off #mx-loader, html.mx-seen #mx-loader { display: none; }

.mx-mark { display: grid; grid-template-columns: repeat(3, 6px); gap: 4px; }
.mx-mark b { width: 6px; height: 6px; border-radius: 1px; background: var(--ink, #111); animation: mx-dot 1.2s ease-in-out infinite; }
/* onda diagonal pelos pontos */
.mx-mark b:nth-child(2), .mx-mark b:nth-child(4) { animation-delay: .1s; }
.mx-mark b:nth-child(3), .mx-mark b:nth-child(5), .mx-mark b:nth-child(7) { animation-delay: .2s; }
.mx-mark b:nth-child(6), .mx-mark b:nth-child(8) { animation-delay: .3s; }
.mx-mark b:nth-child(9) { animation-delay: .4s; }
@keyframes mx-dot { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* ---------- Troca de página: some em 0,18 s; blocos da nova sobem 10 px em cascata ---------- */
main { transition: opacity .18s ease; }
main.mx-leave { opacity: 0; } /* só opacidade: sem repintar a página inteira */
.mx-rise { animation: mx-rise .6s cubic-bezier(.22,1,.36,1) var(--mx-d, 0ms) both; will-change: opacity, transform; }
@keyframes mx-rise { from { opacity: 0; transform: translate3d(0,10px,0); } to { opacity: 1; transform: none; } }

/* ---------- Página Projetos: 1ª tela direto; os próximos em fade lento, sem deslocamento ---------- */
.work-card.mx-fade { transition: opacity .9s ease var(--mx-d, 0ms); }
.work-card.mx-fade.mx-wait { opacity: 0; transition: none; will-change: opacity; } /* abaixo da tela, esperando */

/* ---------- Cursor: ponto pequeno (só mouse/trackpad) ---------- */
#mx-cursor {
  position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none;
  width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--ink, #111); box-shadow: 0 0 0 1px rgba(255,255,255,.6);
  opacity: 0; transition: opacity .3s;
}
#mx-cursor.on { opacity: 1; }
@media (hover: none), (pointer: coarse) { #mx-cursor { display: none; } }

/* ---------- Hover discreto ---------- */
.main-nav a { position: relative; }
.main-nav a::after {
  content: ""; position: absolute; left: 21px; right: 0; bottom: -3px; /* sublinha só o nome, não o ícone */ height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.main-nav a:hover::after, .main-nav a.current::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 767px) { .top-header .main-nav a::after { display: none; } }

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
  #mx-loader, #mx-cursor { display: none !important; }
  .mx-rise { animation: none; }
  .work-card.mx-wait { opacity: 1 !important; }
}
html.mx-off #mx-cursor { display: none !important; }
html.mx-off .work-card.mx-wait { opacity: 1 !important; }

/* texto só para leitores de tela e buscadores (ex.: título principal da página Sobre) */
.mx-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
