/* El sitio público de BIIOSMED.
 *
 * Sin JavaScript: las animaciones son CSS. Las que siguen al scroll usan
 * animation-timeline (Chrome, Edge y Safari 26); en los navegadores que no
 * lo tienen el contenido simplemente aparece quieto, completo y legible.
 * Quien pide menos movimiento en su sistema no ve ninguna. */

:root {
  --tinta: #1d1d1f;
  --texto: #1d1d1f;
  --tenue: #6e6e73;
  --linea: #d2d2d7;
  --fondo: #ffffff;
  --gris: #f5f5f7;
  --noche: #000000;
  --noche-2: #161617;
  --acento: #0071e3;
  --acento-hover: #0077ed;
  --enlace: #0066cc;
  --radio: 28px;
  --radio-chico: 18px;
  --ancho: 980px;
  --ancho-amplio: 1200px;
  --sans:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'Inter',
    'Segoe UI', Roboto, Arial, sans-serif;
  --suave: cubic-bezier(0.28, 0.11, 0.32, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--enlace);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--tinta);
  font-weight: 700;
  letter-spacing: -0.03em;
}

:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 3px;
  border-radius: 6px;
}

.saltar {
  position: absolute;
  left: -9999px;
}

.saltar:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--tinta);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}

.contenedor {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 22px;
}

.amplio {
  max-width: var(--ancho-amplio);
}

.centrado {
  text-align: center;
}

/* ---- Navegación ----------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav .contenedor {
  max-width: var(--ancho-amplio);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--tinta);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
}

.marca:hover {
  text-decoration: none;
}

.marca img {
  width: 24px;
  height: auto;
}

.menu {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.menu a {
  color: rgba(0, 0, 0, 0.8);
  transition: color 0.2s;
}

.menu a:hover {
  color: #000;
  text-decoration: none;
}

/* ---- Botones -------------------------------------------------------- */

.boton {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  border: 0;
  cursor: pointer;
  transition:
    background 0.25s var(--suave),
    transform 0.25s var(--suave);
  white-space: nowrap;
  font-family: inherit;
}

.boton:hover {
  text-decoration: none;
}

.boton:active {
  transform: scale(0.97);
}

.boton-azul {
  background: var(--acento);
  color: #fff;
}

.boton-azul:hover {
  background: var(--acento-hover);
}

.boton-blanco {
  background: #fff;
  color: var(--tinta);
}

.boton-blanco:hover {
  background: #e8e8ed;
}

.boton-chico {
  padding: 6px 14px;
  font-size: 13px;
}

.nav .boton-chico {
  margin-left: 4px;
}

.enlace-flecha {
  font-size: 17px;
  color: var(--enlace);
}

.enlace-flecha::after {
  content: ' ›';
}

.noche .enlace-flecha,
.cierre .enlace-flecha {
  color: #2997ff;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 28px;
  margin-top: 30px;
}

/* ---- Portada -------------------------------------------------------- */

.portada {
  padding: 96px 0 0;
  text-align: center;
  overflow: hidden;
}

.antetitulo {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: var(--acento);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.noche .antetitulo {
  color: #2997ff;
}

.portada h1 {
  font-size: clamp(44px, 8vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 11ch;
  margin: 0 auto;
}

.portada .entrada {
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.35;
  color: var(--tenue);
  max-width: 34em;
  margin: 22px auto 0;
  letter-spacing: -0.015em;
}

.portada-imagen {
  margin: 64px auto 0;
  max-width: var(--ancho-amplio);
  padding: 0 22px;
}

.portada-imagen img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: var(--radio);
}

/* Entrada de la portada al cargar: funciona en todos los navegadores. */
.entra {
  animation: entra 1.1s var(--suave) both;
}

.entra-2 {
  animation-delay: 0.12s;
}

.entra-3 {
  animation-delay: 0.24s;
}

.entra-4 {
  animation-delay: 0.38s;
}

@keyframes entra {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Secciones ------------------------------------------------------ */

.seccion {
  padding: 120px 0;
}

.gris {
  background: var(--gris);
}

.noche {
  background: var(--noche);
  color: #f5f5f7;
}

.noche h2,
.noche h3 {
  color: #f5f5f7;
}

.titular {
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.subtitular {
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.38;
  color: var(--tenue);
  max-width: 36em;
  margin-top: 18px;
}

.centrado .subtitular {
  margin-left: auto;
  margin-right: auto;
}

.noche .subtitular {
  color: #a1a1a6;
}

/* ---- Frase que se ilumina al leerla -------------------------------- */

.frase {
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 18em;
  color: var(--tinta);
}

/* ---- Mosaico de servicios ------------------------------------------- */

.mosaico {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.tesela {
  position: relative;
  overflow: hidden;
  border-radius: var(--radio);
  background: var(--gris);
  min-height: 460px;
  grid-column: span 3;
  isolation: isolate;
}

.tesela-ancha {
  grid-column: span 6;
  min-height: 560px;
}

.tesela-tercio {
  grid-column: span 2;
  min-height: 420px;
}

.tesela img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 1.2s var(--suave);
}

.tesela:hover img {
  transform: scale(1.045);
}

.tesela::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.12) 46%,
    rgba(0, 0, 0, 0) 70%
  );
}

