/* Fontes hospedadas no próprio site (WOFF2, só latim: cobre o português).
   Neue Machina (Pangram Pangram), Inter e JetBrains Mono (licença OFL). */
@font-face { font-family: 'Neue Machina'; src: url(fonts/NeueMachina-Regular.woff2) format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Neue Machina'; src: url(fonts/NeueMachina-Ultrabold.woff2) format('woff2'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(fonts/JetBrainsMono-latin.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  /* Tema escuro (padrão). Triplas RGB para usar com transparência: rgb(var(--ink) / .1) */
  --ink: 255 255 255;        /* linhas, vidro, brilhos */
  --fg-rgb: 244 243 239;     /* texto */
  --base: 8 8 10;            /* superfícies (página, dock, vidro escuro) */
  --bg: #050506;
  --fg: #f4f3ef;
  --muted: rgb(var(--fg-rgb) / 0.62);
  --glass: rgb(var(--ink) / 0.08);
  --glass-border: rgb(var(--ink) / 0.14);
  --dock-h: 56px;
  --dock-bottom: max(20px, env(safe-area-inset-bottom));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Tipografia: display larga e geométrica (como o monograma), texto em Inter, rótulos em mono */
  --font-display: 'Neue Machina', Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
/* Tema claro: fundo off-white quente, texto quase preto, vidro e linhas invertidos. */
:root[data-theme="claro"] {
  --ink: 20 20 24;
  --fg-rgb: 22 22 26;
  --base: 244 243 238;
  --bg: #ecebe6;
  --fg: #16161a;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#focus-ui {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(100vw - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.focused #focus-ui {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
  transition-delay: 0.45s;
}
#focus-ui h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
#focus-ui p { font-size: 14px; color: var(--muted); margin-top: 2px; }
#focus-ui button {
  flex: none;
  font: 500 13px/1 Inter, system-ui, sans-serif;
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  cursor: pointer;
}
#focus-ui button:hover { background: rgb(var(--ink) / 0.14); }

#hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-bottom) + var(--dock-h) + 14px);
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s ease 1.6s;
  pointer-events: none;
}
body.ready #hint { opacity: 1; }
#hint.gone, body.focused #hint { opacity: 0 !important; transition-delay: 0s; }

#player {
  position: fixed;
  border-radius: 22px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  background: #000;
}
#player.on { opacity: 1; pointer-events: auto; }
#player iframe { width: 100%; height: 100%; border: 0; display: block; }

#recenter {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-bottom) + var(--dock-h) + 14px);
  transform: translate(-50%, 12px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 14px;
  border-radius: 999px;
  font: 500 14px/1 Inter, system-ui, sans-serif;
  color: var(--fg);
  background: rgb(var(--base) / 0.55);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
}
body.off-center #recenter { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#recenter:hover { background: rgb(var(--base) / 0.7); }
#recenter:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
body.off-center #hint { opacity: 0 !important; transition-delay: 0s; }

#fallback { display: none; }
body.no-webgl #fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}

/* ── Logo ─────────────────────────────────────────────────────────────── */
#logo {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--fg);
  line-height: 0;
  mix-blend-mode: difference;
}
#logo .wr-mark { width: clamp(92px, 8.5vw, 124px); height: auto; display: block; }
[data-theme="claro"] #logo { mix-blend-mode: normal; }
#logo:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
body.focused #logo { opacity: 0; pointer-events: none; }

/* ── Dock ─────────────────────────────────────────────────────────────── */
#dock {
  position: fixed;
  left: 50%;
  bottom: var(--dock-bottom);
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 6px;
  height: var(--dock-h);
  border-radius: 999px;
  background: rgb(var(--base) / 0.5);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgb(var(--ink) / 0.08);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
body.focused #dock { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
#dock a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font: 500 14px/1 Inter, system-ui, sans-serif;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
#dock a:hover { color: var(--fg); background: rgb(var(--ink) / 0.07); }
#dock a.active { color: var(--fg); background: rgb(var(--ink) / 0.14); }
#dock a:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
@media (max-width: 560px) {
  #dock a { padding: 0 13px; }
  #dock a span { display: none; }
  #dock a.active span { display: inline; }
}

