/* =========================================================
   El Universo de la Hipérbola — styles.css
   ========================================================= */

/* ---------- Variables ----------
   Colores, tipografías y medidas reutilizables. Cambiar una variable actualiza
   el diseño completo sin tener que buscar el mismo color en muchas reglas. */
:root {
  --bg: #060818;
  --bg-2: #0b1030;
  --panel: rgba(16, 22, 58, 0.62);
  --panel-solid: #10163a;
  --border: rgba(120, 140, 255, 0.18);
  --border-strong: rgba(0, 229, 255, 0.45);

  --neon: #00e5ff;
  --violet: #a855f7;
  --pink: #ff3ea5;
  --yellow: #ffd23f;
  --orange: #ff9f1c;
  --green: #22ff9a;
  --red: #ff4d6d;

  --text: #e6ecff;
  --muted: #93a0cf;

  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(0, 229, 255, 0.35);

  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

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

/* Hace que los enlaces del menú se desplacen suavemente y no queden ocultos bajo la barra fija. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(168, 85, 247, 0.20), transparent 60%),
    radial-gradient(900px 500px at -10% 35%, rgba(0, 229, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #cfe, transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, #fff, transparent),
    radial-gradient(1px 1px at 75% 55%, #dcf, transparent),
    radial-gradient(1.5px 1.5px at 90% 85%, #fff, transparent),
    radial-gradient(1px 1px at 45% 90%, #fff, transparent),
    radial-gradient(1px 1px at 20% 45%, #aef, transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
}

a { color: var(--neon); text-decoration: none; }
strong { color: #fff; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.5px; line-height: 1.2; }

.grad {
  background: linear-gradient(90deg, var(--neon), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.45));
}

.c-pink { color: var(--pink); font-weight: 600; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--neon);
  border: 1px solid var(--border-strong);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: rgba(0, 229, 255, 0.06);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  color: var(--text);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(90deg, var(--neon), var(--violet));
  color: #05061a;
  box-shadow: var(--glow);
}
.btn.primary:hover { box-shadow: 0 0 34px rgba(0, 229, 255, 0.6); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--neon); box-shadow: var(--glow); }

.btn.small { padding: 9px 16px; font-size: 0.88rem; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.pulse { animation: pulseBtn 1.4s ease-in-out infinite; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(6, 8, 24, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon);
  font-size: 1.3rem;
  letter-spacing: -2px;
}

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: rgba(0, 229, 255, 0.1);
}
.nav-links a.active { box-shadow: inset 0 -2px 0 var(--neon); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  border-radius: 10px;
  padding: 4px 12px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(50px, 9vw, 110px) 20px 60px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 70px);
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 900;
  margin-bottom: 20px;
}
.lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--neon);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}
.hero-stats span { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

.hero-visual {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(rgba(120, 140, 255, 0.06) 1px, transparent 1px) 0 0 / 5% 6.25%,
    linear-gradient(90deg, rgba(120, 140, 255, 0.06) 1px, transparent 1px) 0 0 / 5% 6.25%,
    rgba(10, 14, 40, 0.6);
  box-shadow: var(--shadow), inset 0 0 60px rgba(168, 85, 247, 0.15);
  overflow: hidden;
  animation: floaty 6s ease-in-out infinite;
}
.hero-visual svg { width: 100%; height: 100%; display: block; }

.h-axis { stroke: rgba(200, 210, 255, 0.35); stroke-width: 0.05; }
.h-asym { stroke: var(--violet); stroke-width: 0.06; stroke-dasharray: 0.3 0.25; opacity: 0.8; }
.h-curve {
  fill: none;
  stroke: var(--neon);
  stroke-width: 0.14;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.6s ease forwards;
}
.h-curve.delay { animation-delay: 0.6s; }
.h-focus { fill: var(--pink); animation: blink 2s ease-in-out infinite; }
.h-vertex { fill: var(--yellow); }
.h-label { fill: var(--muted); font-family: var(--font-mono); font-size: 0.55px; }
.h-mover { fill: #fff; }

/* ---------- Secciones ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 20px;
}
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 12px; }
.section-sub { color: var(--muted); max-width: 720px; margin: 0 auto; font-size: 1.05rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.panel-title { font-size: 1rem; margin-bottom: 16px; }

/* ---------- Concepto ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.concept-card {
  padding: 26px 22px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.concept-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow), var(--glow);
}
.concept-icon { font-size: 1.8rem; margin-bottom: 10px; color: var(--neon); }
.concept-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.concept-card p { color: var(--muted); font-size: 0.95rem; }

.formula {
  font-family: var(--font-mono);
  color: var(--text) !important;
  font-size: 1.05rem !important;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.formula-list { list-style: none; display: grid; gap: 8px; }
.formula-list li {
  font-family: var(--font-mono);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
}

/* Fracciones */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.25;
  margin: 0 2px;
}
.frac > span:first-child { padding: 0 4px 2px; }
.frac > span:last-child { border-top: 2px solid currentColor; padding: 2px 4px 0; width: 100%; text-align: center; }

.elements { padding: 22px; }
.elements h3 { font-size: 1rem; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.chip i, .legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}
i.dashed {
  width: 18px !important;
  height: 0 !important;
  border-radius: 0 !important;
  border-top: 2px dashed var(--violet);
  box-shadow: none !important;
}