.tesela .texto {
  padding: 40px 40px 0;
  color: #fff;
}

.tesela h3 {
  color: #fff;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.tesela p {
  margin-top: 10px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.86);
  max-width: 26em;
}

.tesela-tercio h3 {
  font-size: 26px;
}

.tesela-tercio .texto {
  padding: 30px 30px 0;
}

/* ---- Lista de servicios --------------------------------------------- */

.servicios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--linea);
  border-radius: var(--radio-chico);
  overflow: hidden;
  margin-top: 56px;
}

.servicio {
  background: var(--fondo);
  padding: 30px 28px;
}

.servicio h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.servicio p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--tenue);
  line-height: 1.45;
}

/* ---- Carrusel de industrias ----------------------------------------- */

.carrusel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 56px max(22px, calc((100vw - var(--ancho-amplio)) / 2 + 22px)) 24px;
  scrollbar-width: none;
}

.carrusel::-webkit-scrollbar {
  display: none;
}

.industria {
  flex: 0 0 min(380px, 78vw);
  scroll-snap-align: center;
  border-radius: var(--radio);
  overflow: hidden;
  background: var(--fondo);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.5s var(--suave),
    box-shadow 0.5s var(--suave);
}

.industria:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

.industria img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.industria div {
  padding: 22px 26px 28px;
}

.industria h3 {
  font-size: 22px;
}

.industria p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--tenue);
}

.carrusel-pista {
  text-align: center;
  font-size: 14px;
  color: var(--tenue);
}

/* ---- Cifras --------------------------------------------------------- */

.cifras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
  margin-top: 72px;
}

.cifra strong {
  display: block;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #0071e3 0%, #42a1ec 55%, #00478d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cifra span {
  display: block;
  margin-top: 12px;
  font-size: 17px;
  color: var(--tenue);
  max-width: 14em;
}

/* ---- Principios ----------------------------------------------------- */

.principios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 48px;
  margin-top: 72px;
}

.principio h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.principio p {
  margin-top: 8px;
  color: var(--tenue);
  font-size: 16px;
}

.principio::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--acento);
  margin-bottom: 18px;
}

/* ---- Plataforma ----------------------------------------------------- */

.brillo {
  background: linear-gradient(90deg, #5ac8fa 0%, #0a84ff 40%, #bf5af2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.plataforma-imagen {
  margin: 64px auto 0;
  max-width: 880px;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(10, 132, 255, 0.18);
}

.plataforma-imagen img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.funciones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.funcion {
  background: var(--noche-2);
  border-radius: var(--radio-chico);
  padding: 30px;
}

.funcion h3 {
  font-size: 19px;
}

.funcion p {
  margin-top: 8px;
  color: #a1a1a6;
  font-size: 15px;
}

.letra-chica {
  font-size: 12px;
  line-height: 1.5;
  color: #86868b;
  max-width: 60em;
  margin: 40px auto 0;
}

/* ---- Dirección médica ----------------------------------------------- */

.direccion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.direccion img {
  border-radius: var(--radio);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

.direccion .cargo {
  margin-top: 12px;
  color: var(--tenue);
  font-size: 17px;
}

.direccion p.cuerpo {
  margin-top: 22px;
  font-size: 17px;
}

.insignias {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}

.insignias li {
  background: var(--fondo);
  border: 1px solid var(--linea);
  border-radius: 980px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
}

.nota {
  margin-top: 24px;
  font-size: 14px;
  color: var(--tenue);
}

.credenciales {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.credenciales li {
  background: var(--gris);
  border-radius: var(--radio-chico);
  padding: 24px 26px;
  transition: transform 0.4s var(--suave);
}

.credenciales li:hover {
  transform: translateX(6px);
}

.credenciales strong {
  display: block;
  font-size: 19px;
  color: var(--tinta);
  letter-spacing: -0.02em;
}

.credenciales span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--tenue);
}

/* ---- Cierre --------------------------------------------------------- */

.cierre {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 160px 0;
  text-align: center;
  color: #fff;
}

.cierre img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.cierre::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.58);
}

.cierre h2 {
  color: #fff;
}

.cierre .subtitular {
  color: rgba(255, 255, 255, 0.82);
}

/* ---- Pie ------------------------------------------------------------ */

