/* Base dos mini apps dos filmes.
   Tudo é medido em em, e o em da cena é uma fração da largura do cartão (cqw): a cena escala inteira.
   Cartão largo: 16:9, 69em por 39em. Cartão estreito: 4:5, 43em por 54em. */
.scene {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  font-family: var(--font);
  font-size: 1.45cqw;
  line-height: 1.35;
}

@container film (max-width: 560px) {
  .scene {
    aspect-ratio: 4 / 5;
    font-size: 2.3cqw;
  }
}

/* A câmera assenta devagar no começo do filme */
.cam {
  position: absolute;
  inset: 0;
  transform-origin: 50% 40%;
}

.film.is-playing .cam {
  animation: cam var(--film) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes cam {
  from {
    transform: scale(1.07) translateY(2%);
  }

  55%,
  100% {
    transform: none;
  }
}

/* ── Linha do tempo: cada peça entra (ou sai) em --at, uma fração do filme ──
   Parado, o cartão mostra o quadro final; por isso o estado de base de cada peça é o final. */
.film.is-playing :is(.sc-in, .sc-pop, .sc-up, .sc-down, .sc-fade, .sc-out, .sc-draw, .sc-grow-x, .sc-grow-y, .sc-ripple, .sc-lit, .sc-select, .sc-flash, .sc-type, .sc-unlock) {
  animation-duration: var(--d, 0.7s);
  animation-timing-function: var(--ease-out);
  animation-fill-mode: both;
  animation-delay: calc(var(--film) * var(--at, 0));
}

.film.is-playing .sc-in { animation-name: sc-in; }
.film.is-playing .sc-pop { animation-name: sc-pop; }
.film.is-playing .sc-up { animation-name: sc-up; }
.film.is-playing .sc-down { animation-name: sc-down; }
.film.is-playing .sc-fade { animation-name: sc-fade; }
.film.is-playing .sc-out { animation-name: sc-out; }
.film.is-playing .sc-draw { animation-name: sc-draw; }
.film.is-playing .sc-grow-x { animation-name: sc-grow-x; }
.film.is-playing .sc-grow-y { animation-name: sc-grow-y; }
.film.is-playing .sc-ripple { animation-name: sc-ripple; }
.film.is-playing .sc-lit { animation-name: sc-lit; }
.film.is-playing .sc-select { animation-name: sc-select; }
.film.is-playing .sc-flash { animation-name: sc-flash; }
.film.is-playing .sc-unlock { animation-name: sc-unlock; }

.film.is-playing .sc-type {
  animation-name: sc-type;
  animation-timing-function: steps(16, end);
}

@keyframes sc-in { from { opacity: 0; transform: translateY(0.8em) scale(0.98); } }
@keyframes sc-pop { from { opacity: 0; transform: scale(0.82); } 60% { opacity: 1; transform: scale(1.03); } }
@keyframes sc-up { from { transform: translateY(105%); } }
@keyframes sc-down { from { opacity: 0; transform: translateY(-1.4em) scale(0.97); } }
@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sc-draw { from { stroke-dashoffset: 1; } }
@keyframes sc-grow-x { from { transform: scaleX(0); } }
@keyframes sc-grow-y { from { transform: scaleY(0); } }
@keyframes sc-ripple { from { opacity: 0.6; transform: scale(0); } to { opacity: 0; transform: scale(1); } }
@keyframes sc-lit { from { opacity: 0.45; box-shadow: none; } }
@keyframes sc-select { from { background: var(--sel-from); box-shadow: none; } }
@keyframes sc-flash { 0%, 100% { background: transparent; } 35% { background: var(--flash); } }
@keyframes sc-unlock { from { filter: grayscale(1) brightness(0.92); } }
@keyframes sc-type { from { width: 0; } }

/* Estados de base: o que sai já está fora, o que desenha já está desenhado */
.sc-out {
  opacity: 0;
}

.sc-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.sc-grow-x {
  transform-origin: left center;
}

.sc-grow-y {
  transform-origin: top center;
}

.sc-type {
  display: inline-block;
  width: 16ch;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.sc-stack,
.sc-swap {
  display: grid;
}

.sc-swap {
  display: inline-grid;
}

.sc-stack > *,
.sc-swap > * {
  grid-area: 1 / 1;
}

.sc-swap > * {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

/* Toque: um anel que abre a partir do centro do alvo */
.sc-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5em;
  height: 5em;
  margin: -2.5em 0 0 -2.5em;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.45);
  opacity: 0;
  pointer-events: none;
}

/* ── Peças ── */
.sc-ico {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc-av {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: linear-gradient(140deg, hsl(var(--h) 75% 66%), hsl(calc(var(--h) + 35) 70% 46%));
  color: #fff;
  font-size: 0.8em;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
}

.sc-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  width: 1.9em;
  height: 1.9em;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0.25em 0.35em rgb(0 0 0 / 0.35));
}