/* ── Páginas ──────────────────────────────────────────────────────────── */
#page {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgb(var(--base) / 0.72);
  backdrop-filter: blur(34px) saturate(1.3);
  -webkit-backdrop-filter: blur(34px) saturate(1.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
body.page-open #page { opacity: 1; visibility: visible; transition: opacity 0.45s ease; }
body.page-open #recenter, body.page-open #hint { opacity: 0 !important; pointer-events: none; }

.page-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(max(18px, env(safe-area-inset-top)) + 84px) 24px calc(var(--dock-h) + 96px);
  transform: translateY(24px) scale(0.985);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.45s ease;
}
body.page-open .page-inner { transform: none; opacity: 1; transition-delay: 0.08s; }
#page.leaving .page-inner { opacity: 0; transform: translateY(10px); transition-duration: 0.18s; transition-delay: 0s; }

.eyebrow {
  font: 500 13px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
#page h1 {
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.04em;
  max-width: 12ch;
}
#page .lead {
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.45;
  color: rgb(var(--fg-rgb) / 0.8);
  max-width: 34em;
  margin-top: 24px;
}
#page h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 88px 0 24px;
  padding-top: 24px;
  border-top: 1px solid rgb(var(--ink) / 0.1);
}
#page h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
#page p { line-height: 1.6; }
#page a { color: inherit; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.stat b { display: block; font-size: clamp(44px, 6vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }

.bio { margin-top: 56px; max-width: 40em; } /* uma coluna só: em duas, os parágrafos de tamanhos diferentes deixavam um lado vazio */
.bio p { color: rgb(var(--fg-rgb) / 0.78); margin-bottom: 18px; font-size: 18px; line-height: 1.65; text-wrap: pretty; }

