/* ═══════════════════════════════════════════════════════════════════════════
   YUZIOT — Enhancement Layer (capa aditiva)
   Animaciones de scroll, dashboard en vivo, parallax, tilt, marca de agua
   y refinamiento de detalle. No reemplaza styles.css; sólo añade.
   Respeta prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Barra de progreso de scroll ───────────────────────────────────────── */
.yz-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    /* Línea subliminal: 1px, cian a muy baja opacidad — casi imperceptible
       contra el fondo (#0a0e14). El subconsciente la detecta sin que salte a
       la vista; sin glow (el resplandor la volvía protagonista). */
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.10) 0%, rgba(0, 229, 255, 0.30) 100%);
    z-index: calc(var(--z-fixed) + 5);
    pointer-events: none;
    will-change: transform;
}

/* ── Reveal al scroll ──────────────────────────────────────────────────── */
.yz-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.7, 0.2, 1),
                transform 0.7s cubic-bezier(0.22, 0.7, 0.2, 1);
    transition-delay: var(--yz-delay, 0ms);
    will-change: opacity, transform;
}
.yz-reveal.yz-in { opacity: 1; transform: none; }

/* ── Tilt 3D en tarjetas ───────────────────────────────────────────────── */
.yz-tilt {
    transform-style: preserve-3d;
    transition: transform 0.25s cubic-bezier(0.22, 0.7, 0.2, 1), box-shadow 0.25s ease;
    will-change: transform;
}

/* ═══════════════════════════════════════════════════════════════════════
   YUZIOT DASHBOARD — consola de telemetría en vivo
   ═══════════════════════════════════════════════════════════════════════ */
.dashboard-mockup .yz-dash-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: var(--color-success);
    padding: 3px 9px;
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: var(--radius-full);
    background: rgba(0, 230, 118, 0.08);
}
.yz-live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
    animation: yzPulse 1.6s ease-in-out infinite;
}
@keyframes yzPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* Sidebar con iconos */
.mockup-sidebar .sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}
.mockup-sidebar .sidebar-item.active {
    color: var(--color-bg-primary);
}

/* Fila superior: gauge + KPIs */
.yz-dash-top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.yz-gauge {
    position: relative;
    width: 118px;
    height: 118px;
    flex: 0 0 auto;
}
.yz-gauge svg { width: 100%; height: 100%; display: block; }
.yz-gauge-track {
    fill: none;
    stroke: var(--color-bg-elevated);
    stroke-width: 9;
}
.yz-gauge-fill {
    fill: none;
    stroke: url(#yzArea);
    stroke: var(--color-accent-primary);
    stroke-width: 9;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    filter: drop-shadow(0 0 6px var(--color-accent-glow));
    transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.yz-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}
.yz-gauge-val {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    font-size: 1.5rem;
    color: var(--color-text-primary);
    line-height: 1;
}
.yz-gauge-val::after { content: '%'; font-size: 0.8rem; color: var(--color-accent-secondary); margin-left: 1px; }
.yz-gauge-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--color-text-tertiary);
}

.yz-kpis {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}
.yz-kpi {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--space-2);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 7px 10px;
}
.yz-kpi-label {
    grid-column: 1;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
}
.yz-kpi-val {
    grid-column: 1;
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    font-size: 1.05rem;
    color: var(--color-text-primary);
    line-height: 1.1;
}
.yz-kpi[data-accent="cyan"] .yz-kpi-val { color: var(--color-accent-primary); }
.yz-kpi[data-accent="green"] .yz-kpi-val { color: var(--color-success); }
.yz-kpi[data-accent="amber"] .yz-kpi-val { color: var(--color-warning); }

.yz-spark {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 30px;
    width: 70px;
}
.yz-spark i {
    flex: 1;
    min-width: 0;
    border-radius: 1px;
    background: var(--color-accent-secondary);
    opacity: 0.5;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.yz-kpi[data-accent="green"] .yz-spark i { background: var(--color-success); }
.yz-kpi[data-accent="amber"] .yz-spark i { background: var(--color-warning); }
.yz-spark i:last-child { opacity: 1; }

/* Gráfico de producción en streaming */
.yz-dash-chart {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}
.yz-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.yz-chart-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
}
.yz-chart-now {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    font-size: 0.82rem;
    color: var(--color-accent-primary);
}
.yz-chart-svg {
    display: block;
    width: 100%;
    height: 72px;
    overflow: visible;
}
.yz-chart-area { fill: url(#yzArea); }
.yz-chart-line {
    fill: none;
    stroke: var(--color-accent-primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--color-accent-glow));
}
.yz-chart-dot {
    fill: #fff;
    stroke: var(--color-accent-primary);
    stroke-width: 2;
    filter: drop-shadow(0 0 5px var(--color-accent-glow));
}

/* Feed de eventos */
.yz-dash-feed {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}
.yz-feed-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    padding: 4px 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    transition: transform 0.45s cubic-bezier(0.22, 0.7, 0.2, 1), opacity 0.45s ease;
}
.yz-feed-row.yz-feed-new { transform: translateY(-8px); opacity: 0; }
.yz-feed-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.yz-feed-dot.ok { background: var(--color-success); box-shadow: 0 0 6px var(--color-success-glow); }
.yz-feed-dot.warn { background: var(--color-warning); box-shadow: 0 0 6px rgba(255, 171, 0, 0.4); }
.yz-feed-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yz-feed-time { color: var(--color-text-muted); font-size: 0.66rem; flex: 0 0 auto; }

