/* ==========================================================================
   O Brasil que aprende conectado: exposição fotográfica virtual da EACE

   Três telas que se revezam (body[data-tela]):
     abertura  título, conceito e os números (escolas e estudantes)
     temas     o biombo com os seis capítulos
     historia  o capítulo em tela cheia, uma foto por vez (formato stories)

   Paleta e fontes seguem o Design System EACE. O palco é escuro de propósito:
   são fotografias, e o fundo escuro faz a imagem saltar, como numa galeria.
   ========================================================================== */

@font-face { font-family: 'Graphik'; src: url('/fontes/graphik-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Graphik'; src: url('/fontes/graphik-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Graphik'; src: url('/fontes/graphik-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Lucida Fax'; src: url('/fontes/lucida-fax.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sky Script'; src: url('/fontes/sky-script.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --noite: #0a1118;          /* palco */
  --noite-2: #0f1922;        /* folhas e painéis por cima do palco */
  --tinta: #f3efe6;          /* texto */
  --tinta-2: rgba(243, 239, 230, .7);
  --tinta-3: rgba(243, 239, 230, .48);
  --fio: rgba(243, 239, 230, .16);
  --luz: #ffe900;            /* Electric Yellow: destaque e chamada principal */
  --azul: #0299de;           /* Ocean Blue: compartilhar */
  --verde: #00b44f;          /* Emerald Green: confirmação */

  --serifa: 'Lucida Fax', 'Lora', Georgia, serif;
  --sans: 'Graphik', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --manuscrita: 'Sky Script', 'Dancing Script', cursive;

  --topo-seguro: max(12px, env(safe-area-inset-top));
  --base-segura: max(18px, env(safe-area-inset-bottom));
  --suave: cubic-bezier(.2, .8, .2, 1);
  --vh: 100vh;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--noite);
  color: var(--tinta);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }

:focus-visible { outline: 2px solid var(--luz); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

.visualmente-oculto {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sem-js { position: fixed; inset: auto 20px 20px; padding: 1rem; background: var(--noite-2); border-radius: 12px; }

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

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 52px; padding: .9rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem/1.1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--suave), background-color .2s, border-color .2s, opacity .2s;
}
.botao:active { transform: scale(.97); }
.botao svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.botao-luz { background: var(--luz); color: #111; }
.botao-luz:hover { background: #fff27a; }
.botao-azul { background: var(--azul); color: #fff; }
.botao-azul:hover { background: #18a9ea; }
.botao-linha { background: transparent; border-color: rgba(243, 239, 230, .3); color: var(--tinta); }
.botao-linha:hover { border-color: rgba(243, 239, 230, .6); }
.botao-vidro {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  min-height: 42px; padding: .6rem 1.05rem; font-size: .875rem; font-weight: 500;
}
.botao-vidro:hover { background: rgba(255, 255, 255, .18); }

.botao-icone {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: transparent; border: 0; color: #fff; cursor: pointer;
}
.botao-icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.botao-icone.vidro { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.botao-icone.vidro:hover { background: rgba(255, 255, 255, .2); }

.marca-eace { fill: currentColor; display: block; }

/* ------------------------------------------------------------------- telas -- */
/* Só uma tela aparece por vez, e quem decide é um atributo só, no <body>.
   Nenhuma outra regra pode mexer no display das telas. */

.tela { display: none; position: fixed; inset: 0; overflow: hidden; }
body[data-tela="abertura"] #tela-abertura,
body[data-tela="temas"] #tela-temas,
body[data-tela="historia"] #tela-historia { display: block; }

.entrando { animation: entrar .5s var(--suave) both; }
@keyframes entrar { from { opacity: 0; } to { opacity: 1; } }

/* ================================================================ abertura == */

#tela-abertura { background: var(--noite); }
.ab-fundo { position: absolute; inset: 0; }
.ab-fundo img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  opacity: 0; transition: opacity 1.8s ease;
}
.ab-fundo img.ativa { opacity: 1; animation: aproximar 9s linear both; }
@keyframes aproximar { from { transform: scale(1.12); } to { transform: scale(1.0); } }
.ab-veu {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 17, 24, .6) 0%, rgba(10, 17, 24, 0) 26%, rgba(10, 17, 24, .3) 46%, rgba(10, 17, 24, .97) 76%);
}
.ab-topo {
  position: absolute; top: var(--topo-seguro); left: 22px; right: 22px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; padding-top: 14px;
}
.ab-topo .marca-eace { width: 58px; height: auto; color: #fff; opacity: .95; }
.ab-topo .marca-ac { height: 34px; width: auto; }

.ab-texto { position: absolute; left: 22px; right: 22px; bottom: var(--base-segura); z-index: 2; padding-bottom: 12px; max-width: 560px; }
.ab-tipo { font-size: .875rem; color: var(--tinta-2); }
.ab-titulo { font: 400 clamp(2.15rem, 9.6vw, 2.7rem)/1.06 var(--serifa); margin: .5rem 0 .9rem; letter-spacing: -.005em; text-wrap: balance; }
.ab-conceito { font-size: 1rem; color: var(--tinta); }
.ab-conceito em {
  display: block; font: 400 2.15rem/1.05 var(--manuscrita); color: var(--luz); margin-top: .2rem;
}
/* os números da abertura, lado a lado, separados por um fio */
.ab-marcos {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 1.3rem 0 1.4rem; padding-top: 1.05rem;
  border-top: 1px solid var(--fio);
}
.ab-marco { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ab-marco + .ab-marco { padding-left: 14px; margin-left: 14px; border-left: 1px solid var(--fio); }
/* acompanha a largura: em celular de 360 px, "+3 milhões" encostava na borda */
.ab-marco strong { font: 400 clamp(1.25rem, 6vw, 1.6rem)/1 var(--serifa); color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-marco span { font-size: .85rem; line-height: 1.3; color: var(--tinta-2); }
#ab-entrar { width: 100%; }

/* =================================================================== temas == */

#tela-temas { background: radial-gradient(ellipse 90% 60% at 50% 38%, #142231 0%, var(--noite) 70%); }
.tm-topo {
  position: absolute; top: var(--topo-seguro); left: 22px; right: 22px; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-start; padding-top: 16px;
}
/* O título fica numa linha só: a fonte acompanha a largura da tela. A frase
   mede 13,9 em na Lucida Fax; o divisor 14,2 deixa uma folga. Se o texto
   mudar, refaça a conta (ou volte a deixar quebrar). */
.tm-titulo { font: 400 min(1.6rem, calc((100vw - 48px) / 14.2))/1.15 var(--serifa); white-space: nowrap; }
.tm-instrucao { font-size: .9rem; color: var(--tinta-2); margin-top: .4rem; }

/* O biombo ocupa o espaço entre o título e a área de baixo, e fica no meio
   dele. A área de baixo já fica reservada para o tema escolhido e o botão,
   para nada pular quando um painel é escolhido. Os painéis têm altura
   máxima: numa tela muito alta virariam tiras. */
.biombo {
  --bb-alto: min(100%, 500px);
  position: absolute; left: 0; right: 0;
  top: calc(var(--topo-seguro) + 100px); bottom: calc(var(--base-segura) + 196px);
  perspective: var(--bb-persp, 1000px); perspective-origin: 50% 40%;
}
.biombo-giro { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.biombo.sobre-painel { cursor: pointer; }
.biombo-chao {
  position: absolute; left: 12%; right: 12%; top: calc(50% + var(--bb-alto) / 2 - 30px); height: 70px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 233, 0, .17), rgba(255, 233, 0, 0) 70%);
  filter: blur(8px);
}
/* As camadas de montagem não recebem clique: num conjunto 3D elas ficam "na
   frente" das partes dobradas para trás e engoliam o toque. Quem recebe é o
   painel, e quem decide qual painel é a posição (ver Biombo no JS). */
.biombo-cadeia {
  position: absolute; top: calc(50% - var(--bb-alto) / 2); height: var(--bb-alto);
  transform-style: preserve-3d; transform-origin: 0 50%; pointer-events: none;
}
.bb-p {
  position: absolute; top: 0; left: 0; height: 100%; width: 40px;   /* a largura certa vem do JS */
  transform-style: preserve-3d; pointer-events: none;
}
.bb-p .bb-p { left: 100%; transform-origin: 0 50%; }
.bb-face {
  position: absolute; inset: 0; display: block; width: 100%; padding: 0; margin: 0; border: 0;
  background-color: #1b2733; background-size: cover; background-repeat: no-repeat;
  color: #fff; cursor: pointer; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  pointer-events: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.bb-face::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .72));
}
.bb-face::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .5s; }
.bb-face.luz::before { background: linear-gradient(90deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 60%); }
.bb-face.sombra::before { background: linear-gradient(90deg, rgba(0, 0, 0, .16), rgba(0, 0, 0, .5)); }
/* com mouse, o painel sob o cursor acende (a classe vem do JS, pela posição); nada muda de lugar */
.bb-face.acesa { box-shadow: inset 0 0 0 2px var(--luz); }
.bb-face.acesa::before { opacity: .3; }
.bb-face:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--luz); }
.bb-face:focus-visible::before { opacity: .3; }
/* o painel escolhido fica marcado e os outros se apagam um pouco */
.bb-face { transition: filter .35s ease; }
.bb-face.escolhida { box-shadow: inset 0 0 0 3px var(--luz); }
.bb-face.escolhida::before { opacity: 0; }
.biombo.com-escolha .bb-face:not(.escolhida) { filter: brightness(.5) saturate(.7); }
.biombo.com-escolha .bb-face.acesa:not(.escolhida) { filter: brightness(.8) saturate(.9); }
.bb-num {
  position: absolute; top: 10px; left: 0; right: 0; z-index: 2; text-align: center;
  font: 400 .85rem/1 var(--serifa); text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.bb-nome {
  position: absolute; bottom: 12px; left: 50%; z-index: 2; white-space: nowrap;
  transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl;
  font: 500 .7rem/1 var(--sans); letter-spacing: .06em; text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}
.bb-brilho {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .2) 50%, transparent 70%);
  background-size: 300% 100%; animation: brilho 7s ease-in-out infinite;
}
@keyframes brilho { 0% { background-position: 120% 0; } 55%, 100% { background-position: -40% 0; } }

/* Embaixo do biombo: a instrução; com mouse sobre um painel, a prévia do
   tema; com um painel escolhido, o tema e o botão "Iniciar visita". O bloco
   tem altura fixa e o conteúdo começa no alto dele, logo abaixo do biombo. */
.tm-info {
  position: absolute; left: 22px; right: 22px; bottom: var(--base-segura); height: 190px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 10px; text-align: center;
}
.tm-num, .tm-cap, .tm-resumo, .tm-iniciar { display: none; }
.tm-info.com-escolha .tm-iniciar { display: inline-flex; width: 100%; margin-top: 14px; }
.tm-info.troca > * { animation: entrar .4s var(--suave) both; }
.tm-info.com-tema .tm-num { display: flex; justify-content: center; gap: .8rem; align-items: baseline; font-size: .875rem; color: var(--tinta-2); }
.tm-info.com-tema .tm-cap { display: block; font: 400 1.6rem/1.15 var(--serifa); margin: .35rem 0 .45rem; color: #fff; }
.tm-info.com-tema .tm-resumo { display: block; font-size: .95rem; line-height: 1.45; color: var(--tinta-2); }
.tm-info.com-tema .tm-dica { display: none; }
.tm-num #tm-num { font: 400 1rem/1 var(--serifa); color: var(--luz); }
.tm-dica { display: inline-flex; align-items: center; gap: .7rem; font-size: .9rem; color: var(--tinta-2); }
.tm-dica::before, .tm-dica::after { content: ''; width: 22px; height: 1px; background: var(--tinta-3); }
/* em celular estreito os fios dos lados faziam a frase quebrar em duas linhas */
@media (max-width: 380px) {
  .tm-dica { font-size: .82rem; }
  .tm-dica::before, .tm-dica::after { display: none; }
}

/* ================================================================ historia == */

#tela-historia { background: #000; }
.hs-cena { position: absolute; inset: 0; perspective: var(--hs-persp, 1200px); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.hs-cubo { position: absolute; inset: 0; transform-style: preserve-3d; }
.hs-face {
  position: absolute; inset: 0; overflow: hidden; background: #000;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
/* escurece a face que gira para longe, como no cubo dos stories */
.hs-sombra { position: absolute; inset: 0; z-index: 50; pointer-events: none; background: #000; opacity: 0; }

.hs-fundo {
  position: absolute; inset: -60px; background-color: var(--cor, #111); background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.2) brightness(.48); transform: scale(1.08);
  transition: background-image .4s;
}

.hs-palco {
  --pad-topo: calc(var(--topo-seguro) + 70px);
  --pad-base: calc(var(--base-segura) + 170px);
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: var(--pad-topo) 0 var(--pad-base);
}
.hs-foto {
  --r: 1.78;
  position: relative; margin: 0; width: min(100%, calc((var(--vh) - var(--pad-topo) - var(--pad-base)) * var(--r)));
  aspect-ratio: var(--r); background: rgba(255, 255, 255, .04);
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .85);
  transform: translateY(var(--sobe, 0)) scale(var(--escala, 1)); transform-origin: 50% 0;
  transition: transform .5s var(--suave), opacity .35s;
}
.hs-foto img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s; transform-origin: 0 0; }
.hs-foto img.pronta { opacity: 1; }
.hs-face.na-intro .hs-foto, .hs-face.no-fim .hs-foto { display: none; }

.hs-intro {
  display: none; position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-46%); max-width: 640px; margin: 0 auto;
}
.hs-face.na-intro .hs-intro { display: block; }
.hs-intro-num { font: 400 5.4rem/.8 var(--serifa); color: transparent; -webkit-text-stroke: 1px rgba(255, 233, 0, .8); }
.hs-intro-titulo { font: 400 2.15rem/1.04 var(--serifa); margin: .9rem 0 .9rem; color: #fff; text-wrap: balance; }
.hs-intro-resumo { font-size: 1rem; line-height: 1.45; color: var(--luz); margin-bottom: .8rem; }
.hs-intro-texto { font-size: .95rem; line-height: 1.62; color: var(--tinta); max-width: 34em; }
.hs-intro-dica { display: flex; align-items: center; gap: .6rem; margin-top: 1.6rem; font-size: .875rem; color: var(--tinta-2); }
.hs-intro-dica i { width: 26px; height: 1px; background: var(--tinta-3); }
.hs-comecar { display: none; margin-top: 1.8rem; }

/* encerramento */
.hs-fim { display: none; position: absolute; inset: 0; }
.hs-face.no-fim .hs-fim { display: block; }
.hs-mural {
  position: absolute; inset: -6%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; opacity: .34;
  transform: rotate(-4deg) scale(1.06); animation: mural 60s linear infinite alternate;
}
.hs-mural i { aspect-ratio: 16 / 10; background-size: cover; background-position: center; border-radius: 2px; }
@keyframes mural { from { transform: rotate(-4deg) scale(1.06) translateY(0); } to { transform: rotate(-4deg) scale(1.06) translateY(-8%); } }
.hs-fim-veu { position: absolute; inset: 0; background: radial-gradient(ellipse 120% 80% at 50% 60%, rgba(10, 17, 24, .55), rgba(10, 17, 24, .96) 70%); }
.hs-fim-texto {
  position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); max-width: 560px; margin: 0 auto; text-align: left;
}
.hs-fim-titulo { font: 400 2.2rem/1.08 var(--serifa); color: #fff; }
.hs-fim-conceito { font: 400 1.9rem/1.05 var(--manuscrita); color: var(--luz); margin: .5rem 0 1.1rem; }
.hs-fim-p { font-size: .975rem; line-height: 1.6; color: var(--tinta); margin-bottom: .8rem; }
.hs-fim-acoes { display: grid; gap: 10px; margin-top: 1.5rem; }
.hs-fim-acoes .linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hs-fim-acoes .linha .botao { padding-left: .7rem; padding-right: .7rem; white-space: nowrap; }

/* topo: barras de progresso, capítulo, pausa e fechar */
.hs-topo {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20; padding: var(--topo-seguro) 10px 26px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
  transition: opacity .3s;
}
.hs-barras { display: flex; gap: 4px; padding: 0 2px; }
.hs-barras i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.hs-barras b { display: block; height: 100%; width: 0; background: #fff; }
.hs-cab { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 10px; }
.hs-cap { display: flex; align-items: baseline; gap: .55rem; padding-left: 6px; font-size: .9rem; font-weight: 500; min-width: 0; }
.hs-cap span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-cap-num { font: 400 1rem/1 var(--serifa); color: var(--luz); }
.hs-cab-acoes { display: flex; gap: 2px; flex-shrink: 0; }
.hs-caps { display: none; }

/* legenda e ações da foto */
.hs-legenda {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 40px 20px var(--base-segura);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .55));
  transition: opacity .3s;
}
.hs-face.na-intro .hs-legenda, .hs-face.no-fim .hs-legenda { display: none; }
.hs-leg-num { font-size: .8rem; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.hs-leg-escola { font-size: 1.02rem; line-height: 1.42; color: #fff; margin: .3rem 0 0; max-width: 40em; text-wrap: pretty; }
.hs-leg-local { font-size: .82rem; color: var(--tinta-2); margin-top: .3rem; }
.hs-leg-local:empty { display: none; }
.hs-leg-acoes { display: flex; gap: 8px; margin-top: 1rem; }

/* setas e miniaturas: à vista só com mouse. No toque as setas continuam lá,
   escondidas, para quem navega com leitor de tela. */
.hs-seta {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; background: none; color: inherit;
}
.hs-tiras { display: none; }

/* quem segura o dedo na foto vê só a foto */
.hs-face.segurando .hs-topo, .hs-face.segurando .hs-legenda { opacity: 0; }

/* zoom: a foto ampliada passa por cima de tudo e a interface sai da frente */
.hs-face.com-zoom .hs-palco { z-index: 30; }
.hs-face.com-zoom .hs-foto { box-shadow: none; }
.hs-face.com-zoom .hs-topo, .hs-face.com-zoom .hs-legenda,
.hs-face.com-zoom .hs-seta, .hs-face.com-zoom .hs-tiras { opacity: 0; pointer-events: none; }
.hs-dica-zoom {
  position: absolute; left: 50%; bottom: calc(var(--base-segura) + 16px); z-index: 40; pointer-events: none;
  transform: translate(-50%, 10px); opacity: 0; transition: opacity .3s, transform .3s var(--suave);
  background: rgba(0, 0, 0, .62); color: #fff; font-size: .85rem; padding: .55rem 1rem; border-radius: 999px; white-space: nowrap;
}
.hs-face.dica-zoom .hs-dica-zoom { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------------- ficha -- */

.ficha {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 70%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--noite-2); border-radius: 22px 22px 0 0; padding: 10px 22px var(--base-segura);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, .5);
  transform: translateY(105%); visibility: hidden;
  transition: transform .45s var(--suave), visibility 0s linear .45s;
}
#tela-historia.ficha-aberta .ficha { transform: none; visibility: visible; transition: transform .45s var(--suave); }
.ficha-pega { display: block; width: 60px; height: 22px; margin: 0 auto 8px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.ficha-pega::before { content: ''; position: absolute; left: 12px; right: 12px; top: 9px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.ficha-fechar { display: none; }
.ficha-cap { font-size: .85rem; color: var(--tinta-2); }
.ficha-cap-num { font-family: var(--serifa); font-size: .95rem; color: var(--luz); margin-right: .45rem; }
.ficha-titulo { font: 400 1.22rem/1.38 var(--serifa); color: #fff; margin: .5rem 0 1.1rem; outline: none; text-wrap: pretty; }
.ficha-dados { display: grid; gap: .95rem; margin: 0 0 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--fio); }
.ficha-dados:empty { display: none; }
.ficha-dados div { min-width: 0; }
.ficha-dados dt { font-size: .78rem; color: var(--tinta-3); margin-bottom: .2rem; }
.ficha-dados dd { margin: 0; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }

/* ---------------------------------------------------- transição para capítulo */

.abrindo { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: none; }
.abrindo.ativo { display: block; }
.abrindo i { position: absolute; inset: 0; background-size: cover; background-position: center; }
.abrindo-borrao { inset: -60px !important; filter: blur(26px) saturate(1.2) brightness(.48); transform: scale(1.08); opacity: 0; }

/* ------------------------------------------------------------------- aviso -- */

.aviso {
  position: fixed; left: 50%; bottom: calc(var(--base-segura) + 12px); z-index: 120; pointer-events: none;
  transform: translate(-50%, 20px); opacity: 0; transition: opacity .25s, transform .25s var(--suave);
  background: var(--verde); color: #06120b; font-weight: 600; font-size: .9rem; padding: .7rem 1.15rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.aviso.visivel { opacity: 1; transform: translate(-50%, 0); }

/* ================================================== telas largas (computador) */

@media (min-width: 900px) and (min-height: 501px) {
  /* abertura: texto à esquerda e as fotos à direita. A foto começa depois da
     coluna de texto: em tela cheia, quem está à esquerda na foto (as crianças
     da ponte, o barco) ficaria escondido atrás do título. */
  .ab-fundo { left: 34%; }
  .ab-fundo img { filter: blur(.6px); }
  .ab-veu {
    background:
      linear-gradient(90deg, var(--noite) 0%, var(--noite) 34%, rgba(10, 17, 24, .55) 44%, rgba(10, 17, 24, .08) 62%, rgba(10, 17, 24, .3) 100%),
      linear-gradient(0deg, rgba(10, 17, 24, .55) 0%, rgba(10, 17, 24, 0) 26%);
  }
  .ab-topo { left: 72px; right: 72px; padding-top: 34px; }
  .ab-topo .marca-eace { width: 76px; }
  .ab-topo .marca-ac { height: 50px; }
  .ab-texto { left: 72px; right: auto; top: 50%; bottom: auto; transform: translateY(-46%); width: 560px; max-width: none; padding: 0; }
  .ab-tipo { font-size: 1rem; }
  .ab-titulo { font-size: 4.4rem; margin: 1rem 0 1.3rem; }
  .ab-conceito { font-size: 1.2rem; }
  .ab-conceito em { font-size: 3.1rem; margin-top: .35rem; }
  .ab-marcos { margin: 2rem 0 2.1rem; max-width: 540px; }
  .ab-marco + .ab-marco { padding-left: 26px; margin-left: 26px; }
  .ab-marco strong { font-size: 2.2rem; }
  .ab-marco span { font-size: .95rem; }
  #ab-entrar { width: auto; min-width: 280px; }

  /* temas: biombo grande no centro */
  .tm-topo { left: 72px; right: 72px; padding-top: 38px; }
  .tm-titulo { font-size: 2.3rem; }
  .tm-instrucao { font-size: 1rem; margin-top: .5rem; }
  .biombo { --bb-alto: min(100%, 560px); top: calc(var(--topo-seguro) + 150px); bottom: 244px; }
  .bb-num { font-size: 1.1rem; top: 14px; }
  .bb-nome { font-size: .78rem; bottom: 16px; }
  .tm-info { left: 50%; right: auto; width: 620px; transform: translateX(-50%); bottom: 30px; height: 206px; }
  .tm-info.com-escolha .tm-iniciar { width: auto; min-width: 260px; margin-top: 18px; }
  .tm-info.com-tema .tm-num { font-size: .95rem; }
  .tm-info.com-tema .tm-cap { font-size: 2.1rem; }
  .tm-info.com-tema .tm-resumo { font-size: 1.02rem; }
  .tm-dica { font-size: 1rem; }

  /* história */
  .hs-palco { --pad-topo: 128px; --pad-base: 232px; transition: right .45s var(--suave); }
  .hs-foto { width: min(100% - 240px, 1080px, calc((var(--vh) - var(--pad-topo) - var(--pad-base)) * var(--r))); }
  .hs-topo { padding: 22px 40px 40px; }
  .hs-cab { margin-top: 14px; }
  .hs-cap { padding-left: 0; font-size: 1rem; }
  .hs-cap-num { font-size: 1.15rem; }
  .hs-caps { display: flex; gap: 4px; position: absolute; left: 50%; transform: translateX(-50%); top: calc(22px + 3px + 14px); }
  .hs-caps button {
    min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
    font: 400 .95rem/1 var(--serifa); color: var(--tinta-3);
  }
  .hs-caps button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  .hs-caps button[aria-current="true"] { color: var(--luz); }
  .hs-legenda {
    left: 50%; right: auto; bottom: 118px; width: min(100% - 240px, 1080px); transform: translateX(-50%);
    padding: 0; background: none; display: grid; grid-template-columns: 1fr auto; column-gap: 24px; align-items: start;
  }
  .hs-leg-num, .hs-leg-escola, .hs-leg-local { grid-column: 1; }
  .hs-leg-escola { font-size: 1.15rem; }
  .hs-leg-acoes { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .hs-intro { max-width: 680px; }
  .hs-intro-num { font-size: 7.6rem; }
  .hs-intro-titulo { font-size: 3.6rem; }
  .hs-intro-resumo { font-size: 1.15rem; }
  .hs-intro-texto { font-size: 1.05rem; }
  .hs-intro-dica { display: none; }
  .hs-comecar { display: inline-flex; }
  .hs-fim-titulo { font-size: 3.2rem; }
  .hs-fim-conceito { font-size: 2.6rem; }
  .hs-mural { grid-template-columns: repeat(6, 1fr); inset: -4%; }
  .hs-fim-acoes { grid-template-columns: auto auto; justify-content: start; }
  .hs-fim-acoes .linha { display: contents; }

  /* ficha vira painel lateral, e o palco abre espaço para ela */
  .ficha {
    top: 0; bottom: 0; left: auto; width: 400px; max-height: none; border-radius: 0; padding: 110px 40px 40px;
    transform: translateX(105%); box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
  }
  .ficha-pega { display: none; }
  .ficha-fechar { display: inline-grid; position: absolute; top: 28px; right: 28px; }
  .ficha-titulo { font-size: 1.45rem; }
  #tela-historia.ficha-aberta .hs-palco { right: 400px; }
  #tela-historia.ficha-aberta .hs-legenda { width: min(100% - 640px, 1080px); left: calc(50% - 200px); }
  #tela-historia.ficha-aberta .hs-seta.prox { right: 440px; }
  #tela-historia.ficha-aberta .hs-tiras { left: calc(50% - 200px); }
  #tela-historia.ficha-aberta .hs-leg-acoes { visibility: hidden; }
}

/* setas e miniaturas para quem usa mouse */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (min-height: 501px) {
  .hs-seta {
    display: grid; place-items: center; position: absolute; top: 50%; z-index: 21; width: 56px; height: 56px; margin: -60px 0 0;
    overflow: visible; clip: auto; white-space: normal;
    border-radius: 50%; border: 1px solid rgba(255, 255, 255, .26); background: rgba(0, 0, 0, .28); color: #fff; cursor: pointer;
    transition: background-color .2s, opacity .2s, right .45s var(--suave);
  }
  .hs-seta:hover { background: rgba(0, 0, 0, .5); }
  .hs-seta svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .hs-seta.ant { left: 40px; }
  .hs-seta.prox { right: 40px; }
  .hs-seta[disabled] { opacity: 0; pointer-events: none; }
  .hs-tiras {
    display: flex; gap: 10px; position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 21;
    transition: left .45s var(--suave);
  }
  .hs-tiras button {
    width: 84px; height: 50px; padding: 0; border: 0; border-radius: 4px; cursor: pointer; opacity: .42;
    background-color: #1d2833; background-size: cover; background-position: center;
    outline: 2px solid transparent; outline-offset: 2px; transition: opacity .25s, outline-color .25s;
  }
  .hs-tiras button:hover { opacity: .8; }
  .hs-tiras button[aria-current="true"] { opacity: 1; outline-color: var(--luz); }
  .hs-tiras button.tira-intro { display: grid; place-items: center; font: 400 1rem/1 var(--serifa); color: var(--luz); }
  .hs-face.no-fim .hs-tiras { display: none; }
}

/* Celular deitado (nunca passa de 500 px de altura): a foto ocupa a altura
   inteira da tela, sem cortar, e a interface some depois de um instante;
   qualquer toque traz de volta. A ficha abre ao lado, e não por cima da foto. */
@media (orientation: landscape) and (max-height: 500px) {
  .hs-palco { --pad-topo: 0px; --pad-base: 0px; }
  .hs-foto { box-shadow: none; }
  .hs-face.so-foto .hs-topo, .hs-face.so-foto .hs-legenda { opacity: 0; pointer-events: none; }
  .hs-topo { padding-bottom: 34px; background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0)); }
  .hs-legenda {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
    padding: 46px 22px max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .68));
  }
  .hs-leg-num { display: none; }
  .hs-leg-escola { font-size: .92rem; margin: 0; }
  .hs-leg-local { font-size: .78rem; }
  .hs-leg-acoes { margin: 0; flex-shrink: 0; }
  .hs-intro, .hs-fim-texto { top: 54%; }
  .hs-intro-num { font-size: 3rem; }
  .hs-intro-titulo { font-size: 1.7rem; margin: .4rem 0; }
  .hs-intro-texto { display: none; }
  .hs-fim-titulo { font-size: 1.6rem; }
  .hs-fim-conceito { font-size: 1.4rem; margin: .2rem 0 .5rem; }
  .hs-fim-p { display: none; }
  .hs-fim-acoes { grid-template-columns: 1fr 1fr; margin-top: .8rem; }
  .hs-fim-acoes .botao { min-height: 42px; padding-top: .55rem; padding-bottom: .55rem; }

  .ficha {
    top: 0; bottom: 0; left: auto; width: min(380px, 52%); max-height: none; border-radius: 0;
    padding: 24px 26px max(16px, env(safe-area-inset-bottom)); transform: translateX(105%);
  }
  .ficha-pega { display: none; }
  .ficha-fechar { display: inline-grid; position: absolute; top: 10px; right: 10px; }
  .ficha-titulo { font-size: 1.05rem; padding-right: 30px; }

  .ab-texto { max-width: 62%; padding-bottom: 4px; }
  .ab-tipo { display: none; }
  .ab-titulo { font-size: 1.85rem; margin: 0 0 .4rem; }
  .ab-conceito em { font-size: 1.6rem; }
  .ab-marcos { margin: .6rem 0 .75rem; padding-top: .55rem; }
  .ab-marco { gap: .15rem; }
  .ab-marco strong { font-size: 1.3rem; }
  .ab-marco span { font-size: .75rem; }
  #ab-entrar { width: auto; min-width: 240px; min-height: 44px; }

  .tm-topo { padding-top: 6px; }
  .tm-instrucao { display: none; }   /* deitado, a instrução de baixo basta */
  .tm-titulo { font-size: 1.25rem; }
  /* deitado não sobra altura embaixo: o tema e o botão vão para a direita */
  .biombo { --bb-alto: min(100%, 420px); top: calc(var(--topo-seguro) + 46px); bottom: calc(var(--base-segura) + 8px); right: 40%; }
  .tm-info {
    left: 62%; right: 22px; top: calc(var(--topo-seguro) + 46px); bottom: calc(var(--base-segura) + 8px); height: auto;
    align-items: flex-start; justify-content: center; padding-top: 0; text-align: left;
  }
  .tm-info.com-tema .tm-num { justify-content: flex-start; }
  .tm-info.com-tema .tm-cap { font-size: 1.3rem; }
  .tm-info.com-tema .tm-resumo { font-size: .85rem; }
  .tm-info.com-escolha .tm-iniciar { width: auto; min-height: 44px; margin-top: 12px; }
  .tm-dica { font-size: .85rem; }
  .tm-dica::before, .tm-dica::after { display: none; }
}

/* ------------------------------------------------------- movimento reduzido -- */

/* Quem pede menos movimento não vê animação nem transição nenhuma: tudo vai
   direto ao estado final. Não usar o truque de "duração 0,01 ms": ele vale
   para TODAS as propriedades (largura inclusive), e uma transição curta ainda
   é uma transição, que pode ficar no valor antigo até o próximo quadro. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
