/* ==========================================================================
   KodigoDev — Blog personal de datos y desarrollo
   Hoja de estilos
   ========================================================================== */

:root {
  --primary: #1E73B7;
  --primary-dark: #155a8f;
  --primary-light: #e3f0fa;
  --secondary: #F07F13;
  --secondary-dark: #d26c08;
  --gray: #BDBDBD;
  --navy: #0b1c39;
  --navy-soft: #16274a;
  --text: #2a3350;
  --muted: #6b7590;
  --bg: #ffffff;
  --bg-alt: #f5f8ff;
  --border: #e6ebf5;
  --white: #ffffff;
  --shadow-sm: 0 6px 20px rgba(20, 40, 90, 0.06);
  --shadow-md: 0 18px 45px rgba(20, 40, 90, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: auto;
  scroll-padding-top: 110px;
  /* Evita que iOS agrande la tipografía al girar el móvil a horizontal */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* URLs y palabras largas no rompen el layout en pantallas estrechas */
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { font-family: "Nunito", sans-serif; color: var(--navy); line-height: 1.2; font-weight: 700; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 92%; max-width: var(--container); margin-inline: auto; }
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--navy); }

/* ---------- Section heads ---------- */
.section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section__eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
.section__eyebrow--light { color: #5aa9e0; }
.section__title { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
.section__title--light { color: var(--white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 10px 25px rgba(30, 115, 183, .35); }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-3px); }
.btn--secondary { background: var(--secondary); color: #fff; box-shadow: 0 10px 25px rgba(240, 127, 19, .35); }
.btn--secondary:hover { background: var(--secondary-dark); transform: translateY(-3px); }
.btn--ghost { background: rgba(255,255,255,.15); color: var(--navy); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--primary-light); transform: translateY(-3px); }
.btn--outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn--outline:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }

.link-more { color: var(--primary); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 7px; transition: gap .25s; }
.link-more:hover { gap: 12px; }

.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: .82rem;
  padding: 7px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
}

/* ---------- Topbar ---------- */
.topbar { background: var(--navy); color: #cdd6ea; font-size: .84rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
.topbar__contact { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar__contact i { color: var(--primary); margin-right: 6px; }
.topbar__social { display: flex; gap: 10px; }
.topbar__social a {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff; font-size: .8rem;
  transition: background .25s, transform .25s;
}
.topbar__social a:hover { background: var(--primary); transform: translateY(-2px); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 115;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 20px; }

.logo { font-family: "Nunito", sans-serif; font-weight: 800; font-size: 1.7rem; color: var(--navy); display: flex; align-items: center; gap: 13px; letter-spacing: -.5px; }
.logo span { color: var(--primary); }
.logo--light { color: #fff; }
.logo--light span { color: #5aa9e0; }
.logo__img { width: 58px; height: 58px; object-fit: contain; flex-shrink: 0; }

/* Parpadeo suave del logo: da algo de vida sin distraer de la lectura.
   El bloque de prefers-reduced-motion del final lo desactiva por completo. */
@keyframes logo-latido {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.94); }
}
.logo__img { animation: logo-latido 3s var(--ease) infinite; will-change: opacity, transform; }
.logo:hover .logo__img { animation-play-state: paused; opacity: 1; transform: scale(1.05); }
.logo__mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(30,115,183,.4);
}

.nav__list { display: flex; gap: 30px; }
.nav__link { font-weight: 500; color: var(--text); position: relative; padding: 6px 0; transition: color .25s; }
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--primary); transition: width .3s var(--ease);
}
.nav__link:hover, .nav__link.active { color: var(--primary); }
.nav__link:hover::after, .nav__link.active::after { width: 100%; }

.header__cta { padding: 10px 22px; }