.xp { list-style: none; padding: 0; }
.xp li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid rgb(var(--ink) / 0.08);
}
.xp-years { font: 500 14px/1.8 Inter, system-ui, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.xp h3 small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.xp-role { font-size: 15px; color: rgb(var(--fg-rgb) / 0.9); margin: 2px 0 8px; }
.xp li p:last-child { color: rgb(var(--fg-rgb) / 0.66); max-width: 44em; }

.chips-group + .chips-group { margin-top: 28px; }
.chips-group h3 { font-size: 15px; margin-bottom: 12px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li, .clients li {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  background: rgb(var(--ink) / 0.06);
  border: 1px solid rgb(var(--ink) / 0.1);
}

.edu { list-style: none; padding: 0; }
.edu li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid rgb(var(--ink) / 0.08);
}
.edu p, .edu span { color: var(--muted); font-size: 15px; }
.edu span { white-space: nowrap; }

.glass-card {
  border-radius: 22px;
  background: linear-gradient(160deg, rgb(var(--ink) / 0.09), rgb(var(--ink) / 0.03));
  border: 1px solid rgb(var(--ink) / 0.12);
  box-shadow: inset 0 1px 0 rgb(var(--ink) / 0.08);
}

.services { list-style: none; padding: 0; margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.services li { padding: 26px; transition: transform 0.35s var(--ease), background 0.3s ease; }
.services li:hover { transform: translateY(-3px); background: linear-gradient(160deg, rgb(var(--ink) / 0.13), rgb(var(--ink) / 0.04)); }
.svc-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: rgb(var(--ink) / 0.08); margin-bottom: 22px;
}
.services p { color: rgb(var(--fg-rgb) / 0.68); margin-top: 8px; font-size: 15px; }

.clients { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.clients li { font-size: 16px; padding: 11px 18px; }

.cta { margin-top: 96px; padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta p { color: var(--muted); margin-top: 4px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  font: 500 14px/1 Inter, system-ui, sans-serif; color: var(--fg); text-decoration: none;
  background: rgb(var(--ink) / 0.08); border: 1px solid rgb(var(--ink) / 0.14);
  cursor: pointer; transition: background 0.2s ease;
}
.pill:hover { background: rgb(var(--ink) / 0.15); }
.pill-solid { background: var(--fg); color: var(--bg) !important; border-color: var(--fg); }
.pill-solid:hover { background: rgb(var(--ink)); }

.contact-main { margin-top: 56px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.big-mail {
  font-size: clamp(26px, 5vw, 56px); font-weight: 600; letter-spacing: -0.03em;
  text-decoration: none; border-bottom: 2px solid rgb(var(--ink) / 0.25);
  overflow-wrap: anywhere; transition: border-color 0.2s ease;
}
.big-mail:hover { border-color: var(--fg); }
.contact-links { list-style: none; padding: 0; margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.contact-links a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 20px 22px; text-decoration: none; transition: transform 0.35s var(--ease), background 0.3s ease;
}
.contact-links a:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgb(var(--ink) / 0.13), rgb(var(--ink) / 0.04)); }
.contact-links span { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.contact-links b { color: var(--fg); font-size: 16px; font-weight: 600; }
.foot { margin-top: 72px; color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .xp li { grid-template-columns: 1fr; gap: 6px; }
  .page-inner { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-inner, #page, .services li, .contact-links a { transition: none !important; }
}

/* ── Preloader ────────────────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: var(--bg);
  transition: opacity 0.7s ease 0.25s, visibility 0s linear 1s;
}
/* halo suave atrás da marca, o mesmo branco do glow do grid */
#preloader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(40vmin 40vmin at 50% 46%, rgb(var(--ink) / 0.07), transparent 70%);
  pointer-events: none;
}
.pl-mark {
  --draw: 1;
  position: relative;
  color: var(--fg);
  line-height: 0;
  animation: pl-in 0.8s var(--ease) both;
  transition: transform 0.9s var(--ease), filter 0.7s ease, opacity 0.6s ease;
}
.pl-mark .wr-mark {
  width: clamp(150px, 20vw, 220px); height: auto; display: block;
  /* a marca é revelada da esquerda para a direita junto com o carregamento */
  clip-path: inset(-10% calc(var(--draw) * 100%) -10% 0);
  transition: clip-path 0.25s linear;
}
/* marca apagada por baixo, para já se ler antes de terminar */
.pl-mark::before {
  content: '';
  position: absolute; inset: 0;
  background: currentColor;
  opacity: 0.12;
  -webkit-mask: url(brand/wr-monogram.svg) center / contain no-repeat;
  mask: url(brand/wr-monogram.svg) center / contain no-repeat;
}
.pl-bar {
  position: relative;
  width: min(180px, 46vw);
  height: 4px;
  border-radius: 999px;
  background: rgb(var(--ink) / 0.1);
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.06);
  overflow: hidden;
  animation: pl-in 0.8s var(--ease) 0.1s both;
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}
.pl-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--ink) / 0.65), rgb(var(--ink)));
  box-shadow: 0 0 12px rgb(var(--ink) / 0.6);
  transform: scaleX(0);
  transform-origin: left center;
}
.pl-meta {
  font: 500 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  animation: pl-in 0.8s var(--ease) 0.2s both;
  transition: opacity 0.4s ease;
}
/* saída: barra e número somem, a marca cresce e desfoca, o fundo abre */
#preloader.pl-done { opacity: 0; visibility: hidden; pointer-events: none; }
#preloader.pl-done .pl-bar { opacity: 0; transform: scaleX(1.4); }
#preloader.pl-done .pl-meta { opacity: 0; }
#preloader.pl-done .pl-mark { transform: scale(1.35); filter: blur(10px); opacity: 0; }

@keyframes pl-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .pl-mark, .pl-bar, .pl-meta { animation: none; }
  .pl-mark .wr-mark { transition: none; }
  #preloader, .pl-mark { transition: none; }
}

/* ── Timeline ─────────────────────────────────────────────────────────── */
.tl-jump {
  position: sticky;
  top: 64px;
  z-index: 2;
  display: flex;
  gap: 4px;
  margin-top: 48px;
  padding: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: rgb(var(--base) / 0.6);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}
.tl-jump::-webkit-scrollbar { display: none; }
.tl-jump a {
  padding: 9px 13px;
  border-radius: 999px;
  font: 500 13px/1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.tl-jump a:hover { color: var(--fg); background: rgb(var(--ink) / 0.1); }

.tl { margin-top: 40px; }
.tl-year {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 32px;
  padding: 44px 0;
  border-top: 1px solid rgb(var(--ink) / 0.08);
  scroll-margin-top: 120px;
}
.tl-rail { position: sticky; top: 136px; align-self: start; display: flex; flex-direction: column; gap: 8px; }
.tl-num {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgb(var(--ink)), rgb(var(--fg-rgb) / 0.45));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tl-count { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }

.tl-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 14px 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  background: rgb(var(--ink) / 0.08);
  border: 1px solid rgb(var(--ink) / 0.16);
  box-shadow: 0 0 24px rgb(var(--ink) / 0.06);
}
.tl-mark svg { flex: none; opacity: 0.8; }

