/* MAE Labs — estilos del sitio
   Colores tomados del logo: cian (núcleo), amarillo (electrones), gris (órbitas), negro (soporte). */

:root {
  --ink: #0F1E28;
  --ink-2: #172C39;
  --text: #384954;
  --muted: #566773;
  --line: #D8E1E6;
  --surface: #F2F6F8;
  --white: #FFFFFF;

  --brand: #00739E;        /* cian oscuro: botones y enlaces (contraste AA con blanco) */
  --brand-hover: #005C80;
  --brand-tint: #E3F4F8;
  --cyan: #12C8E0;         /* cian del logo: solo decorativo */
  --yellow: #FFE11A;       /* amarillo del logo: solo decorativo */
  --orbit: #9AA0A6;

  --font-head: "Jost", "Century Gothic", "Futura", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --radius: 12px;
  --container: 1200px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; color: inherit; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: var(--white); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 500; font-size: 14px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand);
}
.eyebrow::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.01em; }
.section-head p { font-size: 18px; color: var(--text); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 17px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--brand); color: var(--white); }
.btn--primary:hover { background: var(--brand-hover); color: var(--white); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); border-color: var(--white); }
.btn svg { width: 18px; height: 18px; }

/* Barra superior */
.topbar { background: var(--ink); color: #C9D6DD; font-size: 15px; }
.topbar .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-block: 8px; }
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { color: var(--cyan); }
.topbar__links { display: flex; flex-wrap: wrap; gap: 6px 24px; }

/* Encabezado */
.header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 62px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; font-family: var(--font-head); }
.brand__small { font-size: 10.5px; letter-spacing: 0.2em; font-weight: 500; }
.brand__name { font-size: 25px; font-weight: 600; letter-spacing: 0.32em; margin: 3px 0 2px; }
.brand__labs { font-size: 12px; letter-spacing: 0.3em; font-weight: 500; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__list a {
  display: block; padding: 10px 0; color: var(--ink); text-decoration: none;
  font-family: var(--font-head); font-weight: 500; font-size: 16px;
}
.nav__list a:hover { color: var(--brand); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--ink); align-items: center; justify-content: center; cursor: pointer;
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 24px 24px;
    box-shadow: 0 12px 24px rgba(15, 30, 40, 0.08);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .nav .btn { margin-top: 16px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  /* mosaico de fórmulas (formulas-patron-svg.py), más tenue del lado del texto */
  background:
    linear-gradient(100deg, rgba(15, 30, 40, 0.9) 0%, rgba(15, 30, 40, 0.6) 45%, rgba(15, 30, 40, 0) 100%),
    url("../img/hero-formulas.svg") center / 960px auto repeat,
    var(--ink);
}
.hero .container {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 64px; align-items: center; padding-block: 96px 72px;
}
.hero__copy { display: flex; flex-direction: column; gap: 24px; }
.hero .eyebrow { color: var(--cyan); }
.hero h1 { font-size: clamp(36px, 4.6vw, 58px); font-weight: 600; letter-spacing: -0.015em; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero__lead { font-size: 19px; color: #C9D6DD; max-width: 600px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__index { list-style: none; margin: 0; padding: 0; counter-reset: idx; }
.hero__index a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white); text-decoration: none; font-family: var(--font-head); font-size: 24px; font-weight: 400;
}
.hero__index li:first-child a { border-top: 1px solid rgba(255, 255, 255, 0.25); }
.hero__index .hero__label span { color: var(--cyan); margin-right: 14px; font-weight: 500; }
.hero__index a svg { width: 26px; height: 26px; flex: none; transition: transform .2s; }
.hero__index a:hover { color: var(--cyan); }
.hero__index a:hover svg { transform: translate(3px, -3px); }

.hero__contact { position: relative; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.hero__contact .container { display: flex; flex-wrap: wrap; gap: 16px 48px; padding-block: 22px; grid-template-columns: none; }
.hero__contact a { display: inline-flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; font-size: 18px; }
.hero__contact a:hover { color: var(--cyan); }
.hero__contact svg { width: 22px; height: 22px; color: var(--cyan); }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; padding-block: 56px 40px; }
  .hero {
    background:
      linear-gradient(rgba(15, 30, 40, 0.45), rgba(15, 30, 40, 0.45)),
      url("../img/hero-formulas.svg") center / 720px auto repeat,
      var(--ink);
  }
  .hero__index a { font-size: 21px; }
}

