/* ==========================================================================
   Supralabs Digital — hero de la portada (maqueta aprobada).
   Notebook en CSS 3D + panel en HTML/SVG + baldosas flotantes + haces de luz.
   Movimiento infinito (haces, baldosas): solo transform y opacity, lo resuelve la tarjeta gráfica.
   Las entradas del panel (línea, dona, barras) corren una sola vez y repintan un área chica.
   Con prefers-reduced-motion todo aparece de inmediato y quieto (regla global en base.css).
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--noche);
  padding-block: clamp(40px, 6vw, 72px) clamp(56px, 7vw, 96px);
}
@media (min-width: 1080px) {
  .hero { display: grid; align-items: center; min-height: min(820px, calc(100svh - var(--alto-header))); }
}

/* --- Fondo: profundidad, sala de servidores sugerida, líneas en perspectiva, haces --- */
.hero__fondo {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 62% at 74% 46%, rgba(0, 142, 255, .30) 0%, rgba(0, 142, 255, 0) 70%),
    radial-gradient(36% 44% at 96% 12%, rgba(23, 105, 170, .38) 0%, rgba(23, 105, 170, 0) 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(16, 28, 49, .95) 0%, rgba(16, 28, 49, 0) 70%),
    linear-gradient(180deg, #08111F 0%, #0B1A33 58%, #0A1322 100%);
}
/* Bastidores de servidores desenfocados: columnas y luces sueltas, muy tenues */
.hero__racks {
  position: absolute; inset: 4% -4% 14% 40%;
  background:
    radial-gradient(circle, rgba(85, 167, 255, .55) 0 1px, transparent 1.6px) 0 0 / 46px 26px,
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(85, 167, 255, .07) 88px 90px, transparent 90px 180px),
    repeating-linear-gradient(180deg, rgba(0, 142, 255, .05) 0 2px, transparent 2px 18px);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent);
  mask-image: radial-gradient(closest-side, #000 20%, transparent);
  opacity: .55;
}
.hero__perspectiva { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Detrás del texto los haces se atenúan: la legibilidad manda */
.hero__perspectiva, .hero__haces {
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .28) 22%, rgba(0, 0, 0, .28) 40%, #000 62%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .28) 22%, rgba(0, 0, 0, .28) 40%, #000 62%);
}
.hero__haces { position: absolute; inset: 0; overflow: hidden; }
.haz {
  position: absolute; left: -36%; width: 36%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(85, 167, 255, 0), rgba(85, 167, 255, .9) 70%, rgba(200, 228, 255, 1));
  box-shadow: 0 0 12px 1px rgba(0, 142, 255, .45);
  opacity: 0;
  transform: rotate(var(--a, 0deg)) translateX(0);
  animation: haz var(--t, 11s) linear var(--d, 0s) infinite;
}
.haz--1 { top: 14%; --a: 7deg;  --t: 12s; --d: .5s; }
.haz--2 { top: 30%; --a: 3deg;  --t: 9s;  --d: 3.5s; height: 1px; }
.haz--3 { top: 58%; --a: -2deg; --t: 13s; --d: 1.8s; }
.haz--4 { top: 74%; --a: -6deg; --t: 10s; --d: 6s;   height: 1px; }
.haz--5 { top: 88%; --a: -9deg; --t: 14s; --d: 4.2s; }
.haz--6 { top: 44%; --a: 1deg;  --t: 16s; --d: 8s;   height: 1px; }
@keyframes haz {
  0%   { opacity: 0; transform: rotate(var(--a)) translateX(0); }
  12%  { opacity: .9; }
  70%  { opacity: .55; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(420%); }
}

/* --- Composición: texto 45 % | visual 55 % --- */
.hero__fila { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 6vw, 56px); }   /* minmax(0,…): sin él, el notebook impone su ancho mínimo y el texto se sale en pantallas muy angostas */
@media (min-width: 1080px) {
  .hero__fila { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 16px; align-items: center; }
}

/* --- Texto --- */
.hero__texto { position: relative; z-index: 2; }
.hero__ante { margin-bottom: clamp(16px, 2vw, 22px); }
.hero__titulo { font-size: clamp(2.75rem, .9rem + 8.2vw, 4.75rem); line-height: 1; }
@media (min-width: 1080px) { .hero__titulo { font-size: clamp(3.5rem, .6rem + 4.6vw, 5.375rem); } }
.hero__linea { display: block; }
/* El punto de "resuelve." viene con aire propio de la fuente: se acerca un poco */
.hero__punto { margin-left: -.06em; }
.hero__bajada { margin-top: clamp(18px, 2.2vw, 26px); color: rgba(255, 255, 255, .9); max-width: 41ch; }
.hero__botones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(28px, 3.4vw, 40px); }
@media (max-width: 559px) {
  .hero__botones { flex-direction: column; }
  .hero__botones .btn { width: 100%; }
}

