/* ZTE — la cámara, detrás de los píxeles.
   La pantalla vista muy de cerca, con sus subpíxeles rojo, verde y azul sobre un fondo negro. --q (0 → 1) es el
   avance: en escritorio, el de la portada fijada (--p); en móvil, una animación que se reproduce sola. Al bajar, el
   fondo entre los píxeles se vuelve transparente sobre la cámara (el Axon 20 5G, en 2020, fue el primer móvil a la
   venta con la cámara frontal bajo la pantalla), la lente aparece detrás y la luz pasa entre los píxeles. */

@property --q {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

.cv--zte {
    --q: var(--p);
    /* El fondo se vuelve transparente entre 0,18 y 0,5, suave al empezar y al acabar */
    --o0: clamp(0, (var(--q) - 0.18) / 0.32, 1);
    --open: calc(var(--o0) * var(--o0) * (3 - 2 * var(--o0)));
    /* Las notas, al final */
    --notes: clamp(0, (var(--q) - 0.58) / 0.08, 1);
    --zt-blue: #4fb4ff;
    --zt-ink: #f1f7ff;
    --zt-muted: rgba(214, 232, 255, 0.7);
    --zt-night: #021627;
    --cv-bg: var(--zt-night);
    --cv-ink: var(--zt-ink);
    --cv-muted: var(--zt-muted);
    --cv-hint: var(--zt-muted);
    --cv-accent: var(--zt-blue);
    --cv-font-display: 'Saira', system-ui, sans-serif;
    --cv-font-body: 'Saira', system-ui, sans-serif;
    color: var(--zt-ink);
    background:
        radial-gradient(60% 70% at 72% 45%, rgba(79, 180, 255, 0.14), rgba(79, 180, 255, 0) 70%),
        var(--zt-night);
}

.cv--zte ::selection {
    color: var(--zt-night);
    background: var(--zt-blue);
}

/* La portada no se desvanece al bajar: la lente se ve con todo el texto */
.cv--zte .cv__stage {
    width: min(1180px, 100%);
    justify-items: stretch;
    text-align: left;
}

.cv--zte .cv__copy {
    width: 100%;
    align-items: stretch;
    opacity: 1;
    transform: none;
}

.cv-zt-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(32px, 6vw, 100px);
}

/* —— Nombre y promesa —— */
.cv-zt-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.cv-zt-kicker {
    margin: 0;
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--zt-blue);
}

.cv--zte .cv__title {
    margin-top: 6px;
    font-size: clamp(4.6rem, min(12vw, 21vh), 10rem);
    font-weight: 800;
    font-stretch: 112%;
    line-height: 0.85;
    letter-spacing: -0.01em;
}

.cv--zte .cv-ch {
    animation: cv-zt-letter 0.8s var(--cv-ease) both;
    animation-delay: calc((var(--d) + var(--i) * var(--step)) * 1ms);
}

@keyframes cv-zt-letter {
    from {
        opacity: 0;
        transform: translate3d(0, 0.15em, 0);
    }
}

.cv-zt-line {
    margin: clamp(12px, 2vh, 20px) 0 0;
    font-size: clamp(1.5rem, 2.5vw, 2.3rem);
    font-weight: 600;
    line-height: 1.08;
    text-wrap: balance;
}

.cv--zte .cv__lead {
    max-width: 42ch;
    margin-top: 12px;
    font-size: clamp(0.98rem, 1.15vw, 1.08rem);
    font-weight: 400;
    color: var(--zt-muted);
}

.cv-zt-facts {
    margin-top: clamp(16px, 3vh, 28px);
}

.cv--zte .cv__meta {
    margin: 0;
}

.cv--zte .cv__stats strong {
    color: var(--zt-ink);
}

/* —— La pantalla vista de cerca —— */
.cv-zt-macro {
    position: relative;
    width: clamp(320px, 38vw, 560px);
    margin: 0;
    overflow: hidden;
    background: #03060b;
    border: 1px solid rgba(79, 180, 255, 0.22);
    border-radius: 18px;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

.cv-zt-svg {
    display: block;
    width: 100%;
    height: auto;
}

.cv-zt-back,
.cv-zt-plug {
    fill: #05080e;
}

/* Sobre la cámara, el fondo se vuelve transparente y deja ver la lente */
.cv-zt-plug {
    opacity: calc(1 - var(--open));
}

.cv-zt-ring {
    fill: none;
    stroke: var(--zt-blue);
    stroke-width: 1.2;
    stroke-dasharray: 4 5;
    opacity: calc(var(--open) * 0.7);
}

.cv-zt-px .r {
    fill: #ff4a5a;
    opacity: calc(var(--o) * 0.38);
}

.cv-zt-px .g {
    fill: #41f08b;
    opacity: calc(var(--o) * 0.7);
}

.cv-zt-px .b {
    fill: #4b8cff;
    opacity: var(--o);
}

/* Los píxeles de encima de la cámara siguen ahí; se atenúan un poco para que se vea la lente */
.cv-zt-px--udc {
    opacity: calc(1 - var(--open) * 0.4);
}

/* La luz cae hacia la lente pasando entre los píxeles */
.cv-zt-rays {
    opacity: var(--open);
}

.cv-zt-ray {
    fill: #d8efff;
    transform-box: view-box;
    transform-origin: 195px 130px;
    animation: cv-zt-ray 2.4s linear infinite;
    animation-delay: calc(var(--i) * -0.34s);
}

@keyframes cv-zt-ray {
    from {
        opacity: 0;
        transform: rotate(var(--a)) translateX(96px);
    }

    25% {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: rotate(var(--a)) translateX(10px);
    }
}

.cv-zt-note {
    position: absolute;
    padding: 0.35em 0.7em;
    font-size: clamp(0.72rem, 0.85vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--zt-ink);
    background: rgba(2, 22, 39, 0.82);
    border: 1px solid rgba(79, 180, 255, 0.4);
    border-radius: 999px;
    opacity: var(--notes);
}

.cv-zt-note--pix {
    top: 5%;
    left: 4%;
}

.cv-zt-note--cam {
    right: 4%;
    bottom: 6%;
}

/* —— Móvil: la cámara aparece sola —— */
@media (max-width: 900px) {
    .cv--zte {
        --q: 0;
        animation: cv-zt-run 6s linear 1.6s both;
    }

    .cv-zt-wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .cv--zte .cv__title {
        font-size: clamp(3.8rem, 22vw, 5.6rem);
    }

    .cv-zt-line {
        font-size: clamp(1.3rem, 6vw, 1.7rem);
    }

    .cv--zte .cv__lead {
        font-size: 0.95rem;
    }

    .cv-zt-facts {
        margin-top: 12px;
    }

    .cv-zt-macro {
        width: 100%;
        border-radius: 14px;
    }

    .cv-zt-note {
        font-size: 0.66rem;
    }
}

@keyframes cv-zt-run {
    from { --q: 0; }
    to { --q: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cv--zte,
    .cv--zte .cv-ch,
    .cv-zt-ray {
        animation: none;
    }

    /* Directamente la lente a la vista */
    .cv--zte {
        --q: 1;
    }
}
