/* =========================================================================
 * ДА Work OS · Premium SaaS Interface Stylesheet (saas_premium.css)
 * -------------------------------------------------------------------------
 * Reglas de diseño SaaS de alta gama:
 * - Jerarquía visual, espaciado armónico, tipografía precisa (Inter + Space Grotesk + JetBrains Mono)
 * - Tarjetas con micro-bordes refinados, iluminación ambiental y sombras sutiles
 * - Visualizaciones de datos: Curva S en SVG, grafo acíclico DAG (PERT/CPM),
 *   bóveda de auditoría NOM-035 con sellos SHA-256 y mapa de calor LFT 40h
 * - Adaptabilidad responsive completa: móvil (<640px), tablet (640-1023px) y escritorio (1024px+)
 * - Prevención estricta de desbordamiento horizontal (zero horizontal overflow)
 * ========================================================================= */

:root {
  --gem-primary: rgb(var(--da-primary));
  --gem-primary-hover: rgb(var(--da-primary-fixed));
  --gem-secondary: rgb(var(--da-secondary));
  --gem-emerald: #10b981;
  --gem-rose: #f43f5e;
  --gem-amber: #f59e0b;
  --gem-slate-950: rgb(var(--da-deep-3));
  --gem-slate-900: rgb(var(--da-slate-900));
  --gem-slate-800: rgb(var(--da-slate-800));
  --gem-slate-700: rgb(var(--da-slate-700));
  --gem-slate-200: rgb(var(--da-slate-200));
  --gem-slate-100: rgb(var(--da-slate-100));
  --gem-slate-50: rgb(var(--da-slate-50));
}

/* -------------------------------------------------------------------------
 * 1. ZERO OVERFLOW & ROOT BEHAVIOR
 * ------------------------------------------------------------------------- */
html, body {
  overflow-x: clip !important;
  max-width: 100vw;
}

/* Smooth Scrolling con margen para barra fija */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* -------------------------------------------------------------------------
 * 2. EFECTOS DE SUPERFICIE, ILUMINACIÓN Y GRADIENTES SAAS
 * ------------------------------------------------------------------------- */
.gem-hero-bg {
  background-color: rgb(var(--da-deep-1));
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgb(var(--da-secondary) / 0.15), transparent 70%),
    radial-gradient(circle at 100% 0%, rgb(var(--da-primary) / 0.12), transparent 50%),
    linear-gradient(to bottom, rgb(var(--da-deep-3)) 0%, rgb(var(--da-deep-1)) 50%, rgb(var(--da-slate-900)) 100%);
}

.gem-grid-pattern {
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 60%, transparent 100%);
}

