/* Asclepius Labs, versão 5 (amostra): laboratório de IA para a medicina.
   Filme do bastão que acende no topo, objetos de pontos no resto, registros no lugar de serviços.
   Letras guardadas no próprio site (vendor/fonts). */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/instrument-serif-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: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/instrument-serif-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; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/instrument-serif-italico-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: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/instrument-serif-italico-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; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url("../vendor/fonts/hanken-grotesk-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: "Hanken Grotesk"; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url("../vendor/fonts/hanken-grotesk-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; }
@font-face { font-family: "Instrument Serif Reserva"; font-style: normal; font-weight: 400;
  src: local("Times New Roman"), local("TimesNewRomanPSMT");
  size-adjust: 82.88%; ascent-override: 119.45%; descent-override: 37.4%; line-gap-override: 0%; }
@font-face { font-family: "Hanken Grotesk Reserva"; font-style: normal; font-weight: 300 500;
  src: local("Helvetica Neue"), local("HelveticaNeue");
  size-adjust: 99.23%; ascent-override: 100.78%; descent-override: 30.23%; line-gap-override: 0%; }

:root {
  /* letras: a serifa fala (títulos), a grotesca explica (texto e controles) */
  --serifa: "Instrument Serif", "Instrument Serif Reserva", "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Hanken Grotesk Reserva", "Helvetica Neue", Arial, sans-serif;

  /* papéis de texto */
  --t-titulo: clamp(2.25rem, 1.3rem + 3.2vw, 4.25rem);
  --t-apoio: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  --t-corpo: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-miudo: 0.875rem;
  --t-mini: 0.75rem;

  /* espaços (base de 4) */
  --e-1: 0.25rem; --e-2: 0.5rem; --e-3: 0.75rem; --e-4: 1rem; --e-5: 1.5rem; --e-6: 2rem; --e-7: 3rem; --e-8: 4.5rem;
  --margem: clamp(1.25rem, 0.3rem + 3.6vw, 5rem);
  --obra: min(80vw, 46rem);

  /* movimento */
  --saida: cubic-bezier(0.16, 1, 0.3, 1);
  --toque: 150ms;
  --desliza: 260ms;
  --entra: 760ms;
}

/* cores tiradas do filme do topo: palco quase preto e quente, creme no texto, âmbar no destaque */
:root {
  color-scheme: dark;
  --fundo: #070403;
  --fundo-rgb: 7 4 3;
  --texto: #f6ecdd;
  --texto-suave: #bdb0a0;
  --linha: rgb(246 236 221 / 0.14);
  --linha-forte: rgb(246 236 221 / 0.36);
  --destaque: #f0b662;
  --botao-fundo: #f3e7d3;
  --botao-fundo-ativo: #fff6e6;
  --botao-texto: #1a1008;
  --vidro: rgb(18 11 8 / 0.6);
  --janela: #140d0a;
  --sombra: 0 2px 6px rgb(0 0 0 / 0.4), 0 28px 70px -24px rgb(0 0 0 / 0.85);
  --selecao: rgb(240 182 98 / 0.32);
  --peso-corpo: 350;
  /* unidade do topo: a tela de 1440 por 900 é a referência, tudo cresce e encolhe junto */
  --u: min(calc(100vw / 1440), calc(100vh / 900));
  --vai-e-vem: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  background: var(--fundo);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--linha-forte) transparent;
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}
html.lenis { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: var(--t-corpo);
  font-weight: var(--peso-corpo);
  line-height: 1.55;
  caret-color: var(--destaque);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--selecao); color: var(--texto); }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }

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

.pular {
  position: fixed; left: var(--margem); top: var(--e-3); z-index: 40;
  padding: var(--e-3) var(--e-4); border-radius: 999px;
  background: var(--botao-fundo); color: var(--botao-texto);
  font-weight: 500; text-decoration: none;
  transform: translateY(-200%);
}
.pular:focus { transform: none; }

/* ---------- cena ---------- */

#cena { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }

/* véu: uma faixa no topo, para o menu ler quando os pontos passam por trás dele */
.veu {
  position: fixed; inset: 0 0 auto 0; height: 7rem; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--fundo-rgb) / 0.82) 0, rgb(var(--fundo-rgb) / 0) 100%);
}