.nav__toggle {
  display: none;
  width: 46px; height: 46px; border-radius: 12px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--primary);
  box-shadow: 0 6px 16px rgba(30,115,183,.35);
  transition: background .25s, box-shadow .25s, transform .2s;
}
.nav__toggle:hover { background: var(--primary-dark); }
.nav__toggle:active { transform: scale(.94); }
.nav__toggle span { width: 22px; height: 2.5px; background: #fff; border-radius: 3px; transition: transform .3s, opacity .3s; }
.nav__toggle.open { background: var(--secondary); box-shadow: 0 6px 16px rgba(240,127,19,.4); }
.nav__toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Fondo oscuro detrás del menú móvil */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(11, 28, 57, .55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.nav-backdrop.show { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 110px;
  background:
    radial-gradient(circle at 85% 15%, rgba(43,89,255,.10), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(43,89,255,.07), transparent 40%),
    var(--bg-alt);
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 50px; }
.hero__title { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; margin-bottom: 20px; }
.hero__title span { color: var(--primary); }
.hero__text { color: var(--muted); font-size: 1.05rem; margin-bottom: 32px; max-width: 520px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__visual { position: relative; }
.hero__photo {
  width: 100%; border-radius: 24px; object-fit: cover;
  object-position: center top;
  box-shadow: var(--shadow-md);
  aspect-ratio: 3/4;
}
.stat-card {
  position: absolute; background: #fff; border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 2px;
  animation: float 5s ease-in-out infinite;
}
.stat-card__label { font-size: .74rem; color: var(--muted); font-weight: 500; }
.stat-card__value { font-family: "Nunito"; font-size: 1.35rem; color: var(--navy); }
.stat-card__sub { font-size: .68rem; color: var(--muted); }
.stat-card__trend { font-size: .74rem; font-weight: 600; }
.stat-card__trend.up { color: #16a34a; }
.stat-card--revenue { top: 12%; left: -30px; }
.stat-card--visitors { bottom: 16%; right: -24px; animation-delay: 1.2s; }
.stat-card--growth { bottom: -18px; left: 18%; flex-direction: row; align-items: center; gap: 10px; animation-delay: 2.2s; }
.ring {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--primary);
  background: conic-gradient(var(--primary) 85%, var(--primary-light) 0);
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 5px; background: #fff; border-radius: 50%; }
.ring .count { position: relative; z-index: 1; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Features ---------- */
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feature-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 30px; text-align: center; transition: transform .3s var(--ease), box-shadow .3s;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: transparent; }
.feature-card__icon {
  width: 68px; height: 68px; border-radius: 18px; margin: 0 auto 20px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--primary-light); color: var(--primary); transition: background .3s, color .3s;
}
.feature-card:hover .feature-card__icon { background: var(--primary); color: #fff; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: .95rem; }

/* ---------- About ---------- */
.about__inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.about__media { position: relative; }
.about__media img {
  width: 100%; border-radius: 24px; box-shadow: var(--shadow-md);
  aspect-ratio: 3/2; object-fit: cover; object-position: center;
}
.about__badge {
  position: absolute; bottom: 24px; right: -18px;
  background: #fff; border-radius: 16px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-md);
}
.about__badge i { font-size: 1.8rem; color: var(--primary); }
.about__badge strong { display: block; font-family: "Nunito"; font-size: 1.3rem; color: var(--navy); }
.about__badge span { font-size: .82rem; color: var(--muted); }
.about__lead { color: var(--muted); margin: 16px 0 26px; font-size: 1.05rem; }
.about__points { display: flex; flex-direction: column; gap: 22px; margin-bottom: 32px; }
.about__points li { display: flex; gap: 16px; }
.about__points-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .85rem;
}
.about__points strong { display: block; color: var(--navy); font-family: "Nunito"; margin-bottom: 4px; }
.about__points p { color: var(--muted); font-size: .92rem; }

/* ---------- Services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 24px; transition: transform .3s var(--ease), box-shadow .3s;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: transparent; }
.service-card__icon {
  width: 60px; height: 60px; border-radius: 16px; margin-bottom: 18px;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--primary-light); color: var(--primary); transition: background .3s, color .3s;
}
.service-card:hover .service-card__icon { background: var(--primary); color: #fff; }
.service-card h3 { font-size: 1.1rem; margin-bottom: 9px; }
.service-card p { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

/* ---------- Choose ---------- */
.choose__inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.choose__media img { border-radius: 24px; box-shadow: var(--shadow-md); }
.choose__text { color: #b8c3de; margin: 16px 0 30px; }
.progress { margin-bottom: 24px; }
.progress__label { display: flex; justify-content: space-between; color: #e5ebf7; font-weight: 500; margin-bottom: 10px; font-size: .95rem; }
.progress__num { color: #5aa9e0; }
.progress__bar { height: 8px; background: rgba(255,255,255,.12); border-radius: 20px; overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #4aa3dd); border-radius: 20px; transition: width 1.4s var(--ease); }
.choose .btn { margin-top: 10px; }

/* ---------- FAQ ---------- */
.faq__list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: box-shadow .3s; }
.faq-item.open { box-shadow: var(--shadow-sm); border-color: var(--primary-light); }
.faq-item__q {
  width: 100%; text-align: left; padding: 20px 24px;
  font-family: "Nunito"; font-weight: 600; font-size: 1.02rem; color: var(--navy);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item__q i { color: var(--primary); transition: transform .3s; flex-shrink: 0; }
.faq-item.open .faq-item__q i { transform: rotate(45deg); }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.faq-item__a p { padding: 0 24px 20px; color: var(--muted); font-size: .95rem; }

/* ---------- Pricing ---------- */
.pricing__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
.price-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 38px 30px; text-align: center; position: relative;
  display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s;
}
.price-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.price-card--popular { border-color: var(--primary); box-shadow: var(--shadow-md); }
.price-card__tag {
  position: absolute; top: 18px; right: 18px;
  background: var(--secondary); color: #fff; font-size: .72rem; font-weight: 600;
  padding: 5px 14px; border-radius: 20px;
}
.price-card__name { font-family: "Nunito"; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: .85rem; }
.price-card__price { font-family: "Nunito"; font-weight: 800; font-size: 3rem; color: var(--navy); margin: 12px 0 8px; }
.price-card__price span { font-size: 1.4rem; vertical-align: super; }
.price-card__price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.price-card__list { text-align: left; margin: 22px 0 28px; display: flex; flex-direction: column; gap: 13px; flex-grow: 1; }
.price-card__list li { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: .92rem; }
.price-card__list i { color: var(--primary); background: var(--primary-light); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; flex-shrink: 0; }
.price-card .btn { justify-content: center; }

/* ---------- Testimonials ---------- */
.slider { max-width: 760px; margin: 0 auto; overflow: hidden; }
.slider__track { display: flex; transition: transform .6s var(--ease); }
.testimonial { min-width: 100%; background: #fff; border-radius: var(--radius); padding: 44px; text-align: center; box-shadow: var(--shadow-sm); }
.testimonial__stars { color: #ffb400; margin-bottom: 18px; display: flex; justify-content: center; gap: 4px; }
.testimonial__text { font-size: 1.12rem; color: var(--text); font-style: italic; margin-bottom: 26px; line-height: 1.7; }
.testimonial__author { display: flex; align-items: center; justify-content: center; gap: 14px; }
.testimonial__author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.testimonial__author strong { display: block; font-family: "Nunito"; color: var(--navy); }
.testimonial__author span { font-size: .85rem; color: var(--muted); }
.slider__dots { display: flex; justify-content: center; gap: 10px; margin-top: 28px; }
.slider__dots button { width: 11px; height: 11px; border-radius: 50%; background: #cdd6ea; transition: background .3s, width .3s; }
.slider__dots button.active { background: var(--primary); width: 28px; border-radius: 20px; }

/* ---------- Blog ---------- */
.blog__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.post-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
/* display:block porque en blog.html este contenedor es un <a> y, siendo inline,
   ignoraría el aspect-ratio y deformaría la portada. */
.post-card__img { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-card__img img { transform: scale(1.08); }
.post-card__cat { position: absolute; top: 14px; left: 14px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 600; padding: 5px 12px; border-radius: 20px; }
.post-card__body { padding: 24px; }
.post-card__date { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.post-card__body h3 { font-size: 1.12rem; margin-bottom: 10px; line-height: 1.35; }
.post-card__body p { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

/* ---------- CTA / Newsletter ---------- */
.cta__inner {
  background: linear-gradient(120deg, var(--primary), #3a9bd8);
  border-radius: 28px; padding: 56px; display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 40px; align-items: center; box-shadow: 0 25px 60px rgba(30,115,183,.35);
}
.cta__text h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 12px; }
.cta__text p { color: rgba(255,255,255,.9); }
.cta__form { display: flex; gap: 12px; flex-wrap: wrap; position: relative; }
.cta__form input {
  flex: 1; min-width: 220px; padding: 15px 22px; border-radius: 40px; border: none;
  font-size: .95rem; font-family: inherit; outline: none;
}
.cta__form .btn--primary { background: var(--navy); box-shadow: none; }
.cta__form .btn--primary:hover { background: #050e1f; }
.cta__msg { flex-basis: 100%; margin: 4px 4px 0; color: #fff; font-size: .9rem; font-weight: 500; min-height: 1.2em; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #a9b4cf; padding-top: 72px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 40px; padding-bottom: 56px; }
.footer__col h4 { color: #fff; font-size: 1.05rem; margin-bottom: 22px; }
.footer .logo { margin-bottom: 18px; }
.footer__about { font-size: .92rem; margin-bottom: 20px; }
.footer__contact { display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
.footer__contact i { color: var(--primary); margin-right: 10px; width: 16px; }
.footer__links { display: flex; flex-direction: column; gap: 12px; }
.footer__links a { font-size: .92rem; transition: color .25s, padding-left .25s; }
.footer__links a:hover { color: var(--white); padding-left: 6px; }
.footer__social { display: flex; gap: 10px; margin-top: 20px; }
.footer__social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; transition: background .25s, transform .25s; }
.footer__social a:hover { background: var(--primary); transform: translateY(-3px); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 24px 0; }
.footer__bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer__bottom p { font-size: .85rem; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 1rem;
  box-shadow: 0 10px 25px rgba(30,115,183,.4);
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity .3s, visibility .3s, transform .3s, background .25s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--primary-dark); }

/* ---------- Barra de progreso de scroll ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px;
  z-index: 200; pointer-events: none; background: rgba(30,115,183,.08);
}
.scroll-progress__bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 10px rgba(240,127,19,.5);
  transition: width .12s ease-out;
  will-change: width;
}

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .section { padding: 72px 0; }
  .topbar__contact li:nth-child(3) { display: none; }

  /* Sin backdrop-filter en móvil: si no, el header sería el bloque contenedor
     del drawer fixed y este no ocuparía toda la altura de la pantalla. */
  .header {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #fff;
  }
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(82%, 330px);
    background: #fff;
    box-shadow: -22px 0 60px rgba(11, 28, 57, .28);
    transform: translateX(105%); transition: transform .4s var(--ease);
    padding: 92px 0 28px; z-index: 120;
    overflow-y: auto;
  }
  .nav.open { transform: translateX(0); }
  .nav__list { flex-direction: column; gap: 4px; padding: 0 18px; }
  .nav__link {
    display: flex; align-items: center;
    padding: 14px 16px; border-radius: 10px;
    font-size: 1.05rem; color: var(--navy);
  }
  .nav__link::after { display: none; }
  .nav__link:hover, .nav__link.active { color: var(--primary); background: var(--primary-light); }
  .nav__toggle { display: flex; z-index: 130; }
  .header__cta { display: none; }

  .hero__inner { grid-template-columns: 1fr; gap: 70px; }
  .hero__content { text-align: center; }
  .hero__text { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__photo { max-width: 420px; margin: 0 auto; }
  .stat-card--revenue { left: 0; }
  .stat-card--visitors { right: 0; }

  .about__inner, .choose__inner { grid-template-columns: 1fr; gap: 40px; }
  .about__badge { right: 16px; }
  .features__grid { grid-template-columns: 1fr; }
  .pricing__grid { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .blog__grid { grid-template-columns: 1fr; }
  .cta__inner { grid-template-columns: 1fr; padding: 40px 28px; text-align: center; }
  .cta__form { justify-content: center; }
}

/* Tablets y móviles en horizontal: dos columnas en vez de tarjetas
   estiradas a todo lo ancho, que es como se veían entre 561 y 860 px. */
@media (min-width: 561px) and (max-width: 860px) {
  .features__grid,
  .blog__grid { grid-template-columns: repeat(2, 1fr); }
  .blog__grid .post-card:nth-child(3) { grid-column: 1 / -1; max-width: 420px; margin-inline: auto; }
}

@media (max-width: 560px) {
  .services__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .topbar__contact li:nth-child(2) { display: none; }
  .testimonial { padding: 32px 22px; }
  .section__head { margin-bottom: 40px; }
  .section { padding: 60px 0; }
  html { scroll-padding-top: 84px; }
  .cta__form input { min-width: 100%; }
  .logo { font-size: 1.4rem; gap: 10px; }
  .logo__img { width: 46px; height: 46px; }
}

/* Pantallas muy estrechas (iPhone SE y similares) */
@media (max-width: 380px) {
  .container { width: 94%; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
}

/* Móvil en horizontal: el cajón del menú no debe quedar sin aire arriba */
@media (max-width: 860px) and (max-height: 460px) {
  .nav { padding-top: 70px; }
  .nav__link { padding: 10px 16px; }
}

/* Dispositivos táctiles: áreas de toque de al menos 44 px */
@media (hover: none) and (pointer: coarse) {
  .topbar__social a,
  .footer__social a { width: 44px; height: 44px; }
  .share a { min-width: 44px; min-height: 44px; }
  .link-more { padding: 6px 0; }
}

/* Accesibilidad: respeta preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }

  /* Excepción: el latido del logo es un efecto pedido expresamente. Se mantiene,
     pero más lento y sin escalado, para que sea un desvanecido casi imperceptible
     (nunca un parpadeo rápido, que es lo que esta preferencia busca evitar). */
  .logo__img { animation: logo-latido 5s ease-in-out infinite !important; }
  @keyframes logo-latido {
    0%, 100% { opacity: 1; transform: none; }
    50% { opacity: .7; transform: none; }
  }
}
