/* ═══════════════════════════════════════════════════════════
   GLUCUBE — Primeros pasos · start.glucube.com
   styles.css — todos los estilos y animaciones
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Google Sans Flex';
  src: url('https://fonts.gstatic.com/s/googlesans/v58/4Ua_rENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iqcsih3wGBnkSHsNEhMkA.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000000;
  --white: #ffffff;
  --gray:  #f5f5f7;
  --font:  'Google Sans Flex', Inter, system-ui, sans-serif;
  --tk:    -0.04em;
  --max:   680px;
  --px:    24px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── NAV ───────────────────────────────────────────────── */
/* Identidad: fondos siempre opacos al 100% — sin transparencia ni blur */

nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  height: 52px;
  padding: 0 var(--px);
  display: flex; align-items: center; justify-content: flex-end;
}

/* Selector de idioma — desplegable con bandera + nombre del país */
.lang-select { position: relative; }

.lang-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 0;
  padding: 6px 10px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  letter-spacing: var(--tk);
  color: var(--black);
  cursor: pointer;
  transition: border-color .14s;
}
.lang-trigger:hover { border-color: rgba(0,0,0,0.3); }

.lang-flag {
  display: block; width: 20px; height: 15px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.1);
}
.lang-name { white-space: nowrap; }
.lang-chevron {
  width: 11px; height: auto; color: rgba(0,0,0,0.4);
  transition: transform .18s ease;
}
.lang-select.open .lang-chevron { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 240px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 0;
  padding: 4px;
  margin: 0;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.lang-select.open .lang-menu {
  opacity: 1; visibility: visible; transform: none;
}

.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none; border: none;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  letter-spacing: var(--tk);
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.lang-option:hover { background: rgba(0,0,0,0.05); }
.lang-option[aria-selected="true"] { background: rgba(0,0,0,0.07); }
.lang-option .lang-flag { flex: none; }
.lang-option .opt-name { flex: 1; white-space: nowrap; }
.lang-option .opt-en { color: rgba(0,0,0,0.45); }

/* ─── BLOQUE 1 · BLANCO — HERO + VÍDEO ─────────────────── */

.hero {
  background: var(--white);
  padding: 72px var(--px) 88px;
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
}

/* Wordmark — logo oficial del design system */
.hero-wordmark {
  display: block;
  margin-bottom: 56px;
  /* Gesto de marca: wipe geométrico del logo — algo más pausado, aire de presentación */
  animation: wipe-in 0.78s cubic-bezier(0.77, 0, 0.18, 1) 0.15s both;
}
.hero-wordmark-img {
  display: block;
  width: clamp(220px, 62vw, 340px);
  height: auto;
}

.hero h1 {
  font-size: clamp(44px, 11vw, 74px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: var(--tk);
  color: var(--black);
  max-width: 600px;
  margin-bottom: 40px;
  white-space: pre-line;
  /* Entra cuando el logo ya casi ha terminado — el contenido no se hace esperar */
  animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.62s both;
}

.hero-lead {
  font-size: 19px; font-weight: 400;
  color: rgba(0,0,0,0.55);
  line-height: 1.65;
  letter-spacing: var(--tk);
  max-width: 400px;
  margin-bottom: 52px;
  animation: fade-in 0.5s ease 0.78s both;
}

/* Certificaciones */
.cert-block {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px;
  margin-bottom: 72px;
  animation: fade-in 0.5s ease 0.88s both;
}

.cert-badges {
  display: flex; align-items: center; gap: 16px;
  color: rgba(0,0,0,0.45);
}
.badge-ce-svg { height: 52px; width: auto; display: block; opacity: 0.55; }
.badge-md-svg { height: 38px; width: auto; display: block; opacity: 0.55; }

.cert-label {
  font-size: 16px; font-weight: 400;
  color: rgba(0,0,0,0.45);
  letter-spacing: var(--tk);
}

/* Vídeo — fade-up limpio, sin rebote (la marca pide "no bounce") */
.video-wrap {
  width: 100%; max-width: var(--max);
  animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.98s both;
}

.video-card {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 0;
  overflow: hidden;
  cursor: pointer; position: relative;
  /* La proporción vive en la tarjeta (no en el overlay):
     así la altura se mantiene al ocultar el overlay y mostrar el iframe */
  aspect-ratio: 3/4;
  transition: border-color .2s;
}
.video-card:hover { border-color: rgba(0,0,0,0.2); }

.video-placeholder {
  position: absolute; inset: 0;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
}

.video-replay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.replay-ring {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s;
}
.video-card:hover .replay-ring {
  border-color: rgba(255,255,255,0.90);
}
.replay-icon {
  font-size: 28px;
  line-height: 1;
  color: white;
  display: block;
  margin-top: -2px;
}

.play-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  animation: ring-pulse 2.6s ease-in-out infinite;
  transition: border-color .2s;
}
.video-card:hover .play-ring {
  border-color: rgba(255,255,255,0.7);
  animation: none;
}
.play-tri {
  width: 0; height: 0; border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent rgba(255,255,255,0.85);
  margin-left: 4px;
}

/* Texto debajo del vídeo */
.video-caption {
  width: 100%; max-width: var(--max);
  text-align: left;
  margin-top: 20px;
  animation: fade-in 0.5s ease 1.12s both;
}
.video-caption-title {
  font-size: 19px; font-weight: 500;
  color: var(--black);
  letter-spacing: var(--tk);
  margin-bottom: 6px;
}
.video-caption-sub {
  font-size: 16px; font-weight: 400;
  color: rgba(0,0,0,0.55);
  letter-spacing: var(--tk); line-height: 1.6;
}
.video-caption-note {
  font-size: 14px; font-weight: 400;
  color: rgba(0,0,0,0.38);
  letter-spacing: var(--tk); line-height: 1.5;
  margin: 8px 0 0;
}

/* ─── BLOQUE 2 · BLANCO — PASOS ─────────────────────────── */

.steps-zone {
  background: var(--white);
  padding: 96px var(--px) 104px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.steps-inner { max-width: var(--max); margin: 0 auto; }

.kicker {
  font-size: 12px; font-weight: 400;
  color: rgba(0,0,0,0.35);
  letter-spacing: var(--tk);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.steps-h2 {
  font-size: clamp(38px, 9.5vw, 58px);
  font-weight: 500; line-height: 1.05;
  letter-spacing: var(--tk);
  color: var(--black);
  margin-bottom: 64px;
}

.steps-list { display: flex; flex-direction: column; }

.step {
  padding: 36px 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.step:last-child { border-bottom: 1px solid rgba(0,0,0,0.1); }

/* Número — cuadrado negro, esquinas rectas */
.step-num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--black);
  border-radius: 0;
  font-size: 18px; font-weight: 500;
  color: var(--white);
  letter-spacing: var(--tk);
  margin-bottom: 24px;
  /* Entrada limpia al aparecer en viewport — sin overshoot (marca: "no bounce") */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--stagger, 0ms) + 40ms);
}
.step.in-view .step-num { opacity: 1; transform: none; }