.tl-videos {
  list-style: none;
  padding: 0;
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px 16px;
}
.tl-video {
  all: unset;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  cursor: pointer;
}
.tl-video:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 16px; }
.tl-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: rgb(var(--ink) / 0.05);
  border: 1px solid rgb(var(--ink) / 0.1);
  margin-bottom: 8px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.3s ease;
}
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.tl-dur {
  position: absolute; right: 8px; bottom: 8px;
  padding: 4px 7px; border-radius: 7px;
  font: 500 11px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.6); color: #fff;
}
.tl-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; background: rgba(0, 0, 0, 0.25);
  opacity: 0; transition: opacity 0.3s ease;
}
.tl-video:hover .tl-thumb, .tl-video:focus-visible .tl-thumb {
  transform: translateY(-3px);
  border-color: rgb(var(--ink) / 0.3);
  box-shadow: 0 0 0 1px rgb(var(--ink) / 0.08), 0 0 32px rgb(var(--ink) / 0.14);
}
.tl-video:hover .tl-thumb img { transform: scale(1.05); }
.tl-video:hover .tl-play, .tl-video:focus-visible .tl-play { opacity: 1; }
.tl-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.tl-sub { font-size: 13px; color: var(--muted); line-height: 1.35; }

@media (max-width: 640px) {
  .tl-year { grid-template-columns: 1fr; gap: 16px; padding: 32px 0; }
  .tl-rail { position: static; flex-direction: row; align-items: baseline; gap: 12px; }
  .tl-videos { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
}

/* ── Player (lightbox) ────────────────────────────────────────────────── */
#lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 24px;
  background: rgba(3, 3, 4, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
#lightbox.on { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.lb-box {
  width: min(1100px, 100%, calc((100vh - 140px) * 16 / 9));
  transform: scale(0.96); transition: transform 0.5s var(--ease);
}
#lightbox.on .lb-box { transform: none; }
.lb-frame { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; }
.lb-title { font-size: 17px; font-weight: 600; color: #f4f3ef; }
#lightbox .pill { color: #f4f3ef; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

/* ── Tema ─────────────────────────────────────────────────────────────── */
#theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  margin-left: 2px;
  border: 0;
  border-left: 1px solid rgb(var(--ink) / 0.1);
  border-radius: 0 999px 999px 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}
#theme-toggle:hover { color: var(--fg); }
#theme-toggle:focus-visible { outline: 2px solid var(--fg); outline-offset: -4px; }
/* mostra o ícone do tema para onde o botão leva */
[data-theme="escuro"] #theme-toggle .ic-moon,
[data-theme="claro"] #theme-toggle .ic-sun { display: none; }

/* No escuro, os halos brancos de interface também apagam. */
[data-theme="escuro"] #preloader::before {
  background: radial-gradient(40vmin 40vmin at 50% 46%, rgb(var(--ink) / 0.035), transparent 70%);
}
[data-theme="escuro"] #dock { background: rgb(var(--base) / 0.62); }
[data-theme="escuro"] #page { background: rgb(var(--base) / 0.8); }

/* ── Timeline de experiências (palco em tela cheia) ───────────────────── */
#page.is-stage { overflow: hidden; background: rgb(var(--base) / 0.93); }
#page.is-stage .page-inner { max-width: none; height: 100%; padding: 0; }

.back-link {
  display: inline-block; margin-bottom: 28px;
  font-size: 14px; color: var(--muted) !important; text-decoration: none;
}
.back-link:hover { color: var(--fg) !important; }

.xp-stage {
  --accent: rgb(var(--ink));
  position: relative;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* Piso de grade em perspectiva; desliza um pouco a cada troca. */
.xp-floor {
  --shift: 0px;
  position: absolute;
  left: -60%; right: -60%; top: 8%; bottom: -30%;
  background-image:
    linear-gradient(rgb(var(--ink) / 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--ink) / 0.13) 1px, transparent 1px),
    linear-gradient(rgb(var(--ink) / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--ink) / 0.045) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: 0 var(--shift), var(--shift) 0, 0 var(--shift), var(--shift) 0;
  transform: perspective(900px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 96%);
  mask-image: linear-gradient(to top, #000 35%, transparent 96%);
  transition: background-position 1.1s var(--ease);
  pointer-events: none;
}
/* brilho da cor da fase atual vindo de baixo */
.xp-stage::before {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 55%;
  background: radial-gradient(60% 80% at 30% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  transition: background 0.8s ease;
  pointer-events: none;
}

.xp-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  padding: 90px clamp(24px, 6vw, 96px) 0;
}

/* Ano gigante: cada dígito é uma coluna 0–9 que desliza até o número. */
.xp-year {
  display: flex;
  font-size: clamp(110px, 17vw, 300px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  height: 1em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.xp-dcol {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--d) * -1em));
  transition: transform 1s cubic-bezier(0.65, 0, 0.25, 1);
  transition-delay: calc(var(--i) * 70ms);
}
.xp-dcol span { height: 1em; display: block; }

