/* ============================================================
   ACLASES — style.css
   1. Design Tokens     5. Hero            9. Footer
   2. Reset & Base      6. Materias       10. WhatsApp flotante
   3. Utilidades        7. Sobre Nelson   11. Animaciones
   4. Header / Nav      8. (libre)        12. Responsive
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS  — editar aquí colores y medidas
   ============================================================ */
:root {
  /* Paleta */
  --mostaza:       #feae00;
  --mostaza-deep:  #e09a00;
  --verde:         #20724b;
  --verde-deep:    #185639;
  --verde-soft:    #e7f0ea;
  --tinta:         #121212;        /* negro suave */
  --tinta-70:      rgba(18, 18, 18, 0.70);
  --tinta-55:      rgba(18, 18, 18, 0.55);
  --tinta-12:      rgba(18, 18, 18, 0.12);
  --tinta-06:      rgba(18, 18, 18, 0.06);
  --blanco:        #ffffff;
  --gris-soft:     #f6f6f4;        /* gris muy claro para separar secciones */
  --wa:            #25d366;
  --wa-deep:       #1fb457;

  /* Tipografía */
  --font: 'Poppins', system-ui, sans-serif;

  /* Layout */
  --maxw:      1200px;
  --pad:       clamp(1.25rem, 4vw, 4rem);
  --radius:    18px;
  --radius-pill: 100px;            /* botones redondeados */

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(18,18,18,.06), 0 4px 16px rgba(18,18,18,.05);
  --shadow-md: 0 2px 6px rgba(18,18,18,.07), 0 18px 40px rgba(18,18,18,.09);

  --ease: cubic-bezier(.22, .61, .36, 1);
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--tinta);
  background: var(--blanco);
  line-height: 1.6;
  font-size: 16px;                 /* base más pequeña */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 3px;
  border-radius: 6px;
}


/* ============================================================
   3. UTILIDADES
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.kicker {
  display: block;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mostaza-deep);
  margin-bottom: .9rem;
}
.section-head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.section-head p {
  margin-top: 1rem;
  font-size: clamp(.98rem, 1.6vw, 1.1rem);
  color: var(--tinta-70);
  text-align: justify;
  hyphens: auto;
}
section.block {
  padding-block: clamp(2.8rem, 7vw, 5rem);
}
.block + .block {
  border-top: 1px solid rgba(18,18,18,.08);
  padding-top: clamp(2rem, 5vw, 3.5rem);
}


/* ============================================================
   4. HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blanco);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--tinta-12);
  box-shadow: 0 4px 20px rgba(18,18,18,.05);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: .65rem; }
.brand img { height: 34px; width: auto; }

.nav-links { display: flex; align-items: center; gap: .5rem; }
.nav-links > a:not(.nav-cta) {
  font-weight: 600;
  font-size: .92rem;
  color: var(--tinta-70);
  padding: .55rem .85rem;
  border-radius: 10px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links > a:not(.nav-cta):hover { color: var(--tinta); background: var(--tinta-06); }

/* Botón Agendar (WhatsApp) — texto e ícono blancos */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--wa);
  color: var(--blanco);
  font-weight: 600;
  font-size: .92rem;
  padding: .6rem 1.15rem;
  border-radius: var(--radius-pill);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { background: var(--wa-deep); transform: translateY(-1px); }
.nav-cta svg { width: 17px; height: 17px; color: var(--blanco); }

/* Hamburguesa (solo móvil) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border-radius: 12px;
  transition: background .2s var(--ease);
}
.nav-burger:hover { background: var(--tinta-06); }
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  margin-inline: auto;
  background: var(--tinta);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.site-header.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.open .nav-burger span:nth-child(2) { opacity: 0; }
.site-header.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   5. HERO  (fondo negro suave)
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(254,174,0,.10), transparent 55%),
    radial-gradient(90% 70% at 0% 110%, rgba(32,114,75,.12), transparent 60%),
    var(--tinta);
  color: var(--blanco);
  isolation: isolate;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.8rem;
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem);
  max-width: 920px;
}

/* Título */
.hero h1 {
  font-size: clamp(3rem, 9vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--blanco);
}
.hero h1 .line2 { display: block; }

/* Palabra rotatoria (sin subrayado) */
.rotator { display: inline-block; }
.rotator__word { display: inline-block; color: var(--mostaza); }

