/* ============================================================
   ALGORITHMICS LUQUE — styles.css
   Mobile-first, CSS moderno, sin frameworks
   ============================================================ */

/* ============================================================
   1. VARIABLES Y RESET
   ============================================================ */
:root {
  /* Paleta Algorithmics */
  --purple:       #5B2D8E;
  --purple-dark:  #3D1A6B;
  --purple-light: #7B4DB8;
  --purple-bg:    #F4EFFE;
  --yellow:       #FFC107;
  --yellow-dark:  #E6A800;
  --yellow-light: #FFD54F;

  /* Neutros */
  --white:        #FFFFFF;
  --gray-50:      #F8F8FA;
  --gray-100:     #F0EEF6;
  --gray-200:     #E0DCF0;
  --gray-400:     #9B93B8;
  --gray-600:     #5A5470;
  --gray-800:     #1E1830;

  /* Tipografía */
  --font-body:    'Nunito Sans', sans-serif;
  --font-display: 'Nunito', sans-serif;

  /* Espaciado */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   1.5rem;
  --space-lg:   2.5rem;
  --space-xl:   4rem;
  --space-2xl:  6rem;

  /* Radios */
  --radius-sm:  0.5rem;
  --radius-md:  1rem;
  --radius-lg:  1.5rem;
  --radius-xl:  2rem;
  --radius-full: 999px;

  /* Sombras */
  --shadow-sm:  0 2px 8px rgba(91,45,142,0.08);
  --shadow-md:  0 4px 20px rgba(91,45,142,0.12);
  --shadow-lg:  0 8px 40px rgba(91,45,142,0.16);
  --shadow-xl:  0 16px 60px rgba(91,45,142,0.20);

  /* Transición */
  --transition: 0.25s ease;

  /* Layout */
  --container:  1200px;
  --header-h:   70px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--gray-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }


/* ============================================================
   2. UTILIDADES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: var(--gray-800);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--gray-600);
  max-width: 560px;
  margin-inline: auto;
}

.highlight {
  color: var(--purple);
  position: relative;
}

/* ============================================================
   3. BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  border-radius: var(--radius-full);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* Tamaños */
.btn--sm  { font-size: 0.875rem; padding: 0.5rem 1.25rem; }
.btn--md  { font-size: 1rem;     padding: 0.75rem 1.75rem; }
.btn--lg  { font-size: 1.05rem;  padding: 0.9rem 2rem; }
.btn--xl  { font-size: 1.15rem;  padding: 1rem 2.5rem; }
.btn--full { width: 100%; }

/* Variantes */
.btn--primary {
  background: var(--yellow);
  color: var(--gray-800);
  box-shadow: 0 4px 16px rgba(255,193,7,0.35);
}
.btn--primary:hover {
  background: var(--yellow-dark);
  box-shadow: 0 6px 24px rgba(255,193,7,0.45);
}

.btn--purple {
  background: var(--purple);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(91,45,142,0.3);
}
.btn--purple:hover {
  background: var(--purple-dark);
  box-shadow: 0 6px 24px rgba(91,45,142,0.4);
}

.btn--outline {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.btn--outline:hover {
  background: var(--purple-bg);
  box-shadow: var(--shadow-sm);
}


/* ============================================================
   4. HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-h);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: start;
  gap: 0.6rem;
  flex-shrink: 0;
}

.logo__icon {
  width: 150px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: left;
}

.logo__mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--white);
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--purple);
}

.logo__city {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Nav desktop */
.nav {
  display: none;
  margin-left: auto;
}

.nav__list {
  display: flex;
  gap: 0.25rem;
}

.nav__link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-600);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  transition: color var(--transition), background var(--transition);
}
.nav__link:hover {
  color: var(--purple);
  background: var(--purple-bg);
}

/* Hamburger */
.hamburger {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.hamburger:hover { background: var(--gray-100); }

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--purple);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú mobile */
.mobile-menu {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.25rem 1.5rem;
}

.mobile-menu.is-open { display: block; }

.mobile-menu__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu__link {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-800);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.mobile-menu__link:hover {
  background: var(--purple-bg);
  color: var(--purple);
}

.mobile-menu__list > li:last-child { margin-top: 0.75rem; }


/* ============================================================
   5. HERO
   ============================================================ */
.hero {
  background: linear-gradient(160deg, var(--purple-bg) 0%, var(--white) 60%);
  padding: var(--space-xl) 0 var(--space-2xl);
  overflow: hidden;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
}

.hero__content {
  max-width: 640px;
  text-align: center;
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--white);
  color: var(--purple-dark);
  border: 1.5px solid var(--purple-light);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-bottom: var(--space-md);
  max-width: 540px;
  margin-inline: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Visual Hero */
.hero__visual {
  width: 100%;
  max-width: 400px;
}

.hero__image-placeholder {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  text-align: center;
  color: var(--white);
  box-shadow: var(--shadow-xl);
}

.hero__emoji-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero__emoji-grid span {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  backdrop-filter: blur(4px);
}

.hero__image-placeholder p {
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0.85;
}


/* ============================================================
   6. FORTALEZAS
   ============================================================ */
.strengths {
  padding: var(--space-xl) 0;
  background: var(--white);
}

.strengths__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.strength-card {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.strength-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--purple-light);
}

.strength-card__icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.strength-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.strength-card p {
  font-size: 0.92rem;
  color: var(--gray-600);
  line-height: 1.55;
}


/* ============================================================
   7. CURSOS
   ============================================================ */
.courses {
  padding: var(--space-xl) 0;
  background: var(--gray-50);
}