.gem-card-light {
  background: #ffffff;
  border: 1px solid rgb(var(--da-slate-200) / 0.9);
  box-shadow: 0 1px 3px rgb(var(--da-slate-900) / 0.04), 0 8px 24px -6px rgb(var(--da-slate-900) / 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

.gem-card-light:hover {
  border-color: rgb(var(--da-primary) / 0.35);
  box-shadow: 0 2px 4px rgb(var(--da-slate-900) / 0.04), 0 12px 24px -12px rgb(var(--da-slate-900) / 0.07);
  transform: translateY(-2px);
}

.gem-card-dark {
  background: rgb(var(--da-slate-900));
  border: 1px solid rgb(var(--da-slate-700) / 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

.gem-card-dark:hover {
  border-color: rgb(var(--da-secondary) / 0.4);
}

/* -------------------------------------------------------------------------
 * 3. VENTANA WORK OS EN HERO (MOCKUP REALISTA DE APLICACIÓN)
 * ------------------------------------------------------------------------- */
.gem-window {
  border-radius: 16px;
  background: rgb(var(--da-deep-2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
              0 24px 48px -24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.gem-window-header {
  height: 42px;
  background: rgb(var(--da-slate-900) / 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.gem-window-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

/* Indicador de Estado Pulsante */
.gem-pulse-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
}

.gem-pulse-dot::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--gem-emerald);
  animation: gem-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.gem-pulse-dot::after {
  content: "";
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gem-emerald);
}

@keyframes gem-ping {
  75%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------
 * 4. PESTAÑAS DEL SIMULADOR WORK OS (SEGMENTED CONTROL FLUIDO)
 * ------------------------------------------------------------------------- */
.gem-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem;
  background: rgb(var(--da-deep-2));
  border-bottom: 1px solid rgb(var(--da-slate-700) / 0.6);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gem-tab-bar::-webkit-scrollbar {
  display: none;
}

.gem-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-family: var(--da-font-display, "Space Grotesk", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  color: rgb(var(--da-slate-400));
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  user-select: none;
}

.gem-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.gem-tab-btn.active {
  color: #ffffff;
  background: var(--gem-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px -1px rgb(var(--da-primary) / 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------------------------------
 * 5. VISUALIZACIÓN CURVA S (PMI / EVM)
 * ------------------------------------------------------------------------- */
.gem-metric-card {
  background: rgb(var(--da-slate-900) / 0.8);
  border: 1px solid rgb(var(--da-slate-700) / 0.6);
  border-radius: 12px;
  padding: 1.125rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.gem-metric-card:hover {
  border-color: rgb(var(--da-secondary) / 0.5);
}

.gem-metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gem-secondary), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gem-metric-card:hover::before {
  opacity: 1;
}

/* -------------------------------------------------------------------------
 * 6. GRAFO DE NODOS PERT / CPM (RUTA CRÍTICA)
 * ------------------------------------------------------------------------- */
.gem-dag-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.75rem;
}

.gem-dag-hint {
  display: none;
}

@media (max-width: 1023px) {
  .gem-dag-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: rgb(var(--da-slate-900) / 0.85);
    border: 1px solid rgb(var(--da-slate-700) / 0.7);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: rgb(var(--da-slate-400));
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

.gem-dag-node {
  background: rgb(var(--da-deep-2));
  border-radius: 12px;
  border: 1.5px solid rgb(var(--da-slate-700) / 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 200px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gem-dag-node:hover {
  transform: translateY(-2px);
}

.gem-dag-critical {
  border-color: rgba(244, 63, 94, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gem-dag-critical-badge {
  background: #be123c;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
 * 7. BÓVEDA NOM-035 (SELLOS SHA-256)
 * ------------------------------------------------------------------------- */
.gem-hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.gem-copy-btn {
  background: transparent;
  border: none;
  color: rgb(var(--da-slate-400));
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.gem-copy-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* -------------------------------------------------------------------------
 * 8. MAPA DE CALOR LFT 40h
 * ------------------------------------------------------------------------- */
.gem-meter-bar {
  position: relative;
  height: 8px;
  border-radius: 9999px;
  background: rgb(var(--da-slate-700) / 0.5);
  overflow: hidden;
}

.gem-meter-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------------------
 * 9. MATRIZ COMPARATIVA RESPONSIVE (TABLA SAAS)
 * ------------------------------------------------------------------------- */
.gem-table-wrapper {
  position: relative;
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgb(var(--da-slate-200));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.gem-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.gem-table th {
  background: rgb(var(--da-slate-50));
  color: rgb(var(--da-slate-800));
  font-family: var(--da-font-display, "Space Grotesk", sans-serif);
  font-weight: 600;
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgb(var(--da-slate-200));
  white-space: nowrap;
}

.gem-table td {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid rgb(var(--da-slate-100));
  vertical-align: middle;
}

.gem-table tr:last-child td {
  border-bottom: none;
}

/* Columna destacada de ДА Work OS */
.gem-col-highlight {
  background: rgb(var(--da-primary) / 0.035);
  border-left: 1px solid rgb(var(--da-primary) / 0.15);
  border-right: 1px solid rgb(var(--da-primary) / 0.15);
}

th.gem-col-highlight {
  background: rgb(var(--da-primary) / 0.07);
  color: var(--gem-primary);
}

/* Aviso de scroll horizontal en móvil/tablet */
.gem-scroll-hint {
  display: none;
}

@media (max-width: 1023px) {
  .gem-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgb(var(--da-slate-100));
    border-bottom: 1px solid rgb(var(--da-slate-200));
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: rgb(var(--da-slate-500));
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

/* -------------------------------------------------------------------------
 * 10. PLANES Y PRECIOS: TOGGLE Y TARJETAS
 * ------------------------------------------------------------------------- */
.gem-plan-toggle {
  display: inline-flex;
  align-items: center;
  background: rgb(var(--da-slate-800));
  border: 1px solid rgb(var(--da-slate-700) / 0.8);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
}

.gem-plan-toggle-btn {
  padding: 6px 16px;
  border-radius: 9999px;
  font-family: var(--da-font-display, "Space Grotesk", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--da-slate-400));
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.gem-plan-toggle-btn.active {
  background: var(--gem-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgb(var(--da-primary) / 0.5);
}

.gem-card-featured {
  position: relative;
  border: 2px solid var(--gem-primary) !important;
  box-shadow: 0 20px 40px -12px rgb(var(--da-primary) / 0.35),
              0 0 0 1px rgb(var(--da-primary) / 0.2);
}

/* -------------------------------------------------------------------------
 * 11. FORMULARIO DE CONTACTO / AGENDAR DEMO (ENTERPRISE GRADE)
 * ------------------------------------------------------------------------- */
.gem-choice-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 12px;
  border: 1.5px solid rgb(var(--da-slate-300));
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.gem-choice-card:hover {
  border-color: rgb(var(--da-slate-400));
  background: rgb(var(--da-slate-50));
}

.gem-choice-card.is-selected {
  border-color: var(--gem-primary);
  background: rgb(var(--da-primary) / 0.035);
  box-shadow: 0 0 0 3px rgb(var(--da-primary) / 0.12);
}

/* Ajustes de control para móvil (evita auto-zoom en iOS con font-size >= 16px) */
.gem-form-control {
  width: 100%;
  font-size: 16px;
  line-height: 1.5;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: rgb(var(--da-slate-800));
  min-height: 46px;
}

@media (min-width: 768px) {
  .gem-form-control {
    font-size: 14.5px;
  }
}

.gem-form-control:focus {
  outline: none;
  border-color: var(--gem-primary);
  box-shadow: 0 0 0 3px rgb(var(--da-primary) / 0.18);
}

/* Botón CTA Principal con micro-interacción */
.gem-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gem-primary);
  color: #ffffff;
  font-family: var(--da-font-display, "Space Grotesk", sans-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.8125rem 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgb(var(--da-slate-900) / 0.07);
  cursor: pointer;
  transition: background-color 0.15s ease,
              box-shadow 0.15s ease,
              transform 0.1s ease;
  min-height: 48px;
  text-decoration: none;
}

.gem-btn-primary:hover {
  background: var(--gem-primary-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 4px rgb(var(--da-slate-900) / 0.07);
}

.gem-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgb(var(--da-slate-900) / 0.1);
}

/* Botón Secundario */
.gem-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgb(var(--da-slate-50));
  font-family: var(--da-font-display, "Space Grotesk", sans-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.8125rem 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
  text-decoration: none;
}

.gem-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
 * 12. RESPONSIVE BREAKPOINT REFINEMENTS
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* En pantallas móviles estrechas */
  .gem-btn-primary, .gem-btn-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .gem-window-header {
    padding: 0 10px;
    height: 36px;
  }

  .gem-metric-card {
    padding: 0.875rem;
  }
}

/* Toast de Copiado Rápido */
.gem-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgb(var(--da-slate-900));
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgb(var(--da-slate-700));
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gem-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------------------
 * 13. SISTEMA DE ANIMACIONES Y MICRO-INTERACCIONES SAAS PREMIUM (SUAVE & ELEGANTE)
 * ------------------------------------------------------------------------- */

/* Sobrescribir neutralización previa de AOS con desaceleración ultra-suave y tiempos extendidos */
[data-aos] {
  pointer-events: none;
  transition-duration: 1.0s !important;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform, opacity;
}
[data-aos].aos-animate {
  pointer-events: auto;
}

/* Duraciones personalizadas para elementos escalonados (entrada suave y progresiva) */
[data-aos][data-aos-duration="600"]  { transition-duration: 0.65s !important; }
[data-aos][data-aos-duration="700"]  { transition-duration: 0.75s !important; }
[data-aos][data-aos-duration="800"]  { transition-duration: 0.85s !important; }
[data-aos][data-aos-duration="900"]  { transition-duration: 0.95s !important; }
[data-aos][data-aos-duration="950"]  { transition-duration: 1.0s !important; }
[data-aos][data-aos-duration="1000"] { transition-duration: 1.05s !important; }
[data-aos][data-aos-duration="1050"] { transition-duration: 1.1s !important; }
[data-aos][data-aos-duration="1100"] { transition-duration: 1.15s !important; }
[data-aos][data-aos-duration="1150"] { transition-duration: 1.2s !important; }
[data-aos][data-aos-duration="1200"] { transition-duration: 1.25s !important; }
[data-aos][data-aos-duration="1400"] { transition-duration: 1.4s !important; }

/* 1. Desplazamiento vertical suave (Ascenso elegante de 20px) */
[data-aos="fade-up"] {
  opacity: 0 !important;
  transform: translate3d(0, 20px, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="fade-up"].aos-animate {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* 2. Desplazamiento descendente suave (Para badges y selectores) */
[data-aos="fade-down"] {
  opacity: 0 !important;
  transform: translate3d(0, -16px, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="fade-down"].aos-animate {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* 3. Desplazamiento lateral suave desde la derecha (20px controlados) */
[data-aos="fade-left"] {
  opacity: 0 !important;
  transform: translate3d(20px, 0, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="fade-left"].aos-animate {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* 4. Desplazamiento lateral suave desde la izquierda (20px controlados) */
[data-aos="fade-right"] {
  opacity: 0 !important;
  transform: translate3d(-20px, 0, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="fade-right"].aos-animate {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* 5. Apertura en profundidad suave (Escala 0.97 con suave elevación) */
[data-aos="zoom-in"] {
  opacity: 0 !important;
  transform: scale(0.97) translate3d(0, 12px, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="zoom-in"].aos-animate {
  opacity: 1 !important;
  transform: scale(1) translate3d(0, 0, 0) !important;
}

/* 6. Entrada con profundidad y elevación (Para tarjetas destacadas) */
[data-aos="zoom-in-up"] {
  opacity: 0 !important;
  transform: scale(0.96) translate3d(0, 24px, 0) !important;
  transition-property: opacity, transform !important;
}
[data-aos="zoom-in-up"].aos-animate {
  opacity: 1 !important;
  transform: scale(1) translate3d(0, 0, 0) !important;
}

/* Transición suave de entrada al cambiar pestañas en el simulador */
.gem-fade-in,
.sim-pane.block {
  animation: gemTabFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gemTabFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ventana del hero y tarjetas destacadas: estáticas.
 * La flotación (9s) y el pulso de brillo (6s) eran decoración en bucle
 * que animaba box-shadow; se retiran (skills motion + anti-slop). */
.gem-floating,
.gem-glow-pulse { animation: none; }

/* Animación de trazado de Curva S (EVM) lenta, ejecutiva y elegante (2.4s) */
.gem-scurve-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: gemDrawPath 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gem-scurve-area {
  opacity: 0;
  animation: gemFadeArea 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gem-scurve-dot {
  opacity: 0;
  transform-origin: center;
  animation: gemPopDot 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}

@keyframes gemDrawPath {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes gemFadeArea {
  0% { opacity: 0; }
  60% { opacity: 0.15; }
  100% { opacity: 1; }
}

@keyframes gemPopDot {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Ruta Crítica (Slack = 0): estado estático. El significado ya lo dan
 * el color, el texto "Slack = 0d" y la insignia; no hace falta pulso. */
.gem-dag-critical { animation: none; }

/* CTA principal: sin barrido de brillo (decoración). El hover lo da el
 * cambio de color de fondo de la propia utilidad. */
.gem-btn-primary::after { content: none; }

/* Hover amortiguado en Bento Cards (0.35s) */
.gem-card-light {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}

.gem-card-light:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--da-primary) / 0.35);
  box-shadow: 0 2px 4px rgb(var(--da-slate-900) / 0.04), 0 12px 24px -12px rgb(var(--da-slate-900) / 0.07);
}

/* Hover en las tarjetas oscuras del simulador (0.3s) */
.gem-metric-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.3s ease;
}

.gem-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--da-secondary) / 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Animación de apertura suave del FAQ (0.38s) */
details[open] > summary ~ * {
  animation: gemFaqOpen 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gemFaqOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reducción de movimiento para accesibilidad: estado final inmediato.
 * Antes, "animation: none" dejaba la Curva S invisible (dashoffset 1000)
 * y el punto final con opacity 0. */
@media (prefers-reduced-motion: reduce) {
  [data-aos],
  .gem-floating,
  .gem-glow-pulse,
  .gem-dag-critical,
  .gem-fade-in,
  .sim-pane.block,
  details[open] > summary ~ * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .gem-pulse-dot::before { animation: none !important; opacity: 0 !important; }
  .gem-scurve-line { animation: none !important; stroke-dashoffset: 0 !important; }
  .gem-scurve-area,
  .gem-scurve-dot { animation: none !important; opacity: 1 !important; transform: none !important; }
  .gem-toast { transition: opacity 0.1s linear !important; transform: none !important; }
}

/* -------------------------------------------------------------------------
 * 14. STORYTELLING, CONTADORES, CASOS Y DEMO INTERACTIVA
 * ------------------------------------------------------------------------- */
.gem-story-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.gem-story-visual { min-width: 0; }

.gem-story-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gem-story-step {
  padding: 1.25rem 1.375rem;
  border-radius: 14px;
  border: 1px solid rgb(var(--da-slate-800) / 0.7);
  background: rgb(var(--da-slate-900) / 0.5);
}

.gem-story-panel { display: none; }

.gem-story-panel.is-active {
  display: block;
  animation: gemTabFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.gem-story-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.gem-story-dot {
  width: 26px;
  height: 4px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgb(var(--da-slate-700));
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.gem-story-dot.is-active {
  width: 40px;
  background: var(--gem-secondary);
}

@media (max-width: 1023px) {
  .gem-story-panel { display: block; }
  .gem-story-panel + .gem-story-panel { margin-top: 0.75rem; }
  .gem-story-dots { display: none; }
}

@media (min-width: 1024px) {
  .gem-story-inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: start;
    gap: 3.5rem;
  }

  .gem-story-visual { position: sticky; top: 5.5rem; }

  .gem-story-step {
    min-height: 58vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
    border-color: transparent;
    background: transparent;
    opacity: 1;
    transition: opacity 0.35s ease, border-color 0.35s ease,
                background-color 0.35s ease, padding 0.35s ease;
  }

  [data-story][data-story-active] .gem-story-step { opacity: 0.38; }

  [data-story][data-story-active] .gem-story-step.is-active {
    opacity: 1;
    padding: 1.25rem 1.5rem;
    border-color: rgb(var(--da-slate-800) / 0.8);
    background: rgb(var(--da-slate-900) / 0.55);
  }
}

.gem-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.gem-stat {
  padding: 1.125rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgb(var(--da-slate-800) / 0.7);
  background: rgb(var(--da-slate-950) / 0.6);
}

.gem-counter {
  display: block;
  min-height: 1em;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .gem-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

.gem-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.35em, 0);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 40ms);
}

.gem-word.is-in {
  opacity: 1;
  transform: none;
}

.gem-flicker.is-flicker {
  animation: gemFlicker 0.9s steps(2, end) 1;
}

@keyframes gemFlicker {
  0%, 100% { opacity: 1; }
  20%, 45%, 70% { opacity: 0.35; }
  30%, 55%, 80% { opacity: 1; }
}

.gem-cases-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gem-cases-rail::-webkit-scrollbar { display: none; }

.gem-case {
  flex: 0 0 86%;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .gem-case { flex-basis: 46%; }
}

@media (min-width: 1024px) {
  .gem-case { flex-basis: 32%; }
}

.gem-cases-progress {
  height: 3px;
  border-radius: 999px;
  background: rgb(var(--da-slate-800));
  overflow: hidden;
}

.gem-cases-progress > span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: var(--gem-secondary);
  transition: width 0.15s linear;
}

.gem-clock-row {
  animation: gemTabFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gem-dag-node {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}

.gem-dag-container.has-focus .gem-dag-node:not(.is-focus) { opacity: 0.4; }

.gem-dag-node.is-focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .gem-word { opacity: 1; transform: none; transition: none; }
  .gem-flicker.is-flicker,
  .gem-clock-row,
  .gem-story-panel.is-active { animation: none !important; }
  .gem-story-step { opacity: 1; transition: none; }
  [data-story][data-story-active] .gem-story-step { opacity: 1; }
}
