/* === Kids Kingdom — Neuropsicología CSS === */

.np-section {
  position: relative;
  padding-top: 90px;
  padding-bottom: 110px;
}

/* ---------- Header ---------- */
.np-head {
  max-width: 820px;
  margin: 0 auto 64px;
  text-align: center;
}
.np-head .kk-h2 {
  margin-left: auto;
  margin-right: auto;
  max-width: 22ch;
}
.np-head .kk-sub {
  margin: 0 auto;
  max-width: 64ch;
}

/* Pull quote */
.np-quote {
  position: relative;
  margin: 36px auto 0;
  max-width: 680px;
  padding: 22px 28px 22px 56px;
  background: #fff;
  border: 1px solid rgba(75, 69, 145, 0.12);
  border-left: 5px solid var(--kk-gold);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}
.np-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 19px;
  line-height: 1.35;
  color: var(--kk-ink);
}
.np-quote-em { color: var(--kk-purple); font-weight: 600; }
.np-quote-mark {
  position: absolute;
  top: 4px; left: 14px;
  font-family: var(--font-display);
  font-size: 84px; line-height: 1;
  color: var(--kk-gold);
  opacity: 0.55;
}

@media (max-width: 600px) {
  .np-quote { padding: 20px 22px 20px 46px; }
  .np-quote p { font-size: 17px; }
  .np-quote-mark { font-size: 64px; top: 8px; left: 12px; }
}

/* ---------- Grid ---------- */
.np-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 980px) { .np-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 620px) { .np-grid { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Card ---------- */
.np-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(26, 17, 24, 0.06);
  box-shadow: 0 12px 28px -20px rgba(26, 17, 24, 0.3);
  /* Override reveal hover transition with our own — keep opacity at 1 ALWAYS once shown */
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), box-shadow 0.4s ease, border-color 0.4s !important;
}
.np-card.show { opacity: 1 !important; transform: translateY(0); }
.np-card:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 32px 60px -28px rgba(26, 17, 24, 0.4);
  border-color: color-mix(in srgb, var(--c) 35%, transparent);
}

/* ---------- Illo wrapper ---------- */
.np-illo-wrap {
  position: relative;
  aspect-ratio: 5 / 4;
  background:
    radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--c) 18%, transparent), transparent 55%),
    radial-gradient(circle at 15% 90%, color-mix(in srgb, var(--c) 14%, transparent), transparent 50%),
    #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(26, 17, 24, 0.05);
}
.np-illo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Number tag */
.np-illo-wrap .np-num {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--c);
  padding: 5px 12px;
  background: #fff;
  border: 1.5px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-radius: 999px;
  z-index: 3;
}

/* ---------- Body ---------- */
.np-body {
  position: relative;
  padding: 22px 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.np-tagline {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c);
  margin-bottom: 8px;
}
.np-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--kk-ink);
  letter-spacing: -0.01em;
}
.np-body p {
  margin: 0 0 22px;
  font-size: 14.8px;
  line-height: 1.55;
  color: var(--kk-gray);
}
.np-bar {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--c);
  margin-top: auto;
  transition: width 0.4s cubic-bezier(.2,.7,.2,1);
}
.np-card:hover .np-bar { width: 80px; }

/* ============================================================
   ANIMACIONES POR ILUSTRACIÓN
   - cada keyframe se ejecuta en bucle (continuo y "vivo")
   - hover acelera/intensifica
   ============================================================ */

/* 01 ATENCIÓN — anillos pulsando + dot latiendo + mariposas */
.ai-atencion .atn-pulse {
  transform-origin: 100px 80px;
  animation: atnPulse 2.6s ease-out infinite;
  opacity: 0;
}
.ai-atencion .atn-pulse.p2 { animation-delay: 0.85s; }
.ai-atencion .atn-pulse.p3 { animation-delay: 1.7s; }
@keyframes atnPulse {
  0%   { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.ai-atencion .atn-dot { animation: atnDot 1.6s ease-in-out infinite; transform-origin: 100px 80px; }
@keyframes atnDot {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.4); }
}
.ai-atencion .atn-fly { animation: atnFly 6s ease-in-out infinite; }
.ai-atencion .atn-fly.f2 { animation-delay: -3s; animation-duration: 7s; }
@keyframes atnFly {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(20px, -10px); }
  50%  { transform: translate(8px, 14px); }
  75%  { transform: translate(-14px, 6px); }
  100% { transform: translate(0, 0); }
}
.np-card:hover .ai-atencion .atn-pulse { animation-duration: 1.6s; }

/* 02 MEMORIA — nodos parpadean en secuencia + spark dibujado */
.ai-memoria .mem-node {
  transform-origin: center;
  animation: memBlink 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 0 transparent);
}
.ai-memoria .mem-node.n1 { animation-delay: 0s;   }
.ai-memoria .mem-node.n2 { animation-delay: 0.6s; }
.ai-memoria .mem-node.n3 { animation-delay: 1.2s; }
.ai-memoria .mem-node.n4 { animation-delay: 1.8s; }
@keyframes memBlink {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%      { opacity: 1;    transform: scale(1.3); }
}
.ai-memoria .mem-spark {
  animation: memSpark 3.6s ease-in-out infinite;
}
@keyframes memSpark {
  0%   { stroke-dashoffset: 160; opacity: 0.2; }
  50%  { stroke-dashoffset: 0;   opacity: 0.9; }
  100% { stroke-dashoffset: -160; opacity: 0.2; }
}
.np-card:hover .ai-memoria .mem-spark { animation-duration: 2s; }