.step-h {
  font-size: 24px; font-weight: 500;
  line-height: 1.15; letter-spacing: var(--tk);
  color: var(--black);
  margin-bottom: 10px;
}
.step-p {
  font-size: 18px; font-weight: 400;
  line-height: 1.65; letter-spacing: var(--tk);
  color: rgba(0,0,0,0.55);
}

.store-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 24px;
}
/* Insignias oficiales App Store / Google Play.
   La de Apple no tiene margen transparente: 44px = 44px visibles.
   La de Google trae margen transparente arriba/abajo que varía según el
   idioma del badge. Mostramos la imagen completa a 66px y dejamos que
   el flex row las alinee por su centro visual — el padding transparente
   queda invisible y no hay riesgo de recortar el botón. */
.store-badge {
  display: inline-flex; align-items: center;
  text-decoration: none;
  transition: opacity .15s;
}
.store-badge:hover { opacity: .72; }
.store-badge img { display: block; width: auto; }

/* Apple: sin margen transparente → 44px directos */
#badgeAppStore   { height: 44px; }
#imgAppStore     { height: 44px; }

/* Google Play: overflow:hidden recorta el safe-space transparente y el
   centrado flex (.store-badge) centra el botón. JS ajusta la altura de
   render por idioma. SIN margin-top (rompería el centrado). */
#badgeGooglePlay { height: 44px; overflow: hidden; }
#imgGooglePlay   { height: 66px; } /* JS sobreescribe la altura por idioma */