/* barra de leitura no alto: cresce com a rolagem */
.progresso {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 30;
  background: var(--destaque);
  transform: scaleX(0); transform-origin: 0 50%;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes cresce { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    .progresso { animation: cresce auto linear; animation-timeline: scroll(root); }
  }
}

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

.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: var(--e-6);
  padding: var(--e-4) max(var(--margem), env(safe-area-inset-right)) var(--e-4) max(var(--margem), env(safe-area-inset-left));
  padding-top: max(var(--e-4), env(safe-area-inset-top));
}

/* faixa escura atrás do topo: o texto que rola some antes de passar por baixo da marca e do botão */
.topo::before {
  content: ""; position: absolute; inset: 0 0 -1.75rem 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--fundo-rgb) / 0.96) 0, rgb(var(--fundo-rgb) / 0.86) 58%, rgb(var(--fundo-rgb) / 0) 100%);
}

.marca { display: inline-flex; align-items: center; gap: var(--e-3); margin-right: auto; padding: var(--e-2) 0; text-decoration: none; white-space: nowrap; }
.marca-sinal { width: 1.75rem; height: 1.75rem; flex: none; fill: none; stroke: var(--destaque); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.marca-sinal circle { fill: var(--destaque); stroke: none; }
.marca-nome { font-family: var(--serifa); font-size: 1.5rem; line-height: 1; letter-spacing: -0.01em; }
.marca-nome span { font-family: var(--sans); font-size: var(--t-mini); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; margin-left: 0.2em; color: var(--texto-suave); }

.menu { display: flex; gap: clamp(1rem, 2.4vw, 2.5rem); }
.menu a {
  position: relative;
  font-size: var(--t-miudo); font-weight: 400;
  text-decoration: none; white-space: nowrap;
  padding: var(--e-3) 0;
}
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--desliza) var(--saida);
}
.menu a:hover::after, .menu a:focus-visible::after, .menu a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- botões ---------- */

