/* Analytica — Próximamente · build estático de "Proximamente Analytica v2.dc.html" */

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-900: #141F38;
  --navy-800: #1C2D50;
  --amber-500: #FFB000;
  --coral-500: #FF543B;
  --gradient-brand: linear-gradient(135deg, #FFB000 0%, #FFA30B 40%, #FF543B 100%);
  --gradient-rule: linear-gradient(90deg, #FF543B 0%, #FFA30B 60%, #FFB000 100%);
  --font-sans: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --focus-ring: 0 0 0 3px rgba(255, 84, 59, 0.28);
  --r-md: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #1C2D50; }
a { color: #FFB000; text-decoration: none; }
a:hover { color: #FFFFFF; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* ---- Idioma: html[lang] muestra un solo bloque ---- */
html[lang="es"] [data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="es"] { display: none !important; }

/* ---- Animaciones ---- */
@keyframes om-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes om-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes om-ripple {
  0% { box-shadow: 0 0 0 4px rgba(255, 84, 59, 0.30), 0 0 26px rgba(255, 176, 0, 0.55); }
  70% { box-shadow: 0 0 0 22px rgba(255, 84, 59, 0), 0 0 26px rgba(255, 176, 0, 0.55); }
  100% { box-shadow: 0 0 0 4px rgba(255, 84, 59, 0), 0 0 26px rgba(255, 176, 0, 0.55); }
}
@keyframes om-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Layout raíz ---- */
#om-root {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1C2D50 url('../assets/wave-dark.svg') center / cover no-repeat;
  font-family: var(--font-sans);
  color: #FFFFFF;
}
@supports (min-height: 100svh) { #om-root { min-height: 100svh; } }

/* ---- Header ---- */
#om-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 48px;
}
.brand-logo { height: 30px; display: block; }

.lang-toggle { display: flex; align-items: center; gap: 10px; }
.lang-sep { color: rgba(255, 255, 255, 0.25); font-size: 12px; }
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 6px 2px 4px;
  color: rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid transparent;
  transition: color 0.2s;
}
html[lang="es"] .lang-btn[data-lang-btn="es"],
html[lang="en"] .lang-btn[data-lang-btn="en"] {
  color: #FFFFFF;
  border-bottom-color: #FF543B;
}

/* ---- Main ---- */
#om-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 48px 36px;
}
#om-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}
.copy-block { display: flex; flex-direction: column; align-items: inherit; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 0, 0.45);
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-brand);
  animation: om-blink 2.2s ease-in-out infinite;
}
.badge-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  background: var(--gradient-rule);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FFB000;
}

.kicker {
  margin: 26px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* coral aclarado solo como color de texto: 4.6:1 sobre navy (WCAG AA); el coral de marca #FF543B sigue en bordes y reglas */
  color: #FF6149;
}
#om-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(30px, 3.5vw, 52px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  text-wrap: balance;
}
.rule { width: 110px; height: 2px; background: var(--gradient-rule); margin: 24px 0 0; }
.lede {
  margin: 22px 0 0;
  max-width: 560px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  text-wrap: pretty;
}
.sub { margin: 18px 0 0; font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 0.6); }

/* Entrada en cascada — solo en el bloque ES (paridad con el original: EN aparece sin animación) */
[data-lang="es"] .badge { animation: om-up 0.7s ease-out both; }
[data-lang="es"] .kicker { animation: om-up 0.7s ease-out 0.08s both; }
[data-lang="es"] h1 { animation: om-up 0.7s ease-out 0.16s both; }
[data-lang="es"] .rule { animation: om-up 0.7s ease-out 0.24s both; }
[data-lang="es"] .lede { animation: om-up 0.7s ease-out 0.3s both; }
[data-lang="es"] .sub { animation: om-up 0.7s ease-out 0.34s both; }
[data-lang="es"] [data-cta] { animation: om-up 0.7s ease-out 0.38s both; }
[data-lang="es"] .email-link { animation: om-up 0.7s ease-out 0.44s both; }
[data-lang="es"] [data-stats] { animation: om-up 0.7s ease-out 0.52s both; }

