/* ==========================================================================
   GLYMDO SCREENING — escenas propias de la página /screening
   1) La onda del pulso (scrn-wave): la señal rPPG se dibuja con el scroll,
      a su paso encienden las métricas y al final el semáforo.
   2) El escaneo (scrn-scan): el celular en vivo — guía → medición → cifras
      → semáforo — conducido por el scroll.
   Reusa los tokens del design system (variables.css) y convive con
   pages/iot.css + product-vision.css.
   ========================================================================== */

/* ── Paleta local ── */
.scrn-wave,
.scrn-scan {
  --scrn-a: #FF6B2B;
  --scrn-b: #FFB800;
  --scrn-green: #22c55e;
  --scrn-yellow: #eab308;
  --scrn-red: #ef4444;
}

/* ==========================================================================
   1. LA ONDA DEL PULSO — quirófano de lujo: el título vive en la escena,
   un corazón de partículas late en canvas, el ECG cruza detrás y las
   métricas flotan sin cajas. El veredicto tiñe todo de verde.
   ========================================================================== */

.scrn-wave {
  position: relative;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: clip; /* clip, NO hidden: hidden mata el sticky interno */
}

.scrn-wave::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 45% at 72% 42%, rgba(255, 107, 43, 0.07), transparent 70%),
    radial-gradient(45% 35% at 12% 90%, rgba(255, 184, 0, 0.05), transparent 70%);
  pointer-events: none;
}

/* El bloque alto que conduce la escena; el escenario queda pegado */
.scrn-wave__scroll {
  height: 340vh;
}

.scrn-wave__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vh, 48px) clamp(16px, 4vw, 56px);
}

/* ECG atravesando el fondo del escenario, a media altura */
.scrn-wave__canvas {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0.5;
  pointer-events: none;
}

.scrn-wave__svg {
  display: block;
  width: 100%;
  height: clamp(160px, 30vh, 280px);
  overflow: visible;
}

.scrn-wave__base {
  fill: none;
  stroke: color-mix(in srgb, var(--text-primary) 8%, transparent);
  stroke-width: 2;
}

.scrn-wave__draw {
  fill: none;
  stroke: url(#scrn-wave-grad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(255, 107, 43, 0.45));
}

.scrn-wave__head {
  fill: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.9));
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Composición centrada: el corazón es el protagonista; el título arriba,
   las lecturas flanqueándolo simétricas — todo vive la escena completa */
.scrn-wave__grid {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vh, 22px);
  min-height: 0;
}

.scrn-wave__intro {
  text-align: center;
}

.scrn-wave__over {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: color-mix(in srgb, var(--text-primary) 38%, transparent);
  margin-bottom: 14px;
}

/* Línea editorial sobre el mega */
.scrn-wave__lead {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: color-mix(in srgb, var(--text-primary) 88%, transparent);
  margin-bottom: 6px;
}