.botao {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 var(--e-5); border-radius: 999px;
  background: var(--botao-fundo); color: var(--botao-texto);
  font-size: 1rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  /* uma faixa de luz atravessa o botão ao passar o mouse */
  background-image: linear-gradient(115deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 0.7) 50%, rgb(255 255 255 / 0) 70%);
  background-size: 260% 100%; background-position: 135% 0; background-repeat: no-repeat;
  transition: background-color var(--toque) ease, background-position 0.65s ease, transform var(--desliza) var(--saida);
}
.botao:hover { background-color: var(--botao-fundo-ativo); background-position: -35% 0; }
.botao:active { transform: scale(0.96); transition-duration: var(--toque); }
.botao.contorno {
  min-height: 2.75rem; padding: 0 var(--e-4);
  background-color: rgb(var(--fundo-rgb) / 0.35); background-image: none; color: var(--texto);
  box-shadow: inset 0 0 0 1px var(--linha-forte);
  font-size: var(--t-miudo);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.botao.contorno:hover { background-color: var(--texto); color: var(--fundo); }

.controle {
  appearance: none; cursor: pointer; position: relative;
  width: 2.75rem; height: 2.75rem; flex: none; padding: 0;
  border: 0; border-radius: 999px;
  background: var(--vidro); color: var(--texto-suave);
  box-shadow: inset 0 0 0 1px var(--linha);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: color var(--toque) ease, transform var(--toque) ease;
}
.controle:hover { color: var(--texto); }
.controle:active { transform: scale(0.96); }
.controle svg {
  position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity var(--desliza) cubic-bezier(0.2, 0, 0, 1), transform var(--desliza) cubic-bezier(0.2, 0, 0, 1), filter var(--desliza) cubic-bezier(0.2, 0, 0, 1);
}
.controle .icone-toca { fill: currentColor; stroke-width: 1; }
.controle[aria-pressed="false"] .icone-toca, .controle[aria-pressed="true"] .icone-pausa { opacity: 0; transform: scale(0.25); filter: blur(4px); }

/* pausa do movimento: no pé da página, fora de cima do filme e do caminho da leitura */
body { position: relative; }
.controles { position: absolute; right: max(var(--e-4), env(safe-area-inset-right)); bottom: max(var(--e-4), env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: var(--e-2); }

/* ---------- trilha: onde a pessoa está na página ---------- */

.trilha {
  position: fixed; right: max(var(--e-4), env(safe-area-inset-right)); top: 50%; z-index: 20;
  display: none; flex-direction: column; align-items: flex-end;
  transform: translateY(-50%);
}
.trilha a {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--e-3);
  min-height: 1.75rem; padding-left: var(--e-4);
  font-size: var(--t-mini); letter-spacing: 0.02em; color: var(--texto-suave);
  text-decoration: none; white-space: nowrap;
}
.trilha span { opacity: 0; transform: translateX(6px); transition: opacity var(--desliza) ease, transform var(--desliza) var(--saida); }
.trilha i { width: 0.875rem; height: 1px; background: var(--linha-forte); transform-origin: 100% 50%; transition: transform var(--desliza) var(--saida), background-color var(--toque) ease; }
/* o nome só aparece ao passar o mouse ou focar: na parte atual basta o traço dourado */
.trilha a:hover span, .trilha a:focus-visible span { opacity: 1; transform: none; }
.trilha a[aria-current="true"] { color: var(--texto); }
.trilha a[aria-current="true"] i { transform: scaleX(2.2); background: var(--destaque); }
@media (min-width: 1180px) and (min-height: 620px) { .trilha { display: flex; } }

/* ---------- partes ----------
   Cada parte reserva um espaço grande (.palco) para o objeto de pontos; o texto é a legenda dele. */

main { position: relative; z-index: 3; }

.parte {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
  padding: 5.5rem max(var(--margem), env(safe-area-inset-right)) var(--e-7) max(var(--margem), env(safe-area-inset-left));
}

.palco { grid-column: 6 / -1; grid-row: 1; height: 84vh; height: 84svh; min-height: 22rem; pointer-events: none; }
.texto { grid-column: 1 / span 5; grid-row: 1; }
.parte.inverte .palco { grid-column: 1 / span 7; }
.parte.inverte .texto { grid-column: 8 / -1; }

h1, h2 { margin: 0; font-family: var(--serifa); font-weight: 400; letter-spacing: -0.018em; text-wrap: balance; }
h2 { font-size: var(--t-titulo); line-height: 1.02; }

p { margin: 0; max-width: 34em; color: var(--texto-suave); text-wrap: pretty; }
h2 + p { margin-top: var(--e-5); }
p + p { margin-top: 1em; }

/* links dentro do texto (nomes dos fundadores): sublinhado fino que some ao passar o mouse */
.texto p a { color: var(--texto); text-decoration-color: var(--linha-forte); transition: text-decoration-color var(--toque) ease, color var(--toque) ease; }
.texto p a:hover, .texto p a:focus-visible { color: var(--destaque); text-decoration-color: currentColor; }

/* fatos: três linhas curtas sob cada serviço, separadas por fio */
.fatos { list-style: none; margin: var(--e-6) 0 0; padding: 0; max-width: 30rem; border-bottom: 1px solid var(--linha); }
.fatos li { padding: var(--e-3) 0; border-top: 1px solid var(--linha); font-size: var(--t-miudo); color: var(--texto); }

/* ---------- topo: o filme do bastão, o título por cima ----------
   O título usa mistura por diferença: as letras ficam creme sobre o escuro e viram escuras sobre o ouro. */

.abre {
  position: relative; z-index: 0;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto auto auto;
  padding: 6rem max(var(--margem), env(safe-area-inset-right)) clamp(3.75rem, 8.5vh, 5.25rem) max(var(--margem), env(safe-area-inset-left));
  /* clip, e não hidden: assim a animação ligada à rolagem do filme enxerga a rolagem da página */
  overflow: clip;
}
/* a imagem parada é o primeiro quadro do filme: quando o filme entra por cima, nada pula */
.abre-filme { position: absolute; inset: 0; z-index: -2; background: var(--fundo) url("../video/bastao-poster.webp") 50% 50% / cover no-repeat; }
.abre-filme video, .abre-filme canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* a sombra fica no topo, por cima do filme e também dos pontos de luz que tomam o lugar dele ao rolar:
   atrás do título o fundo escurece nos dois casos */
.abre::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* a sombra abre de novo antes do fim do topo: assim o fio de luz que desce para a parte seguinte não aparece
     cortado numa linha */
  background: linear-gradient(180deg, rgb(var(--fundo-rgb) / 0) 0, rgb(var(--fundo-rgb) / 0) 64%, rgb(var(--fundo-rgb) / 0.8) 82%, rgb(var(--fundo-rgb)) 90%, rgb(var(--fundo-rgb)) 97.5%, rgb(var(--fundo-rgb) / 0) 100%);
}
/* tela larga: o filme começa um pouco abaixo do alto da tela, para a cabeça da serpente (onde o olho acende)
   ficar abaixo do menu; a borda de cima do filme se desfaz no fundo da página */