/* --- Visual --- */
.hero__visual { position: relative; z-index: 1; }
.hero__escena {
  position: relative;
  perspective: 1500px; perspective-origin: 20% 40%;   /* en el padre directo del notebook: si no, el giro sale sin escorzo */
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 6% 0 8% 16%;
  translate: calc(var(--px, 0) * -10px) calc(var(--py, 0) * -6px);
  transition: translate .9s var(--suave);
}
@media (min-width: 1080px) { .hero__escena { margin-right: 0; width: min(100%, 800px); } }

/* Notebook: tapa con marco + pantalla, base con muesca. Girado hacia el texto, como en la maqueta. */
.laptop {
  position: relative;
  transform: rotateY(21deg) rotateX(3deg) rotateZ(-.5deg);
  transform-origin: 30% 60%;
  transform-style: preserve-3d;
}
.laptop::after {                   /* sombra sobre el "piso" */
  content: ""; position: absolute; left: 4%; right: -2%; bottom: -9%; height: 12%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
  z-index: -1;
}
.laptop__tapa {
  position: relative;
  padding: 1.7% 1.7% 2.3%;
  border-radius: 16px 16px 6px 6px;
  background: linear-gradient(160deg, #2B3547 0%, #111A28 38%, #070C15 100%);
  box-shadow:
    inset 0 0 0 1px rgba(150, 180, 220, .22),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 50px 90px -40px rgba(0, 0, 0, .9),
    0 0 90px -30px rgba(0, 142, 255, .6);
}
.laptop__pantalla {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
  background: #0A1424;
  container-type: inline-size;
}
.laptop__pantalla::after {        /* reflejo del vidrio */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 70%, rgba(85, 167, 255, .06) 100%);
}
/* Base vista apenas desde arriba: cubierta del teclado (trapecio) + canto frontal iluminado */
.laptop__base {
  position: relative;
  height: clamp(14px, 2.4vw, 30px);
  margin-inline: -8%;
  clip-path: polygon(4.5% 0, 95.5% 0, 100% 70%, 99.4% 100%, .6% 100%, 0 70%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0 68%, rgba(255, 255, 255, .55) 70%, rgba(255, 255, 255, 0) 76%),
    linear-gradient(180deg, #1B2331 0%, #2C3749 45%, #4A576B 68%, #8D9AAD 72%, #4C586B 100%);
}
.laptop__base::before {           /* zona del teclado y muesca */
  content: ""; position: absolute; left: 12%; right: 12%; top: 8%; height: 40%;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 1.6%, rgba(255, 255, 255, .04) 1.6% 2%);
  opacity: .8;
}