/* El título manda: nada en la escena puede ser más grande que él */
.scrn-wave__mega {
  font-size: clamp(46px, 6.6vw, 100px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 14px;
}

.scrn-wave__sub {
  font-size: clamp(13.5px, 1.4vw, 16px);
  line-height: 1.6;
  color: color-mix(in srgb, var(--text-primary) 55%, transparent);
  max-width: 560px;
  margin: 0 auto;
}

/* El corazón: canvas centrado con las lecturas flanqueándolo */
.scrn-wave__heart {
  position: relative;
  width: min(42vw, 54vh);
  aspect-ratio: 1 / 1;
  min-width: 280px;
}

.scrn-wave__cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Cifras con el gradiente de la marca — grandes, sin cajas ni puntos */
.scrn-wave__bpm-num b,
.scrn-wave__read-num {
  background: linear-gradient(100deg, var(--scrn-a), var(--scrn-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* BPM protagonista a la izquierda del corazón, late con él */
.scrn-wave__bpm {
  position: absolute;
  right: 100%;
  top: 50%;
  margin-right: clamp(8px, 2vw, 32px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  white-space: nowrap;
  opacity: 0.1;
  transform-origin: right center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.scrn-wave__bpm.is-lit { opacity: 1; }

.scrn-wave__bpm-num {
  font-size: clamp(46px, 5vw, 78px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.scrn-wave__count {
  font-variant-numeric: tabular-nums;
}

.scrn-wave__bpm-num b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 0 26px rgba(255, 107, 43, 0.4));
}

.scrn-wave__bpm-num em,
.scrn-wave__read-num em {
  font-style: normal;
  font-size: 0.36em;
  font-weight: 600;
  color: color-mix(in srgb, var(--text-primary) 55%, transparent);
  margin-left: 6px;
  -webkit-background-clip: initial;
  background-clip: initial;
  background: none;
}

/* Lecturas flotantes a la derecha — simétricas, grandes, alineadas */
.scrn-wave__read {
  position: absolute;
  left: 100%;
  margin-left: clamp(8px, 2vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  white-space: nowrap;
  opacity: 0.1;
  transform: translateY(14px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrn-wave__read--fr { top: 22%; }
.scrn-wave__read--st { top: 62%; }

.scrn-wave__read.is-lit {
  opacity: 1;
  transform: translateY(0);
}

.scrn-wave__read-num {
  font-size: clamp(36px, 3.9vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(255, 107, 43, 0.32));
}

.scrn-wave__read-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-primary) 45%, transparent);
}

/* La etiqueta del veredicto sí debe leerse: es la que desactiva el diagnóstico.
   Sigue el tema (oscura en claro, clara en oscuro) — ya no hay halo negro. */
.scrn-wave__sem .scrn-wave__read-label {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--text-primary) 82%, transparent);
  text-align: center;
}

/* Semáforo/veredicto: nace en el centro del corazón, sin caja */
.scrn-wave__sem {
  position: absolute;
  left: 50%;
  top: 56%; /* bajo el veredicto para que no lo pise la línea del ECG */
  transform: translate(-50%, -50%) scale(0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrn-wave__sem.is-green {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* En esta escena el semáforo no muestra luces: el veredicto es tipográfico */
.scrn-wave__sem-lights { display: none; }

.scrn-wave__sem-title {
  font-size: clamp(26px, 2.7vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.16; /* holgura para el descendente de la "p" (se recortaba) */
  padding-bottom: 0.06em;
  background: linear-gradient(100deg, var(--scrn-a), var(--scrn-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 184, 0, 0.5));
}

/* Cuando el veredicto llega, la escena se enciende — dorado de la marca,
   nada de virar a colores ajenos */
.scrn-wave.is-green .scrn-wave__bpm-num b {
  filter: drop-shadow(0 0 34px rgba(255, 184, 0, 0.55));
}

.scrn-wave.is-green .scrn-wave__read-num {
  filter: drop-shadow(0 0 24px rgba(255, 184, 0, 0.45));
}

/* Caption de campaña al pie del escenario */
.scrn-wave__cap {
  position: relative;
  z-index: 1;
  min-height: 2.6em;
  text-align: center;
  font-size: clamp(18px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--text-primary);
  opacity: 0;
  margin: 0 auto;
  max-width: 940px;
  padding-bottom: clamp(4px, 2vh, 18px);
  transition: opacity 0.25s ease;
}

/* Fallback sin animación */
.scrn-wave.is-static .scrn-wave__scroll { height: auto; }
.scrn-wave.is-static .scrn-wave__stage { position: static; height: auto; padding-top: 96px; padding-bottom: 96px; gap: 40px; }
.scrn-wave.is-static .scrn-wave__draw { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
.scrn-wave.is-static .scrn-wave__cap { opacity: 1; }

/* ==========================================================================
   2. EL ESCANEO — el celular en vivo (sigue el tema claro/oscuro)
   ========================================================================== */

.scrn-scan {
  position: relative;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: clip;
}

/* La demo es interactiva (no depende del scroll): layout normal */
.scrn-scan__scroll {
  height: auto;
}

.scrn-scan__stage {
  position: static;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vh, 40px);
  padding: clamp(72px, 11vh, 130px) 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.scrn-scan__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.scrn-scan__over {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.scrn-scan__title {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.scrn-scan__sub {
  font-size: clamp(14.5px, 1.5vw, 17px);
  line-height: 1.65;
  color: var(--text-secondary);
}

.scrn-scan__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
}

.scrn-scan__phone {
  flex: none;
}

.scrn-scan__iphone {
  max-width: 320px;
}

@media (min-width: 1024px) {
  .scrn-scan__iphone { max-width: 380px; }
}

/* ── La pantalla del escaneo (demo interactiva) ── */
.scrn-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(90% 60% at 50% 30%, #16181d 0%, #0a0b0e 78%);
  overflow: hidden;
}

/* Media: el video de demostración o la cámara en vivo */
.scrn-screen__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scrn-screen__media.is-mirror { transform: scaleX(-1); } /* selfie espejo */

/* Canvas del overlay del escaneo (retícula, malla, barrido, onda) */
.scrn-screen__cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Lectura del pulso en vivo (arriba a la izquierda) */
.scrn-screen__read {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  display: flex;
  align-items: baseline;
}

.scrn-screen__read[aria-hidden="true"] { display: none; }

.scrn-read__bpm {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 107, 43, 0.6);
  font-variant-numeric: tabular-nums;
}

.scrn-read__bpm em {
  font-style: normal;
  font-size: 0.4em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 3px;
}

/* Estado (permiso / centrado / midiendo) */
.scrn-screen__status {
  position: absolute;
  left: 0; right: 0;
  bottom: 14%;
  z-index: 3;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  padding: 0 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scrn-screen__status.is-on { opacity: 1; }

/* ── Dashboard de salud final (aparece al terminar el escaneo) ── */
.scrn-dash {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.4%, 9px);
  text-align: center;
  padding: 7% 7% 4%; /* holgura arriba para que la isla no tape el veredicto */
  color: #fff;
  background:
    radial-gradient(120% 85% at 50% 6%, rgba(30, 21, 12, 0.93) 0%, rgba(16, 11, 9, 0.95) 46%, rgba(8, 9, 12, 0.97) 100%);
  opacity: 0;
  transition: opacity 0.55s ease;
  overflow: hidden;
}

.scrn-dash.is-on { opacity: 1; }
.scrn-dash[aria-hidden="true"] { pointer-events: none; }

/* Cabecera: estado + subtítulo */
.scrn-dash__top { display: flex; flex-direction: column; align-items: center; gap: 3px; }

.scrn-dash__status {
  font-size: clamp(22px, 7%, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
  padding-bottom: 0.05em;
  color: var(--scrn-a);
  filter: drop-shadow(0 0 20px rgba(255, 107, 43, 0.45));
}

.scrn-dash__ready {
  font-size: clamp(10px, 3.4%, 13px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.66);
}

/* Radar de salud (araña): grid + polígono + índice al centro + valores */
.scrn-dash__radar {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 260 / 232;
  flex: none;
}

.scrn-radar { width: 100%; height: 100%; overflow: visible; }

.scrn-radar__grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.scrn-radar__spoke {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.scrn-radar__area {
  fill: color-mix(in srgb, var(--scrn-a) 28%, transparent);
  stroke: var(--scrn-a);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--scrn-a) 55%, transparent));
  opacity: 0;
  transition: opacity 0.8s ease 0.2s;
}

.scrn-dash.is-filled .scrn-radar__area { opacity: 1; }

.scrn-radar__dot {
  fill: #fff;
  filter: drop-shadow(0 0 5px var(--scrn-a));
  opacity: 0;
  transition: opacity 0.5s ease 0.5s;
}

.scrn-dash.is-filled .scrn-radar__dot { opacity: 1; }

/* Índice de bienestar al centro del radar */
.scrn-radar__center {
  position: absolute;
  left: 50%;
  top: 55.2%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.scrn-radar__center b {
  font-size: clamp(26px, 11%, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.5);
}

.scrn-radar__center span {
  font-size: clamp(7.5px, 2.5%, 9.5px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  max-width: 84px;
  line-height: 1.2;
  margin-top: 2px;
}

/* Valor + etiqueta flotando en la punta de cada eje */
.scrn-radar__tag {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease 0.4s;
}

.scrn-dash.is-filled .scrn-radar__tag { opacity: 1; }

.scrn-radar__tag--end { align-items: flex-end; transform: translate(-100%, -50%); }
.scrn-radar__tag--start { align-items: flex-start; transform: translate(0, -50%); }

.scrn-radar__tag b {
  font-size: clamp(17px, 6.5%, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.scrn-radar__tag em {
  font-style: normal;
  font-size: 0.5em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 2px;
}

.scrn-radar__tag i {
  font-style: normal;
  font-size: clamp(8px, 2.6%, 10px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--scrn-a);
  margin-top: 2px;
}

/* ── Widgets de salud (números grandes + gráfico), estilo Apple Watch ── */
.scrn-dash__widgets {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2%, 13px);
}

.scrn-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 12px;
  row-gap: 4px;
  padding-top: clamp(10px, 2.4%, 16px);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

.scrn-dash.is-filled .scrn-metric { opacity: 1; transform: translateY(0); }

.scrn-metric__name {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(10px, 3%, 12px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.62);
}

.scrn-metric__name svg { width: 13px; height: 13px; color: var(--scrn-a); }

/* El gráfico ocupa la fila inferior izquierda; el número grande a la derecha */
.scrn-metric__chart {
  width: 100%;
  height: clamp(28px, 8%, 36px);
  align-self: center;
}

/* Frecuencia cardíaca: candlesticks (segmentos verticales sueltos).
   Color sólido: un <line> vertical tiene bbox de ancho 0 y el gradiente
   objectBoundingBox no pintaría. */
.scrn-metric__candle {
  stroke: var(--scrn-a);
  stroke-width: 3.4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.4s ease;
  transition-delay: calc(var(--bd) * 16ms + 0.4s);
}

.scrn-dash.is-filled .scrn-metric__candle { opacity: 0.92; }

.scrn-metric__now {
  fill: #fff;
  filter: drop-shadow(0 0 5px var(--scrn-b));
  opacity: 0;
  transition: opacity 0.4s ease 0.9s;
}

.scrn-dash.is-filled .scrn-metric__now { opacity: 1; }

/* HRV: nube de puntos */
.scrn-metric__dot {
  fill: url(#gradient-active);
  opacity: 0;
  transition: opacity 0.4s ease;
  transition-delay: calc(var(--bd) * 20ms + 0.4s);
}

.scrn-dash.is-filled .scrn-metric__dot { opacity: 0.9; }

.scrn-metric__line {
  fill: none;
  stroke: url(#gradient-active);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--scrn-a) 55%, transparent));
}

.scrn-metric__area { fill: color-mix(in srgb, var(--scrn-a) 14%, transparent); }

.scrn-metric__read {
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

.scrn-metric__read b {
  font-size: clamp(34px, 13%, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.scrn-metric__read em {
  font-style: normal;
  font-size: clamp(11px, 3.4%, 14px);
  font-weight: 700;
  color: var(--scrn-a);
}

.scrn-dash__note {
  font-size: clamp(9px, 2.7%, 11px);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.48);
  max-width: 92%;
}

.scrn-dash__actions {
  margin-top: 2px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
}

/* Invitación comercial del dashboard: texto + CTA con el gradiente de marca.
   Sin cajas ni divisores: la jerarquía la da el propio botón. */
.scrn-dash__cta {
  flex: 0 0 100%;
  font-size: clamp(10px, 3%, 12px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.78);
}

.scrn-dash__actions .scrn-dash__btn { max-width: 136px; min-height: 34px; padding: 0 12px; }

.scrn-dash__btn--cta {
  gap: 6px;
  border: none;
  background: linear-gradient(135deg, #FF6B2B 0%, #FFB800 100%);
  box-shadow: 0 6px 20px rgba(255, 107, 43, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  text-decoration: none;
}

.scrn-dash__btn--cta:hover {
  background: linear-gradient(135deg, #FF7A40 0%, #FFC21F 100%);
  border: none;
  filter: brightness(1.05);
}

/* Mismo diseño y liquid glass que los botones de la puerta, algo más compacto */
.scrn-dash__btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  min-height: 40px;
  padding: 0 18px;
  font-size: clamp(12px, 3.6%, 14px);
  font-weight: 600;
  color: #fff;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.scrn-dash__btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.45); }
.scrn-dash__btn:active { transform: scale(0.97); }

/* Puerta inicial: contenido en la parte baja (deja ver la cara/animación
   arriba); botones iguales; nota anclada al footer. */
.scrn-screen__gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 22px 14px;
  background: linear-gradient(180deg, transparent 34%, rgba(8, 9, 12, 0.5) 66%, rgba(8, 9, 12, 0.9) 100%);
  transition: opacity 0.4s ease;
}

.scrn-screen__gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Panel de la llamada a la acción, algo por encima del footer */
.scrn-gate__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-bottom: clamp(14px, 5%, 26px);
}

.scrn-gate__title {
  font-size: clamp(16px, 5%, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 3px;
}

/* Botones idénticos: mismo ancho y misma altura */
.scrn-gate__btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 250px;
  min-height: 46px;
  padding: 0 18px;
  font-size: clamp(13px, 4%, 15px);
  font-weight: 600;
  border-radius: 99px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, filter 0.2s ease, background 0.2s ease;
}

.scrn-gate__btn:active { transform: scale(0.97); }

.scrn-gate__btn--cam {
  color: #1a1206;
  background: linear-gradient(100deg, var(--scrn-a), var(--scrn-b));
  box-shadow: 0 8px 24px rgba(255, 107, 43, 0.4);
}

.scrn-gate__btn--cam:hover { filter: brightness(1.06); }
.scrn-gate__btn--cam svg { width: 15px; height: 15px; }

/* Liquid glass real: vidrio esmerilado sobre el video */
.scrn-gate__btn--demo {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.scrn-gate__btn--demo:hover { background: rgba(255, 255, 255, 0.2); }

/* Nota de privacidad: un solo renglón, pegada al footer */
.scrn-gate__note {
  font-size: clamp(9.5px, 3%, 11px);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  max-width: 92%;
}

/* Clave de lectura del radar, discreta bajo la araña */
.scrn-dash__radarhint {
  text-align: center;
  font-size: clamp(7.5px, 2.5%, 9px);
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 3px;
}

/* Consentimiento y fallo: overlays sobre la pantalla del teléfono */
.scrn-consent,
.scrn-fail {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.scrn-consent.is-on,
.scrn-fail.is-on { opacity: 1; visibility: visible; pointer-events: auto; }

/* Alerta estilo iOS nativo: tarjeta esmerilada, botones de texto con hairlines */
.scrn-alert {
  width: min(80%, 280px);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(37, 37, 40, 0.78);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.scrn-consent.is-on .scrn-alert,
.scrn-fail.is-on .scrn-alert { transform: scale(1); }

.scrn-alert__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 16px 14px;
}

.scrn-alert__title {
  font-size: clamp(13px, 4.2%, 15px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 2px;
}

.scrn-alert__text {
  font-size: clamp(10px, 3.2%, 11.5px);
  line-height: 1.45;
  color: rgba(235, 235, 245, 0.62);
}

.scrn-alert__btn {
  font: inherit;
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  font-size: clamp(12.5px, 4%, 14.5px);
  font-weight: 400;
  color: #fff;
  background: none;
  border: 0;
  border-top: 1px solid rgba(84, 84, 88, 0.65);
  cursor: pointer;
  transition: background 0.12s ease;
}

.scrn-alert__btn:hover { background: rgba(255, 255, 255, 0.06); }
.scrn-alert__btn:active { background: rgba(255, 255, 255, 0.1); }

.scrn-alert__btn--primary {
  font-weight: 650;
  color: var(--scrn-b);
}

@supports (border-width: 0.5px) {
  .scrn-alert__btn { border-top-width: 0.5px; }
}

/* Métrica sin lectura estable: "--" sin unidad */
.scrn-radar__tag.is-nodata em,
.scrn-metric__read.is-nodata em { display: none; }
.scrn-radar__tag.is-nodata b,
.scrn-metric__read.is-nodata b { opacity: 0.55; }

/* Rostro abstracto (silueta, nadie real) */
.scrn-screen__face {
  position: absolute;
  inset: 6% 0 0;
  width: 100%;
  height: 88%;
}

.scrn-face__head,
.scrn-face__body {
  fill: none;
  stroke: rgba(250, 250, 250, 0.22);
  stroke-width: 2;
}

.scrn-face__body {
  stroke: rgba(250, 250, 250, 0.12);
}

/* Malla FaceMesh: aparece al medir */
.scrn-mesh path {
  fill: none;
  stroke: rgba(255, 107, 43, 0.55);
  stroke-width: 1;
}

.scrn-mesh circle {
  fill: var(--scrn-b);
}

.scrn-mesh {
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Guía de encuadre (fase 0): anillo que respira */
.scrn-screen__ring {
  position: absolute;
  top: 16%;
  left: 50%;
  width: 72%;
  aspect-ratio: 0.82;
  transform: translateX(-50%);
  border: 2px dashed rgba(250, 250, 250, 0.4);
  border-radius: 50%;
  opacity: 1;
  transition: opacity 0.6s ease;
  animation: scrn-ring-breathe 2.4s ease-in-out infinite;
}

@keyframes scrn-ring-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.03); }
}

/* Barra de progreso de los 30 s (fase 1) */
.scrn-screen__bar {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 8%;
  height: 4px;
  border-radius: 99px;
  background: rgba(250, 250, 250, 0.14);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.scrn-screen__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--scrn-a), var(--scrn-b));
}

/* Cifras (fase 2) */
.scrn-screen__hud {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 15%;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrn-hud__chip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(250, 250, 250, 0.07);
  border: 1px solid rgba(250, 250, 250, 0.09);
  backdrop-filter: blur(6px);
}

.scrn-hud__chip b {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fafafa;
  line-height: 1;
}

.scrn-hud__chip em {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.55);
  white-space: nowrap;
}

/* Semáforo (fase 3) */
.scrn-screen__sem {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrn-screen__sem-halo {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  margin-bottom: 8px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.95) 0%, rgba(34, 197, 94, 0.28) 58%, transparent 72%);
  box-shadow: 0 0 44px rgba(34, 197, 94, 0.5);
  position: relative;
}

.scrn-screen__sem-halo::after {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 3px solid #fff;
  border-top-color: transparent;
  transform: rotate(-45deg);
  /* check minimalista: media marca */
  clip-path: polygon(0 40%, 45% 100%, 100% 20%, 100% 100%, 0 100%);
  display: none;
}

.scrn-screen__sem strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fafafa;
}

.scrn-screen__sem span {
  font-size: 11px;
  color: rgba(250, 250, 250, 0.6);
}

/* Privacidad (fase 3) */
.scrn-screen__priv {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(250, 250, 250, 0.55);
  opacity: 0;
  transition: opacity 0.6s ease;
  margin: 0;
}

.scrn-screen__priv svg { flex: none; }

/* ── Coreografía por fase ── */
.scrn-screen.is-p1 .scrn-screen__ring,
.scrn-screen.is-p2 .scrn-screen__ring,
.scrn-screen.is-p3 .scrn-screen__ring { opacity: 0; animation: none; }

.scrn-screen.is-p1 .scrn-mesh,
.scrn-screen.is-p2 .scrn-mesh { opacity: 1; }

.scrn-screen.is-p1 .scrn-screen__bar,
.scrn-screen.is-p2 .scrn-screen__bar { opacity: 1; }

.scrn-screen.is-p2 .scrn-screen__hud,
.scrn-screen.is-p3 .scrn-screen__hud { opacity: 1; transform: translateY(0); }

/* Al nacer el semáforo el rostro se disuelve: el resultado es lo único */
.scrn-screen.is-p3 .scrn-screen__face { opacity: 0.16; transition: opacity 0.7s ease; }
.scrn-screen.is-p3 .scrn-screen__sem { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.scrn-screen.is-p3 .scrn-screen__priv { opacity: 1; }

/* ── Pasos al costado ── */
/* Paso a paso: tipografía pura — numerales gigantes en contorno que se
   rellenan con el gradiente al activarse. Sin cajas, sin bordes, sin fondos. */
.scrn-scan__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4vh, 16px);
  max-width: 460px;
  width: 100%;
  counter-reset: scrn-step;
}

.scrn-scan__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.8vw, 28px);
  padding: clamp(6px, 1vh, 12px) 0;
  transition: opacity 0.5s ease;
  opacity: 0.5;
}

.scrn-scan__step.is-on { opacity: 1; }

/* Numeral gigante en contorno; se rellena en gradiente cuando el paso activa */
.scrn-scan__step-num {
  flex: none;
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--text-primary) 26%, transparent);
  transition: -webkit-text-stroke-color 0.4s ease, filter 0.4s ease;
}

.scrn-scan__step.is-on .scrn-scan__step-num {
  -webkit-text-stroke: 0;
  -webkit-text-fill-color: var(--scrn-a);
  color: var(--scrn-a);
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--scrn-a) 50%, transparent));
}

/* Etiqueta + una línea de acento que se dibuja bajo el paso activo */
.scrn-scan__step-label {
  position: relative;
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-secondary);
  line-height: 1.25;
  padding-bottom: 8px;
  transition: color 0.4s ease;
}

.scrn-scan__step.is-on .scrn-scan__step-label { color: var(--text-primary); }

.scrn-scan__step-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--scrn-a), var(--scrn-b));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px color-mix(in srgb, var(--scrn-a) 55%, transparent);
}