@media (min-width: 901px) {
  .abre-filme { top: 11%; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 5%); mask-image: linear-gradient(180deg, transparent 0, #000 5%); }
  .abre::before { top: 11%; }
}

.abre .titulo {
  grid-row: 2;
  font-size: clamp(3rem, calc(98 * var(--u)), 7.5rem); line-height: 0.98; letter-spacing: -0.03em;
  color: var(--texto); mix-blend-mode: difference;
}
.titulo em { font-style: italic; color: var(--destaque); }
.ln { display: block; }
/* cada palavra tem a sua máscara: sobe de trás dela na entrada */
.pal { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.05em 0.24em; margin: -0.1em -0.05em -0.24em; }
.pal > span { display: inline-block; }
.titulo em .pal { padding-right: 0.12em; margin-right: -0.12em; }

.fio { grid-row: 3; height: 1px; margin: clamp(1.25rem, 3.4vh, 2.25rem) 0 clamp(1rem, 2.6vh, 1.75rem); background: var(--linha-forte); transform-origin: 0 50%; }

.abre-base { grid-row: 4; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e-5) clamp(1.5rem, 4vw, 4.5rem); align-items: end; }
.apoio { font-size: var(--t-apoio); line-height: 1.45; max-width: 26em; color: var(--texto); }
.acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--e-3) clamp(1.5rem, 3vw, 3rem); }

/* atalho: um caminho curto para a prova (os trabalhos), com a sua seta */
.atalho { display: inline-flex; align-items: center; gap: var(--e-3); min-height: 2.75rem; font-size: 1rem; text-decoration: none; white-space: nowrap; }
.atalho .seta { flex: none; width: 1.75rem; height: 1.75rem; padding: 0.375rem; border-radius: 0.5rem; box-shadow: inset 0 0 0 1px var(--linha-forte); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--desliza) var(--saida), background-color var(--toque) ease, color var(--toque) ease; }
.atalho:hover .seta, .atalho:focus-visible .seta { background: var(--texto); color: var(--fundo); transform: translate(2px, -2px); }
.atalho:active { opacity: 0.7; }
.texto .atalho { margin-top: var(--e-5); }

/* ao rolar para fora do topo, o filme dá lugar aos pontos de luz do bastão (quem faz a troca é a cena, em js/cena.js) */

/* cortina de entrada: a marca se desenha e a cortina recolhe para baixo */
.cortina { display: none; position: fixed; inset: 0; z-index: 60; place-items: center; background: #050302; }
.intro .cortina { display: grid; }
.cortina .marca-sinal { width: 3.25rem; height: 3.25rem; }
.cortina path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: desenha 0.85s var(--vai-e-vem) 0.1s forwards; }
.cortina circle { opacity: 0; animation: acende 0.35s ease 0.6s forwards; }
@keyframes desenha { to { stroke-dashoffset: 0; } }
@keyframes acende { to { opacity: 1; } }

/* antes da entrada: palavras escondidas atrás da máscara, o resto apagado, o fio recolhido */
.intro .abre .pal > span { transform: translateY(112%); }
.intro .surge { opacity: 0; transform: translateY(14px); }
.intro .abre .fio { transform: scaleX(0); }

