/* Chronyas — phase 1 prototype styles. The final design is phase 3 (see docs/ARQUITETURA.md, E). */
:root {
  --tinta: #F6F2EA;
  --tinta-2: rgba(246, 242, 234, 0.72);
  --tinta-3: rgba(246, 242, 234, 0.5);
  --filete: rgba(246, 242, 234, 0.18);
  --acento: #FFB547;
  --fundo: #0E0508;
  --painel: rgba(10, 9, 12, 0.9);
  --letra: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fundo); color: var(--tinta); }
body { font-family: var(--letra); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#linha { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; opacity: 0; transition: opacity .6s; }
body.pronto #linha { opacity: 1; }
#linha:active { cursor: grabbing; }

/* ---- scenery (cenario.js): sky, 13 scenes of SVG layers, ground.
   Direction "Silhouette", chosen on 15-10-2026: near-black shapes against a luminous sky in the colour of the era ---- */
.cenario { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
  --ceu: #0E0508; --hor: #6A1A0A; --chao: #1A0805; --bri: #FF5A1F; --eixo: 62vh; }
.ceu, .pista { position: absolute; left: 0; right: 0; top: 0; height: var(--eixo); }
.ceu { background: linear-gradient(to bottom, var(--ceu), var(--hor));
  background: linear-gradient(to bottom, var(--ceu) 0%, color-mix(in srgb, var(--hor) 24%, var(--bri)) 100%); }
.ceu::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .38), transparent 42%); }
.pista { overflow: hidden; }
.solo { position: absolute; left: 0; right: 0; top: var(--eixo); bottom: 0; background: #060507;
  background: color-mix(in srgb, var(--chao) 40%, #000); }
.cena { position: absolute; inset: 0; }
.cena[hidden] { display: none; }
.camada { position: absolute; left: -90px; bottom: 0; width: calc(100% + 180px); height: 100%; display: block; will-change: transform; }
@media (max-aspect-ratio: 4/5) { .camada { height: 140%; } }
.camada .gira { animation: gira linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.camada path { fill: var(--k); }
.camada .l { fill: var(--kl); }
.camada .w { fill: var(--w); }
.camada .n { fill: var(--kl); fill: color-mix(in srgb, var(--k) 40%, var(--s)); }   /* snow and ice on the mountains */
.camada .a { fill: var(--g); }                           /* accent: lava, fire, lamps, lit windows */
.camada .s { fill: var(--s); opacity: .92; }             /* sky light: sun, moon, clouds, contrails */

/* where am I */
.topo { position: fixed; top: 0; left: 0; right: 0; padding: 20px clamp(16px, 4vw, 48px) 0; pointer-events: none; }
.marca { pointer-events: auto; display: inline-block; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--tinta); text-decoration: none; }
.marca::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--acento); margin-right: 8px; vertical-align: 1px; }
.onde { margin-top: clamp(14px, 3vh, 34px); transition: opacity .4s; max-width: 100%; }
.onde p { margin: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 1px 14px rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.onde-epoca { font-size: clamp(28px, 5.2vw, 68px); font-weight: 750; letter-spacing: -0.035em; line-height: 1.02; }
.onde-data { margin-top: 6px !important; font-size: clamp(16px, 1.9vw, 24px); font-weight: 500; color: var(--acento); letter-spacing: -0.01em; }
.onde-escala { margin-top: 4px !important; font-size: 13px; color: var(--tinta-3); }
body.intro-aberta .onde { opacity: 0; }

@property --eixo { syntax: "<length>"; inherits: true; initial-value: 62vh; }
.cenario.desce { transition: --eixo 1.1s cubic-bezier(.4, 0, .2, 1); }
/* intro (23-10-2026: the owner found the opening screen too busy) - only the living painting, the title, the numbers and
   two buttons; the events, the bands and the control bar fade in as soon as the journey starts */
#linha { transition: opacity .8s ease; }
body.intro-aberta #linha { opacity: 0; }
.barra { transition: opacity .7s ease, transform .7s ease; }
body.intro-aberta .barra { opacity: 0; transform: translateY(18px); pointer-events: none; }
#cenario::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .9s ease;
  background: linear-gradient(90deg, rgba(8, 6, 4, .66) 0%, rgba(8, 6, 4, .34) 46%, rgba(8, 6, 4, 0) 78%),
              linear-gradient(0deg, rgba(8, 6, 4, .55) 0%, rgba(8, 6, 4, 0) 40%); }