.sc-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sc-cursor path {
  fill: #fff;
  stroke: #111;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* Celular: moldura de metal, ilha e barra de status */
.sc-phone {
  position: absolute;
  width: 17.5em;
  height: 36em;
  padding: 0.5em;
  border-radius: 3em;
  background: linear-gradient(150deg, #47474d, #121214 38%, #2b2b31 80%, #4a4a50);
  box-shadow:
    0 0 0 0.1em #55555c,
    inset 0 0 0.15em rgb(255 255 255 / 0.25),
    0 3em 5em -1.5em rgb(0 0 0 / 0.7);
}

.sc-phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 2.55em;
}

.sc-island {
  position: absolute;
  top: 0.65em;
  left: 50%;
  z-index: 10;
  width: 5.4em;
  height: 1.55em;
  margin-left: -2.7em;
  border-radius: 1em;
  background: #000;
}

.sc-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85em 0.6em 0;
  font-size: 0.78em;
}

.sc-status b {
  font-weight: 650;
}

.sc-status__icons {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.sc-status .sc-ico {
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2.6;
}

.sc-signal {
  display: flex;
  align-items: flex-end;
  gap: 0.12em;
  height: 0.8em;
}

.sc-signal i {
  width: 0.2em;
  border-radius: 0.1em;
  background: currentColor;
}

.sc-signal i:nth-child(1) { height: 35%; }
.sc-signal i:nth-child(2) { height: 55%; }
.sc-signal i:nth-child(3) { height: 75%; }
.sc-signal i:nth-child(4) { height: 100%; }

.sc-batt {
  position: relative;
  width: 1.7em;
  height: 0.85em;
  padding: 0.1em;
  border-radius: 0.25em;
  box-shadow: inset 0 0 0 0.09em currentColor;
}

.sc-batt i {
  display: block;
  width: 78%;
  height: 100%;
  border-radius: 0.12em;
  background: currentColor;
}

/* Janela de computador */
.sc-lights {
  display: flex;
  gap: 0.4em;
}

.sc-lights i {
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: #ff5f57;
}

.sc-lights i:nth-child(2) { background: #febc2e; }
.sc-lights i:nth-child(3) { background: #28c840; }

/* Notificação no estilo do sistema: vidro claro por cima de tudo */
.sc-notif {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 0.8em;
  padding: 0.9em 1.05em;
  border-radius: 1.4em;
  background: rgb(248 248 250 / 0.84);
  color: #121212;
  box-shadow: 0 1.6em 3em -1em rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(255 255 255 / 0.6);
  -webkit-backdrop-filter: blur(1.2em) saturate(1.6);
  backdrop-filter: blur(1.2em) saturate(1.6);
  font-size: 0.95em;
}

.sc-notif__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: 0.75em;
  color: #fff;
}

.sc-notif__icon .sc-ico {
  width: 1.35em;
  height: 1.35em;
}

.sc-notif__body {
  display: grid;
  gap: 0.1em;
  min-width: 0;
  line-height: 1.3;
}

.sc-notif__top {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.sc-notif__top small {
  color: #7a7a80;
  font-size: 0.85em;
}

.sc-qr {
  display: block;
  width: 100%;
}