/* grão fino por cima de tudo, como em filme */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 44; pointer-events: none; opacity: 0.055; filter: invert(1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.7 0 0 0 -.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* entrada do texto das outras partes: o título sobe de trás de uma máscara, o resto vem atrás.
   Só vale com script ligado (classe .js); sem script o texto já está no lugar. */
@media (prefers-reduced-motion: no-preference) {
  .js .revela h2 .pal > span { transform: translateY(112%); transition: transform var(--entra) var(--saida); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .revela > p, .js .revela .fatos li, .js .revela .ficha > div, .js .revela .demo, .js .revela .botao, .js .revela .nota, .js .revela .atalho {
    opacity: 0; transform: translateY(0.75rem);
    transition: opacity var(--entra) ease, transform var(--entra) var(--saida);
  }
  .js .revela > p { transition-delay: 0.1s; }
  .js .revela > p + p { transition-delay: 0.17s; }
  .js .revela .fatos li:nth-child(1) { transition-delay: 0.2s; }
  .js .revela .fatos li:nth-child(2) { transition-delay: 0.27s; }
  .js .revela .fatos li:nth-child(3) { transition-delay: 0.34s; }
  .js .revela .botao { transition-delay: 0.2s; }
  .js .revela .atalho { transition-delay: 0.41s; }
  .js .revela .ficha > div:nth-child(1) { transition-delay: 0.2s; }
  .js .revela .ficha > div:nth-child(2) { transition-delay: 0.26s; }
  .js .revela .ficha > div:nth-child(3) { transition-delay: 0.32s; }
  .js .revela .ficha > div:nth-child(4) { transition-delay: 0.38s; }
  .js .revela .ficha > div:nth-child(5) { transition-delay: 0.44s; }
  .js .revela .demo { transition-delay: 0.24s; }
  .js .revela .nota { transition-delay: 0.27s; }
  .js .revela.visto h2 .pal > span { transform: none; }
  .js .revela.visto > p, .js .revela.visto .fatos li, .js .revela.visto .ficha > div, .js .revela.visto .demo, .js .revela.visto .botao, .js .revela.visto .nota, .js .revela.visto .atalho { opacity: 1; transform: none; }
}

/* faixa com os nomes dos trabalhos: letras enormes, uma cheia e uma só de contorno, passando devagar */
.faixa { overflow: hidden; margin-bottom: var(--e-7); padding: var(--e-3) 0; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); }
.faixa-trilho { display: flex; width: max-content; white-space: nowrap; font-family: var(--serifa); font-size: clamp(3.25rem, 9.5vw, 8.5rem); line-height: 1; letter-spacing: -0.02em; will-change: transform; }
.faixa-trilho span { display: inline-flex; align-items: center; padding-right: 0.32em; }
.faixa-trilho span::after { content: ""; flex: none; width: 0.1em; height: 0.1em; margin-left: 0.32em; border-radius: 50%; background: var(--destaque); }
.faixa-trilho span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgb(246 236 221 / 0.72); }

/* trabalhos: as telas reais num arco; o anel de pontos fica por trás */

.conta { color: var(--destaque); font-variant-numeric: tabular-nums; }

.parte.trabalhos { display: block; padding-left: 0; padding-right: 0; padding-top: 7rem; }
.trabalhos .cabeca { padding: 0 max(var(--margem), env(safe-area-inset-right)) 0 max(var(--margem), env(safe-area-inset-left)); max-width: 60rem; }
.trabalhos .palco { position: absolute; left: 0; right: 0; top: 71%; height: 26%; min-height: 0; }

.vitrine { position: relative; margin-top: var(--e-6); }
.trilho {
  list-style: none; margin: 0; display: flex; gap: clamp(1rem, 3vw, 2.5rem);
  padding: var(--e-6) calc(50% - var(--obra) / 2) var(--e-5);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  perspective: 1500px;
}
.trilho::-webkit-scrollbar { display: none; }
.obra { flex: 0 0 var(--obra); scroll-snap-align: center; }
.obra > * { display: block; text-decoration: none; transform-origin: 50% 60%; }

.janela {
  display: block; overflow: hidden; border-radius: 14px;
  background: var(--janela);
  box-shadow: inset 0 0 0 1px var(--linha), var(--sombra);
  isolation: isolate;
}
.janela-barra { display: flex; align-items: center; gap: 0.375rem; padding: 0.625rem var(--e-3); border-bottom: 1px solid var(--linha); }
.janela-barra i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--linha-forte); }
.janela-barra b { margin-left: var(--e-3); font-size: var(--t-mini); font-weight: 400; color: var(--texto-suave); letter-spacing: 0.01em; }
.janela img { width: 100%; aspect-ratio: 1200 / 750; object-fit: cover; }
.sem-tela-texto { display: grid; place-items: center; aspect-ratio: 1200 / 750; padding: var(--e-6); text-align: center; font-family: var(--serifa); font-size: clamp(1.25rem, 0.9rem + 1.6vw, 2rem); line-height: 1.32; color: var(--texto-suave); text-wrap: balance; }