body.intro-aberta #cenario::after { opacity: 1; }
.intro-numeros { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 26px 0 0; font-size: 14px; color: var(--tinta-2); letter-spacing: .01em; }
.intro-numeros b { display: block; font-size: clamp(22px, 2.4vw, 30px); font-weight: 750; letter-spacing: -.03em; color: var(--tinta); }
.intro { position: fixed; left: clamp(16px, 4vw, 48px); right: clamp(16px, 4vw, 48px); top: 50%; transform: translateY(-50%); max-width: 920px;
  transition: opacity .5s, transform .5s; z-index: 7; }
.intro.fora { opacity: 0; transform: translateY(calc(-50% - 14px)); pointer-events: none; }
.intro h1 { margin: 0; font-size: clamp(38px, 7.4vw, 108px); line-height: .98; font-weight: 800; letter-spacing: -0.045em; text-wrap: balance; }
.intro-sub { margin: 18px 0 0; font-size: clamp(17px, 2vw, 24px); color: var(--tinta-2); letter-spacing: -0.01em; }
.intro-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.intro-dica { margin: 18px 0 0; font-size: 13px; color: var(--tinta-3); }
.b-cheio, .b-linha { height: 44px; padding: 0 18px; border-radius: 4px; font-weight: 600; cursor: pointer; }
.b-cheio { background: var(--acento); color: #1A1206; border: 0; }
.b-linha { background: transparent; border: 1px solid var(--filete); }
.b-cheio:hover { filter: brightness(1.08); }
.b-linha:hover { border-color: var(--tinta-3); }

/* event panel */
.painel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); padding: 72px 28px 28px; background: var(--painel); border-left: 1px solid var(--filete); overflow-y: auto; z-index: 5; }
.painel-cat { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.painel-titulo { margin: 10px 0 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 750; }
.painel-data { margin: 10px 0 0; color: var(--acento); font-weight: 500; }
.painel-resumo { margin: 18px 0 0; line-height: 1.55; color: var(--tinta-2); font-size: 16px; }
.painel-fonte { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--tinta-3, #8D8A92); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.painel-fonte:empty { display: none; }
.painel-fonte a { color: inherit; text-decoration: underline; text-decoration-color: var(--filete); text-underline-offset: 3px; }
.painel-fonte a:hover, .painel-fonte a:focus-visible { color: var(--acento); }
.painel-botoes { display: flex; gap: 10px; margin-top: 24px; align-items: center; }
.b-fechar { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--filete); background: transparent; cursor: pointer; }

/* controls (23-10-2026, redesign: icon buttons, one accent play button, rounded fields, no boxes; the bar is a soft
   fade over the picture rather than a panel) */
.barra { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  justify-content: space-between; padding: 22px clamp(16px, 4vw, 48px) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(8, 7, 6, 0), rgba(8, 7, 6, .72) 38%, rgba(8, 7, 6, .9)); }
.grupo { display: flex; gap: 4px; align-items: center; }
.barra button, .barra select, .barra input { font: inherit; color: var(--tinta); }
.b-ico { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; padding: 0; }
.b-ico svg, .campo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.b-ico:hover { background: rgba(255, 255, 255, .1); }
.b-tocar { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--acento);
  color: #1A1206; cursor: pointer; margin: 0 4px; box-shadow: 0 0 0 0 rgba(255, 181, 71, .45); transition: transform .15s; }