.xp-info { max-width: 34em; transition: opacity 0.26s ease, transform 0.5s var(--ease), filter 0.4s ease; }
.xp-info.out { opacity: 0; filter: blur(6px); }
.xp-info.out.down { transform: translateY(-18px); }
.xp-info.out.up { transform: translateY(18px); }
.xp-info.pre { opacity: 0; transition: none; filter: blur(6px); }
.xp-info.pre.down { transform: translateY(22px); }
.xp-info.pre.up { transform: translateY(-22px); }
.xp-info.in { opacity: 1; transform: none; filter: none; }

.xp-meta {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
#page .xp-role { margin: 0; padding: 0; border: 0; text-transform: none; color: var(--fg); font-size: clamp(30px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin-top: 14px; }
.xp-company { margin-top: 10px; font-size: 18px; color: var(--accent); transition: color 0.6s ease; }
.xp-text { margin-top: 18px; color: rgb(var(--fg-rgb) / 0.75); font-size: 16px; line-height: 1.6; }
.xp-tags { list-style: none; padding: 0; margin-top: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.xp-tags li {
  padding: 6px 11px;
  border-radius: 999px;
  font: 500 12px/1.2 var(--font-mono);
  color: var(--bg);
  background: rgb(var(--fg-rgb) / 0.92);
}

.xp-arrows {
  position: absolute; right: clamp(16px, 3vw, 40px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
}
.xp-arrows button {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--fg); cursor: pointer;
  background: rgb(var(--ink) / 0.06);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s ease;
}
.xp-arrows button:hover { background: rgb(var(--ink) / 0.14); }

/* Régua */
.xp-ruler {
  position: relative;
  margin: 0 clamp(24px, 6vw, 96px) calc(var(--dock-h) + var(--dock-bottom) + 34px);
  padding-top: 26px;
}
.xp-ticks { position: relative; height: 14px; }
.xp-ticks span {
  position: absolute; bottom: 0; width: 1px; height: 5px;
  background: rgb(var(--ink) / 0.22);
}
.xp-ticks span.major { height: 10px; background: rgb(var(--ink) / 0.4); }
.xp-ticks b {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font: 500 11px/1 var(--font-mono); color: var(--muted); font-weight: 400;
}
.xp-track {
  position: relative;
  height: calc(var(--lanes) * 12px + 24px);
  margin-top: 6px;
}
.xp-head { /* linha branca do começo da régua até a fase atual */
  position: absolute; top: -8px; left: 0; width: 0; height: 2px;
  background: linear-gradient(90deg, rgb(var(--ink) / 0.35), rgb(var(--ink)));
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.65, 0, 0.25, 1);
}
.xp-head::after {
  content: ''; position: absolute; right: -5px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgb(var(--ink)); box-shadow: 0 0 14px rgb(var(--ink) / 0.9);
}
.xp-seg {
  position: absolute;
  top: calc((var(--lanes) - 1 - var(--lane)) * 12px);
  height: 34px;
  padding: 0 1.5px;
  border: 0; background: none; cursor: pointer;
  display: block;
}
.xp-bar { /* fixa no topo: o <button> centralizaria o conteúdo */
  position: absolute; top: 0; left: 1.5px; right: 1.5px;
  display: block; height: 6px; border-radius: 999px;
  background: var(--c); opacity: 0.55;
  transition: opacity 0.3s ease, height 0.3s ease, box-shadow 0.4s ease, transform 0.4s var(--ease);
}
.xp-name { /* todos os nomes numa linha só, abaixo da faixa mais baixa */
  position: absolute; left: 50%; top: calc(var(--lane) * 12px + 16px); transform: translateX(-50%);
  white-space: nowrap;
  font: 500 10px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}
/* nomes das faixas de cima só aparecem quando ativos, para não embolar */
.xp-seg:not(.on) .xp-name { opacity: 0.7; }
.xp-seg[style*="--lane:1"] .xp-name, .xp-seg[style*="--lane:2"] .xp-name { display: none; }
.xp-seg.on .xp-name { display: block; color: var(--c); }
.xp-seg:hover .xp-bar { opacity: 0.9; }
.xp-seg.on .xp-bar {
  opacity: 1; height: 9px; transform: translateY(-1.5px);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 70%, transparent);
}
.xp-seg:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

