/*
 * Cenas desenhadas em código para duas seções da home (só na proposta):
 *   .cena--noticias      TV com a programação KRTV em tela dividida
 *   .cena--dispositivos  videowall, TV, totem de LED e quiosque touch
 * Ocupam exatamente a área das colagens originais (que continuam no modo
 * "Atual"). Medidas em cqw/cqh: tudo escala com o quadro. A animação começa
 * quando o js/efeitos.js põe .ligada na cena.
 */

.cena { display: none; }
.proposta .colagem--noticias > img,
.proposta .colagem--dispositivos > img { display: none; }
.proposta .cena {
    display: block; position: absolute; inset: 0;
    container-type: size; font-family: 'Montserrat', sans-serif; color: #fff;
}

.sol {
    display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.12em;
    background: radial-gradient(circle at 40% 40%, #fff6c2, #ffcf3d 55%, #ff9f1c);
    box-shadow: 0 0 .6em rgba(255, 196, 61, .8);
}

/* =========================================================
   Notícias: TV com tela dividida
   ========================================================= */

.cena--noticias .tv {
    position: absolute; left: 2%; top: 3%; width: 96%; aspect-ratio: 16 / 9;
    container-type: inline-size;
    padding: 1.1%; border-radius: 1.6cqw; background: #0c0c0c;
    box-shadow: 0 0 0 1px #2a2a2a, 0 30px 60px -22px rgba(81, 152, 251, .65), 0 18px 30px -18px rgba(0, 0, 0, .55);
}
.cena--noticias .tv__pe {
    position: absolute; left: 39%; width: 22%; top: calc(3% + 54cqw + 1cqw); height: 1.6cqw;
    border-radius: 1cqw; background: linear-gradient(#2b2b2b, #0c0c0c);
    box-shadow: 0 1.4cqw 2.4cqw -1cqw rgba(0, 0, 0, .5);
}
.tv__tela {
    position: relative; height: 100%; overflow: hidden; border-radius: .9cqw; background: #05070d;
    display: grid; grid-template-columns: 66% 34%; grid-template-rows: 1fr 1fr 13%;
}
.zona { position: relative; overflow: hidden; }
.zona--noticia { grid-row: 1 / 3; }
/* .cena na frente: as regras das colagens antigas (.colagem img) não podem encurtar a foto. */
.proposta .cena .zona__foto { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: left bottom; border-radius: 0; box-shadow: none; }
.zona__foto--2 { opacity: 0; }
.zona__ao-vivo {
    position: absolute; right: 2.4cqw; top: 2.4cqw; padding: .5cqw 1.2cqw; border-radius: .5cqw;
    background: #e3172b; font-size: 1.9cqw; font-weight: 800; letter-spacing: .08em;
}
.zona--tempo {
    display: flex; flex-direction: column; justify-content: center; gap: .6cqw; padding: 0 2.6cqw;
    background: linear-gradient(160deg, #2c6fe8, #5198fb 60%, #8cc4ff);
}
.tempo__cidade { font-size: 2.1cqw; font-weight: 600; opacity: .9; }
.tempo__agora { font-size: 6cqw; font-weight: 800; line-height: 1; display: flex; align-items: center; gap: 1cqw; }
.tempo__agora .sol { font-size: 4.2cqw; }
.tempo__descricao { font-size: 1.8cqw; opacity: .9; }
.tempo__semana { font-size: 1.6cqw; opacity: .85; }
.tempo__semana b { font-weight: 700; }
.zona--cotacoes {
    display: flex; flex-direction: column; justify-content: center; gap: 1.1cqw; padding: 0 2.6cqw;
    background: #0e1420; border-top: 1px solid rgba(255, 255, 255, .06);
}
.cotacao { display: flex; align-items: baseline; gap: 1cqw; font-size: 2cqw; font-variant-numeric: tabular-nums; }
.cotacao b { width: 6.2cqw; font-weight: 700; color: #9fb3d1; }
.cotacao em { margin-left: auto; font-style: normal; font-size: 1.6cqw; }
.cotacao .sobe { color: #4ade80; }
.cotacao .desce { color: #f87171; }
.zona--faixa {
    grid-column: 1 / -1; display: flex; align-items: stretch;
    background: #fff; color: #0b0b0b; font-size: 2cqw; font-weight: 600;
}
.faixa__rotulo { display: flex; align-items: center; padding: 0 1.6cqw; background: #e3172b; color: #fff; font-weight: 800; letter-spacing: .06em; }
.faixa__trilho { flex: 1; overflow: hidden; display: flex; align-items: center; }
.faixa__texto { white-space: nowrap; padding-left: 2cqw; }
.faixa__hora { display: flex; align-items: center; padding: 0 1.6cqw; background: #0b0b0b; color: #fff; font-variant-numeric: tabular-nums; }

/* Animação: a TV liga e as áreas entram cada uma do seu lado. */
.anima .cena--noticias .tv__tela { opacity: 0; }
.anima .cena--noticias .zona { opacity: 0; }
.anima .cena--noticias .zona--noticia { transform: translateX(-40%); }
.anima .cena--noticias .zona--tempo,
.anima .cena--noticias .zona--cotacoes { transform: translateX(60%); }
.anima .cena--noticias .zona--faixa { transform: translateY(100%); }

.anima .cena--noticias.ligada .tv__tela { animation: cena-liga 1s ease-out forwards; }
.anima .cena--noticias.ligada .zona { animation: zona-entra .9s cubic-bezier(.2, .8, .2, 1) forwards; }
.anima .cena--noticias.ligada .zona--noticia { animation-delay: .65s; }
.anima .cena--noticias.ligada .zona--tempo { animation-delay: .85s; }
.anima .cena--noticias.ligada .zona--cotacoes { animation-delay: 1s; }
.anima .cena--noticias.ligada .zona--faixa { animation-delay: 1.15s; }
.cena--noticias.ligada .faixa__texto { animation: faixa-corre 26s 1.8s linear infinite; }
.cena--noticias.ligada .zona__foto--2 { animation: foto-alterna 12s 3s ease-in-out infinite; }

@keyframes cena-liga {
    from { opacity: 0; filter: brightness(.25); }
    to { opacity: 1; filter: none; }
}
@keyframes zona-entra { to { opacity: 1; transform: none; } }
@keyframes faixa-corre { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes foto-alterna { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* =========================================================
   Dispositivos: os aparelhos reais (fotos originais) num mesmo ambiente
   ========================================================= */

/* Luz azul das telas na parede e sombra de contato no piso: o que une o conjunto. */
.cena--dispositivos .ambiente {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 38% 34% at 42% 38%, rgba(81, 152, 251, .26), transparent 70%),
        radial-gradient(ellipse 22% 4% at 66% 97%, rgba(0, 0, 0, .2), transparent 75%);
}

.aparelho { position: absolute; }
/* .cena na frente: as regras das colagens antigas (.colagem img) não valem aqui.
   As fotos da TV e do LED tinham fundo branco: usam-se as versões recortadas
   (aparelho-*.webp, geradas a partir dos originais do Wix). */
.proposta .cena .aparelho img {
    position: static; display: block; width: 100%; height: auto; aspect-ratio: auto;
    object-fit: initial; border-radius: 0; box-shadow: none;
}
.aparelho__tela { position: absolute; inset: 0; clip-path: var(--tela); pointer-events: none; }
/* Foto e área da tela andam juntas dentro do plano. */
.aparelho__plano { position: relative; }

/* Mesma composição da colagem original do site (posições em % do quadro de 999×470). */
.aparelho--vw { left: 0; top: 2.34%; width: 60.06%; z-index: 3; }
.aparelho--tv { left: 38.54%; top: 0; width: 31.43%; z-index: 2; }
.aparelho--led { left: 49.35%; top: 3.62%; width: 50.65%; z-index: 1; }
.aparelho--touch { left: 44.64%; top: 54.68%; width: 25.93%; z-index: 4; }

.aparelho__toque {
    position: absolute; left: 47%; top: 31%; width: 9%; aspect-ratio: 1; margin: -4.5% 0 0 -4.5%;
    border-radius: 50%; border: .3cqw solid rgba(81, 152, 251, .95); opacity: 0;
}

/* Animação: os aparelhos chegam um a um, cada tela liga (preto → clarão → conteúdo),
   um reflexo passa no vidro e o quiosque recebe um toque. */
.anima .cena--dispositivos .ambiente { opacity: 0; transition: opacity 1.6s .6s; }
.anima .cena--dispositivos .aparelho { opacity: 0; transform: translateY(5cqw); }
.anima .cena--dispositivos .aparelho__tela { background: #050608; }

.anima .cena--dispositivos.ligada .ambiente { opacity: 1; }
.anima .cena--dispositivos.ligada .aparelho { animation: aparelho-chega 1s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: var(--chega); }
.anima .cena--dispositivos.ligada .aparelho__tela { animation: tela-acende 1.6s ease-in-out forwards; animation-delay: calc(var(--chega) + .55s); }
.cena--dispositivos .aparelho--vw { --chega: 0s; }
.cena--dispositivos .aparelho--tv { --chega: .2s; }
.cena--dispositivos .aparelho--led { --chega: .4s; }
.cena--dispositivos .aparelho--touch { --chega: .6s; }

.cena--dispositivos.ligada .aparelho__tela::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) no-repeat;
    background-size: 250% 100%; background-position: 150% 0;
    animation: reflexo 1.4s ease-in-out forwards; animation-delay: calc(var(--chega) + 1.5s);
}
.cena--dispositivos.ligada .aparelho__toque { animation: toque 1.3s 2.6s ease-out 2; }

@keyframes aparelho-chega { to { opacity: 1; transform: none; } }
@keyframes tela-acende {
    from { background: rgba(5, 6, 8, .92); }
    to { background: transparent; }
}
@keyframes reflexo { from { background-position: 150% 0; } to { background-position: -60% 0; } }
@keyframes toque {
    0% { opacity: .9; transform: scale(.2); }
    100% { opacity: 0; transform: scale(1.8); }
}

/* Celular: o quadro original é quase quadrado e sobrava espaço; aqui ele fica na
   altura do conjunto, que mantém a composição do desktop. */
@media (max-width: 767px) {
    .proposta .colagem--dispositivos { height: calc(200 * var(--m)); }
}

@media (prefers-reduced-motion: reduce) {
    .cena *, .cena { animation: none !important; transition: none !important; }
    .anima .cena .tv__tela, .anima .cena .zona, .anima .cena .aparelho, .anima .cena .ambiente { clip-path: none; filter: none; opacity: 1; transform: none; }
    .anima .cena .aparelho__tela { background: transparent; }
}