.pie {
  background: var(--gris);
  color: var(--tenue);
  font-size: 12px;
  line-height: 1.6;
  padding: 28px 0 36px;
}

.pie .contenedor {
  max-width: var(--ancho-amplio);
}

.pie-contacto {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--linea);
  margin-bottom: 16px;
}

.pie a {
  color: #424245;
}

.pie-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* ---- Formulario ----------------------------------------------------- */

.formulario {
  max-width: 680px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo-completo {
  grid-column: 1 / -1;
}

.campo label,
.campo legend {
  font-size: 14px;
  font-weight: 500;
  color: var(--tinta);
}

.campo .opcional {
  color: var(--tenue);
  font-weight: 400;
}

.campo input,
.campo select,
.campo textarea {
  font: inherit;
  font-size: 17px;
  color: var(--tinta);
  background: var(--fondo);
  border: 1px solid #86868b;
  border-radius: 12px;
  padding: 13px 15px;
  width: 100%;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.campo textarea {
  min-height: 130px;
  resize: vertical;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--acento);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22);
}

.campo .ayuda {
  font-size: 13px;
  color: var(--tenue);
}

fieldset.campo {
  border: 0;
  padding: 0;
  margin: 0;
}

.casillas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin-top: 6px;
}

.campo .casilla {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.campo .casilla input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--acento);
  flex: none;
}

/* Trampa para robots: invisible para las personas. */
.trampa {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.enviar {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  text-align: center;
}

.enviar .boton {
  min-width: 260px;
}

/* ---- Páginas de texto ----------------------------------------------- */

.documento {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 22px 120px;
}

.documento h1 {
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.04em;
}

.documento h2 {
  font-size: 24px;
  margin: 44px 0 10px;
}

.documento p {
  margin-bottom: 14px;
}

.documento .fecha {
  color: var(--tenue);
  margin-top: 10px;
}

.mensaje {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 22px;
}

.mensaje .icono {
  width: 72px;
  height: 72px;
  margin: 0 auto 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  color: #fff;
  background: var(--acento);
  animation: entra 0.9s var(--suave) both;
}

.mensaje .icono.error {
  background: #e30000;
}

/* ---- Animaciones ligadas al scroll ---------------------------------- */

@supports (animation-timeline: view()) {
  .revela {
    animation: revela linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }

  @keyframes revela {
    from {
      opacity: 0;
      transform: translateY(60px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  /* La foto de la portada crece hasta su lugar mientras se baja. */
  .portada-imagen img {
    animation: acerca linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  @keyframes acerca {
    from {
      transform: scale(0.86);
      border-radius: 56px;
      filter: saturate(0.6);
    }
    to {
      transform: none;
      border-radius: var(--radio);
      filter: none;
    }
  }

  /* El texto se va iluminando conforme se lee. */
  .frase {
    background: linear-gradient(180deg, var(--tinta) 45%, #d2d2d7 55%);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ilumina linear both;
    animation-timeline: view();
    animation-range: cover 18% cover 58%;
  }

  @keyframes ilumina {
    from {
      background-position: 0 100%;
    }
    to {
      background-position: 0 0;
    }
  }

  /* La foto del cierre se desplaza más lento que la página. */
  .cierre img {
    animation: paralaje linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }

  @keyframes paralaje {
    from {
      transform: translateY(-8%) scale(1.16);
    }
    to {
      transform: translateY(8%) scale(1.16);
    }
  }

  .plataforma-imagen {
    animation: asoma linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  @keyframes asoma {
    from {
      opacity: 0;
      transform: perspective(1200px) rotateX(18deg) translateY(80px) scale(0.92);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---- Teléfono y tableta --------------------------------------------- */

@media (max-width: 1000px) {
  .menu {
    display: none;
  }

  .nav .boton-chico {
    margin-left: auto;
  }

  .tesela,
  .tesela-tercio {
    grid-column: span 6;
    min-height: 420px;
  }

  .servicios,
  .funciones,
  .principios {
    grid-template-columns: 1fr 1fr;
  }

  .cifras {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .seccion {
    padding: 80px 0;
  }

  .portada {
    padding-top: 64px;
  }

  .portada-imagen {
    margin-top: 44px;
  }

  .portada-imagen img {
    aspect-ratio: 4 / 3;
  }

  .tesela-ancha {
    min-height: 460px;
  }

  .tesela .texto {
    padding: 28px 26px 0;
  }

  .servicios,
  .funciones,
  .principios,
  .direccion,
  .formulario,
  .casillas {
    grid-template-columns: 1fr;
  }

  .direccion {
    gap: 40px;
  }

  .cierre {
    padding: 110px 0;
  }

  .marca span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .frase {
    color: var(--tinta) !important;
    background: none !important;
  }
}