.scrn-scan__step.is-on .scrn-scan__step-label::after { transform: scaleX(1); }

/* Caption final */
.scrn-scan__cap {
  text-align: center;
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.5;
  color: var(--text-primary);
  opacity: 1;
  margin: 0 auto;
  padding: 0.1em 0 0.18em;
  overflow: visible;
  filter: none;
}

/* El recorte a texto (background-clip) se ve borroso dentro del scroll suave;
   en este caption usamos color sólido de marca — nítido en claro y oscuro. */
.scrn-scan__cap .text-gradient {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--scrn-a);
  color: var(--scrn-a);
}

/* Fallback sin animación */
.scrn-scan.is-static .scrn-scan__scroll { height: auto; }
.scrn-scan.is-static .scrn-scan__stage { position: static; min-height: 0; }

/* ── Móvil: pasos debajo del teléfono ── */
@media (max-width: 760px) {
  .scrn-scan__body {
    flex-direction: column;
    gap: 24px;
  }

  .scrn-scan__iphone { max-width: 280px; }

  .scrn-scan__steps {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    gap: 10px 18px;
  }

  .scrn-scan__step-label { font-size: 13px; }
}

/* ── Móvil/tablet: mismo orden centrado, corazón algo menor y lecturas
   pegadas a los flancos sin salirse de pantalla ── */
