/* =====================================================================
   07 · Ativações — um palco de show: treliça, refletores, três telões
   (fotos reais das edições anteriores) e a faixa de LED do palco.
   Estado padrão do CSS = estado FINAL (movimento reduzido mostra tudo);
   o JS aplica os estados iniciais pela timeline.
   ===================================================================== */
#ativacoes {
  --tick-h: 58px;
  --hdr-top: calc(var(--hud-h) + 18px);
  --wall-top: calc(var(--hud-h) + 108px);
  --wall-bot: calc(var(--tick-h) + 26px);
}
/* O topo nasce preto: o capítulo 06 termina em #000 opaco e, sem essa emenda, a passagem mostrava
   um degrau reto entre o preto dele e o céu violeta daqui. */
#ativacoes .atv {
  background:
    linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .2) 18%, rgba(5, 1, 15, .55) 48%, rgba(5, 1, 15, .92) 100%);
}

/* ---------- O palco (decoração) ---------- */
#ativacoes .atv__rig { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#ativacoes .atv__haze {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background:
    radial-gradient(8% 4% at 14% 86%, rgba(0, 216, 248, .28), transparent),
    radial-gradient(9% 4% at 38% 88%, rgba(240, 0, 240, .22), transparent),
    radial-gradient(9% 4% at 63% 88%, rgba(0, 216, 248, .2), transparent),
    radial-gradient(8% 4% at 86% 86%, rgba(240, 0, 240, .26), transparent),
    radial-gradient(55% 70% at 50% 100%, rgba(120, 0, 240, .34), transparent 72%),
    radial-gradient(28% 46% at 16% 100%, rgba(0, 216, 248, .16), transparent 80%),
    radial-gradient(28% 46% at 84% 100%, rgba(240, 0, 240, .16), transparent 80%);
}
#ativacoes .atv__beams { position: absolute; inset: 0; overflow: hidden; }
#ativacoes .atv__beam {
  position: absolute; left: var(--x); top: calc(var(--wall-top) - 12px);
  width: 46vw; height: 125vh; margin-left: -23vw;
  transform-origin: 50% 0; opacity: .22;
  clip-path: polygon(49.2% 0, 50.8% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 75%, transparent) 0%, color-mix(in srgb, var(--c) 22%, transparent) 38%, transparent 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent 8%, #000 42%, #000 58%, transparent 92%);
  mask-image: linear-gradient(90deg, transparent 8%, #000 42%, #000 58%, transparent 92%);
  mix-blend-mode: screen;
}
/* canhão de luz sobre o lugar do astronauta (abertura) */
#ativacoes .atv__spot {
  position: absolute; left: 81%; top: calc(var(--wall-top) - 12px); bottom: 12%; width: 30vw; margin-left: -15vw;
  pointer-events: none; opacity: 0; --spot: 1;
}
#ativacoes .atv__spot::before, #ativacoes .atv__spot i { opacity: var(--spot); }
#ativacoes .atv__spot::before {
  content: ''; position: absolute; inset: 0; mix-blend-mode: screen;
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(235, 225, 255, .55), rgba(150, 110, 255, .22) 55%, rgba(120, 0, 240, .08));
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 40%, #000 60%, transparent 96%);
  mask-image: linear-gradient(90deg, transparent 4%, #000 40%, #000 60%, transparent 96%);
}
#ativacoes .atv__spot i {
  position: absolute; left: -10%; right: -10%; bottom: -6%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(230, 220, 255, .5), rgba(120, 0, 240, .22) 55%, transparent);
  filter: blur(6px);
}
#ativacoes .atv__truss {
  position: absolute; left: 2%; right: 2%; top: calc(var(--wall-top) - 34px); height: 22px;
  background:
    linear-gradient(#6d6690, #6d6690) 0 0 / 100% 2px no-repeat,
    linear-gradient(#6d6690, #6d6690) 0 100% / 100% 2px no-repeat,
    repeating-linear-gradient(60deg, transparent 0 11px, rgba(150, 140, 205, .5) 11px 12.5px, transparent 12.5px 24px),
    repeating-linear-gradient(-60deg, transparent 0 11px, rgba(150, 140, 205, .32) 11px 12.5px, transparent 12.5px 24px),
    linear-gradient(180deg, #1b1731, #0a0716);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .6);
}
#ativacoes .atv__truss i {
  position: absolute; left: var(--x); top: 100%; width: 20px; height: 17px; margin-left: -10px;
  border-radius: 3px 3px 9px 9px; background: linear-gradient(180deg, #2b2640, #0f0c1c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
#ativacoes .atv__truss i::after {
  content: ''; position: absolute; left: 3px; right: 3px; bottom: 2px; height: 6px; border-radius: 50%;
  background: radial-gradient(closest-side, #fff, rgba(200, 180, 255, .8) 45%, transparent);
  box-shadow: 0 4px 14px rgba(180, 150, 255, .7);
}

/* ---------- Conteúdo ---------- */
#ativacoes .atv__inner { position: relative; z-index: 2; }

/* Abertura: texto */
#ativacoes .atv__copy {
  position: absolute; left: var(--gutter); top: var(--hud-h); bottom: var(--tick-h);
  width: min(600px, 48%);
  display: flex; flex-direction: column; justify-content: center;
}
#ativacoes .atv__kicker { margin-bottom: 14px; }
#ativacoes .atv__title {
  font-size: clamp(56px, 7.4vw, 124px);
  transform-origin: 0 0; width: max-content; max-width: 100%;
}
#ativacoes .atv__body { margin-top: clamp(14px, 2vh, 24px); }
#ativacoes .atv__lede { max-width: 31ch; font-size: clamp(18px, 1vw + 8px, 23px); }
#ativacoes .atv__tags { margin-top: clamp(18px, 3vh, 30px); }
#ativacoes .atv__tags span:nth-child(1) { color: #ffd6ff; }
#ativacoes .atv__tags span:nth-child(2) { color: #d2f7ff; }
#ativacoes .atv__astro { position: absolute; right: var(--gutter); top: 24%; width: 34%; height: 52%; pointer-events: none; }

/* Cabeçalho do palco */
#ativacoes .atv__hdr {
  position: absolute; left: var(--gutter); right: var(--gutter); top: var(--hdr-top);
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px clamp(18px, 3vw, 44px);
}
#ativacoes .atv__slot { font-size: clamp(30px, 3.1vw, 50px); visibility: hidden; flex: none; }
#ativacoes .atv__chs { display: flex; flex-wrap: wrap; gap: 10px 12px; }
#ativacoes .atv__ch {
  --on: 1;
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px;
  font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; line-height: 1;
  color: color-mix(in srgb, #ffffff calc(var(--on) * 100%), #6f6890);
  background: color-mix(in srgb, rgba(240, 0, 240, .12) calc(var(--on) * 100%), rgba(10, 6, 24, .6));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, rgba(240, 0, 240, .7) calc(var(--on) * 100%), rgba(255, 255, 255, .12));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