.b-tocar:hover { transform: scale(1.06); }
.b-tocar svg { width: 20px; height: 20px; fill: currentColor; }
.b-tocar[aria-pressed="true"] { animation: tocar-pulso 2.4s ease-out infinite; }
@keyframes tocar-pulso { 0% { box-shadow: 0 0 0 0 rgba(255, 181, 71, .45); } 100% { box-shadow: 0 0 0 14px rgba(255, 181, 71, 0); } }
.b-pilula { height: 34px; border: 0; border-radius: 17px; padding: 0 14px; background: rgba(255, 255, 255, .08); cursor: pointer;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; }
.b-pilula:hover { background: rgba(255, 255, 255, .16); }
.barra select.b-pilula { appearance: none; -webkit-appearance: none; padding-right: 28px; max-width: 200px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 11px) 15px; background-size: 4px 4px; background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, .08); }
.barra select option { background: #111; color: #eee; }
#sentido[aria-pressed="true"] { color: var(--acento); }
.procura { gap: 8px; flex: 1 1 420px; justify-content: flex-end; }
.campo { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px;
  background: rgba(255, 255, 255, .08); transition: background .15s; }
.campo:focus-within { background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 1.5px var(--acento); }
.campo svg { color: var(--tinta-3); flex: none; }
.campo input { border: 0; background: transparent; outline: none; min-width: 0; width: 100%; height: 100%; padding: 0; font-size: 14px; }
.campo input::placeholder { color: var(--tinta-3); }
.campo input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.busca { flex: 1 1 240px; max-width: 340px; }
.ir { flex: 0 1 230px; }
.busca-lista { position: absolute; left: 0; right: 0; bottom: 46px; margin: 0; padding: 6px; list-style: none; z-index: 40;
  background: rgba(14, 12, 10, .97); border-radius: 14px; box-shadow: 0 -8px 40px rgba(0, 0, 0, .45); max-height: 52vh; overflow-y: auto;
  min-width: min(380px, calc(100vw - 32px)); }
.busca-lista[hidden] { display: none; }
.busca-lista li { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.busca-lista li[aria-selected="true"], .busca-lista li:hover { background: rgba(255, 255, 255, .09); }
.busca-lista .bp { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.busca-lista .bt { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.busca-lista .bd { grid-column: 2; font-size: 12.5px; color: var(--tinta-3); margin-top: 1px; }
.busca-lista .vazio { display: block; color: var(--tinta-3); font-size: 13.5px; cursor: default; }
.ir-erro { position: absolute; right: 0; bottom: 46px; margin: 0; padding: 8px 12px; background: var(--painel); border-radius: 10px; font-size: 13px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

.prototipo { position: fixed; right: clamp(16px, 4vw, 48px); top: 20px; margin: 0; font-size: 12px; color: var(--tinta-3); border: 1px solid var(--filete); padding: 4px 8px; border-radius: 4px; }

/* toast when the zoom stops at the dating-precision limit */
.aviso-zoom { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); margin: 0; padding: 10px 16px; max-width: calc(100% - 32px);
  background: var(--painel); border: 1px solid var(--filete); border-radius: 4px; font-size: 14px; text-align: center; z-index: 6; }

/* events in view: for keyboard and screen-reader users; appears when it receives focus */
.lista { position: fixed; left: clamp(16px, 4vw, 48px); top: 30%; width: min(420px, calc(100% - 32px)); max-height: 40vh; overflow-y: auto;
  padding: 16px; background: var(--painel); border: 1px solid var(--filete); border-radius: 4px; z-index: 6;
  clip-path: inset(50%); opacity: 0; pointer-events: none; }
.lista:focus-within { clip-path: none; opacity: 1; pointer-events: auto; }
.lista-h { margin: 0 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3); }
.lista ul { list-style: none; margin: 0; padding: 0; }
.lista button { display: block; width: 100%; text-align: left; padding: 8px 6px; background: none; border: 0; border-bottom: 1px solid var(--filete); cursor: pointer; }
.lista-vazia { margin: 0; color: var(--tinta-2); font-size: 14px; }

@media (max-width: 640px) {
  .painel { top: auto; left: 0; width: 100%; max-height: 62vh; padding: 56px 18px 24px; border-left: 0; border-top: 1px solid var(--filete); background: #0B0A0D; }
  .barra { gap: 8px 6px; padding-top: 16px; }
  .viagem, .zoom { gap: 2px; }
  .barra select.b-pilula { max-width: 128px; padding-left: 10px; }
  .procura { flex-basis: 100%; }
  .busca { max-width: none; }
  .ir { flex: 0 1 150px; }
  #hoje { padding: 0 10px; }
  .prototipo { position: fixed; left: 16px; right: auto; top: 40px; font-size: 11px; padding: 2px 6px; max-width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .camada .gira { animation: none !important; }
}

/* ---- realistic painted scenes (phase 3b): raster planes made by build/pintar.py; clouds drift (transform only) ---- */
.cena.real .deriva { position: absolute; inset: 0; will-change: transform; animation: deriva ease-in-out infinite alternate; }
@keyframes deriva { from { transform: translate3d(-70px, 0, 0); } to { transform: translate3d(70px, 0, 0); } }   /* = DERIVA in cenario.js */
.cena.real .camada { transform-origin: 50% 100%; }   /* the slow camera move through each era (cenario.js) scales from the ground */
.cena.real::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .22) 22%, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .38) 100%); }   /* the headline stays readable over a bright sky */
.cena.real .brilho { animation: cintila 3.2s ease-in-out infinite alternate; }
.cena.real .brilho.f1 { animation-delay: -1.6s; }
@keyframes cintila { from { opacity: .1; } to { opacity: .85; } }
.cena.real .pulsa { animation: pulsa 2.6s ease-in-out infinite alternate; }
@keyframes pulsa { from { opacity: .3; } to { opacity: 1; } }
/* life in a still scene: wind gusts crossing the grass (3 phases lit one after the other), animals milling about,
   boats rocking, flyers drifting, aircraft crossing, flocks of birds; transform/opacity only */
.cena.real .rajada { opacity: 0; animation: rajada 9s ease-in-out infinite; }
.cena.real .rajada.r1 { animation-delay: -6s; }
.cena.real .rajada.r2 { animation-delay: -3s; }
@keyframes rajada { 0% { opacity: 0; } 22% { opacity: 1; } 45% { opacity: 0; } 100% { opacity: 0; } }
.cena.real .mexe { transform-box: fill-box; transform-origin: 50% 100%; animation-timing-function: ease-in-out;
  animation-iteration-count: infinite; animation-direction: alternate; }
.cena.real .mexe.pasta { animation-name: pasta; }
@keyframes pasta { from { transform: translateX(calc(-1 * var(--a))); } to { transform: translateX(var(--a)); } }
.cena.real .mexe.voa { animation-name: voa; }
@keyframes voa { 0% { transform: translate(calc(-1 * var(--a)), 0); } 50% { transform: translate(0, -8px); } 100% { transform: translate(var(--a), 0); } }
.cena.real .mexe.navega { animation-name: navega; }
@keyframes navega { from { transform: translate(calc(-1 * var(--a)), 0) rotate(-.6deg); } to { transform: translate(var(--a), 1px) rotate(.6deg); } }
.cena.real .mexe.cruza { animation-name: cruza; animation-timing-function: linear; animation-direction: normal; }
@keyframes cruza { 0% { transform: translateX(calc(-1 * var(--a))); opacity: 0; } 8%, 92% { opacity: 1; }
  100% { transform: translateX(var(--a)); opacity: 0; } }
.cena.real .aves .asa { fill: none; stroke: #1c1b20; stroke-width: 1.5; stroke-linecap: round; opacity: .7;
  transform-box: fill-box; transform-origin: 50% 100%; animation: bate .5s ease-in-out infinite alternate; }
@keyframes bate { from { transform: scaleY(1); } to { transform: scaleY(-.45); } }
.cena.real .bando { animation: voo linear infinite; }
@keyframes voo { from { transform: translate(-140px, 0); } to { transform: translate(1780px, -50px); } }
@media (prefers-reduced-motion: reduce) {
  .cena.real .deriva, .cena.real .brilho, .cena.real .pulsa, .cena.real .rajada, .cena.real .mexe,
  .cena.real .bando, .cena.real .asa { animation: none !important; }
  .cena.real .brilho.f1, .cena.real .pulsa, .cena.real .rajada { opacity: 0; }
  .cena.real .bando { transform: translate(820px, 0); }
}

/* topics filter (23-10-2026) */
.temas-grupo { position: relative; }
.temas-menu { position: absolute; bottom: 46px; left: 0; z-index: 30; min-width: 270px; max-width: calc(100vw - 24px); padding: 10px 12px;
  background: rgba(12, 10, 9, .94); border: 1px solid var(--filete); border-radius: 4px; display: grid; gap: 6px; }
.temas-menu[hidden] { display: none; }
.temas-menu label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.temas-menu input { accent-color: var(--acento); width: 15px; height: 15px; margin: 0; }
.temas-cor { width: 10px; height: 10px; border-radius: 50%; flex: none; }
@media (max-width: 640px) { .temas-menu { left: auto; right: 0; } .temas-menu label { white-space: normal; } }

/* ambient life over the painting (23-10-2026): cloud shadows, mist, particles, lightning, sun rays, a slow camera */
.ambiente { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.amb-sombras, .amb-nevoa { position: absolute; left: 0; right: 0; opacity: 0; transition: opacity 1.6s ease; overflow: hidden; }
.amb-sombras { bottom: 0; height: 62%; mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%); mask-image: linear-gradient(to bottom, transparent, #000 35%); }
.amb-nevoa { top: 38%; height: 34%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); }
.amb-sombras i, .amb-nevoa i { position: absolute; top: 0; bottom: 0; left: 0; width: 200%; background-repeat: repeat-x;
  animation: amb-desliza 210s linear infinite; will-change: transform; }
.amb-sombras i { background-image: url(../../data/f/_amb/sombras.webp); background-size: 50% 100%; filter: brightness(0) opacity(.9); }
.amb-nevoa i { background-image: url(../../data/f/_amb/nevoa.webp); background-size: 50% 100%; animation-duration: 300s; animation-direction: reverse; }
@keyframes amb-desliza { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.amb-tinta { position: absolute; inset: 0; opacity: 0; mix-blend-mode: multiply; }
.amb-part { position: absolute; inset: 0; width: 100%; height: 100%; }
.amb-flash { position: absolute; inset: 0; background: #dfe8ff; opacity: 0; mix-blend-mode: screen; }
.amb-flash.raio { animation: amb-raio .9s ease-out 1; }
@keyframes amb-raio { 0% { opacity: 0; } 6% { opacity: .38; } 14% { opacity: .05; } 22% { opacity: .26; } 100% { opacity: 0; } }
.cena.real .camada.raios { mix-blend-mode: screen; animation: amb-respira 11s ease-in-out infinite alternate; }
@keyframes amb-respira { from { opacity: .35; } to { opacity: .75; } }
.cena.real { animation: amb-camara 46s ease-in-out infinite alternate; transform-origin: 50% 70%; }
@keyframes amb-camara { from { transform: scale(1) translate3d(-6px, 0, 0); } to { transform: scale(1.035) translate3d(6px, -3px, 0); } }
@media (prefers-reduced-motion: reduce) {
  .ambiente { display: none; }
  .cena.real, .cena.real .camada.raios { animation: none; }
}

/* pre-visualizacao dos anuncios (CHRONYAS_PREVIA_ANUNCIOS): caixa de exemplo no fundo do painel do evento */
.painel-anuncio { margin-top: 22px; }
.painel-anuncio .anuncio-exemplo { display: grid; place-content: center; gap: 4px; text-align: center; min-height: 250px; border-radius: 10px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 12px, rgba(255,255,255,.06) 12px 24px);
  border: 1px dashed rgba(255, 255, 255, .22); color: var(--tinta-3); font-size: 13px; }
.painel-anuncio .anuncio-exemplo span { font-weight: 700; color: var(--tinta); }