.obra-legenda { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e-4); padding: var(--e-4) var(--e-1) 0; }
.obra-legenda .nome { font-family: var(--serifa); font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); line-height: 1.1; }
.obra-legenda .tipo { font-size: var(--t-miudo); color: var(--texto-suave); text-align: right; }
.obra a .janela { transition: transform var(--desliza) var(--saida); }
.obra a:hover .janela { transform: translateY(-4px); }

/* cada tela encolhe e vira de lado ao sair do centro: o conjunto lê como um arco */
@keyframes arco {
  0% { transform: rotateY(34deg) translateZ(-220px) scale(0.86); opacity: 0.35; }
  50% { transform: none; opacity: 1; }
  100% { transform: rotateY(-34deg) translateZ(-220px) scale(0.86); opacity: 0.35; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .obra > * { animation: arco auto linear both; animation-timeline: view(inline); }
  }
}

.vitrine-comandos { display: flex; align-items: center; justify-content: center; gap: var(--e-5); margin-top: var(--e-2); }
.vitrine-conta { margin: 0; min-width: 4.5rem; text-align: center; font-size: var(--t-miudo); font-variant-numeric: tabular-nums; color: var(--texto-suave); }


/* ---------- registros do laboratório (v5) ---------- */

h2.menor { font-size: clamp(2rem, 1.25rem + 2.4vw, 3.5rem); }

/* ficha: os dados do sistema, um por linha, nome à esquerda e valor à direita */
.ficha { margin: var(--e-6) 0 0; max-width: 32rem; border-bottom: 1px solid var(--linha); }
.ficha > div { display: grid; grid-template-columns: 8.75rem minmax(0, 1fr); column-gap: var(--e-4); align-items: baseline; padding: var(--e-3) 0; border-top: 1px solid var(--linha); }
.ficha dt { font-size: var(--t-mini); letter-spacing: 0.12em; text-transform: uppercase; color: var(--texto-suave); }
.ficha dd { margin: 0; font-size: var(--t-miudo); color: var(--texto); text-wrap: pretty; }
.ficha a { display: inline-block; margin: calc(-1 * var(--e-3)) 0; padding: var(--e-3) 0; text-decoration-color: var(--linha-forte); transition: text-decoration-color var(--toque) ease; }
.ficha a:hover { text-decoration-color: currentColor; }
.ficha a:active { opacity: 0.7; }