#ativacoes .atv__ch i {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--magenta) calc(var(--on) * 100%), #3a3352);
  box-shadow: 0 0 calc(var(--on) * 12px) var(--magenta);
}

/* ---------- Telões ---------- */
#ativacoes .atv__cam {
  position: absolute; left: 0; right: 0; top: var(--wall-top); bottom: var(--wall-bot);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
#ativacoes .atv__wall {
  --mw: min(41vw, calc((100svh - var(--wall-top) - var(--wall-bot) - 44px) * 1.2));
  display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2.4vw, 40px);
  perspective: 1500px;
}
#ativacoes .atv__scr { position: relative; margin: 0; flex: none; }
#ativacoes .atv__scr--main { width: var(--mw); z-index: 2; order: 2; }
#ativacoes .atv__scr--l, #ativacoes .atv__scr--r { width: calc(var(--mw) * .52); z-index: 1; }
#ativacoes .atv__scr--l { order: 1; transform: rotateY(16deg); transform-origin: 100% 50%; }
#ativacoes .atv__scr--r { order: 3; transform: rotateY(-16deg); transform-origin: 0 50%; }
/* cabos: os telões laterais pendem da treliça */
#ativacoes .atv__scr--l::before, #ativacoes .atv__scr--r::before {
  content: ''; position: absolute; bottom: 100%; left: 16%; right: 16%; height: var(--cable, 22vh); pointer-events: none;
  border-inline: 1px solid rgba(170, 160, 225, .38);
  -webkit-mask-image: linear-gradient(0deg, #000 70%, rgba(0, 0, 0, .5)); mask-image: linear-gradient(0deg, #000 70%, rgba(0, 0, 0, .5));
}

