.itps-entry { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .itps-intro .itps-entry {
    --itps-entry-progress: 0;
    position: fixed;
    inset: 0;
    z-index: 150;
    isolation: isolate;
    display: grid;
    place-items: center;
    overflow: clip;
    pointer-events: none;
    color: #fff;
    background:
      radial-gradient(ellipse 52% 66% at 52% 48%, #292653 0%, transparent 72%),
      #11102a;
    animation: itps-entry-fallback .48s ease 2.35s forwards;
  }
  .itps-entry::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #dcd9ff 0 .8px, transparent 1.2px) 0 0 / 28px 28px;
    mask-image: radial-gradient(ellipse at 51% 48%, transparent 24%, #000 71%);
    opacity: .19;
  }
  .itps-entry::after {
    content: "";
    position: absolute;
    right: -8vw;
    bottom: -8vh;
    z-index: -1;
    width: clamp(560px, 79vw, 1350px);
    aspect-ratio: 3 / 2;
    background: url("./assets/editorial/cifras-nubes-capas.webp") center / contain no-repeat;
    mask-image: linear-gradient(90deg, transparent, #000 24% 92%, transparent), linear-gradient(transparent, #000 20%);
    mask-composite: intersect;
    opacity: .29;
    transform: translate3d(0, calc(var(--itps-entry-progress) * -28px), 0);
  }
  .itps-entry-lockup {
    position: relative;
    display: grid;
    justify-items: center;
    gap: clamp(1.1rem, 3.1vh, 2rem);
    padding-bottom: .4rem;
    transform: translateY(-3vh);
  }
  .itps-entry-mark {
    height: clamp(5.35rem, 13vw, 10.5rem);
    aspect-ratio: 285 / 324;
    position: relative;
    isolation: isolate;
    filter: drop-shadow(0 16px 38px #1884bb48);
    perspective: 520px;
  }
  .itps-entry-mark i {
    position: absolute;
    inset: 0;
    background: url('./assets/brand/itps-one.png') left center / auto 100% no-repeat;
    animation: itps-entry-piece .85s cubic-bezier(.2,.8,.2,1) both;
  }
  .itps-entry-mark i:first-child {
    --piece-x: 32%;
    --piece-y: -22%;
    --piece-r: 21deg;
    clip-path: polygon(14% 0%, 100% 0%, 100% 45%);
    animation-delay: .07s;
  }
  .itps-entry-mark i:nth-child(2) {
    --piece-x: -27%;
    --piece-y: 0%;
    --piece-r: -19deg;
    clip-path: polygon(0 7%, 67% 39%, 74% 48%, 70% 57%, 0 94%);
  }
  .itps-entry-mark i:nth-child(3) {
    --piece-x: 31%;
    --piece-y: 21%;
    --piece-r: -19deg;
    clip-path: polygon(14% 100%, 100% 54%, 100% 100%);
    animation-delay: .15s;
  }
  .itps-entry-wordmark {
    width: clamp(7rem, 17vw, 11rem);
    aspect-ratio: 823 / 136;
    background: url('./assets/brand/itps-one-horizontal.png') right center / auto 100% no-repeat;
    filter: brightness(0) invert(1);
    animation: itps-entry-name .5s cubic-bezier(.24,.8,.3,1) .3s both;
  }
  .itps-entry-readout {
    position: absolute;
    left: max(clamp(18px, 4.5vw, 74px), env(safe-area-inset-left));
    right: max(clamp(18px, 4.5vw, 74px), env(safe-area-inset-right));
    bottom: max(clamp(20px, 5vh, 64px), env(safe-area-inset-bottom));
    display: flex;
    align-items: baseline;
    gap: .42rem;
    font-variant-numeric: tabular-nums lining-nums;
  }
  .itps-entry-count {
    font-size: clamp(3.65rem, 8.4vw, 10rem);
    letter-spacing: -.085em;
    line-height: .9;
    font-weight: 400;
  }
  .itps-entry-percent {
    font-size: clamp(.8rem, 1.4vw, 1.35rem);
    color: #a6f7e2;
  }
  .itps-entry-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.72rem;
    height: 1px;
    background: #c7c5ff45;
  }
  .itps-entry-track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #4343a3, #247ecd, #3cd2ad);
    transform: scaleX(var(--itps-entry-progress));
    transform-origin: left;
  }
  .itps-intro .itps-entry.is-leaving {
    animation: itps-entry-wipe .55s cubic-bezier(.78,.02,.33,1) forwards;
  }
  @keyframes itps-entry-piece {
    from { opacity: 0; transform: translate(var(--piece-x), var(--piece-y)) rotate(var(--piece-r)) rotateY(-57deg) scale(.85); }
    65% { opacity: 1; }
    to { opacity: 1; transform: none; }
  }
  @keyframes itps-entry-name {
    from { opacity: 0; transform: translateY(8px); clip-path: inset(0 0 100% 0); }
    to { opacity: 1; transform: none; clip-path: inset(0); }
  }
  @keyframes itps-entry-wipe {
    from { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    to { clip-path: polygon(135% 0, 160% 0, 160% 100%, 101% 100%); visibility: hidden; }
  }
  @keyframes itps-entry-fallback {
    to { opacity: 0; visibility: hidden; }
  }
}

/* ---------- Cielo del cargador: anticipa la atmósfera de la portada ---------- */
.itps-entry-sky { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .itps-intro .itps-entry::after { content: none; }
  .itps-intro .itps-entry-sky {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    overflow: clip;
    transform: translate3d(0, calc(var(--itps-entry-progress) * -3vh), 0) scale(calc(1.06 - var(--itps-entry-progress) * .06));
  }
  /* Viñeta: el centro queda limpio para el logo y la lectura */
  .itps-entry-sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 30% 34% at 50% 45%, #11102a 0 30%, #11102ab3 55%, transparent 100%),
      linear-gradient(0deg, #11102ae6 0, transparent 22%);
  }
  .itps-entry-sky i {
    position: absolute;
    display: block;
    opacity: 0;
    animation: entry-sky-in 1.4s cubic-bezier(.2, .7, .2, 1) forwards;
  }
  .itps-entry-sky b {
    display: block;
    width: 100%;
    background: center / contain no-repeat;
    animation: entry-sky-drift 3.2s ease-in-out infinite alternate;
  }
  .es-banda { left: -10vw; right: -10vw; bottom: -2vh; --o: .7; animation-delay: .05s !important; }
  .es-banda b { aspect-ratio: 1800 / 282; background-image: url("./assets/editorial/cielo/noche-banda.webp"); }
  .es-a { right: 8vw; bottom: 4vh; width: min(30vw, 46vh); --o: .82; animation-delay: .15s !important; }
  .es-a b { aspect-ratio: 666 / 942; background-image: url("./assets/editorial/cielo/noche-a.webp"); }
  .es-c { right: -4vw; top: 12vh; width: min(24vw, 40vh); --o: .62; animation-delay: .3s !important; }
  .es-c b { aspect-ratio: 566 / 779; background-image: url("./assets/editorial/cielo/noche-c.webp"); animation-duration: 3.8s; animation-direction: alternate-reverse; }
  .es-b { left: 9vw; top: 14vh; width: min(10vw, 20vh); --o: .45; animation-delay: .4s !important; }
  .es-b b { aspect-ratio: 403 / 648; background-image: url("./assets/editorial/cielo/noche-b.webp"); animation-duration: 2.8s; }
  @keyframes entry-sky-in {
    from { opacity: 0; transform: translate3d(0, 4vh, 0) scale(.96); filter: blur(10px); }
    to { opacity: var(--o); transform: none; filter: blur(0); }
  }
  @keyframes entry-sky-drift {
    from { transform: translate3d(-1.2%, .6%, 0); }
    to { transform: translate3d(1.2%, -.6%, 0); }
  }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 800px) {
  .es-a { right: -16vw; bottom: 9vh; width: 50vw; }
  .es-c { right: -22vw; top: 6vh; width: 40vw; }
  .es-b { left: -6vw; top: 16vh; width: 20vw; }
  .itps-entry-sky::after { background: radial-gradient(ellipse 56% 30% at 50% 45%, #11102a 0 36%, #11102ab3 62%, transparent 100%), linear-gradient(0deg, #11102ae6 0, transparent 22%); }
  .es-banda { left: -60vw; right: -60vw; }
}