.xp-archive { position: absolute; left: clamp(24px, 6vw, 96px); top: 84px; z-index: 2; font-size: 13px; padding: 9px 14px; }

@media (max-width: 760px) {
  .xp-main { grid-template-columns: 1fr; align-content: center; gap: 10px; padding-top: 120px; }
  .xp-year { font-size: clamp(88px, 28vw, 160px); }
  .xp-text { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .xp-arrows { display: none; } /* no celular, troca com swipe */
  .xp-name { display: none; }
  .xp-seg.on .xp-name { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-dcol, .xp-info, .xp-head, .xp-floor { transition: none !important; }
}

.xp-seg.name-hidden .xp-name { opacity: 0; }
.xp-name { transition: color 0.3s ease, opacity 0.25s ease; }


/* Tema claro: a cor da fase escurece um pouco para ter contraste no fundo claro */
[data-theme="claro"] .xp-company { color: color-mix(in srgb, var(--accent) 55%, var(--fg)); }
[data-theme="claro"] .xp-seg.on .xp-name { color: color-mix(in srgb, var(--c) 55%, var(--fg)); }

/* Menu na fonte display (Neue Machina) */
#dock a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* ── Tipografia display (Neue Machina) ───────────────────────────────────────
   Larga e geométrica, como o monograma: vai nos títulos, números grandes e
   rótulos. Textos corridos continuam em Inter. A Neue Machina ocupa mais
   largura, então os tamanhos são um pouco menores que os da Inter. */
#page h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5.2vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.eyebrow, #page h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
}
#page h3 { font-family: var(--font-display); font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: clamp(38px, 5vw, 56px); letter-spacing: -0.04em; }
.big-mail { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 4.2vw, 46px); letter-spacing: -0.03em; }
.pill, .cta-actions a { font-family: var(--font-display); font-weight: 500; font-size: 12px; letter-spacing: 0.01em; }
#focus-ui h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
#focus-ui button, #recenter, #hint { font-family: var(--font-display); font-size: 12px; font-weight: 500; }
.lb-title { font-family: var(--font-display); font-weight: 500; font-size: 15px; }

/* Timeline */
.xp-year { font-family: var(--font-display); font-weight: 600; font-size: clamp(84px, 12.5vw, 220px); letter-spacing: -0.05em; }
#page .xp-role { font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 2.9vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.xp-company { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.xp-tags li { font-family: var(--font-mono); }
.tl-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 5vw, 60px); }
.tl-title { font-family: var(--font-display); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.tl-jump a { font-family: var(--font-display); font-size: 12px; }
.pl-meta { font-family: var(--font-mono); }
@media (max-width: 760px) { .xp-year { font-size: clamp(64px, 21vw, 120px); } }

/* ── Acessibilidade e conteúdo estático ─────────────────────────────────── */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* "Pular para a lista de trabalhos": só aparece com Tab */
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 200;
  padding: 10px 14px; border-radius: 10px;
  background: var(--fg); color: var(--bg); font: 500 14px/1 var(--font-body);
  transform: translateY(-160%); transition: transform 0.2s ease;
}
.skip-link:focus { transform: none; outline: 2px solid var(--fg); outline-offset: 2px; }

/* Lista de trabalhos: escondida até receber foco; aí vira um painel de vidro */
#work-list {
  position: fixed; left: 16px; top: 64px; z-index: 35;
  max-height: calc(100vh - 180px); overflow: auto;
  padding: 12px; border-radius: 16px;
  background: rgb(var(--base) / 0.86); border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  clip-path: inset(50%); opacity: 0; pointer-events: none;
}
#work-list:focus-within { clip-path: none; opacity: 1; pointer-events: auto; }
#work-list ul { list-style: none; padding: 0; display: grid; gap: 2px; }
#work-list button {
  all: unset; display: block; padding: 8px 12px; border-radius: 8px;
  font: 500 14px/1.3 var(--font-body); color: var(--fg); cursor: pointer;
}
#work-list button:hover, #work-list button:focus-visible { background: rgb(var(--ink) / 0.12); outline: 2px solid var(--fg); outline-offset: -2px; }
body.page-open #work-list, body.focused #work-list { display: none; }

