/* ==========================================================================
   Formato 9:16: simulación de historias de Instagram.
   ========================================================================== */

#formatos .art-b {
  background: #000000;
}

.art-b {
  container-type: inline-size;
}

#formatos .art-b.art .fmt {
  background: rgba(255,255,255,.92);
  color: #000000;
  z-index: 7;
}

.st-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .35s;
}

.st-scene.on {
  opacity: 1;
}

.st-bars {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.st-bars span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255,255,255,.4);
}

.st-bars i {
  display: block;
  height: 100%;
  width: 0;
  background: #FFFFFF;
}

.st-head {
  position: absolute;
  top: 22px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
  font-size: max(11px,4.3cqw);
  pointer-events: none;
  transition: color .35s;
}

.st-av {
  flex: none;
  display: block;
  width: max(24px,9cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #B9C3C6;
  box-shadow: 0 0 0 2px #FFFFFF,0 0 0 3.5px #13B3CA;
}

.st-av svg {
  display: block;
  width: 100%;
  height: 100%;
}

.st-head b {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-head em {
  font-style: normal;
  opacity: .7;
  white-space: nowrap;
}

.art-b.light .st-bars span {
  background: rgba(0,0,0,.18);
}

.art-b.light .st-bars i {
  background: #000000;
}

.art-b.light .st-head {
  color: #000000;
}

.st-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.st-prev {
  left: 0;
  width: 32%;
}

.st-next {
  right: 0;
  width: 68%;
}

.st-nav:focus-visible {
  outline: 3px solid #13B3CA;
  outline-offset: -5px;
}

/* Historia 1: lanzamiento, un sol celeste sale sobre el horizonte */
.s1 {
  background: #FFFFFF;
}

.s1 .cap {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 24%;
  color: #000000;
  font-weight: 850;
  font-stretch: 115%;
  font-size: 11cqw;
  line-height: 1;
  letter-spacing: -.02em;
}

.s1.on .cap {
  animation: stIn .6s .25s both;
}

.s1 .sun {
  position: absolute;
  left: -35%;
  width: 170%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000000;
  top: 100%;
}

.s1.on .sun {
  animation: stSun 1.3s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes stSun {
  to {
    top: 58%;
  }
}

.s1 .dot {
  position: absolute;
  left: 41%;
  width: 18cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #019EB5;
  top: 100%;
}

.s1.on .dot {
  animation: stDot 4.5s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes stDot {
  0% {
    top: 100%;
  }
  40% {
    top: 46%;
  }
  100% {
    top: 42%;
  }
}

/* Historia 2: persona hablándole a la cámara mientras muestra un producto */
.s2 {
  background: #000000;
  display: grid;
  place-items: center;
}

.talk svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.talk svg * {
  transform-box: fill-box;
}

.talk .tk-all {
  transform-origin: 50% 100%;
  animation: tkBob 2.4s ease-in-out infinite alternate;
}

@keyframes tkBob {
  from {
    transform: rotate(-1deg);
  }
  to {
    transform: rotate(1deg);
  }
}

.talk .tk-head {
  transform-origin: 50% 100%;
  animation: tkNod 1.2s ease-in-out infinite alternate;
}

@keyframes tkNod {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(2.5deg) translateY(-.5px);
  }
}

.talk .tk-mouth {
  transform-origin: center;
  animation: tkTalk .9s linear infinite;
}

@keyframes tkTalk {
  0% {
    transform: scaleY(.25);
  }
  18% {
    transform: scaleY(1);
  }
  32% {
    transform: scaleY(.45);
  }
  48% {
    transform: scaleY(1.25);
  }
  62% {
    transform: scaleY(.3);
  }
  80% {
    transform: scaleY(.9);
  }
  100% {
    transform: scaleY(.25);
  }
}

.talk .tk-eye {
  transform-origin: center;
  animation: gBlink 3.2s infinite;
}

.talk .tk-prod {
  transform-origin: 50% 100%;
  animation: tkShow 1.5s ease-in-out infinite alternate;
}

@keyframes tkShow {
  from {
    transform: rotate(-5deg);
  }
  to {
    transform: rotate(4deg) translateY(-2px);
  }
}

.tk-sub {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 13%;
  height: 2em;
  text-align: center;
  font-size: max(11px,4.8cqw);
  font-weight: 700;
}

.tk-sub span {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: .2em .5em;
  background: #000000;
  color: #FFFFFF;
  border-radius: .3em;
  opacity: 0;
}

.s2.on .tk-sub span:nth-child(1) {
  animation: tkSub 1.5s .1s both;
}

.s2.on .tk-sub span:nth-child(2) {
  animation: tkSub 1.5s 1.6s both;
}

.s2.on .tk-sub span:nth-child(3) {
  animation: tkSubLast 1.4s 3.1s both;
}

@keyframes tkSub {
  0% {
    opacity: 0;
  }
  10%, 88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes tkSubLast {
  0% {
    opacity: 0;
  }
  12%, 100% {
    opacity: 1;
  }
}

/* Historia 3: reacciones */
.s3 {
  background: #000000;
}

.s3 .big {
  position: absolute;
  left: 50%;
  top: 44%;
  color: #FFFFFF;
  font-size: 40cqw;
  line-height: 1;
  transform: translate(-50%,-50%) scale(0);
}

.s3.on .big {
  animation: stHeart .7s .2s cubic-bezier(.2,1.6,.4,1) forwards,stBeat 1.1s 1.1s ease-in-out infinite;
}

@keyframes stHeart {
  to {
    transform: translate(-50%,-50%) scale(1);
  }
}

@keyframes stBeat {
  0%, 100% {
    transform: translate(-50%,-50%) scale(1);
  }
  50% {
    transform: translate(-50%,-50%) scale(1.08);
  }
}

.s3 .fly {
  position: absolute;
  bottom: 4%;
  color: #13B3CA;
  font-size: 10cqw;
  line-height: 1;
  opacity: 0;
}

.s3.on .fly {
  animation: stFly 2.6s ease-out infinite;
}

.s3 .fly:nth-child(2) {
  left: 64%;
  animation-delay: .3s;
}

.s3 .fly:nth-child(3) {
  left: 76%;
  color: #FFFFFF;
  animation-delay: .8s;
}

.s3 .fly:nth-child(4) {
  left: 70%;
  animation-delay: 1.2s;
}

.s3 .fly:nth-child(5) {
  left: 82%;
  color: #FFFFFF;
  animation-delay: 1.6s;
}

.s3 .fly:nth-child(6) {
  left: 60%;
  animation-delay: 2s;
}

.s3 .fly:nth-child(7) {
  left: 78%;
  animation-delay: 2.4s;
}

@keyframes stFly {
  0% {
    opacity: 0;
    transform: translate(0,0) scale(.6);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-12cqw,-120cqw) scale(1.1);
  }
}

/* Historia 4: franjas de la marca y llamado a la acción */
.s4 {
  background: #000000;
}

.s4 .stripe {
  position: absolute;
  top: -20%;
  bottom: -20%;
  transform: skewX(-42deg) translateX(-140cqw);
}

.s4 .k1 {
  left: 8%;
  width: 30%;
  background: #019EB5;
}

.s4 .k2 {
  left: 46%;
  width: 7%;
  background: #FFFFFF;
}

.s4 .k3 {
  left: 60%;
  width: 16%;
  background: #006A7A;
}

.s4.on .stripe {
  animation: stSweep .9s cubic-bezier(.2,.8,.2,1) forwards;
}

.s4.on .k2 {
  animation-delay: .12s;
}

.s4.on .k3 {
  animation-delay: .24s;
}

@keyframes stSweep {
  to {
    transform: skewX(-42deg) translateX(0);
  }
}

.s4 .msg {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 32%;
  color: #FFFFFF;
  font-weight: 850;
  font-stretch: 115%;
  font-size: 11.5cqw;
  line-height: 1.08;
  letter-spacing: -.02em;
}

.s4 .msg span {
  display: table;
  background: #000000;
  padding: .04em .16em;
  margin: .05em 0;
  opacity: 0;
}

.s4.on .msg span {
  animation: stIn .45s both;
}

.s4.on .msg span:nth-child(1) {
  animation-delay: .9s;
}

.s4.on .msg span:nth-child(2) {
  animation-delay: 1.25s;
}

.s4 .cta {
  position: absolute;
  left: 50%;
  bottom: 9%;
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding: 2.4cqw 5cqw;
  border-radius: 99px;
  background: #FFFFFF;
  color: #000000;
  font-weight: 700;
  font-size: max(11px,4.6cqw);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
}

.s4 .cta::before {
  content: "";
  width: 2.2cqw;
  height: 2.2cqw;
  border-left: 2px solid #000000;
  border-top: 2px solid #000000;
  transform: rotate(45deg) translate(1px,1px);
}

.s4.on .cta {
  animation: stCta .5s 2s both,stBob 1s 2.6s ease-in-out infinite;
}

@keyframes stCta {
  from {
    opacity: 0;
    transform: translate(-50%,10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%,0);
  }
}

@keyframes stBob {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%,0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%,-4px);
  }
}