#ativacoes .atv__halo {
  position: absolute; inset: 8% 6%; z-index: -1; pointer-events: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 50%, var(--magenta));
  filter: blur(30px); opacity: .42; transition: opacity .5s var(--ease-out);
}
#ativacoes .atv__bezel {
  --bv: 16px;
  position: relative; padding: 11px;
  clip-path: polygon(var(--bv) 0, calc(100% - var(--bv)) 0, 100% var(--bv), 100% calc(100% - var(--bv)), calc(100% - var(--bv)) 100%, var(--bv) 100%, 0 calc(100% - var(--bv)), 0 var(--bv));
  background: linear-gradient(135deg, var(--cyan), var(--violet) 50%, var(--magenta));
}
#ativacoes .atv__bezel::before {
  content: ''; position: absolute; inset: 2px; --bi: calc(var(--bv) - 1px);
  clip-path: polygon(var(--bi) 0, calc(100% - var(--bi)) 0, 100% var(--bi), 100% calc(100% - var(--bi)), calc(100% - var(--bi)) 100%, var(--bi) 100%, 0 calc(100% - var(--bi)), 0 var(--bi));
  background:
    radial-gradient(circle at 10px 10px, #d6dae3 0 1.5px, #43465a 2px 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) 10px, #d6dae3 0 1.5px, #43465a 2px 3px, transparent 3.5px),
    radial-gradient(circle at 10px calc(100% - 10px), #d6dae3 0 1.5px, #43465a 2px 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #d6dae3 0 1.5px, #43465a 2px 3px, transparent 3.5px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #2a2640 0%, #0a0717 55%, #16122a 100%);
}
#ativacoes .atv__tube {
  --tb: 10px;
  position: relative; z-index: 1; aspect-ratio: 5 / 4; overflow: hidden; background: #000;
  clip-path: polygon(var(--tb) 0, calc(100% - var(--tb)) 0, 100% var(--tb), 100% calc(100% - var(--tb)), calc(100% - var(--tb)) 100%, var(--tb) 100%, 0 calc(100% - var(--tb)), 0 var(--tb));
}
#ativacoes .atv__scr--l .atv__tube, #ativacoes .atv__scr--r .atv__tube { aspect-ratio: 6 / 5; }
/* moldura de visor de câmera */
#ativacoes .atv__tube::after {
  content: ''; position: absolute; inset: 5%; z-index: 3; pointer-events: none; --k: rgba(255, 255, 255, .6); --s: clamp(10px, 1.2vw, 18px);
  background:
    linear-gradient(var(--k), var(--k)) 0 0 / var(--s) 1.5px, linear-gradient(var(--k), var(--k)) 0 0 / 1.5px var(--s),
    linear-gradient(var(--k), var(--k)) 100% 0 / var(--s) 1.5px, linear-gradient(var(--k), var(--k)) 100% 0 / 1.5px var(--s),
    linear-gradient(var(--k), var(--k)) 0 100% / var(--s) 1.5px, linear-gradient(var(--k), var(--k)) 0 100% / 1.5px var(--s),
    linear-gradient(var(--k), var(--k)) 100% 100% / var(--s) 1.5px, linear-gradient(var(--k), var(--k)) 100% 100% / 1.5px var(--s);
  background-repeat: no-repeat;
}