/* Texto pré-renderizado: visível para quem não roda JS (o JS o esconde) */
.static-content {
  position: relative; z-index: 1; max-width: 760px; margin: 0 auto;
  padding: 110px 24px 160px; font: 16px/1.6 var(--font-body); color: var(--fg);
}
.static-content h1 { font: 600 32px/1.15 var(--font-display); margin-bottom: 16px; }
.static-content h2 { font: 500 14px/1.3 var(--font-display); margin: 32px 0 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.static-content a { color: inherit; }
.static-content ul { padding-left: 20px; }
html:has(.static-content:not([hidden])) { overflow: auto; }

/* Foco sempre visível nos controles do site */
:where(a, button, [tabindex]):focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
#page { scroll-padding-bottom: calc(var(--dock-h) + 60px); }

/* Contraste: nomes da régua inativos e textos pequenos mais legíveis */
.xp-seg:not(.on) .xp-name { opacity: 0.88; }
.xp-name { font-size: 11px; }
.tl-count { color: rgb(var(--fg-rgb) / 0.72); }

/* Movimento reduzido: corta animações e transições em todo o site */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* Timeline no celular: botões de fase com área de toque de verdade (≥ 32px) */
.xp-steps { display: none; }
@media (max-width: 760px) {
  .xp-track { pointer-events: none; }
  .xp-steps { display: flex; gap: 6px; margin-top: 4px; }
  .xp-step {
    flex: 1; min-width: 32px; height: 36px; padding: 0;
    display: grid; place-items: center;
    border: 1px solid var(--glass-border); border-radius: 10px;
    background: rgb(var(--ink) / 0.04); cursor: pointer;
  }
  .xp-step span { width: 60%; height: 4px; border-radius: 999px; background: var(--c); opacity: 0.5; transition: opacity 0.3s ease, height 0.3s ease; }
  .xp-step.on { background: rgb(var(--ink) / 0.12); }
  .xp-step.on span { opacity: 1; height: 6px; box-shadow: 0 0 10px var(--c); }
  .xp-step:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
}

/* Cabeça 3D: camada transparente sobre o centro do grid, maior que um card.
   Não recebe cliques (arrastar o grid continua funcionando por cima dela). */
#head3d {
  position: fixed; left: 0; top: 0; z-index: 5;
  pointer-events: none;
  opacity: 0; transition: opacity 0.6s ease;
  filter: drop-shadow(0 24px 30px rgb(0 0 0 / 0.45));
}
#head3d.on { opacity: 1; }
#head3d.on.away { opacity: 0; transition-duration: 0.25s; }

/* Carregando a cabeça 3D: anel de vidro girando + porcentagem, no centro do grid */
#head-loading {
  position: fixed; left: 0; top: 0; z-index: 5;
  width: 0; height: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.4s ease;
}
#head-loading.on { opacity: 1; }
#head-loading.on.away { opacity: 0; }
#head-loading i {
  position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(var(--ink) / 0) 0deg, rgb(var(--ink) / 0.9) 300deg, rgb(var(--ink) / 0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 31px, #000 32px);
          mask: radial-gradient(circle, transparent 31px, #000 32px);
  animation: head-spin 1.1s linear infinite;
  filter: drop-shadow(0 0 10px rgb(var(--ink) / 0.35));
}
#head-loading b {
  position: absolute; left: -36px; top: -8px; width: 72px; text-align: center;
  font: 500 12px/16px var(--font-mono); letter-spacing: 0.06em; color: rgb(var(--ink) / 0.8);
}
@keyframes head-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { #head-loading i { animation-duration: 3s; } }

/* Sobre: botão de baixar o currículo, logo abaixo da introdução */
.about-cv { margin: 4px 0 28px; }
.about-cv .pill svg { flex: none; }

/* Monograma 3D no topo (logo3d.js): substitui o SVG quando carrega */
#logo.is3d { mix-blend-mode: normal; padding: 0; }
#logo.is3d .wr-mark { display: none; }
#logo .wr-mark-3d { display: none; }
#logo.is3d .wr-mark-3d { display: block; filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.35)); }