/* Beneficios */
.benefits { border-bottom: 1px solid var(--line); }
.benefits ul {
  list-style: none; margin: 0; padding: 36px 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px;
}
.benefits li { display: flex; gap: 14px; align-items: flex-start; }
.benefits svg { width: 40px; height: 40px; flex: none; color: var(--brand); }
.benefits strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.benefits span { font-size: 15px; color: var(--muted); line-height: 1.45; }

/* Nosotros */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about h2 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 600; }
.about__text { display: flex; flex-direction: column; gap: 18px; font-size: 18px; color: var(--text); }
.about__text strong { color: var(--ink); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 24px; } }

/* Productos */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; overflow: hidden; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { color: var(--ink); border-color: var(--brand); box-shadow: 0 10px 28px rgba(15, 30, 40, 0.08); transform: translateY(-2px); }
.card__media {
  aspect-ratio: 16 / 9; background: var(--brand-tint);
  display: flex; align-items: center; justify-content: center; color: var(--brand);
}
.card__media svg { width: 56px; height: 56px; }
.card__media { overflow: hidden; }
.card__media picture { display: contents; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; flex: 1; }
.card h3 { font-size: 21px; font-weight: 600; }
.card p { font-size: 16px; color: var(--muted); line-height: 1.5; }
.card__more { margin-top: auto; padding-top: 8px; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--brand); }

.card--cta { background: var(--ink); border-color: var(--ink); color: var(--white); justify-content: space-between; }
.card--cta:hover { color: var(--white); border-color: var(--ink); }
.card--cta .card__body { justify-content: center; gap: 14px; padding: 32px 28px; }
@media (max-width: 600px) {
  .card { flex-direction: row; }
  .card__media { flex: none; width: 96px; aspect-ratio: auto; }
  .card__media svg { width: 40px; height: 40px; }
  .card__body { padding: 18px 18px 20px; gap: 4px; }
  .card h3 { font-size: 19px; }
  .card p { font-size: 15px; }
}
.card--cta p { color: #C9D6DD; }
.card--cta .card__more { color: var(--cyan); }

/* Industrias (franjas alternadas) */
.bands { display: flex; flex-direction: column; gap: 20px; }
.band {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) auto; gap: 64px; align-items: center;
  padding: 32px 36px 32px 28px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.band:nth-child(even) { background: var(--brand-tint); border-color: #C6E6EF; }
.band__media { position: relative; aspect-ratio: 1 / 1; margin: 12%; }
.band__photo {
  width: 100%; height: 100%; object-fit: cover;
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
  transition: transform .4s ease;
}
.band__molecule { position: absolute; inset: -25%; width: 150%; height: 150%; max-width: none; overflow: visible; pointer-events: none; transition: transform .6s ease; }
.band:nth-child(even) .band__molecule { transform: scaleX(-1); }
.band:hover .band__photo { transform: scale(1.03); }
.band:hover .band__molecule { transform: rotate(8deg); }
.band:nth-child(even):hover .band__molecule { transform: scaleX(-1) rotate(8deg); }
.band__num { font-family: var(--font-head); color: var(--brand); font-size: 18px; font-weight: 500; }
.band h3 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; margin: 4px 0 12px; }
.band p { color: var(--text); max-width: 640px; }
.band__link {
  align-self: start; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--brand);
  display: flex; align-items: center; justify-content: center; color: var(--brand);
}
.band__link:hover { background: var(--brand); color: var(--white); }
.band__link svg { width: 24px; height: 24px; }
@media (max-width: 860px) {
  .band { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px; }
  .band__media { max-width: 200px; margin: 28px 36px 20px; }
  .band__link { display: none; }
}

/* Proceso */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px;
}
.steps li { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 2px solid var(--ink); }
.steps__num { font-family: var(--font-head); color: var(--brand); font-weight: 600; font-size: 16px; }
.steps h3 { font-size: 22px; font-weight: 600; }
.steps p { color: var(--text); }

