/* ============ RuruChay — estilos ============ */
:root {
  --purple-dark: #3B1170;
  --purple-ink: #4A1A57;
  --purple: #7B3FB0;
  --purple-soft: #F5EDFA;
  --yellow: #FBBC24;
  --yellow-shadow: #E3A10E;
  --text: #3B2A4A;
  --muted: #5A4A66;
  --hero-bg: #F5F0FE;
  --font-head: 'Baloo 2', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-script: 'Kalam', cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* La cabecera es sticky: el ancla no debe quedar por debajo de ella. */
section[id] { scroll-margin-top: 96px; }

/* ── Animaciones ──────────────────────────────────────────────────── */
@keyframes rc-rise      { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }
@keyframes rc-float     { 0%, 100% { transform: translate3d(0, 0, 0); }          50% { transform: translate3d(0, -16px, 0); } }
@keyframes rc-floatSlow { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(0, 18px, 0) scale(1.06); } }
@keyframes rc-swing     { 0%, 100% { transform: rotate(-6deg); }                 50% { transform: rotate(8deg); } }
@keyframes rc-ken       { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ── Aparición al entrar en pantalla ──────────────────────────────────
   El ocultado solo se aplica si el JS arrancó (html.rc-js). Sin JS la
   página se ve completa, nunca en blanco.
   ──────────────────────────────────────────────────────────────────── */
html.rc-js [data-reveal] > * { visibility: hidden; }
html.rc-js [data-reveal] > .rc-in { visibility: visible; animation: rc-rise .7s cubic-bezier(.2,.7,.3,1) both; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: #fff; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: #6A2C91; text-decoration: none; }
a:hover { color: #F7892A; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; }
p { margin: 0; }

.container { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.yellow { color: var(--yellow); }

/* Iconos */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--sm { width: 16px; height: 16px; }
.ico--md { width: 26px; height: 26px; }
.ico--lg { width: 30px; height: 30px; }
.ico--xl { width: 32px; height: 32px; stroke-width: 1.8; }
.fill { width: 16px; height: 16px; fill: #fff; }
.circle { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; font-weight: 800; font-size: 14px; transition: background .15s, transform .15s; }
.btn--lg { padding: 16px 30px; font-size: 16px; gap: 10px; }
.btn--yellow { background: var(--yellow); color: #3B1747; box-shadow: 0 4px 0 var(--yellow-shadow); }
.btn--yellow:hover { background: #FFC93F; color: #3B1747; }
.btn--outline { border: 2px solid #6A2C91; color: var(--purple-ink); padding: 8px 20px; }
.btn--outline:hover { background: var(--purple-soft); color: var(--purple-ink); }
.btn--soft { background: var(--btn); color: #2A1236; padding: 11px 26px; font-size: 15px; }
.btn--soft:hover { filter: brightness(.96); color: #2A1236; }
.btn--white { background: #fff; color: var(--purple-dark); padding: 16px 40px; }
.btn--white:hover { background: var(--yellow); color: var(--purple-dark); }

/* Header */
.header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid #F1EAF6; }
.header__inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__logo { width: 48px; height: 48px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 28px; color: var(--purple-ink); letter-spacing: -.5px; }
.brand__tag { font-size: 10px; color: #6B5A78; font-weight: 600; margin-top: 2px; }
.nav { display: flex; gap: 28px; font-weight: 700; font-size: 14px; }
.nav a { color: var(--text); padding: 6px 0; border-bottom: 3px solid transparent; }
.nav a:hover { color: #6A2C91; border-bottom-color: var(--yellow); }
.header__actions { display: flex; gap: 12px; }
.menu-btn { display: none; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--purple-soft); color: var(--purple-ink); align-items: center; justify-content: center; cursor: pointer; }

/* Hero */
.hero { position: relative; background: var(--hero-bg); overflow: hidden; }
.hero__dot { position: absolute; border-radius: 50%; background: var(--yellow); }
.hero__dot--l { left: -60px; bottom: -40px; width: 180px; height: 180px; opacity: .85; animation: rc-floatSlow 18s ease-in-out infinite; }
.hero__dot--r { right: -40px; bottom: 30px; width: 120px; height: 120px; opacity: .7; animation: rc-floatSlow 22s ease-in-out infinite reverse; }
.hero__grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: center; padding-top: 56px; padding-bottom: 110px; }
.hero__text { position: relative; display: flex; flex-direction: column; gap: 24px; }
.hero__title-wrap { position: relative; max-width: 100%; animation: rc-rise .8s cubic-bezier(.2,.7,.3,1) both; }
.hero__title { font-weight: 800; font-size: clamp(52px, 7vw, 88px); line-height: .95; color: var(--purple-dark); letter-spacing: -1.5px; }
.script { font-family: var(--font-script); font-weight: 700; color: var(--yellow); font-size: 1.05em; letter-spacing: 0; display: inline-block; transform: rotate(-4deg); margin-top: 6px; }
.deco { position: absolute; fill: none; stroke-linecap: round; transform-origin: 50% 100%; }
.deco--y { width: 60px; height: 40px; left: 28px; top: -34px; stroke: var(--yellow); stroke-width: 5; animation: rc-swing 5s ease-in-out infinite; }
.deco--p { width: 40px; height: 50px; left: min(420px, 80%); top: -20px; stroke: var(--purple); stroke-width: 4; animation: rc-swing 6.5s ease-in-out infinite reverse; }
.hero__lead { font-size: 19px; line-height: 1.5; max-width: 440px; text-wrap: pretty; animation: rc-rise .8s .12s cubic-bezier(.2,.7,.3,1) both; }
.hero__text > div:last-child { animation: rc-rise .8s .24s cubic-bezier(.2,.7,.3,1) both; }
.hero__media { position: relative; align-self: start; aspect-ratio: 1462 / 1076; margin: -56px calc((min(1240px, 100vw) - 100vw) / 2 - 24px) -60px 0; }

/* Carrusel del hero: las imágenes se apilan y se cruzan por opacidad. Con
   una sola imagen se comporta igual que una imagen suelta. */
.hero__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.1s ease; }
.hero__slide.is-activa { opacity: 1; animation: rc-ken 12s ease-in-out infinite alternate; }
.hero__puntos { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; }
.hero__punto { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 2px solid rgba(74,26,87,.35); background: rgba(255,255,255,.6); cursor: pointer; transition: width .25s ease, background .25s ease, transform .25s ease; }
.hero__punto:hover { transform: scale(1.15); }
.hero__punto.is-activo { width: 26px; background: var(--yellow); border-color: var(--yellow); }
.hero__punto:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.hero__wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; display: block; }

/* Features */
.features-wrap { position: relative; z-index: 2; margin-top: -60px; }
.features { background: #F7F1FB; border-radius: 28px; padding: 28px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; box-shadow: 0 10px 30px rgba(74,26,87,.06); }
.feature { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 12px; }
.feature .circle { transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.feature:hover .circle { transform: translateY(-6px) scale(1.06); }
.feature h3 { font-weight: 700; font-size: 18px; color: #2A1236; line-height: 1.1; }
.feature p { font-size: 14px; color: var(--muted); line-height: 1.35; max-width: 160px; }

/* Programas */
.programs { padding-top: 80px; padding-bottom: 40px; }
.section-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 44px; }
.eyebrow { font-weight: 800; font-size: 14px; letter-spacing: 2px; color: var(--purple); }
.eyebrow-line { width: 80px; height: 3px; border-radius: 2px; background: var(--yellow); }
.section-head h2 { margin-top: 6px; font-weight: 800; font-size: clamp(34px, 4.5vw, 50px); line-height: 1.05; color: var(--purple-dark); }
.section-head p { font-size: 18px; color: var(--muted); max-width: 640px; line-height: 1.5; text-wrap: pretty; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.card { background: var(--bg); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s ease; }
.card:hover { transform: translateY(-8px); box-shadow: 0 18px 38px rgba(74,26,87,.14); }
.card__img { height: 240px; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.card:hover .card__img img { transform: scale(1.07); }
.card__body { padding: 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.card__head { display: flex; align-items: center; gap: 14px; }
.card__icon { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.card h3 { font-weight: 800; font-size: 26px; line-height: 1; color: #2A1236; }
.card p { font-size: 16px; line-height: 1.5; color: #4A3A56; flex: 1; }

/* Programa destacado */
.featured { position: relative; padding: 40px 0; }
.featured__grid { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 48px; align-items: center; }
.featured__img { aspect-ratio: 1.4 / 1; border-radius: 28px; overflow: hidden; }
.featured__img img { width: 100%; height: 100%; object-fit: cover; }
.featured__content { display: flex; flex-direction: column; gap: 18px; }
.pill { display: inline-block; padding: 6px 18px; border-radius: 999px; background: #EEDDF8; color: #6A2C91; font-weight: 800; font-size: 14px; }
.featured h2 { font-weight: 800; font-size: clamp(34px, 4vw, 46px); line-height: 1; color: #5B1FA0; }
.featured__sub { font-size: 18px; color: #4A3A56; }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 8px 0; }
.area { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.area .circle { transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.area:hover .circle { transform: translateY(-5px) scale(1.06); }

/* Familia */
.family-wrap { padding-top: 24px; padding-bottom: 20px; }
.family { background: #FAF6F3; border-radius: 32px; overflow: hidden; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.family__text { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; padding: 36px 40px; }
.family__icon { flex: none; }
.family h3 { font-weight: 800; font-size: 28px; line-height: 1.05; color: #2A1236; margin-bottom: 6px; }
.family p { font-size: 17px; color: #4A3A56; line-height: 1.45; }
.family__media { position: relative; min-height: 220px; }
.family__band { position: absolute; inset: 0; background: var(--purple); border-radius: 50% 0 0 50% / 60% 0 0 40%; }
.family__img { position: absolute; top: 0; right: 0; bottom: 0; left: 24px; border-radius: 50% 0 0 50% / 60% 0 0 40%; overflow: hidden; }
.family__img img { width: 100%; height: 100%; object-fit: cover; }

/* CTA */
.cta-wrap { padding-top: 12px; padding-bottom: 48px; }
.cta { position: relative; overflow: hidden; background: linear-gradient(100deg, #5B1F8F, #7B3FB0); border-radius: 32px; padding: 36px 40px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta__bg { position: absolute; right: 30px; top: 50%; width: 140px; height: 140px; transform: translateY(-50%) rotate(8deg); opacity: .12; fill: none; stroke: #fff; stroke-width: 1.2; }
.cta__icon { flex: none; width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.cta__icon .ico { width: 46px; height: 46px; stroke: #fff; }
.cta__text { flex: 1; min-width: 240px; color: #fff; }
.cta__text h2 { font-weight: 800; font-size: clamp(28px, 5vw, 34px); line-height: 1.05; margin-bottom: 6px; }
.cta__text p { font-size: 17px; line-height: 1.45; max-width: 420px; }
.cta .btn--white { position: relative; margin-right: 120px; }

/* Footer */
.footer { padding-bottom: 28px; }
.footer__top { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid #EEE6F3; }
.footer__brand { margin-right: 0; padding-right: 28px; border-right: 1px solid #EEE6F3; }
.footer__brand .brand__name { font-size: 26px; }
.footer__nav { display: flex; gap: 14px 22px; flex-wrap: wrap; font-size: 14px; font-weight: 600; flex: 1 1 280px; }
.footer__nav a { color: var(--text); }
.footer__nav a:hover { color: #6A2C91; }
.footer__contact { display: flex; flex-direction: column; gap: 8px; font-size: 14px; padding-left: 28px; border-left: 1px solid #EEE6F3; }
.footer__contact div,
.footer__contact a { display: flex; align-items: center; gap: 10px; color: var(--text); }
.footer__contact a:hover { color: #6A2C91; }
.footer__contact .ico { stroke: var(--purple-ink); }
.social { display: flex; gap: 10px; }
.social a { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-ink); display: flex; align-items: center; justify-content: center; transition: background .2s ease, transform .2s ease; }
.social a:hover { background: var(--purple); transform: translateY(-3px); }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; font-size: 13px; color: #6B5A78; }

/* ============ Tablet (≤1079px) ============ */
@media (max-width: 1079px) {
  .nav, .header__actions { display: none; }
  .menu-btn { display: flex; }
  .header.is-open .nav,
  .header.is-open .header__actions { display: flex; width: 100%; }
  .header.is-open .nav { flex-direction: column; gap: 4px; padding-top: 8px; }
  .header.is-open .nav a { padding: 14px 12px; border-radius: 14px; font-size: 17px; border: none; }
  .header.is-open .nav a:hover { background: var(--purple-soft); }
  .header.is-open .header__actions { padding-bottom: 12px; }
  .header.is-open .header__actions .btn { flex: 1; justify-content: center; padding-top: 14px; padding-bottom: 14px; font-size: 15px; }

  /* En una sola columna la foto ya no puede meterse debajo de la tarjeta de
     beneficios: queda pegada al borde del hero y la ola blanca la cierra. */
  .hero__grid { grid-template-columns: 1fr; gap: 12px; padding: 48px 32px 0; }
  .hero__text { align-items: center; text-align: center; }
  .hero__media { margin: 8px -32px 0; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%); mask-image: linear-gradient(to bottom, transparent 0%, #000 14%); }
  .hero__wave { height: 44px; }
  .hero__puntos { bottom: 56px; }

  /* Sin superposición, la tarjeta baja a su sitio con aire propio. */
  .features-wrap { margin-top: 24px; }
  .programs { padding-top: 56px; }
  .section-head { margin-bottom: 32px; }
  .featured__grid { gap: 32px; }
}

/* ============ Programa destacado apilado (≤975px) ============
   Bajo este ancho el bloque deja de ir a dos columnas y la foto pasa a ocupar
   todo el ancho: con 1.4/1 quedaba muy achatada. */
@media (max-width: 975px) {
  .featured__img { aspect-ratio: 16 / 11; }
}

/* ============ Tarjetas de programa en 2 columnas (628px–927px) ============
   En este rango la grilla deja exactamente dos columnas, así que la tercera
   tarjeta cae sola y pegada a la izquierda. Con flex conserva el mismo ancho
   que las demás pero la última fila queda centrada, sean 3 tarjetas o 5. */
@media (min-width: 628px) and (max-width: 927px) {
  .cards { display: flex; flex-wrap: wrap; justify-content: center; }
  .card { flex: 1 1 calc(50% - 10px); max-width: calc(50% - 10px); }
}

/* ============ CTA apilado (≤899px) ============
   Cuando el botón deja de caber en la misma fila que el texto, baja a su
   propia línea y el calendario decorativo del fondo le queda cruzado encima.
   Ahí el adorno sobra: se retira y el botón pasa a ancho completo. */
@media (max-width: 899px) {
  .cta { flex-direction: column; align-items: flex-start; gap: 18px; }
  .cta__bg { display: none; }
  .cta__icon { width: 72px; height: 72px; }
  .cta__icon .ico { width: 36px; height: 36px; }
  .cta__text { min-width: 0; }
  .cta__text p { max-width: none; }
  .cta .btn--white { margin-right: 0; width: 100%; justify-content: center; padding: 16px 28px; }
}

/* ============ Celular (≤759px) ============ */
@media (max-width: 759px) {
  .hero__grid { padding: 32px 20px 0; }
  .hero__text { align-items: stretch; text-align: left; }
  .hero__media { margin: 8px -20px 0; }
  .hero__wave { height: 34px; }

  /* El trazo morado se iba encima de la "ó" del título en pantallas angostas. */
  .deco--p { left: auto; right: 0; top: -30px; }

  /* En grilla, "Otras habilidades" caía sola y pegada a la izquierda. Con
     flex la última fila se centra sin importar cuántas áreas haya. */
  .areas { display: flex; flex-wrap: wrap; justify-content: center; }
  .area { flex: 0 1 calc(33.333% - 8px); min-width: 96px; }

  .features { padding: 22px 8px; }
  .feature { padding: 8px 6px; }
  .feature h3 { font-size: 16px; }
  .feature p { font-size: 13px; }
  .card__img { height: 200px; }
  .card__body { padding: 20px; }
  .programs { padding-top: 44px; padding-bottom: 24px; }
  .featured { padding: 24px 0; }
  .family__media { min-height: 260px; }
}

@media (max-width: 599px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .hero__grid { padding-left: 18px; padding-right: 18px; }
  .hero__media { margin-left: -18px; margin-right: -18px; }

  .family__text, .cta { padding: 28px 22px; }
  .featured .btn--lg,
  .hero .btn--lg { width: 100%; justify-content: center; }

  .footer__top { gap: 22px; }
  .footer__brand { border-right: none; padding-right: 0; }
  .footer__contact { border-left: none; padding-left: 0; }
}

/* ============ Pantallas muy angostas (≤379px) ============
   Los textos largos de la marca y las tarjetas de beneficios son lo primero
   que desborda; acá se aflojan para que nada se salga de la pantalla. */
@media (max-width: 379px) {
  .brand__logo { width: 40px; height: 40px; }
  .brand__name { font-size: 24px; }
  .brand__tag { font-size: 9px; }
  .header__inner { gap: 12px; }
  .menu-btn { width: 42px; height: 42px; }

  .features { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .feature .circle { width: 52px; height: 52px; }
  .feature p { max-width: none; }
  .area { flex-basis: calc(50% - 6px); }
}

/* ============ Movimiento reducido ============
   Si el sistema pide menos animación, la página se queda quieta pero
   completa: nada puede permanecer oculto. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.rc-js [data-reveal] > * { visibility: visible !important; }
}