/* texto só para leitor de tela */
.so-leitor { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* demonstração: o Galenus raciocinando um caso, numa janela */
.demo { margin: var(--e-6) 0 0; max-width: 34rem; }
.demo-corpo { padding: var(--e-5); }
/* alturas reservadas: cada trecho que muda de um caso para outro divide a mesma célula com cópias invisíveis
   dos outros casos (postas pelo script). A célula fica sempre com a altura do maior: a página não dá salto. */
.demo-pilha { display: grid; }
.demo-pilha > * { grid-area: 1 / 1; min-width: 0; }
.demo .fantasma { visibility: hidden; pointer-events: none; }
.demo-caso { min-height: 3.1em; max-width: none; font-size: 1rem; line-height: 1.55; color: var(--texto); }
.demo-cursor { display: inline-block; width: 1px; height: 1.1em; margin-left: 2px; vertical-align: -0.18em; background: var(--destaque); animation: pisca 1s steps(2, jump-none) infinite; }
.demo-cursor[hidden] { display: none; }
[data-movimento="parado"] .demo-cursor { animation-play-state: paused; }
@keyframes pisca { 50% { opacity: 0; } }
.demo-area { margin-top: var(--e-4); font-size: var(--t-mini); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--destaque); }
.demo-passos { list-style: none; margin: var(--e-3) 0 0; padding: 0; }
.demo-passos > li { position: relative; padding: var(--e-1) 0 var(--e-1) 1.75rem; font-size: var(--t-miudo); color: var(--texto-suave); opacity: 0.7; transition: opacity var(--desliza) ease, color var(--desliza) ease; }
.demo-passos > li::before { content: ""; position: absolute; left: 0; top: 0.5rem; width: 0.875rem; height: 0.875rem; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--linha-forte); transition: background-color var(--desliza) ease, box-shadow var(--desliza) ease; }
.demo-passos > li::after { content: ""; position: absolute; left: 0.25rem; top: 0.75rem; width: 0.38rem; height: 0.2rem; border-left: 1.5px solid var(--fundo); border-bottom: 1.5px solid var(--fundo); opacity: 0; transform: rotate(-45deg) scale(0.25); filter: blur(4px); transition: opacity var(--desliza) cubic-bezier(0.2, 0, 0, 1), transform var(--desliza) cubic-bezier(0.2, 0, 0, 1), filter var(--desliza) cubic-bezier(0.2, 0, 0, 1); }
.demo-passos > li.agora, .demo-passos > li.feito { opacity: 1; color: var(--texto); }
/* passo em andamento: aro âmbar com um ponto cheio no meio */
.demo-passos > li.agora::before { padding: 0.25rem; box-shadow: inset 0 0 0 1px var(--destaque); background: var(--destaque) content-box; }
.demo-passos > li.feito::before { background: var(--destaque); box-shadow: none; }
.demo-passos > li.feito::after { opacity: 1; transform: rotate(-45deg) scale(1); filter: blur(0); }
.demo-hipoteses { list-style: none; display: flex; flex-wrap: wrap; gap: var(--e-2); margin: var(--e-2) 0 var(--e-1); padding: 0; min-height: 1.75rem; }
.demo-hipoteses li { padding: var(--e-1) var(--e-3); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--linha-forte); font-size: var(--t-mini); line-height: 1.5; color: var(--texto); opacity: 0; transform: translateY(4px); transition: opacity var(--desliza) ease, transform var(--desliza) var(--saida); }
.demo-hipoteses li.visto { opacity: 1; transform: none; }
.demo-conduta { margin-top: var(--e-4); padding-top: var(--e-4); border-top: 1px solid var(--linha); min-height: 3.9em; max-width: none; font-family: var(--serifa); font-size: var(--t-apoio); line-height: 1.3; color: var(--texto); opacity: 0; transform: translateY(6px); transition: opacity var(--desliza) ease, transform var(--desliza) var(--saida); }
.demo-conduta.visto { opacity: 1; transform: none; }

/* fecho: o bastão em cima, quem faz embaixo */

.fecho { grid-template-rows: auto auto; row-gap: var(--e-5); padding-top: 6rem; }
.fecho .palco { grid-column: 1 / -1; grid-row: 1; height: 54vh; height: 54svh; }
.fecho .texto { grid-column: 2 / span 10; grid-row: 2; text-align: center; }
.fecho .texto p { margin-inline: auto; }
.fecho .botao { margin-top: var(--e-6); }
.nota { margin-top: var(--e-4); font-size: var(--t-miudo); }

/* rodapé */

.rodape {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1fr auto; gap: var(--e-6) var(--e-7); align-items: start;
  padding: var(--e-7) max(var(--margem), env(safe-area-inset-right)) calc(var(--e-7) + 3rem) max(var(--margem), env(safe-area-inset-left));
  border-top: 1px solid var(--linha);
  background: rgb(var(--fundo-rgb) / 0.86);
}
.rodape-marca p { margin-top: var(--e-3); font-size: var(--t-miudo); max-width: 22rem; }
.rodape-marca .marca-nome { font-size: 2rem; }
.rodape-menu { display: grid; grid-template-columns: repeat(2, auto); gap: 0 var(--e-7); }
.rodape-menu a, .rodape-fim a { font-size: var(--t-miudo); text-decoration: none; padding: var(--e-2) 0; display: inline-block; }
.rodape-menu a:hover, .rodape-fim a:hover { text-decoration: underline; }
.rodape-fim { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--e-4); max-width: none; padding-top: var(--e-5); border-top: 1px solid var(--linha); font-size: var(--t-miudo); }

/* ---------- telas estreitas: objeto em cima, texto embaixo ---------- */