@media (max-width: 900px) {
  .scrn-wave__scroll { height: 280vh; }

  .scrn-wave__mega { font-size: clamp(32px, 9vw, 48px); margin-bottom: 10px; }
  .scrn-wave__lead { font-size: clamp(15px, 4.4vw, 20px); }
  .scrn-wave__sub { font-size: 13px; max-width: 480px; }

  .scrn-wave__heart {
    width: min(60vw, 36vh);
    min-width: 210px;
  }

  .scrn-wave__bpm { right: 88%; }
  .scrn-wave__bpm-num { font-size: clamp(38px, 11vw, 56px); }
  .scrn-wave__read { left: 88%; }
  .scrn-wave__read--fr { top: 18%; }
  .scrn-wave__read--st { top: 56%; }
  .scrn-wave__read-num { font-size: clamp(24px, 6.4vw, 32px); }
  .scrn-wave__read-label,
  .scrn-wave__bpm .scrn-wave__read-label { font-size: 9.5px; }
  .scrn-wave__sem-title { font-size: clamp(26px, 7vw, 36px); }
  .scrn-wave__cap { font-size: clamp(15px, 4vw, 20px); }
}

/* ==========================================================================
   Showcase: mientras no llegue el asset de línea, el marco del escaneo
   se sostiene solo (panel oscuro elegante, nada roto)
   ========================================================================== */

#screening-showcase .vp-scan--screening {
  background:
    radial-gradient(80% 70% at 50% 20%, #171a20 0%, #0a0b0e 80%);
  min-height: clamp(260px, 42vw, 460px);
}

/* Lectura de pulso en vivo sobre la imagen del showcase: arriba a la izquierda,
   limpia, solo numero y unidad (cuenta al entrar en vista) */
.vp-scan__vitals {
  position: absolute;
  top: clamp(12px, 3.5%, 22px);
  left: clamp(14px, 4%, 26px);
  z-index: 3;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.vp-scan__vitals b {
  font-size: clamp(22px, 4.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 107, 43, 0.65);
}

.vp-scan__vitals em {
  font-style: normal;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.8);
}

/* Movimiento reducido: sin animaciones decorativas */
@media (prefers-reduced-motion: reduce) {
  .scrn-screen__ring { animation: none; }
}
