@font-face {
  font-family: 'Instrument Sans';
  src: url('vendor/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('vendor/ibm-plex-mono.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --grafite: #141311;
  --marfim: #faf6ed;
  --tinta: #211e19;
  --areia: #e8c59a;
  --nevoa: #d6dddd;
  --sans: 'Instrument Sans', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  background: #100f0e;
  color: var(--marfim);
  font-family: var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#palco {
  position: relative;
  isolation: isolate;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  overflow: hidden;
  container-type: size;
  background: var(--grafite);
  --margem: 5.1cqw;
  --movimento: 620ms;
  --easing: cubic-bezier(.2,.67,.24,1);
}

#vistas, .vista-local, #maquete, #fotografias, .fotograma, .luz, #marcacoes,
#chamadas, #nomes-mapa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#vistas, #fotografias { z-index: 0; }
#maquete { display: block; z-index: 3; }
[data-mode='2d'] #maquete { visibility: hidden; }
.vista-local {
  opacity: 0;
  background: var(--grafite) center / cover;
}
.vista-local.ativa { opacity: 1; }

.fotograma {
  opacity: 0;
  display: grid;
  place-items: center;
  padding: 7cqh 5.1cqw 10cqh 37.2cqw;
  background: radial-gradient(ellipse at 72% 31%, #faf7ed 0%, #f1ede4 49%, #e6dfd3 100%);
}
.fotograma.ativo { opacity: 1; }

.moldura {
  position: relative;
  width: min(100%, calc(76cqh * var(--proporcao, 1.5)));
  aspect-ratio: var(--proporcao, 1.5);
  overflow: hidden;
  background: #c9c1b3;
  box-shadow: 0 1.6cqw 3.8cqw -1.35cqw #34291c56, 0 .25cqw .55cqw -.35cqw #34291c47;
}

.moldura img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--posicao, 50% 50%);
  rotate: var(--giro, 0deg);
}

.fotograma:is([data-tipo='abertura'], [data-tipo='congresso'], [data-tipo='panoramica']) {
  padding: 0;
  background: var(--grafite);
}

.fotograma:is([data-tipo='abertura'], [data-tipo='congresso'], [data-tipo='panoramica']) .moldura {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: var(--grafite);
  box-shadow: none;
}

.fotograma[data-tipo='abertura'] img { --giro: 180deg; }
.fotograma[data-imagem='planalto-rampa.jpg'] img { clip-path: inset(.45% 0 0); }