/* barras de teste (sem sinal) — só aparecem antes de ligar */
#ativacoes .atv__bars {
  position: absolute; inset: 0; transform-origin: 50% 50%;
  background:
    linear-gradient(90deg, #d9dce6 0 14.3%, #00d8f8 0 28.6%, #7800f0 0 42.9%, #f000f0 0 57.1%, #200058 0 71.4%, #00a6c4 0 85.7%, #a800a8 0) 0 0 / 100% 67% no-repeat,
    linear-gradient(90deg, #200058 0 14.3%, #05010f 0 28.6%, #f000f0 0 42.9%, #05010f 0 57.1%, #00d8f8 0 71.4%, #05010f 0 85.7%, #d9dce6 0) 0 67% / 100% 9% no-repeat,
    linear-gradient(90deg, #0b0620 0 22%, #f4f6fa 0 30%, #0b0620 0 48%, #7800f0 0 62%, #0b0620 0) 0 100% / 100% 24% no-repeat;
  filter: brightness(.72) saturate(.9);
}
#ativacoes .atv__bars i { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px); }

#ativacoes .atv__feed { position: absolute; inset: 0; transform-origin: 50% 50%; }
#ativacoes .atv__feed img, #ativacoes .atv__ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 42%;
}
#ativacoes .atv__scr--main .atv__feed img { object-position: 50% 8%; }
#ativacoes .atv__img { transition: transform 1.2s var(--ease-out); }
#ativacoes .atv__ghost { position: absolute; inset: 0; isolation: isolate; mix-blend-mode: screen; opacity: 0; visibility: hidden; }
#ativacoes .atv__ghost::after { content: ''; position: absolute; inset: 0; mix-blend-mode: multiply; }
#ativacoes .atv__ghost--c::after { background: var(--cyan); }
#ativacoes .atv__ghost--m::after { background: var(--magenta); }

#ativacoes .atv__scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .24) 0 1px, transparent 1px 3px);
}
#ativacoes .atv__scan::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 28%;
  background: linear-gradient(180deg, transparent, rgba(170, 225, 255, .1) 50%, transparent);
  transform: translateY(-110%);
  animation: atv-roll 6s linear infinite; animation-play-state: paused;
}
#ativacoes .atv__scr--l .atv__scan::after { animation-delay: -2s; }
#ativacoes .atv__scr--r .atv__scan::after { animation-delay: -4s; }
@keyframes atv-roll { to { transform: translateY(420%); } }
#ativacoes .atv__glass {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(125% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(118deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, .04) 26%, transparent 40%);
}
#ativacoes .atv__line {
  position: absolute; left: 3%; right: 3%; top: 50%; height: 2px; margin-top: -1px; z-index: 4;
  background: #fff; box-shadow: 0 0 10px #fff, 0 0 26px var(--cyan), 0 0 44px var(--violet);
  opacity: 0; visibility: hidden; transform: scaleX(0);
}

/* OSD de câmera */
#ativacoes .atv__osd {
  position: absolute; z-index: 4; pointer-events: none;
  font-family: var(--f-mono); font-weight: 700; font-size: clamp(9px, .45vw + 4px, 12px); letter-spacing: .14em; line-height: 1;
  color: #fff; text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .9);
  padding: .32em .5em; background: rgba(0, 0, 0, .34); border-radius: 2px;
}
#ativacoes .atv__osd--rec { top: 9%; left: 8%; display: inline-flex; align-items: center; gap: .55em; }
#ativacoes .atv__osd--rec::before {
  content: ''; width: .75em; height: .75em; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta);
  animation: atv-blink 1.1s steps(2, jump-none) infinite; animation-play-state: paused;
}
@keyframes atv-blink { 50% { opacity: .15; } }
#ativacoes .atv__osd--cam { top: 9%; right: 8%; }
#ativacoes .atv__osd--tc { bottom: 9%; left: 8%; font-weight: 500; font-variant-numeric: tabular-nums; }
#ativacoes.is-on .atv__scan::after, #ativacoes.is-on .atv__osd--rec::before { animation-play-state: running; }

#ativacoes .atv__note { text-align: center; color: var(--mute); }

/* hover: o telão acende um pouco mais */
@media (hover: hover) {
  #ativacoes .atv__scr:hover .atv__halo { opacity: .75; }
  #ativacoes .atv__scr:hover .atv__img { transform: scale(1.04); }
}

/* ---------- Faixa de LED ---------- */
#ativacoes .atv__ticker {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tick-h); z-index: 3;
  background: linear-gradient(180deg, #0c0819, #04010c);
  box-shadow: 0 -20px 44px rgba(120, 0, 240, .18);
}
#ativacoes .atv__ticker::before {
  content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: var(--neon); box-shadow: 0 0 12px rgba(240, 0, 240, .65);
}
#ativacoes .atv__led { width: 100%; height: 100%; }