/* ─── BLOQUES 3+4 · GRIS — AYUDA + FOOTER ───────────────── */

.gray-zone { background: var(--gray); }

.help-section { padding: 96px var(--px) 80px; }
.help-inner { max-width: var(--max); margin: 0 auto; }

.help-h {
  font-size: clamp(30px, 7.5vw, 44px);
  font-weight: 500; line-height: 1.1;
  letter-spacing: var(--tk); color: var(--black);
  margin-bottom: 16px;
}
.help-p {
  font-size: 18px; font-weight: 400;
  color: rgba(0,0,0,0.55);
  letter-spacing: var(--tk); line-height: 1.65;
  margin-bottom: 36px; max-width: 380px;
}
.help-link {
  display: inline-flex;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.75);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  letter-spacing: var(--tk);
  padding: 11px 20px; border-radius: 0;
  text-decoration: none;
  transition: border-color .16s, color .16s;
}
.help-link:hover { border-color: rgba(0,0,0,0.3); color: var(--black); }

footer {
  padding: 28px var(--px);
  border-top: 1px solid rgba(0,0,0,0.08);
}
footer p {
  font-size: 12px; font-weight: 400;
  color: rgba(0,0,0,0.28);
  letter-spacing: var(--tk); line-height: 1.7;
  max-width: var(--max); margin-left: auto; margin-right: auto;
}
/* Advertencia regulatoria: algo más legible que el resto del footer */
.footer-disclaimer {
  color: rgba(0,0,0,0.42);
  margin-bottom: 14px;
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: rgba(0,0,0,0.65); }

/* ─── ANIMACIONES ───────────────────────────────────────── */

@keyframes wipe-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.12); }
  50%       { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}

/* ─── WIPE-IN SECUENCIAL — sólo móvil ──────────────────── */
/* Igual que el logo: cada elemento del bloque 1 aparece con un
   barrido izquierda→derecha, en orden estricto de arriba a abajo.
   En escritorio se conservan las animaciones originales. */
@media (max-width: 679px) {
  /* Logo: wipe-in (0.15s · 0.78s → termina ~0.93s) */

  /* h1 — arranca cuando el logo ya casi ha terminado */
  .hero h1 {
    animation: wipe-in 0.42s cubic-bezier(0.77, 0, 0.18, 1) 0.62s both;
    padding-bottom: 0.18em;
  }
  /* lead — fade tras el h1 */
  .hero-lead {
    animation: fade-in 0.45s ease 0.92s both;
  }
  /* cert-block (badges + label juntos) — fade tras el lead */
  .cert-block {
    animation: fade-in 0.45s ease 1.07s both;
  }
  /* vídeo — fade-up limpio (sin rebote) tras el cert-block */
  .video-wrap {
    animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 1.22s both;
  }
  /* caption del vídeo — fade, lo último */
  .video-caption {
    animation: fade-in 0.45s ease 1.42s both;
  }
}

/* Scroll reveal */
.anim {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
  transition-delay: var(--stagger, 0ms);
}
.anim.in-view { opacity: 1; transform: none; }

/* ─── RTL (árabe) ───────────────────────────────────────── */

[dir="rtl"] .video-caption { text-align: right; }
[dir="rtl"] .video-caption-note { text-align: right; }
[dir="rtl"] .store-row     { justify-content: flex-start; }
[dir="rtl"] .help-p        { max-width: none; }
[dir="rtl"] .lang-menu     { right: auto; left: 0; }
[dir="rtl"] .lang-option   { text-align: right; }

/* ─── REDUCED MOTION ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-wordmark, .hero h1, .hero-lead, .cert-block,
  .video-wrap, .video-caption { opacity: 1 !important; clip-path: none !important; transform: none !important; }
  .anim, .step-num { opacity: 1 !important; transform: none !important; }
}

/* ─── DESKTOP ───────────────────────────────────────────── */

@media (min-width: 680px) {
  :root { --px: 48px; }
  .hero         { padding: 88px var(--px) 104px; align-items: center; text-align: center; }
  .cert-block   { align-items: center; }
  .video-wrap    { max-width: 340px; }
  .video-caption { max-width: 340px; }
  .steps-zone   { padding: 112px var(--px) 120px; }
  .help-section { padding: 112px var(--px) 96px; }
  footer        { padding: 32px var(--px); }
}