.courses__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.course-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.course-card--featured {
  border-color: var(--purple-light);
  box-shadow: var(--shadow-md);
  position: relative;
}

.course-card--featured::before {
  content: '⭐ Más popular';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--yellow);
  color: var(--gray-800);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  z-index: 1;
}

/* Colores de header por curso */
.course-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
}

.course-card__header--scratch-jr  { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
.course-card__header--scratch      { background: linear-gradient(135deg, #FF9A3C, #FFB347); }
.course-card__header--minecraft    { background: linear-gradient(135deg, #56AB2F, #A8E063); }
.course-card__header--roblox       { background: linear-gradient(135deg, #E74C3C, #C0392B); }
.course-card__header--python       { background: linear-gradient(135deg, var(--purple), var(--purple-light)); }
.course-card__header--design       { background: linear-gradient(135deg, #F093FB, #A855F7); }

.course-card__emoji {
  font-size: 2rem;
}

.course-card__age {
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255,255,255,0.9);
  color: var(--gray-800);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.course-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.course-card__desc {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.course-card__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.skill-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--purple-bg);
  color: var(--purple);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
}

.course-card__btn {
  margin: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
}


/* ============================================================
   8. CÓMO FUNCIONA
   ============================================================ */
.how-it-works {
  padding: var(--space-xl) 0;
  background: var(--white);
}

.timeline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

.timeline__item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.timeline__number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--purple);
  color: var(--white);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 12px rgba(91,45,142,0.25);
}

.timeline__content {
  padding: 0 0 2rem;
}

.timeline__content h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gray-800);
  margin-bottom: 0.35rem;
  padding-top: 0.5rem;
}

.timeline__content p {
  font-size: 0.92rem;
  color: var(--gray-600);
  line-height: 1.55;
}

.timeline__connector {
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, var(--purple-light), var(--gray-200));
  margin-left: 21px;
}

.how-it-works__cta {
  text-align: center;
}


/* ============================================================
   9. COMUNIDAD / BENTO
   ============================================================ */
.community {
  padding: var(--space-xl) 0;
  background: linear-gradient(160deg, var(--purple-bg) 0%, var(--white) 100%);
}

.community__bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.bento-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.bento-card--accent {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  border-color: transparent;
  color: var(--white);
}

.bento-card--accent h3,
.bento-card--accent p { color: var(--white); }

.bento-card__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.bento-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--gray-800);
  margin-bottom: 0.4rem;
}

.bento-card p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.5;
}


/* ============================================================
   10. CTA CIERRE
   ============================================================ */
.cta-close {
  background: var(--gray-800);
  padding: var(--space-2xl) 0;
  text-align: center;
}

.cta-close__inner {
  max-width: 700px;
}

.cta-close__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.cta-close__title .highlight {
  color: var(--yellow);
}

.cta-close__sub {
  font-size: 1rem;
  color: var(--gray-400);
  margin-bottom: var(--space-md);
}


/* ============================================================
   11. FOOTER
   ============================================================ */
.footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: var(--space-xl) 0 var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer .logo__name { color: var(--white); }
.footer .logo__city { color: var(--gray-400); }

.footer__tagline {
  font-size: 0.88rem;
  margin-top: 0.75rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer__heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}

.footer__heading--mt { margin-top: 1.25rem; }

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__list li {
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.8;
}

.footer__list a {
  color: var(--white);
  opacity: 0.8;
  transition: opacity var(--transition);
}
.footer__list a:hover { opacity: 1; }

/* Mapa */
.footer__col--map {}

.map-placeholder {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Footer bottom */
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer__bottom p {
  font-size: 0.8rem;
  color: var(--gray-400);
  opacity: 0.7;
}


/* ============================================================
   12. WHATSAPP FAB
   ============================================================ */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #25D366;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  padding: 0.7rem 1.2rem 0.7rem 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.whatsapp-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(37,211,102,0.5);
}

.whatsapp-fab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}


/* ============================================================
   13. RESPONSIVE — TABLET (640px+)
   ============================================================ */
@media (min-width: 640px) {

  .strengths__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .courses__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .community__bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-card--wide {
    grid-column: span 2;
  }

  .hero__actions {
    flex-wrap: nowrap;
  }
}


/* ============================================================
   14. RESPONSIVE — DESKTOP (960px+)
   ============================================================ */
@media (min-width: 960px) {

  /* Header */
  .nav { display: block; }
  .hamburger { display: none; }
  .header__inner .btn--sm { display: inline-flex; }

  .header__inner {
    gap: 0;
  }
  .header__inner .btn--sm {
    margin-left: var(--space-md);
  }

  /* Hero */
  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-xl);
    text-align: left;
  }

  .hero__content {
    text-align: left;
    flex: 1;
  }

  .badges { justify-content: flex-start; }
  .hero__actions { justify-content: flex-start; }
  .hero__subtitle { margin-inline: 0; }

  .hero__visual {
    flex-shrink: 0;
    width: 380px;
  }

  /* Courses */
  .courses__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Strengths */
  .strengths__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Bento */
  .community__bento {
    grid-template-columns: repeat(3, 1fr);
  }

  .bento-card--wide {
    grid-column: span 2;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1.2fr 1fr 1.5fr;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}


/* ============================================================
   15. DESKTOP GRANDE (1200px+)
   ============================================================ */
@media (min-width: 1200px) {
  .hero {
    padding: calc(var(--space-2xl) * 1.2) 0 calc(var(--space-2xl) * 1.4);
  }
}


/* ============================================================
   16. ACCESIBILIDAD
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--purple-light);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