.hero p.lede {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: rgba(255,255,255,.72);
  font-weight: 400;
  max-width: 52ch;                 /* llega hasta el final, ya no angosto */
}

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* Botones (redondeados) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: 1rem;
  padding: .9rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--wa {
  background: var(--wa-deep);
  color: var(--blanco);            /* texto e ícono blancos */
  box-shadow: 0 8px 20px rgba(37,211,102,.20);
}
.btn--wa svg { color: var(--blanco); }
.btn--wa:hover { background: var(--wa-deep); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,211,102,.20); }
.btn--ghost {
  background: var(--blanco);
  color: var(--tinta);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost svg { color: var(--mostaza-deep); }

/* Fórmulas matemáticas de fondo (invertidas a blanco sobre negro) */
.formulas { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.formulas img {
  position: absolute;
  opacity: .10;
  filter: invert(1);               /* fórmulas negras -> blancas */
  -webkit-user-drag: none;
  animation: float-y 10s ease-in-out infinite;
}
.formulas img.f-a { top: 12%; right: 4%;  width: 260px; animation-delay: -2s; }
.formulas img.f-b { top: 60%; right: 14%; width: 200px; animation-delay: -6s;  opacity: .08; }
.formulas img.f-c { top: 68%; left: 3%;   width: 300px; animation-delay: -9s; }
.formulas img.f-d { top: 30%; left: 38%;  width: 190px; animation-delay: -4s;  opacity: .07; }
.formulas img.f-e { top: 6%;  left: 6%;   width: 170px; animation-delay: -12s; opacity: .08; }


/* ============================================================
   6. MATERIAS
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.card {
  background: var(--blanco);
  border: 1px solid var(--tinta-12);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover {                      /* sin salto: solo sombra suave */
  box-shadow: var(--shadow-md);
  border-color: var(--tinta-06);
}

/* Imagen superior (~1/3). Placeholder por ahora.
   Para usar foto real: reemplazar el <div class="card-media"> por
   <img class="card-media" src="assets/..." alt="..."> */
.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background:
    repeating-linear-gradient(135deg, rgba(18,18,18,.04) 0 12px, transparent 12px 24px),
    var(--gris-soft);
  display: grid;
  place-items: center;
  color: var(--tinta-55);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; }
.card-body h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; }
.card-body p { font-size: .95rem; color: var(--tinta-70); line-height: 1.55; }


/* ============================================================
   7. SOBRE NELSON
   ============================================================ */
.sobre { background: var(--blanco); border-top: 1px solid var(--tinta-12); }
.sobre-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.5fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.sobre-portrait {
  display: block;
  width: min(100%, 420px);
  max-width: 420px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.sobre-body h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}
.sobre-body p {
  color: var(--tinta);
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
}

.sobre-contactt {
  color: red;
  margin-bottom: .85rem;
}

.creds { margin-top: 3.0rem; display: grid; gap: .8rem; }
.creds li {
  color: var(--tinta-70);
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  font-size: .95rem;
  font-weight: 500;
}
.creds li svg { width: 21px; height: 21px; flex: none; color: var(--mostaza-deep); margin-top: 1px; }
.creds li b { font-weight: 700; }


/* ============================================================
   9. FOOTER
   ============================================================ */
.site-footer {
  background: var(--tinta);
  color: rgba(255,255,255,.72);
  padding-block: clamp(3rem, 7vw, 4.5rem) 2rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-brand img { height: 38px; margin-bottom: 1.1rem; }
.footer-brand p { font-size: .94rem; max-width: 34ch; line-height: 1.6; }

.footer-col h4 {
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.1rem;
  font-weight: 600;
}
.footer-col a, .footer-col span {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: rgba(255,255,255,.78);
  font-size: .94rem;
  padding: .25rem 0;
  transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--mostaza); }
.footer-col svg { width: 17px; height: 17px; flex: none; color: rgba(255,255,255,.45); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.8rem;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
}
.socials { display: flex; gap: .6rem; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.8);
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.socials a:hover { background: var(--mostaza); color: var(--tinta); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }


/* ============================================================
   10. WHATSAPP FLOTANTE  (ícono blanco)
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 100;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: var(--blanco);
  display: grid; place-items: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(37,211,102,.6); }
.wa-float svg { width: 28px; height: 28px; color: var(--blanco); }


/* ============================================================
   11. ANIMACIONES
   ============================================================ */
@keyframes word-in {
  from { opacity: 0; transform: translateY(0.4em); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes word-out {
  from { opacity: 1; transform: none; filter: blur(0); }
  to   { opacity: 0; transform: translateY(-0.35em); filter: blur(6px); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
.anim-in  { animation: word-in  .5s var(--ease) both; }
.anim-out { animation: word-out .4s var(--ease) both; }

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


/* ============================================================
   12. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav { height: 64px; }
  .nav-burger { display: inline-flex; }

  /* Menú desplegable móvil */
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .3rem;
    background: var(--blanco);
    padding: .8rem var(--pad) 1.2rem;
    border-top: 1px solid var(--tinta-12);
    box-shadow: 0 12px 24px rgba(18,18,18,.08);
    display: none;
  }
  .site-header.open .nav-links { display: flex; }
  .nav-links > a:not(.nav-cta) {
    font-size: 1rem;
    padding: .8rem .9rem;
  }
  .nav-cta { justify-content: center; margin-top: .4rem; padding: .85rem 1.15rem; }
}

@media (max-width: 820px) {
  .sobre-grid { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .sobre-portrait { max-width: 280px; }
  .sobre-body { width: 100%; }
}

@media (max-width: 760px) {
  :root { --pad: clamp(1.25rem, 4vw, 2.5rem); }
  
  .footer-top { 
    grid-template-columns: 1fr; 
    gap: 2rem; 
    text-align: center;
  }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
  .footer-brand img { height: 50px; }
  .footer-col { color: rgba(255,255,255,.6); text-align: left; }
}

@media (max-width: 640px) {
  /* Botones del banner más compactos en móvil */
  .hero h1 { text-align: center; }
  .cta-row { justify-content: center; }
  .btn { font-size: .92rem; padding: .8rem 1.25rem; }
  .btn svg { width: 18px; height: 18px; }
  .formulas img.f-b, .formulas img.f-d { display: none; }
}

@media (max-width: 540px) {
  .cards { grid-template-columns: 1fr; }
}
