/* =========================================================
   Hero – Dr. Héctor Hernández Remess
   ========================================================= */

:root {
  --navy: #17365f;
  --blue: #3a7bc0;
  --blue-dark: #2d68a8;
  --sky: #ecf3fa;
  --text-soft: #4a5d78;
  --white: #fff;

  --header-h: clamp(76px, 8vw, 112px);
  --pad-x: clamp(20px, 5vw, 84px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--navy);
  background: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--white);
  transition: box-shadow .3s ease, transform .8s var(--ease), opacity .8s ease;
}
.navbar.is-scrolled { box-shadow: 0 6px 24px rgba(23, 54, 95, .12); }

.navbar__inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: clamp(12px, 2vw, 32px); min-width: 0; }

/* Espacio del logo */
.brand__logo {
  flex: none;
  width: clamp(56px, 6vw, 92px);
  aspect-ratio: 1;
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; }
/* Guía visual mientras esté vacío; desaparece al insertar el <img> */
.brand__logo:empty { border: 2px dashed #c3d3e6; border-radius: 10px; }

.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name {
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: clamp(.82rem, 1.3vw, 1.1rem);
  line-height: 1.2;
}
.brand__tag {
  margin-top: 6px;
  font-size: clamp(.62rem, .85vw, .76rem);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); }
.nav__list { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }

.nav__link {
  position: relative;
  padding: 6px 0;
  font-size: .92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

/* Hamburguesa */
.menu-toggle {
  display: none;
  flex: none;
  width: 46px; height: 46px;
  border: 0; border-radius: 10px;
  background: var(--sky);
  cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .2s ease, top .35s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 22px; }
.menu-toggle span:nth-child(3) { top: 29px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* =========================================================
   BOTONES
   ========================================================= */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.btn:active { transform: scale(.97); }

/* Brillo que cruza el botón */
.btn--primary::before,
.btn--nav::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .7s var(--ease);
}
.btn--primary:hover::before,
.btn--nav:hover::before { left: 130%; }

.btn--nav {
  background: var(--blue);
  color: var(--white);
  padding: 18px 22px;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.btn--nav:hover { background: var(--blue-dark); }

.btn--primary {
  background: var(--blue);
  color: var(--white);
  padding: 22px 32px;
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  min-width: min(100%, 340px);
  justify-content: flex-start;
  box-shadow: 0 10px 24px rgba(58, 123, 192, .28);
}
.btn--primary:hover { background: var(--blue-dark); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(58, 123, 192, .38); }

.btn__icon { width: 24px; height: 24px; flex: none; }

.btn--outline {
  color: var(--navy);
  border: 2px solid var(--blue);
  background: transparent;
  padding: 20px 28px;
  font-size: clamp(1rem, 1.4vw, 1.3rem);
}
.btn--outline:hover { background: var(--blue); color: var(--white); transform: translateY(-3px); }
.btn__arrow { width: 22px; height: 22px; transition: transform .35s var(--ease); }
.btn--outline:hover .btn__arrow { transform: translateX(6px); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr);
  min-height: calc(100svh - var(--header-h));
  background: var(--sky);
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 72px) var(--pad-x);
}

.hero__eyebrow {
  margin: 0 0 clamp(24px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.hero__eyebrow-blue { color: var(--blue); }

.hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.01em;
  max-width: 100%;
}
.hero__title .line { display: block; }

.hero__rule {
  display: block;
  height: 3px;
  width: 100%;
  max-width: 745px;
  margin-top: 14px;
  background: var(--blue);
}

.hero__subtitle {
  margin: clamp(20px, 3vw, 36px) 0 0;
  font-size: clamp(1.2rem, 2.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1.35;
}

.hero__text {
  margin: clamp(16px, 2.4vw, 28px) 0 0;
  max-width: 36em;
  font-size: clamp(.98rem, 1.35vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-soft);
}

.hero__actions {
  margin-top: clamp(26px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.features {
  margin-top: clamp(30px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px 24px;
  max-width: 760px;
}
.feature { 
    display: flex; 
    align-items: center; 
    gap: 24px;
    padding: .5rem;
 }

.feature__icon {
  position: relative;
  flex: none;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(23, 54, 95, .1);
}
.feature__icon::before {            /* anillo fijo */
  content: "";
  position: absolute;
  inset: 13px;
  border: 2.5px solid var(--blue);
  border-radius: 50%;
}
.feature__icon i {                   /* punto central */
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue);
}
.feature__icon::after {              /* pulso */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0;
  animation: ping 2.6s ease-out infinite;
}
.feature:nth-child(2) .feature__icon::after { animation-delay: .5s; }
.feature:nth-child(3) .feature__icon::after { animation-delay: 1s; }

@keyframes ping {
  0%   { transform: scale(.8); opacity: .6; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.feature__text { display: flex; flex-direction: column; font-size: .9rem; color: var(--text-soft); line-height: 1.4; }
.feature__text strong { color: var(--navy); font-weight: 700; font-size: .98rem; }

/* ---- Imagen ---- */
.hero__media {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background: #cfdbea;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;   /* ajusta si tu foto necesita otro encuadre */
  transform: scale(1.12);
  transition: transform 1.6s var(--ease);
}
.hero.is-in .hero__img { transform: scale(1); }

/* =========================================================
   ANIMACIONES DE ENTRADA / SALIDA
   (solo si JS está activo, para no ocultar contenido sin JS)
   ========================================================= */
.js [data-anim] {
  opacity: 0;
  transition:
    opacity .5s ease,
    transform .5s var(--ease),
    clip-path .5s var(--ease);
  transition-delay: 0s;                 /* salida: rápida y sin retraso */
}
.js [data-anim="up"]   { transform: translateY(30px); }
.js [data-anim="draw"] { transform: scaleX(0); transform-origin: left; }
.js [data-anim="reveal"] { clip-path: inset(0 0 0 100%); opacity: 1; }

/* Entrada */
.js .hero.is-in [data-anim] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  transition-duration: .8s, .9s, 1.2s;
  transition-delay: var(--d, 0s);
}

/* Navbar entra desde arriba */
.js .navbar { transform: translateY(-100%); opacity: 0; }
.js body.is-loaded .navbar { transform: none; opacity: 1; }

/* Salida al cambiar de página */
.js body.is-exiting .navbar { transform: translateY(-100%); opacity: 0; transition-duration: .4s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 1200px) { .br-lg { display: inline; } }
@media (max-width: 1199px) { .br-lg { display: none; } }

/* Tablet y menor: menú colapsable */
@media (max-width: 1024px) {
  .menu-toggle { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad-x) 24px;
    background: var(--white);
    box-shadow: 0 18px 30px rgba(23, 54, 95, .15);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .3s ease, transform .35s var(--ease), visibility 0s linear .35s;
  }
  .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { display: block; padding: 16px 0; border-bottom: 1px solid #e3ebf4; }
  .nav__link::after { display: none; }
  .btn--nav { margin-top: 18px; padding: 18px; }
}

/* Hero a una columna */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__media { aspect-ratio: 4 / 5; max-height: 80svh; min-height: 0; width: 100%; }
  .js [data-anim="reveal"] { clip-path: inset(100% 0 0 0); }
}

@media (max-width: 600px) {
  .brand__tag { display: none; }
  .btn--primary, .btn--outline { width: 100%; }
  .hero__actions { gap: 12px; }
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .brand__name { font-size: .72rem; }
  .btn--primary { padding: 18px 22px; }
}

/* Respeta usuarios que reducen movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}