/* ═══════════════════════════════════════════════════════════════════════
   Marca de agua sutil con el isotipo YUZIOT (máscara CSS, no toca el archivo)
   Nota: las imágenes de "Industrias" ya incluyen el favicon YUZIOT, por eso
   la marca se aplica sólo a los módulos (desktop + bento), no a industrias.
   ═══════════════════════════════════════════════════════════════════════ */
.modules-showcase .panel-visual,
.bento-visual {
    position: relative;
}
.modules-showcase .panel-visual::after,
.bento-visual::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 11px;
    width: 46px;
    height: 42px;
    background-color: rgba(255, 255, 255, 0.62);
    -webkit-mask: url("../images/yuziot-isotipo.svg") no-repeat center / contain;
    mask: url("../images/yuziot-isotipo.svg") no-repeat center / contain;
    opacity: 0.22;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 2;
    transition: opacity 0.3s ease;
}
.modules-showcase .panel-visual:hover::after {
    opacity: 0.34;
}

/* ── Refinamiento de detalle (identidad) ───────────────────────────────── */
.title-line.highlight,
.section-title .highlight {
    background-size: 200% auto;
    animation: yzShimmer 6s linear infinite;
}
@keyframes yzShimmer { to { background-position: 200% center; } }

/* FIX: la línea resaltada del hero (.title-line.highlight, "Manufactura") nace en
   opacity:0 (regla .title-line de styles.css) y dependía de la animación fadeInUp
   para hacerse visible. El shimmer de arriba PISA esa animación (animation es
   shorthand) → la palabra quedaba invisible y dejaba un hueco en el título.
   Forzar opacity:1 la restituye en modo normal Y en reduced-motion (donde la
   animación se apaga), conservando el shimmer. */
.title-line.highlight { opacity: 1; }

.hero-cta .btn-primary {
    transition: transform 0.2s cubic-bezier(0.22, 0.7, 0.2, 1), box-shadow 0.3s ease, filter 0.3s ease;
}
.hero-cta .btn-primary:hover {
    box-shadow: 0 10px 40px -8px var(--color-accent-glow), var(--shadow-glow-sm);
    filter: brightness(1.05);
}

/* Chips de capacidades del hero: rellenan el espacio bajo el párrafo con valor
   escaneable y hacen eco de los KPIs del dashboard de al lado (iconos = sidebar). */
.hero-chips {
    list-style: none;
    margin: 0 0 var(--space-5);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.hero-chips li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-bg-tertiary);
}
.hero-chips li i {
    color: var(--color-accent-primary);
    font-size: 0.85rem;
}
@media (max-width: 424px) {
    .hero-chips li { font-size: 0.72rem; padding: 5px 10px; }
}

.btn:focus-visible,
.nav-link:focus-visible,
.module-tab:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 3px;
}

@media (min-width: 1025px) {
    .modules { padding-block: var(--space-20); }
    .industries { padding-block: var(--space-20); }
    .section-header { margin-bottom: var(--space-12); }
}

@media (hover: hover) and (pointer: fine) {
    .industry-card.yz-tilt:hover,
    .value-card.yz-tilt:hover,
    .blog-card.yz-tilt:hover,
    .docs-card.yz-tilt:hover,
    .support-card.yz-tilt:hover,
    .info-card.yz-tilt:hover {
        box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--color-border-hover);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Dashboard responsive — blindaje en los 4 breakpoints
   ≤424 móvil · 425–768 tablet grande · 769–1024 tablet pro · 1025+ desktop
   ═══════════════════════════════════════════════════════════════════════ */

/* 769–1024 (tablet pro): el hero ya apila; el mockup centra a 560px.
   Reactivamos las tarjetas flotantes (ocultas por styles.css en ≤1024),
   centradas sobre el dashboard para que NO desborden. */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-mockup { max-width: 560px; margin-inline: auto; }

    .floating-elements {
        display: block;
        width: min(100%, 560px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .float-card.card-1 { top: 4%; right: 0; left: auto; }
    .float-card.card-2 { top: 50%; left: 0; right: auto; }
    .float-card.card-3 { bottom: 8%; right: 3%; left: auto; }
}

/* ≤768 (tablet grande + móvil): compactar gauge/sparklines */
@media (max-width: 768px) {
    .mockup-content { min-height: 0; }
    .yz-dash-top { gap: var(--space-3); }
    .yz-gauge { width: 100px; height: 100px; }
    .yz-gauge-val { font-size: 1.3rem; }
    .yz-spark { width: 52px; height: 26px; }
    .yz-kpi-val { font-size: 0.98rem; }
    .yz-kpi-label { font-size: 0.62rem; }
}

/* ≤424 (móvil): sin sparklines, gauge mínimo, feed a 2 filas */
@media (max-width: 424px) {
    .yz-dash-top { gap: var(--space-2); align-items: stretch; }
    .yz-gauge { width: 86px; height: 86px; }
    .yz-gauge-val { font-size: 1.05rem; }
    .yz-gauge-val::after { font-size: 0.58rem; }
    .yz-gauge-label { font-size: 0.5rem; letter-spacing: 1px; }
    .yz-spark { display: none; }
    .yz-kpis { gap: 6px; }
    .yz-kpi { padding: 6px 9px; }
    .yz-kpi-val { font-size: 0.9rem; }
    .yz-chart-svg { height: 58px; }
    .yz-dash-feed .yz-feed-row:nth-child(3) { display: none; }
    .yz-dash-live { font-size: 0.54rem; padding: 2px 7px; }
}

/* ── Respeto a reduced-motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .yz-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .title-line.highlight,
    .section-title .highlight { animation: none; }
    .yz-tilt { transition: none; }
    .yz-live-dot { animation: none; }
}