/* ---------- Celular ---------- */
@media (max-width: 820px) {
  #ativacoes {
    --tick-h: 46px;
    --hdr-top: calc(var(--hud-h) + 12px);
    --wall-top: calc(var(--hud-h) + 150px); /* os canais quebram em duas linhas: folga até a treliça */
    --wall-bot: calc(var(--tick-h) + 18px);
  }
  #ativacoes .atv__copy { width: auto; right: var(--gutter); top: calc(var(--hud-h) + 8px); }
  #ativacoes .atv__title { font-size: clamp(50px, 15.5vw, 80px); }
  #ativacoes .atv__lede { max-width: none; font-size: 18px; }
  #ativacoes .atv__hdr { gap: 8px; }
  #ativacoes .atv__slot { font-size: 34px; }
  #ativacoes .atv__chs { gap: 6px; width: 100%; }
  #ativacoes .atv__ch { font-size: 10px; letter-spacing: .12em; padding: 6px 9px 6px 8px; gap: 7px; }
  #ativacoes .atv__ch i { width: 7px; height: 7px; }
  #ativacoes .atv__truss { top: calc(var(--wall-top) - 20px); height: 11px; left: -4%; right: -4%; }
  #ativacoes .atv__truss i { width: 14px; height: 12px; margin-left: -7px; }
  #ativacoes .atv__beam { width: 90vw; margin-left: -45vw; }
  #ativacoes .atv__spot { display: none; }
  #ativacoes .atv__cam { gap: 16px; left: var(--gutter); right: var(--gutter); }
  #ativacoes .atv__wall {
    --mw: min(100%, calc((100svh - var(--wall-top) - var(--wall-bot) - 76px) * .82));
    display: grid; grid-template-columns: repeat(2, calc((var(--mw) - 10px) / 2)); gap: 10px; justify-content: center; width: 100%;
  }
  #ativacoes .atv__scr--main { grid-column: 1 / -1; width: auto; order: 0; }
  #ativacoes .atv__scr--l, #ativacoes .atv__scr--r { width: auto; transform: none; }
  #ativacoes .atv__scr--l { order: 1; }
  #ativacoes .atv__scr--r { order: 2; }
  #ativacoes .atv__scr--l::before, #ativacoes .atv__scr--r::before { display: none; }
  #ativacoes .atv__bezel { --bv: 11px; padding: 7px; }
  #ativacoes .atv__bezel::before { background: linear-gradient(160deg, #2a2640 0%, #0a0717 55%, #16122a 100%); }
  #ativacoes .atv__tube { --tb: 7px; }
  #ativacoes .atv__scr--l .atv__osd--tc, #ativacoes .atv__scr--r .atv__osd--tc { display: none; }
  #ativacoes .atv__halo { filter: blur(18px); }
}

/* ---------- Movimento reduzido: tudo empilhado e aceso ---------- */
.reduced #ativacoes .atv { height: auto; min-height: 100svh; overflow: visible; padding: calc(var(--hud-h) + 40px) 0 calc(var(--tick-h) + 48px); }
.reduced #ativacoes .atv__inner { height: auto; display: flex; flex-direction: column; gap: 36px; }
.reduced #ativacoes .atv__copy, .reduced #ativacoes .atv__hdr, .reduced #ativacoes .atv__cam { position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; width: auto; }
.reduced #ativacoes .atv__astro { top: 0; height: 40vh; }
.reduced #ativacoes .atv__slot { display: none; }
/* respiro maior que o HUD entre o texto e os canais: a 2ª parada põe os canais logo abaixo do HUD
   e as tags têm de estar inteiras fora do quadro, não cortadas por ele */
.reduced #ativacoes .atv__hdr { margin-top: 56px; }
/* na 2ª parada (canais logo abaixo do HUD) os telões + faixa de LED fecham a tela inteira, em vez
   de deixar o título do capítulo seguinte cortado na borda de baixo. --hdr-h = altura dos canais */
.reduced #ativacoes .atv__cam { --hdr-h: 28px; min-height: calc(100svh - var(--hud-h) - 20px - var(--hdr-h) - 36px - var(--tick-h) - 48px); }
.reduced #ativacoes .atv__wall { --mw: min(38vw, 520px); }
.reduced #ativacoes .atv__truss, .reduced #ativacoes .atv__beam, .reduced #ativacoes .atv__spot,
.reduced #ativacoes .atv__scr--l::before, .reduced #ativacoes .atv__scr--r::before { display: none; }
@media (max-width: 820px) {
  .reduced #ativacoes .atv__wall { --mw: 100%; }
  .reduced #ativacoes .atv__cam { --hdr-h: 50px; } /* canais em duas linhas */
}