/* 03 LENGUAJE — burbujas flotan + puntos pop secuencial */
.ai-lenguaje .lng-b1 {
  transform-origin: 75px 75px;
  animation: lngBob 3.4s ease-in-out infinite;
}
.ai-lenguaje .lng-b2 {
  transform-origin: 145px 100px;
  animation: lngBob 3.4s ease-in-out infinite -1.7s;
}
@keyframes lngBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.ai-lenguaje .lng-dot {
  transform-origin: center;
  animation: lngDot 1.4s ease-in-out infinite;
}
.ai-lenguaje .lng-dot.d1 { animation-delay: 0s;    }
.ai-lenguaje .lng-dot.d2 { animation-delay: 0.18s; }
.ai-lenguaje .lng-dot.d3 { animation-delay: 0.36s; }
@keyframes lngDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30%           { transform: translateY(-8px); opacity: 1; }
}
.np-card:hover .ai-lenguaje .lng-dot { animation-duration: 0.9s; }

/* 04 PLANIFICACIÓN — checks aparecen en orden + lápiz se mueve */
.ai-planificacion .plan-check {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: planCheck 4.5s ease-in-out infinite;
}
.ai-planificacion .plan-row.r1 .plan-check { animation-delay: 0.4s; }
.ai-planificacion .plan-row.r2 .plan-check { animation-delay: 1.4s; }
.ai-planificacion .plan-row.r3 .plan-check { animation-delay: 2.4s; }
@keyframes planCheck {
  0%, 8%   { stroke-dashoffset: 22; opacity: 0; }
  20%      { stroke-dashoffset: 0;  opacity: 1; }
  85%      { stroke-dashoffset: 0;  opacity: 1; }
  92%, 100%{ stroke-dashoffset: 22; opacity: 0; }
}
.ai-planificacion .plan-pencil {
  transform-origin: 150px 60px;
  animation: planPencil 4.5s ease-in-out infinite;
}
@keyframes planPencil {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-30px, -8px) rotate(-8deg); }
  50%  { transform: translate(-50px, 22px) rotate(-4deg); }
  75%  { transform: translate(-30px, 50px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.np-card:hover .ai-planificacion .plan-pencil,
.np-card:hover .ai-planificacion .plan-check { animation-duration: 2.6s; }

/* 05 FLEXIBILIDAD — formas se transforman + flechas orbitan */
.ai-flexibilidad .flx-orbit {
  transform-origin: 100px 80px;
  animation: flxSpin 8s linear infinite;
}
@keyframes flxSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.ai-flexibilidad .flx-square,
.ai-flexibilidad .flx-circle,
.ai-flexibilidad .flx-tri {
  transform-origin: 100px 80px;
  animation: flxMorph 5.4s ease-in-out infinite;
}
.ai-flexibilidad .flx-square { animation-delay: 0s;   }
.ai-flexibilidad .flx-circle { animation-delay: 1.8s; }
.ai-flexibilidad .flx-tri    { animation-delay: 3.6s; }
@keyframes flxMorph {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(-30deg); }
  18%, 30% { opacity: 1; transform: scale(1)   rotate(0deg); }
  48%      { opacity: 0; transform: scale(0.7) rotate(30deg); }
}
.np-card:hover .ai-flexibilidad .flx-orbit { animation-duration: 4s; }
.np-card:hover .ai-flexibilidad .flx-square,
.np-card:hover .ai-flexibilidad .flx-circle,
.np-card:hover .ai-flexibilidad .flx-tri { animation-duration: 3s; }

/* 06 CONTROL INHIBITORIO — mano avanza/se detiene + halo */
.ai-control .ctl-hand {
  transform-origin: 107px 95px;
  animation: ctlHand 2.8s cubic-bezier(.5,.05,.4,1) infinite;
}
@keyframes ctlHand {
  0%   { transform: translate(-12px, 6px) scale(0.92); }
  35%  { transform: translate(0, 0) scale(1.04); }
  55%  { transform: translate(0, 0) scale(1.04); }
  100% { transform: translate(-12px, 6px) scale(0.92); }
}
.ai-control .ctl-halo {
  transform-origin: 100px 80px;
  animation: ctlHalo 2.8s ease-out infinite;
}
.ai-control .ctl-halo.h2 { animation-delay: 1.4s; }
@keyframes ctlHalo {
  0%   { transform: scale(0.6); opacity: 0; }
  35%  { opacity: 0.35; }
  100% { transform: scale(1.6); opacity: 0; }
}
.ai-control .ctl-ticks {
  animation: ctlTicks 2.8s ease-in-out infinite;
}
@keyframes ctlTicks {
  0%, 25%   { opacity: 0;   transform: scale(0.85); }
  40%, 70%  { opacity: 0.9; transform: scale(1); }
  100%      { opacity: 0;   transform: scale(0.85); }
}
.np-card:hover .ai-control .ctl-hand { animation-duration: 1.6s; }
.np-card:hover .ai-control .ctl-halo { animation-duration: 1.6s; }

/* Reduce motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  .np-illo * { animation: none !important; }
}