/* ---- CTAs (links reales con estilo de botón del design system) ---- */
[data-cta] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.2s ease-out;
  text-decoration: none;
}
.btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { border-radius: var(--r-md); }
.btn-accent {
  background: var(--gradient-brand);
  color: #FFFFFF;
  border: none;
  padding: 15.5px 29.5px;
}
.btn-accent:hover { color: #FFFFFF; filter: brightness(0.94); }
.btn-secondary {
  background: #FFFFFF;
  color: var(--navy-800);
  border: 1.5px solid var(--navy-800);
  padding: 14px 28px;
}
.btn-secondary:hover { color: var(--navy-800); }

.email-link {
  margin-top: 16px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.email-link:hover { color: #FFFFFF; }

/* ---- Stats ---- */
[data-stats] {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 16px 48px;
  margin-top: 44px;
}
.stat-num {
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  background: var(--gradient-rule);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FFB000;
}
.stat-num sup { font-size: 0.55em; }
.stat-label { margin-top: 8px; font-size: 12.5px; color: rgba(255, 255, 255, 0.62); }

/* ---- Sistema orbital ---- */
#om-syscol {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  min-width: 0;
}
#om-sys { position: relative; width: min(100%, 78vh); aspect-ratio: 1; }
/* Safari ≤14 no soporta aspect-ratio: alto cuadrado via padding */
@supports not (aspect-ratio: 1) {
  #om-sys::before { content: ''; display: block; padding-top: 100%; }
}

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.ring-1 { width: 42%; height: 42%; border: 1px solid rgba(255, 255, 255, 0.12); animation: om-pulse 6s ease-in-out infinite; }
.ring-2 { width: 61%; height: 61%; border: 1px solid rgba(255, 176, 0, 0.24); animation: om-pulse 6s ease-in-out infinite 1.5s; }
.ring-3 { width: 80%; height: 80%; border: 1px solid rgba(255, 255, 255, 0.09); animation: om-pulse 6s ease-in-out infinite 3s; }
.ring-4 { width: 97%; height: 97%; border: 1px solid rgba(255, 255, 255, 0.05); }

.center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--gradient-brand);
  animation: om-ripple 3s ease-in-out infinite;
}

.drift {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transition: opacity 0.6s ease-out;
  will-change: transform;
}
.drift-dot-a {
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.7);
}
.drift-dot-b {
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.orbit-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transition: opacity 0.6s ease-out;
  will-change: transform;
  z-index: 2;
}
.chip-anchor {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(255, 176, 0, 0.8);
  z-index: 3;
}
[data-chip] {
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translate(-9px, -50%);
  background: #FFFFFF;
  border-radius: 12px;
  padding: 9px 14px;
  box-shadow: 0 6px 24px rgba(20, 31, 56, 0.35);
  cursor: default;
}
.chip-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
[data-chip] strong { font-size: 13.5px; font-weight: 600; color: #1C2D50; line-height: 1; }
[data-chip] small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #8A93A6; }

/* ---- Footer ---- */
#om-foot {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 20px 48px 26px;
}
.foot-copy { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }
.foot-tagline { font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, 0.55); }
.foot-sep { color: rgba(255, 255, 255, 0.3); margin: 0 6px; }
.foot-credit { font-size: 11px; font-weight: 400; color: rgba(255, 255, 255, 0.35); text-decoration: none; }
.foot-credit:hover { color: rgba(255, 255, 255, 0.7); }

.socials { display: flex; align-items: center; gap: 10px; }
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.75);
  transition: all 0.2s ease-out;
}
.socials a:hover { color: #FFB000; border-color: rgba(255, 176, 0, 0.6); }
.socials svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.socials .x-icon { stroke-width: 1.8; }

/* ---- Canvas de estrellas ---- */
#om-stars {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  #om-top { padding: 16px 20px; }
  #om-top img { height: 24px; }
  #om-main { grid-template-columns: 1fr; gap: 0; padding: 16px 20px 12px; }
  #om-copy { align-items: center; text-align: center; }
  #om-copy [data-cta], #om-copy [data-stats] { justify-content: center; }
  #om-syscol { min-height: 74vmin; margin-top: -10px; }
  #om-sys [data-chip] { padding: 7px 11px; }
  #om-sys [data-chip] strong { font-size: 12px; }
  #om-sys [data-chip] small { font-size: 10px; }
  [data-stats] { gap: 12px 28px; }
  #om-foot { flex-direction: column; gap: 14px; padding: 18px 20px 24px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  #om-root * { animation: none !important; }
}

/* ---- Juego "Revolviendo los Planetas" (la física vive en js/main.js, secciones [juego]) ---- */
[data-chip] {
  position: relative;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
[data-chip].grabbing { cursor: grabbing; }

/* sombra de "lift" pre-renderizada: solo se anima opacity (barato), nunca box-shadow por frame */
[data-chip]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 31, 56, 0.5);
  opacity: 0;
  transition: opacity 0.16s ease-out;
  pointer-events: none;
  z-index: -1;
}
[data-chip].grabbing::after { opacity: 1; }
@media (pointer: fine) {
  [data-chip]:hover::after { opacity: 0.55; }
}

/* área de agarre táctil ≥44px: halo invisible que participa del hit-test del chip.
   Solo touch — en mouse dispararía el hover-pausa de órbita desde lejos. */
@media (pointer: coarse) {
  [data-chip]::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 24px;
  }
}

/* el anillo "casa" del chip agarrado queda encendido hasta que vuelve a su órbita */
.ring-live {
  border-color: rgba(255, 176, 0, 0.5) !important;
  animation: none !important;
  opacity: 1 !important;
}

/* destello de encaje: al re-dock la luz del anillo "exhala" en 500ms en vez de apagarse en seco */
.ring-dock { animation: ring-dock 0.5s ease-out; }
@keyframes ring-dock {
  from {
    border-color: rgba(255, 176, 0, 0.5);
    opacity: 1;
  }
}

/* sin juego no hay razón para bloquear scroll táctil ni selección de texto */
@media (prefers-reduced-motion: reduce) {
  [data-chip] {
    cursor: default;
    touch-action: auto;
    -webkit-user-select: text;
    user-select: text;
  }
}
