/*
 * Portadas de las páginas *-info — base común.
 *
 * Cada marca tiene su hoja en styles/covers/<marca>.css con su paleta, su tipografía,
 * su pieza visual (.cv__art) y sus animaciones. Aquí va lo compartido:
 *
 * - Escenario: la portada se queda fija mientras se desplaza el primer tramo de la página
 *   (--p va de 0 a 1 en ese tramo) y cada marca anima su "salida" con ese valor.
 * - Entrada: los elementos con .cv-in aparecen escalonados (--d = retraso en ms).
 * - Regla de oro: la animación de entrada va en el elemento y la de scroll en su contenedor
 *   (.cv__copy / .cv__art), porque una animación con fill-mode fija opacity/transform y taparía el scroll.
 */

.info-page--scroll .info-hero-stage:has(> .info-hero-stage__inner > .cv) {
    position: relative;
    height: 165vh;
    min-height: 0;
    border-bottom: 0;
    background: var(--cv-bg, var(--info-surface));
    /* Restos de las portadas antiguas (p. ej. TCL animaba un filter aquí): un filter o transform
       en el escenario rompe el position: fixed con el que se queda quieta la portada */
    animation: none !important;
    filter: none !important;
    transform: none !important;
}

.info-page--scroll .info-hero-stage:has(> .info-hero-stage__inner > .cv)::before {
    content: none;
}

.info-page--scroll .info-hero-stage:has(> .info-hero-stage__inner > .cv) .info-hero-stage__inner {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    z-index: 1;
}

.info-hero.cv {
    --p: var(--hero-progress, 0);
    --cv-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --cv-ease-io: cubic-bezier(0.65, 0, 0.35, 1);
    --cv-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --cv-gutter: clamp(20px, 5vw, 88px);
    --cv-top: calc(var(--header-height, 76px) + clamp(12px, 3vh, 36px));
    --cv-bottom: clamp(64px, 10vh, 104px);
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--cv-top) var(--cv-gutter) var(--cv-bottom);
    overflow: hidden;
    isolation: isolate;
    color: var(--cv-ink, #111);
    background: var(--cv-bg, #fff);
    font-family: var(--cv-font-body, inherit);
    opacity: 1;
    transform: none;
    box-sizing: border-box;
}

.cv *,
.cv *::before,
.cv *::after {
    box-sizing: border-box;
}

/* —— Capas —— */
.cv__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.cv__bg > * {
    position: absolute;
}

.cv__stage {
    position: relative;
    z-index: 2;
    width: min(1240px, 100%);
    display: grid;
    align-items: center;
}

.cv--split .cv__stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(24px, 5vw, 96px);
}

.cv--split .cv__art {
    order: 2;
}

.cv--split.cv--art-left .cv__art {
    order: 0;
}

.cv--center .cv__stage {
    justify-items: center;
    text-align: center;
}

/* Pieza visual detrás del texto, en la misma celda */
.cv--stack .cv__stage {
    grid-template-areas: 'stack';
}

.cv--stack .cv__stage > * {
    grid-area: stack;
}

.cv__art {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    pointer-events: none;
}

.cv__art-in {
    position: relative;
    display: grid;
    place-items: center;
}

.cv__copy {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    transform: translate3d(0, calc(var(--p) * -5vh), 0);
    opacity: calc(1 - var(--p) * 0.85);
}

.cv--center .cv__copy {
    align-items: center;
}

/* —— Texto —— */
.cv__kicker,
.cv__title,
.cv__lead,
.cv__meta,
.cv__stats,
.cv__note {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    text-shadow: none;
    max-width: none;
}

.cv__kicker {
    font-family: var(--cv-font-kicker, var(--cv-font-body));
    font-size: clamp(0.75rem, 0.8vw, 0.82rem);
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--cv-accent, currentColor);
}

.cv__title {
    font-family: var(--cv-font-display, inherit);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.02em;
    color: var(--cv-title, var(--cv-ink));
    margin-top: clamp(8px, 1.4vh, 16px);
}

.cv__lead {
    margin-top: clamp(12px, 2vh, 22px);
    max-width: 30ch;
    font-family: var(--cv-font-lead, var(--cv-font-body));
    font-size: clamp(1.02rem, 1.35vw, 1.3rem);
    font-weight: 500;
    line-height: 1.38;
    color: var(--cv-ink);
    text-wrap: balance;
}

.cv__meta {
    margin-top: clamp(8px, 1.2vh, 12px);
    font-family: var(--cv-font-kicker, var(--cv-font-body));
    font-size: clamp(0.78rem, 0.85vw, 0.84rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cv-muted, currentColor);
}

/* Título partido en letras (lectores de pantalla leen la palabra completa) */
.cv-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.cv-word {
    display: inline-flex;
    white-space: nowrap;
}

.cv-ch {
    display: inline-block;
    white-space: pre;
}

/* —— Botón y datos —— */
.cv__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: clamp(16px, 2.6vh, 28px);
}