@media (max-width: 900px) {
  /* o fio de luz corre na margem direita: o texto deixa uma faixa livre para ele */
  :root { --pista-do-fio: 1.125rem; }
  .parte, .parte.inverte { display: flex; flex-direction: column; align-items: stretch; padding-top: 5.25rem; padding-bottom: var(--e-6); padding-right: calc(max(var(--margem), env(safe-area-inset-right)) + var(--pista-do-fio)); }
  .abre { padding-right: calc(max(var(--margem), env(safe-area-inset-right)) + var(--pista-do-fio)); }
  .trabalhos .cabeca { padding-right: calc(max(var(--margem), env(safe-area-inset-right)) + var(--pista-do-fio)); }
  .palco { order: 0; height: 54vh; height: 54svh; }
  .texto { order: 1; margin-top: var(--e-3); }

  /* no celular a entrada do texto é curta e quase sem escalonamento: quem rola lê, não espera a animação */
  :root { --entra: 460ms; }
  .js .revela > p, .js .revela > p + p, .js .revela .fatos li:nth-child(n), .js .revela .ficha > div:nth-child(n), .js .revela .demo, .js .revela .botao, .js .revela .nota, .js .revela .atalho { transition-delay: 0.04s; }
  .js .revela h2 .pal > span { transition-delay: calc(var(--i, 0) * 28ms); }

  /* topo no celular: o filme ocupa a parte de cima da tela e o título começa sobre o pé dele */
  /* o texto fica preso ao pé da tela: em tela alta sobra mais filme à vista, em tela baixa o topo cresce */
  .abre { display: flex; flex-direction: column; justify-content: flex-end; padding-top: 30vh; padding-top: 30svh; padding-bottom: var(--e-6); }
  .abre-filme { inset: 0 0 auto 0; height: 76vh; height: 76svh; }
  /* no celular o filme é uma sequência de imagens quadradas, já recortadas em volta do bastão.
     O quadrado aparece inteiro, apoiado no pé da caixa: assim a cabeça da serpente fica abaixo do cabeçalho. */
  .abre-filme { background-image: url("../video/quadros/q-001.webp"); background-size: contain; background-position: 50% 100%; }
  .abre-filme canvas { object-fit: contain; object-position: 50% 100%; }
  /* só o pé do filme, atrás do título, escurece. O escuro fecha antes do fim da caixa, para a borda de baixo
     do filme não aparecer como uma linha. */
  /* uma faixa escura só atrás do título, onde ficam as voltas de baixo do bastão; ela abre de novo logo depois,
     para o fio de luz da margem aparecer ao lado do texto */
  .abre::before { inset: 0 0 auto 0; height: 88vh; height: 88svh; background: linear-gradient(180deg, rgb(var(--fundo-rgb) / 0) 0, rgb(var(--fundo-rgb) / 0) 47%, rgb(var(--fundo-rgb) / 0.72) 59%, rgb(var(--fundo-rgb)) 71%, rgb(var(--fundo-rgb)) 86%, rgb(var(--fundo-rgb) / 0) 100%); }
  /* no celular o topo leva pouco texto: título menor e uma frase só, para o bastão não sumir atrás das letras */
  .abre .titulo { font-size: clamp(2.3rem, 9.6vw, 3.75rem); }
  .abre .so-largo { display: none; }
  .fio { margin: var(--e-5) 0 var(--e-4); }
  .abre-base { display: flex; flex-direction: column; align-items: stretch; gap: var(--e-5); }
  .abre .acoes { justify-content: flex-start; }

  /* no celular o botão de pausa não fica por cima da leitura: vai para o fim da página */

  .parte.trabalhos { display: block; padding-top: 6rem; }
  .trabalhos .palco { top: 58%; height: 22%; }
  .obra-legenda { flex-direction: column; gap: var(--e-1); }
  .obra-legenda .tipo { text-align: left; }

  .fecho .palco { height: 50vh; height: 50svh; }
  .rodape { grid-template-columns: 1fr; }
  .rodape-fim { flex-direction: column; gap: var(--e-2); }
  .demo-corpo { padding: var(--e-4); }
}

@media (max-width: 760px) {
  .menu { display: none; }
}

@media (max-width: 640px) {
  .topo { gap: var(--e-3); }
  .marca-nome { font-size: 1.375rem; }
  .abre .botao { width: 100%; }
  .fecho .botao { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .demo-cursor { display: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