/* ---------- Laboratorio ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.controls { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.orient-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.seg {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s;
}
.seg.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.25), rgba(168, 85, 247, 0.25));
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.control label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.var {
  font-family: var(--font-mono);
  font-weight: 600;
  font-style: italic;
  color: var(--neon);
  font-size: 1.05rem;
  min-width: 14px;
}
.control-row { display: flex; align-items: center; gap: 12px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  background:
    linear-gradient(90deg, var(--neon), var(--violet)) 0 / var(--fill, 50%) 100% no-repeat,
    rgba(255, 255, 255, 0.1);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--neon);
  box-shadow: 0 0 12px var(--neon);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--neon);
  box-shadow: 0 0 12px var(--neon);
}

input[type="number"] {
  width: 70px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  outline: none;
}
input[type="number"]:focus { border-color: var(--neon); box-shadow: var(--glow); }

.toggles { display: grid; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 16px; }
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input { display: none; }
.switch span {
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}
.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s;
}
.switch input:checked + span { background: linear-gradient(90deg, var(--neon), var(--violet)); }
.switch input:checked + span::after { transform: translateX(16px); }

/* Contenedor de cada plano. Evita que las animaciones del canvas se salgan del recuadro. */
.canvas-wrap { position: relative; padding: 10px; overflow: hidden; }
.canvas-wrap canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 50%, rgba(20, 28, 80, 0.55), rgba(5, 7, 22, 0.9));
  cursor: crosshair;
  touch-action: none;
}
.coord-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(6, 8, 24, 0.8);
  border: 1px solid var(--border);
  color: var(--neon);
  pointer-events: none;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 6px 2px;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.info-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.info-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.3s;
}
.info-card:hover { border-color: var(--border-strong); }
.info-card.wide { grid-column: span 2; }
.info-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--violet);
}
.info-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 1.6em;
}
.info-value.eq { font-size: 1.35rem; color: var(--neon); text-shadow: 0 0 12px rgba(0, 229, 255, 0.35); }
.info-value.small-val { font-size: 0.95rem; line-height: 1.7; display: block; }
.info-note { font-size: 0.82rem; color: var(--muted); }

.flash { animation: flash 0.5s ease; }

.meter {
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.meter div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--neon), var(--violet), var(--pink));
  border-radius: 8px;
  transition: width 0.4s ease;
}

/* ---------- Aplicaciones (tarjetas giratorias) ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.flip-card {
  perspective: 1200px;
  height: 320px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-card:hover .face { border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); }

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.face.front {
  background:
    radial-gradient(circle at 85% 10%, rgba(0, 229, 255, 0.18), transparent 50%),
    var(--panel-solid);
}
.face.back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 15% 90%, rgba(168, 85, 247, 0.25), transparent 55%),
    var(--panel-solid);
}
.face h3 { font-size: 1.1rem; }
.face p { color: var(--muted); font-size: 0.93rem; }
.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(168, 85, 247, 0.25));
  border: 1px solid var(--border-strong);
  box-shadow: var(--glow);
}
.flip-hint { margin-top: auto; font-size: 0.8rem; color: var(--neon); font-family: var(--font-mono); }
.math-tag {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--pink);
  border: 1px solid rgba(255, 62, 165, 0.4);
  background: rgba(255, 62, 165, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ---------- Minijuego ---------- */
.game-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
.game-side { padding: 22px; display: flex; flex-direction: column; gap: 14px; }

.scoreboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scoreboard div {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.scoreboard span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.scoreboard strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}
.scoreboard strong.bump { animation: bump 0.5s ease; }

.challenge {
  background: linear-gradient(135deg, rgba(255, 159, 28, 0.12), rgba(255, 62, 165, 0.08));
  border: 1px solid rgba(255, 159, 28, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
}
.challenge h3 { font-size: 0.98rem; margin-bottom: 6px; color: var(--orange); }
.challenge p { font-size: 0.9rem; color: var(--text); }
.hint-text { margin-top: 8px; color: var(--yellow) !important; font-family: var(--font-mono); font-size: 0.85rem !important; }

.game-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-actions #checkBtn { grid-column: 1 / -1; }

.feedback {
  min-height: 48px;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
  border: 1px dashed var(--border);
  color: var(--muted);
}
.feedback.ok {
  color: var(--green);
  border: 1px solid var(--green);
  background: rgba(34, 255, 154, 0.08);
  box-shadow: 0 0 24px rgba(34, 255, 154, 0.3);
  animation: pop 0.5s ease;
}
.feedback.bad {
  color: var(--red);
  border: 1px solid var(--red);
  background: rgba(255, 77, 109, 0.08);
  animation: shake 0.45s ease;
}
.feedback small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

.canvas-wrap.win { box-shadow: 0 0 40px rgba(34, 255, 154, 0.45); border-color: var(--green); }
.canvas-wrap.lose { animation: shake 0.45s ease; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ---------- Revelado al hacer scroll ---------- */
/* Las tarjetas comienzan discretamente fuera de vista; JavaScript agrega "visible" al llegar al scroll. */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Animaciones ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.7; } }
@keyframes pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes bump { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes flash { 0% { color: var(--pink); } 100% { color: inherit; } }
@keyframes pulseBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
}

/* ---------- Responsive ----------
   Estas reglas reorganizan columnas y menú en pantallas pequeñas, como celulares. */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .lab-grid, .game-grid { grid-template-columns: 1fr; }
  .game-grid .canvas-wrap { order: -1; }
}

@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(6, 8, 24, 0.96);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .section { padding: 64px 16px; }
  .info-card.wide { grid-column: auto; }
  .info-value.eq { font-size: 1.1rem; }
  .canvas-wrap canvas { aspect-ratio: 1 / 1; }
  .flip-card { height: 340px; }
}

/* Respeta la preferencia de personas que solicitan menos movimiento en su dispositivo. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