.luz { z-index: 1; }
.luz::before, .luz::after {
  position: absolute;
  inset: 0;
  content: '';
  opacity: 0;
  transition: opacity var(--movimento) var(--easing);
}
.luz::before {
  background: linear-gradient(90deg, #141210f2, #141210c9 24%, #14121065 42%, #14121000 72%);
}
.luz::after {
  background: linear-gradient(0deg, #161310b8, #16131042 21%, #16131000 47%);
}
[data-tipo='abertura'] .luz::before { opacity: .88; }
[data-tipo='panoramica'] .luz::before { opacity: 1; }
[data-tipo='encerramento'] .luz::before { opacity: .59; }
[data-tipo='mapa'] .luz::before { opacity: .22; }
[data-tipo='congresso'] .luz::after, [data-tipo='aproximacao'] .luz::after { opacity: 1; }

.cartela {
  position: absolute;
  z-index: 3;
  top: 49%;
  left: var(--margem);
  width: 32.2cqw;
  translate: 0 -50%;
  pointer-events: none;
}

.cartela-saida { z-index: 2; }

.titulo {
  margin: 0;
  font-size: var(--corpo-titulo, 5.7cqw);
  font-weight: 540;
  letter-spacing: -.052em;
  word-spacing: .035em;
  line-height: .95;
  text-wrap: balance;
}

.legenda {
  width: fit-content;
  max-width: 100%;
  margin: 2.7cqh 0 0;
  color: #eee4d6;
  font-size: 1.63cqw;
  font-weight: 500;
  line-height: 1.22;
}
.legenda:empty { display: none; }

.cartela[data-tipo='foto'] { color: var(--tinta); }
.cartela[data-tipo='foto'] .legenda { color: #534b3f; }
.cartela[data-tipo='abertura'] {
  top: 50%;
  width: 65cqw;
  --corpo-titulo: 8.85cqw;
}
.cartela[data-tipo='abertura'] .titulo { text-wrap: nowrap; }
.cartela[data-tipo='abertura'] .legenda { margin-top: 3.8cqh; color: var(--areia); }
.cartela[data-tipo='panoramica'] { width: 38cqw; }
.cartela:is([data-slide='10'], [data-slide='11']) { --corpo-titulo: 4.5cqw; }
.cartela[data-tipo='mapa'] {
  top: 12.2cqh;
  translate: none;
  width: 34cqw;
  --corpo-titulo: 4.75cqw;
}
.cartela[data-tipo='mapa'] .titulo { text-wrap: wrap; }
.cartela[data-tipo='mapa'] .legenda { margin-top: 1.8cqh; }

.cartela[data-tipo='congresso'] {
  top: auto;
  bottom: 14.2cqh;
  translate: none;
  width: 31cqw;
  --corpo-titulo: 5.05cqw;
}
.cartela[data-tipo='congresso'] .titulo { text-wrap: wrap; }

.cartela[data-tipo='encerramento'] {
  top: 11.7cqh;
  width: 33cqw;
  translate: none;
  --corpo-titulo: 5.15cqw;
}
.cartela[data-tipo='encerramento'] .titulo { text-wrap: wrap; }
.cartela[data-tipo='encerramento'] .legenda { margin-top: 3.8cqh; color: var(--areia); }

.percurso { display: grid; gap: 1.0cqh; padding: 0; margin: 1.55cqh 0 0; list-style: none; }
.percurso li { display: flex; gap: .9cqw; align-items: baseline; font-size: 1.5cqw; line-height: 1.14; }
.percurso b { color: var(--areia); font: 500 1.05cqw var(--mono); }

#marcacoes { z-index: 2; }
#norte {
  position: absolute;
  top: 7.2cqh;
  right: var(--margem);
  display: flex;
  align-items: center;
  gap: .48cqw;
  color: #e7e1d6;
  font: 500 1.0cqw var(--mono);
}
#norte svg { width: 1.3cqw; fill: none; stroke: currentcolor; stroke-width: 1.4; }
.revelado { animation: aparecer .35s ease; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.linha-mapa { fill: none; stroke: var(--areia); stroke-width: 1.65; opacity: .93; }
.ponto-mapa { fill: var(--areia); stroke: #292620; stroke-width: 1.85; }
.pino-mapa { fill: #24201ae8; stroke: var(--areia); stroke-width: 2; }
.pino-texto { fill: var(--areia); font: 500 20px var(--mono); text-anchor: middle; dominant-baseline: central; }
.rotulo-mapa {
  position: absolute;
  translate: -50% -50%;
  padding: .95cqh .85cqw;
  border-left: .14cqw solid var(--areia);
  background: #191713f0;
  box-shadow: 0 .25cqw 1.2cqw #100e0b42;
  font-size: 1.54cqw;
  font-weight: 600;
  line-height: 1.08;
  white-space: nowrap;
}
.rotulo-mapa small { display: block; color: #efdeca; font-size: 1.13cqw; margin-top: .55cqh; }
.rotulo-mapa.em-foco { border-color: #ffddb0; background: #2d2319f5; }
.em-foco .linha-mapa { stroke: #ffe0b7; opacity: 1; }
.em-foco .ponto-mapa { fill: #fff0cc; stroke: #8a653b; }
.rotulo-mapa.rodoviario { border-color: var(--nevoa); }
.linha-mapa.rodoviario, .ponto-mapa.rodoviario { stroke: var(--nevoa); }
.ponto-mapa.rodoviario { fill: var(--nevoa); }

.controles {
  position: absolute;
  inset: auto var(--margem) 4.45cqh;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  --controle-fundo: #171511d9;
  --controle-texto: #faf6ed;
  --controle-borda: #e9dfce49;
}
[data-tipo='foto'] .controles {
  --controle-fundo: #f9f6efda;
  --controle-texto: #272119;
  --controle-borda: #5c4d3936;
}

.navegacao, .opcoes { display: flex; align-items: center; gap: .55cqw; }
.controles button {
  width: clamp(36px, 3.04cqw, 60px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--controle-borda);
  border-radius: 50%;
  background: var(--controle-fundo);
  color: var(--controle-texto);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 160ms ease, opacity 160ms ease;
}
.controles button svg {
  width: 47%;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.controles button:hover:not(:disabled) { transform: translateY(-2px); border-color: currentcolor; }
.controles button:active:not(:disabled) { transform: scale(.93); }
.controles button:focus-visible { outline: 2px solid var(--controle-texto); outline-offset: 4px; }
.controles button:disabled { opacity: .35; cursor: default; }

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

[data-captura] > :not(#vistas) { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}