/* Contacto */
.contact { background: var(--ink); color: var(--white); }
.contact .container { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; }
.contact .eyebrow { color: var(--cyan); }
.contact h2 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 600; margin: 12px 0; }
.contact__lead { color: #C9D6DD; font-size: 18px; }
.contact__list { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.contact__list dt, .contact__label { font-size: 14px; color: #A9BAC4; letter-spacing: 0.04em; }
.contact__list a, .contact__list span.value { color: var(--white); font-size: 18px; font-weight: 600; text-decoration: none; word-break: break-word; }
.contact__list a:hover { color: var(--cyan); }
@media (max-width: 900px) { .contact .container { grid-template-columns: 1fr; gap: 40px; } }

.form {
  background: var(--white); color: var(--ink); border-radius: 16px; padding: 32px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
}
.form h3 { grid-column: 1 / -1; font-size: 24px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full, .form fieldset, .form .consent, .form button, .form .form__msg { grid-column: 1 / -1; }
.field label, .form legend { font-weight: 600; font-size: 15px; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #8FA2AD; border-radius: 8px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--cyan); outline-offset: 0; border-color: var(--brand); }
.req { color: #B42318; }

.form fieldset { border: 0; margin: 0; padding: 0; }
.form legend { margin-bottom: 10px; padding: 0; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topics label { position: relative; cursor: pointer; }
.topics input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.topics span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px; background: var(--surface);
}
.topics input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--white); }
.topics input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text); }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; min-height: 54px; }
.form__msg { padding: 12px 16px; border-radius: 8px; font-size: 15px; }
.form__msg--error { background: #FEF3F2; color: #912018; border: 1px solid #FECDCA; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; padding: 24px 20px; } }

/* Pie */
.footer { background: #08141B; color: #A9BAC4; font-size: 15px; }
.footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: 56px 32px; }
.footer .brand { color: var(--white); }
.footer .brand img { background: var(--white); border-radius: 10px; padding: 4px; }
.footer h4 { margin: 0 0 14px; color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { color: #DCE6EB; text-decoration: none; }
.footer a:hover { color: var(--cyan); }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer__bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; grid-template-columns: none; }
@media (max-width: 760px) { .footer .container { grid-template-columns: 1fr; gap: 28px; } }

/* WhatsApp flotante */
.whatsapp {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; background: #1E8A4C; color: var(--white);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.whatsapp:hover { background: #17703D; color: var(--white); }
.whatsapp svg { width: 30px; height: 30px; }
.whatsapp[hidden] { display: none; }

/* Páginas simples (aviso, gracias, 404) */
.page { padding: 72px 0 96px; }
.page .container { max-width: 820px; }
.page h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 600; margin-bottom: 20px; }
.page h2 { font-size: 22px; font-weight: 600; margin: 36px 0 10px; }
.page p, .page li { color: var(--text); }
.page p + p { margin-top: 12px; }
.page .btn { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.field [aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 1px #B42318; }
.consent input[aria-invalid="true"] { outline: 2px solid #B42318; outline-offset: 2px; }

/* Encabezado simple de páginas internas */
.header--simple .container { min-height: 76px; }

/* Business partners: carrusel continuo de logos */
.partners { padding-bottom: 72px; }
.partners__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.partners__toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink);
  font: 600 15px var(--font-head); cursor: pointer;
}
.partners__toggle:hover { border-color: var(--brand); color: var(--brand); }
.partners__toggle svg { width: 16px; height: 16px; }
.partners__toggle .icon-play, .partners__toggle[aria-pressed="true"] .icon-pause { display: none; }
.partners__toggle[aria-pressed="true"] .icon-play { display: block; }

.partners__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.partners__track { display: flex; width: max-content; animation: partners-scroll var(--partners-duration, 40s) linear infinite; }
.partners__viewport:hover .partners__track,
.partners__viewport:focus-within .partners__track,
.partners.is-paused .partners__track { animation-play-state: paused; }
.partners__list { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0 10px; }
/* ancho de la pantalla repartido entre las marcas (--partners-count lo pone main.js), mínimo 260px */
.partners__item { flex: none; width: max(260px, calc(100vw / var(--partners-count, 4) - 18px)); }
.partners__item a {
  height: 150px; padding: 20px 24px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-decoration: none; color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.partners__item a:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(15, 30, 40, 0.08); color: var(--ink); }
.partners__logo { height: 64px; display: flex; align-items: center; justify-content: center; }
.partners__logo img { max-width: 220px; max-height: 64px; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter .2s, opacity .2s; }
.partners__item a:hover img, .partners__item a:focus-visible img { filter: none; opacity: 1; }
.partners__wordmark { font: 600 italic 34px/1 Georgia, "Times New Roman", serif; letter-spacing: 0.02em; color: #5B6770; }
.partners__item a:hover .partners__wordmark { color: #1F3A93; }
.partners__name { font-size: 13.5px; line-height: 1.3; text-align: center; }

@keyframes partners-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 600px) { .partners__item { width: max(210px, calc(100vw / var(--partners-count, 4) - 18px)); } .partners__item a { height: 136px; } .partners__logo img { max-width: 160px; max-height: 56px; } }

/* Sin animación: fila desplazable a mano */
@media (prefers-reduced-motion: reduce) {
  .partners__viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .partners__track { animation: none; padding-inline: 24px; }
  .partners__list[aria-hidden="true"], .partners__toggle { display: none; }
}