.cv__cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
    min-height: 48px;
    padding: 0 clamp(20px, 2vw, 28px);
    overflow: hidden;
    isolation: isolate;
    font-family: var(--cv-font-cta, var(--cv-font-body));
    font-size: clamp(0.92rem, 1vw, 1rem);
    font-weight: 700;
    letter-spacing: var(--cv-cta-tracking, 0.01em);
    text-transform: var(--cv-cta-case, none);
    text-decoration: none;
    color: var(--cv-cta-ink, #fff);
    background: var(--cv-cta-bg, #111);
    border: var(--cv-cta-border, 0);
    border-radius: var(--cv-cta-radius, 0);
    box-shadow: var(--cv-cta-shadow, none);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.35s var(--cv-ease), box-shadow 0.35s var(--cv-ease), background-color 0.35s, color 0.35s;
}

.cv__cta::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--cv-ease);
}

.cv__cta:hover::before,
.cv__cta:focus-visible::before {
    transform: translateX(120%);
}

.cv__cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--cv-cta-shadow-hover, 0 10px 26px -12px rgba(0, 0, 0, 0.45));
}

.cv__cta:focus-visible {
    outline: 3px solid var(--cv-focus, var(--cv-accent, #111));
    outline-offset: 4px;
}

.cv__cta-arrow {
    display: inline-block;
    transition: transform 0.35s var(--cv-ease);
}

.cv__cta:hover .cv__cta-arrow {
    transform: translateX(5px);
}

.cv__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-top: clamp(10px, 1.6vh, 16px);
    font-family: var(--cv-font-stats, var(--cv-font-body));
    font-size: clamp(0.8rem, 0.86vw, 0.9rem);
    line-height: 1.4;
    color: var(--cv-muted, currentColor);
}

.cv--center .cv__stats {
    justify-content: center;
}

.cv__stats strong {
    font-weight: 700;
    color: var(--cv-ink);
}

.cv__stat-sep {
    opacity: 0.6;
}

.cv__stat--latest {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, currentColor 55%, transparent);
    pointer-events: auto;
    transition: border-color 0.25s, color 0.25s;
}

.cv__stat--latest:hover {
    color: var(--cv-ink);
    border-color: var(--cv-accent, currentColor);
}

/* —— Aviso de scroll —— */
.cv__hint {
    position: absolute;
    left: 50%;
    bottom: clamp(14px, 3vh, 28px);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--cv-font-kicker, var(--cv-font-body));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cv-hint, var(--cv-muted, currentColor));
    transform: translateX(-50%);
    opacity: calc(1 - var(--p) * 5);
    pointer-events: none;
}

.cv__hint-line {
    position: relative;
    display: block;
    width: 1px;
    height: 34px;
    overflow: hidden;
    background: color-mix(in srgb, currentColor 22%, transparent);
}

.cv__hint-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: -40%;
    width: 100%;
    height: 40%;
    background: currentColor;
    animation: cv-hint-drop 1.8s var(--cv-ease-io) infinite;
}

@keyframes cv-hint-drop {
    from { top: -40%; }
    to { top: 100%; }
}

/* —— Entrada —— */
.cv-in {
    animation: var(--cv-anim, cv-rise) var(--cv-dur, 0.95s) var(--cv-ease) both;
    animation-delay: calc(var(--d, 0) * 1ms);
}

@keyframes cv-rise {
    from {
        opacity: 0;
        transform: translate3d(0, 26px, 0);
    }
}

@keyframes cv-fade {
    from { opacity: 0; }
}

@keyframes cv-focus {
    from {
        opacity: 0;
        filter: blur(14px);
        transform: scale(1.06);
    }
}

@keyframes cv-pop {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }
    60% {
        opacity: 1;
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cv-mask-up {
    from {
        clip-path: inset(0 0 100% 0);
        transform: translate3d(0, 0.5em, 0);
    }
    to {
        clip-path: inset(-20% -10% -20% -10%);
        transform: none;
    }
}

@keyframes cv-draw-x {
    from { transform: scaleX(0); }
}

@keyframes cv-draw-y {
    from { transform: scaleY(0); }
}

@keyframes cv-spin {
    to { transform: rotate(360deg); }
}

@keyframes cv-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -10px, 0); }
}

@keyframes cv-breathe {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes cv-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* En móvil la cabecera pone el nombre en negro: en las marcas de fondo oscuro no se leía */
@media (max-width: 900px) {
    .info-page--scroll .menu-superior:not(.search-panel-open) .titulo-menu {
        color: var(--bar-ink) !important;
        -webkit-text-fill-color: var(--bar-ink) !important;
    }
}

/* —— Tablet y móvil: todo en columna —— */
@media (max-width: 900px) {
    .info-page--scroll .info-hero-stage:has(> .info-hero-stage__inner > .cv) {
        height: 135vh;
        height: 135svh;
    }

    .info-hero.cv {
        --cv-gutter: 20px;
        --cv-top: calc(var(--header-height, 68px) + 14px);
        --cv-bottom: 72px;
        justify-content: center;
    }

    .cv--split .cv__stage {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(10px, 2.4vh, 22px);
        justify-items: center;
        text-align: center;
    }

    .cv--split .cv__art,
    .cv--split.cv--art-left .cv__art {
        order: 0;
    }

    .cv--split .cv__copy {
        align-items: center;
    }

    .cv--split .cv__stats {
        justify-content: center;
    }

    .cv__lead {
        font-size: 1rem;
    }

    .cv__actions {
        justify-content: center;
    }

    .cv__hint {
        bottom: 14px;
    }

    .cv__hint-line {
        height: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cv *,
    .cv *::before,
    .cv *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition: none !important;
    }
}