/* Baldosas de vidrio con borde luminoso (sin backdrop-filter: cuida la CPU) */
.baldosa {
  --b: clamp(50px, 6.4vw, 92px);
  position: absolute; z-index: 2;
  width: var(--b); height: var(--b);
  display: grid; place-items: center;
  border-radius: 22%;
  color: #9FCCFF;
  background: linear-gradient(145deg, rgba(48, 110, 200, .42) 0%, rgba(14, 32, 62, .78) 60%, rgba(10, 22, 44, .88) 100%);
  border: 1px solid rgba(85, 167, 255, .62);
  box-shadow:
    0 0 0 1px rgba(0, 142, 255, .14),
    0 0 30px -4px rgba(0, 142, 255, .6),
    0 18px 30px -16px rgba(0, 0, 0, .8),
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 22px rgba(0, 142, 255, .2);
  translate: calc(var(--px, 0) * var(--z, 14px)) calc(var(--py, 0) * var(--z, 14px));
  transition: translate .9s var(--suave);
  animation: baldosa-entra .7s var(--suave) var(--e, .6s) both, flotar var(--f, 7s) ease-in-out var(--e, .6s) infinite;
}
.baldosa .icono { width: 46%; height: 46%; stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(85, 167, 255, .75)); }
.baldosa--1 { left: 2%;  top: 5%;  --e: .55s; --f: 7s;   --z: 18px; }
.baldosa--2 { left: 9%;  top: 29%; --e: .65s; --f: 8s;   --z: 24px; }
.baldosa--3 { left: 1%;  top: 53%; --e: .75s; --f: 6.5s; --z: 16px; }
.baldosa--4 { left: 10%; top: 76%; --e: .85s; --f: 7.5s; --z: 22px; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes baldosa-entra { from { opacity: 0; scale: .6; } }

/* --- Panel dentro de la pantalla (escala con la pantalla: unidades de contenedor) --- */
.tablero {
  display: grid; grid-template-columns: 15% minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  height: 100%;
  font-family: var(--f-texto); font-size: 9px; font-size: 1.42cqw; line-height: 1.25;
  color: #C9D8EC;
  text-align: left;
}
.tablero .icono { width: 1.35em; height: 1.35em; flex: none; }
.tablero__lado {
  display: flex; flex-direction: column; gap: .35em;
  padding: 1.3em .7em;
  background: #08101D;
  border-right: 1px solid rgba(85, 167, 255, .1);
}
.tablero__app {
  display: grid; place-items: center; width: 2.4em; height: 2.4em; margin: 0 0 1.1em .35em;
  border-radius: .65em; color: var(--blanco);
  background: linear-gradient(135deg, var(--electrico), var(--corporativo));
}
.tablero__nav { display: flex; align-items: center; gap: .55em; padding: .55em .5em; border-radius: .5em; font-weight: 600; font-size: .92em; color: #7F93AE; white-space: nowrap; }
.tablero__nav--activo { color: var(--blanco); background: rgba(0, 142, 255, .16); box-shadow: inset 2px 0 0 var(--electrico); }

.tablero__principal {
  display: grid; grid-template-rows: auto auto minmax(0, 1.55fr) minmax(0, 1fr);
  gap: .9em; padding: 1.2em 1.4em 1.3em; min-width: 0;
}
.tablero__sup { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.tablero__titulo { display: block; font-family: var(--f-titulo); font-weight: 700; font-size: 1.3em; color: var(--blanco); }
.tablero__periodo { font-size: .85em; color: #7F93AE; }
.tablero__acciones { display: flex; align-items: center; gap: .9em; color: #7F93AE; }
.tablero__buscar { display: inline-flex; align-items: center; gap: .45em; padding: .45em .9em; border-radius: 999px; background: #0F1B2E; border: 1px solid rgba(85, 167, 255, .12); font-size: .85em; }
.tablero__avatar { width: 2em; height: 2em; border-radius: 50%; background: linear-gradient(135deg, #55A7FF, #1769AA); box-shadow: 0 0 0 2px #0A1424, 0 0 0 3px rgba(85, 167, 255, .4); }

.tablero__tarjeta {
  min-width: 0; min-height: 0;
  padding: .85em 1em;
  border-radius: .75em;
  background: linear-gradient(180deg, #111F36 0%, #0D182B 100%);
  border: 1px solid rgba(85, 167, 255, .12);
}
.tablero__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em; }
.tablero__kpi { display: grid; gap: .2em; }
.tablero__kpi span { font-size: .85em; color: #8BA0BC; }
.tablero__kpi strong { font-variant-numeric: tabular-nums; font-family: var(--f-titulo); font-weight: 800; font-size: 1.75em; line-height: 1.1; color: var(--blanco); letter-spacing: -.01em; }
.tablero__kpi em { display: inline-flex; align-items: center; gap: .3em; font-style: normal; font-weight: 700; font-size: .82em; color: var(--verde-claro); }
.tablero__kpi em .icono { width: 1.2em; height: 1.2em; stroke-width: 2.2; }
.tablero__etiqueta { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .9em; color: #DCE8F5; margin-bottom: .5em; }
.tablero__vivo { display: inline-flex; align-items: center; gap: .4em; font-style: normal; font-weight: 600; font-size: .85em; color: var(--verde-claro); }
.tablero__vivo::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; animation: latir 2.4s ease-in-out infinite; }
@keyframes latir { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

.tablero__medio { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .8em; min-height: 0; }
.tablero__grafico, .tablero__pedidos { display: flex; flex-direction: column; }
.tablero__lineas, .tablero__barras { flex: 1; width: 100%; min-height: 0; height: 100%; overflow: visible; }
.tablero__guia { stroke: rgba(85, 167, 255, .1); stroke-width: 1; fill: none; }
.tablero__linea { fill: none; stroke: #2FA0FF; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tablero__linea--2 { stroke: rgba(74, 222, 128, .75); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tablero__barras rect { fill: #1E86F0; }
.tablero__barras rect:nth-child(even) { fill: #2F9BFF; }
.tablero__barras rect:last-child { fill: #55A7FF; }

.tablero__canales { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.tablero__canales .tablero__etiqueta { align-self: stretch; }
.tablero__dona { flex: 1; min-height: 0; width: 100%; max-width: 62%; transform: rotate(-90deg); }
.tablero__dona circle { fill: none; stroke-width: 6; }
.tablero__dona-fondo { stroke: rgba(85, 167, 255, .1); }
.tablero__seg { stroke-linecap: butt; }
.tablero__seg--1 { stroke: #1E86F0; stroke-dasharray: 57 43; stroke-dashoffset: 0; }
.tablero__seg--2 { stroke: #34D27B; stroke-dasharray: 26 74; stroke-dashoffset: -58; }
.tablero__seg--3 { stroke: #8EC5FF; stroke-dasharray: 14 86; stroke-dashoffset: -85; }
.tablero__leyenda { list-style: none; margin: .6em 0 0; padding: 0; display: grid; gap: .3em; font-size: .8em; color: #8BA0BC; align-self: stretch; }
.tablero__leyenda li { display: flex; align-items: center; gap: .45em; white-space: nowrap; }
.tablero__punto { width: .7em; height: .7em; border-radius: 3px; flex: none; }
.tablero__punto--1 { background: #1E86F0; } .tablero__punto--2 { background: #34D27B; } .tablero__punto--3 { background: #8EC5FF; }

/* --- Entrada en cascada (CSS puro: no espera al JS, así no retrasa el titular) --- */
@keyframes entra-arriba { from { opacity: 0; transform: translateY(18px); } }
@keyframes entra-escena { from { opacity: 0; transform: translateY(28px) scale(.97); } }
@keyframes trazar { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes crecer { from { transform: scaleY(0); } }
@keyframes dona { from { stroke-dasharray: 0 100; } }
.hero__ante    { animation: entra-arriba .7s var(--suave) both; }
.hero__titulo  { animation: entra-arriba .8s var(--suave) .05s both; }
.hero__bajada  { animation: entra-arriba .8s var(--suave) .06s both; }   /* puede ser el LCP en móvil: casi sin demora */
.hero__botones { animation: entra-arriba .8s var(--suave) .3s both; }
.hero__escena  { animation: entra-escena 1s var(--suave) .2s both; }
.tablero__lineas { animation: trazar 1.6s var(--suave) .9s both; }
.tablero__barras rect { transform-box: fill-box; transform-origin: 50% 100%; animation: crecer .9s var(--suave) both; animation-delay: 1s; }
.tablero__barras rect:nth-child(2)  { animation-delay: 1.04s; } .tablero__barras rect:nth-child(3)  { animation-delay: 1.08s; }
.tablero__barras rect:nth-child(4)  { animation-delay: 1.12s; } .tablero__barras rect:nth-child(5)  { animation-delay: 1.16s; }
.tablero__barras rect:nth-child(6)  { animation-delay: 1.2s; }  .tablero__barras rect:nth-child(7)  { animation-delay: 1.24s; }
.tablero__barras rect:nth-child(8)  { animation-delay: 1.28s; } .tablero__barras rect:nth-child(9)  { animation-delay: 1.32s; }
.tablero__barras rect:nth-child(10) { animation-delay: 1.36s; } .tablero__barras rect:nth-child(11) { animation-delay: 1.4s; }
.tablero__barras rect:nth-child(12) { animation-delay: 1.44s; }
.tablero__seg { animation: dona 1.2s var(--suave) 1.1s both; }
.tablero__seg--2 { animation-delay: 1.25s; } .tablero__seg--3 { animation-delay: 1.4s; }

/* Fuera de pantalla (o en otra pestaña) las animaciones infinitas se detienen: cero trabajo de fondo */
.hero--quieto .haz, .hero--quieto .baldosa, .hero--quieto .tablero__vivo::before { animation-play-state: paused; }

/* --- Tablet y móvil --- */
@media (max-width: 1079px) {
  .hero__texto { max-width: 680px; }
  .hero__escena { padding: 4% 0 7% 11%; }
  .laptop { transform: rotateY(12deg) rotateX(4deg); }
}
@media (max-width: 559px) {
  .hero__escena { padding: 6% 0 9% 9%; }
  .baldosa { --b: 46px; border-radius: 13px; }
  .baldosa--1 { top: 2%; } .baldosa--4 { top: 74%; }
  .haz--2, .haz--4, .haz--6 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__escena, .baldosa { transition: none; translate: none; }
  .haz { display: none; }
}

/* Entre 1080 y 1365 px la columna de texto es angosta: botones un poco más compactos para que vayan lado a lado */
@media (min-width: 1080px) and (max-width: 1365px) {
  .hero__botones .btn { padding: 0 1.3em; font-size: .9375rem; }
}
