/* =============================================================================
   Dispromed — hoja de estilo única
   Paleta y tipografía: docs/design/dispromed-web (maqueta aprobada 2026-08-31)
   ============================================================================= */

:root {
  /* Azules — un solo tono de marca extendido a rampa */
  --ink:       #0B2430;
  --ink-2:     #073A54;
  --blue-700:  #0A6E9E;
  --blue-500:  #12A5DC;
  --blue-300:  #8FD7F2;
  --blue-100:  #D9EFFA;
  --blue-50:   #F0F9FD;

  --paper:     #FFFFFF;
  --paper-2:   #F5F9FB;
  --rule:      #DCE7ED;
  --rule-2:    #E4EEF3;

  --body:      #2A414D;
  --muted:     #4A626E;
  --faint:     #7A8F9A;
  --on-dark:   #CDE9F7;

  --display: 'Space Grotesk', 'Trebuchet MS', system-ui, sans-serif;
  --text:    'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --wrap: 1180px;
  --pad: 40px;
}

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

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

body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--ink-2); }

button { font: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.018em; margin: 0; }

:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; color: #fff; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--blue-500);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; text-align: center; white-space: nowrap;
  padding: 15px 28px; font-size: 16px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--sm { padding: 11px 22px; font-size: 15px; }
.btn--lg { padding: 18px 38px; font-size: 17px; font-weight: 600; }
.btn--block { display: flex; width: 100%; }

.btn--primary { background: var(--blue-700); color: #fff; }
.btn--primary:hover { background: var(--ink-2); color: #fff; }

.btn--ink { background: var(--ink-2); color: #fff; }
.btn--ink:hover { background: var(--ink); color: #fff; }

.btn--brand { background: var(--blue-500); color: #06212F; font-weight: 600; }
.btn--brand:hover { background: var(--blue-300); color: #06212F; }

.btn--outline { background: var(--paper); color: var(--ink-2); border-color: #9FD5EE; }
.btn--outline:hover { background: var(--blue-50); color: var(--ink-2); }

.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  min-height: 78px; display: flex; align-items: center; gap: 32px;
}

.logo { display: inline-flex; align-items: stretch; height: 44px; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.logo__mark { width: 58px; background: var(--blue-500); display: flex; align-items: center; justify-content: center; }
.logo__mark svg { width: 26px; height: 26px; }
.logo__word {
  background: var(--blue-100); display: flex; align-items: center; padding: 0 20px 0 15px;
  font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: .03em; color: var(--ink-2);
}
.logo--dark .logo__word { background: var(--blue-100); }

.nav { display: flex; align-items: center; gap: 26px; flex: 1; }
.nav a { font-size: 15px; color: var(--body); }
.nav a:hover { color: var(--blue-700); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink-2); }
.hero__bg { position: absolute; inset: 0; background: linear-gradient(118deg, #062F45 0%, #0A5C82 48%, #12A5DC 100%); }
.hero__mark { position: absolute; right: -150px; top: -130px; width: 820px; height: 820px; opacity: .14; }
.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4,24,36,.90) 0%, rgba(4,24,36,.74) 42%, rgba(4,24,36,.28) 78%, rgba(4,24,36,.12) 100%);
}
.hero__inner { position: relative; min-height: 620px; display: flex; flex-direction: column; justify-content: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 {
  font-size: clamp(36px, 5.4vw, 68px); line-height: 1.03; letter-spacing: -.028em;
  color: #fff; max-width: 800px; text-wrap: balance; margin: 0;
}
.hero p { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--on-dark); max-width: 580px; margin: 24px 0 0; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.photo-slot {
  position: absolute; right: 26px; bottom: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px dashed rgba(255,255,255,.45);
  font-size: 12px; font-weight: 500; color: #fff;
}

/* ---------- Cifras ---------- */
.stats { background: var(--blue-50); border-bottom: 1px solid var(--rule); padding: 40px 0; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat__n { font-family: var(--display); font-size: clamp(32px, 3.2vw, 44px); font-weight: 700; color: var(--blue-700); line-height: 1; letter-spacing: -.02em; }
.stat__l { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ---------- Secciones ---------- */
.section { padding: 84px 0; }
.section--tight { padding: 84px 0 24px; }
.section--tint { background: var(--paper-2); border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); padding: 80px 0; }
.section__head { margin-bottom: 40px; }
.section__head h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.16; color: var(--ink); max-width: 940px; text-wrap: balance; margin: 14px 0 0; }
.section__head p { font-size: 16px; color: var(--muted); margin: 14px 0 0; }
.section__head--center { text-align: center; max-width: 700px; margin-left: auto; margin-right: auto; }

/* ---------- Líneas ---------- */
.lines { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.line {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: 20px 20px 20px 72px; padding: 30px 32px; min-height: 268px;
  text-decoration: none; transition: transform .18s ease;
}
.line:hover { transform: translateY(-3px); }
.line--wide { grid-column: span 2; min-height: 320px; padding: 34px 38px; }
.line__icon { position: absolute; right: -30px; bottom: -36px; width: 240px; height: 240px; pointer-events: none; }
.line--wide .line__icon { right: -34px; bottom: -46px; width: 330px; height: 330px; }
.line__name { position: relative; font-family: var(--display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1.08; letter-spacing: -.024em; }
.line--wide .line__name { font-size: clamp(30px, 4vw, 52px); line-height: 1.04; letter-spacing: -.026em; }
.line__more { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 15px; font-weight: 600; }
.line__more svg { width: 16px; height: 16px; }

.line--brand { background: var(--blue-500); }
.line--brand .line__name, .line--brand .line__more { color: #06212F; }
.line--brand .line__icon { stroke: #fff; opacity: .30; }

.line--ink { background: var(--ink-2); }
.line--ink .line__name { color: #fff; }
.line--ink .line__more { color: var(--blue-300); }
.line--ink .line__icon { stroke: var(--blue-500); opacity: .26; }

.line--pale { background: var(--blue-100); }
.line--pale .line__name { color: #06212F; }
.line--pale .line__more { color: var(--blue-700); }
.line--pale .line__icon { stroke: var(--blue-700); opacity: .30; }

.line--mid { background: var(--blue-700); }
.line--mid .line__name { color: #fff; }
.line--mid .line__more { color: #BFE4F5; }
.line--mid .line__icon { stroke: #fff; opacity: .26; }

.line--soft { background: var(--blue-50); border: 1px solid #BFE4F5; }
.line--soft .line__name { color: #06212F; }
.line--soft .line__more { color: var(--blue-700); }
.line--soft .line__icon { stroke: var(--blue-500); opacity: .28; }

.note-bar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 18px; padding: 20px 28px; border: 1px solid var(--rule); border-radius: 18px;
}
.note-bar__text { flex: 1; min-width: 260px; font-size: 16px; }
.note-bar__text strong { font-weight: 600; color: var(--ink); }

/* ---------- Marcas ---------- */
.marquee-zone { position: relative; }
.mq { overflow: hidden; }
.mq-track { display: flex; align-items: center; gap: 52px; width: max-content; animation: mq 78s linear infinite; }
.mq-track--rev { animation-name: mqrev; animation-duration: 92s; }
/* Cada casilla del riel admite indistintamente un logotipo o el nombre en
   texto. La altura fija es lo que hace que convivan sin desalinearse, y
   permite ir sustituyendo texto por logotipo de uno en uno, sin rehacer nada. */
/* Casilla de tamano fijo. Es lo que iguala opticamente logos cuadrados y
   logotipos apaisados: sin ella, un logo 1:1 mide a lo ancho la quinta parte
   que un wordmark 8:1 puesto a la misma altura, y parece un error. */
.mq-item {
  display: inline-flex; align-items: center; justify-content: center;
  width: 168px; height: 66px; flex-shrink: 0;
  font-family: var(--display); font-size: 23px; font-weight: 500;
  color: #5C7280; white-space: nowrap; letter-spacing: -.01em;
}
/* Dos topes, no uno: el de altura manda en los cuadrados, el de ancho en los
   apaisados. Asi ninguno domina el riel ni desaparece.
   `mix-blend-mode: multiply` sobre el blanco de la seccion hace desaparecer el
   fondo solido de los logos que llegaron sin transparencia (BMax, Gipao). */
.mq-item img {
  max-height: 46px; max-width: 146px; width: auto; height: auto; object-fit: contain;
  filter: grayscale(1); opacity: .72;
  transition: filter .2s ease, opacity .2s ease;
}
.mq-item img:hover { filter: grayscale(0); opacity: 1; }
/* Logos de linea muy fina y clara: sin oscurecerlos se pierden contra el blanco. */
.mq-item img.is-faint { filter: grayscale(1) brightness(.62) contrast(1.25); opacity: .85; }
/* Logos dibujados dentro de un lienzo cuadrado con mucho margen: el trazo real
   ocupa una fraccion de la casilla y se leen mas pequenos que los demas. */
.mq-item img.is-small { max-height: 64px; max-width: 160px; }
.mq-item img.is-faint:hover { filter: grayscale(0) brightness(1) contrast(1); opacity: 1; }
@keyframes mq    { from { transform: translateX(0); }     to { transform: translateX(-50%); } }
@keyframes mqrev { from { transform: translateX(-50%); }  to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .mq-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; gap: 20px 40px; padding: 0 var(--pad); }
}
.mq-fade { position: absolute; top: 0; bottom: 0; width: 170px; pointer-events: none; }
.mq-fade--l { left: 0; background: linear-gradient(90deg, var(--paper) 12%, rgba(255,255,255,0) 100%); }
.mq-fade--r { right: 0; background: linear-gradient(270deg, var(--paper) 12%, rgba(255,255,255,0) 100%); }

.footnote { font-size: 13px; color: var(--faint); }

/* ---------- Sectores ---------- */
.sectors { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 26px 22px; }
.sector { border-top: 3px solid var(--blue-500); padding-top: 18px; }
.sector h3 { font-family: var(--text); font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.sector p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 8px 0 0; }

/* ---------- Pedidos ---------- */
.orders {
  display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 22px; align-items: center;
  background: var(--blue-50); border: 1px solid #BFE4F5; border-radius: 18px; padding: 30px 34px;
}
.orders h3 { font-size: 22px; color: var(--ink); }
.orders p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 6px 0 0; max-width: 660px; }

/* ---------- Cierre ---------- */
.closer {
  background: var(--blue-500); border-radius: 24px 24px 24px 110px; padding: 56px 60px;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 40px; align-items: center;
}
.closer h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.16; color: #06212F; }
.closer p { font-size: 17px; line-height: 1.6; color: #0D3548; margin: 14px 0 0; max-width: 560px; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #8FA7B4; padding: 56px 0 32px; }
.site-footer__grid { display: grid; grid-template-columns: 320px repeat(3, minmax(0,1fr)); gap: 40px; }
.site-footer h4 { font-family: var(--text); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-500); margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer a, .site-footer li { font-size: 14px; color: #C9DCE5; }
.site-footer a:hover { color: #fff; }
.site-footer p { font-size: 14px; line-height: 1.7; margin: 16px 0 0; }
.site-footer__legal {
  border-top: 1px solid #1D3A48; margin-top: 40px; padding-top: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; font-size: 13px; color: #7A94A2;
}
/* Solo el logotipo es enlace. El texto es texto: si va dentro del <a>
   hereda su color y su peso, y termina pesando mas que el copyright. */
.powered { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #5F7787; }
.powered a { display: inline-flex; line-height: 0; }
.powered img { height: 14px; width: auto; opacity: .6; transition: opacity .15s ease; }
.powered a:hover img { opacity: 1; }

/* ---------- Documento largo (legal) ---------- */
.doc { max-width: 780px; padding-top: 72px; padding-bottom: 88px; }
.doc h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; color: var(--ink); margin: 14px 0 0; }
.doc h2 { font-family: var(--text); font-size: 19px; font-weight: 600; letter-spacing: 0; color: var(--ink); margin: 40px 0 0; }
.doc h3 { font-family: var(--text); font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink); margin: 26px 0 0; }
.doc p, .doc li { font-size: 16px; line-height: 1.75; color: var(--muted); }
.doc p { margin: 12px 0 0; }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 22px; }
.doc li { margin-top: 8px; }
.doc strong { color: var(--body); font-weight: 600; }
.doc__meta { font-size: 14px; color: var(--faint); margin-top: 10px; }
.doc__aviso {
  background: #FFF4E0; border-radius: 12px; padding: 18px 20px; margin-top: 28px;
}
.doc__aviso p { color: #6B4400; font-size: 15px; margin: 0; }
.doc__aviso p + p { margin-top: 10px; }
.doc__aviso strong { color: #6B4400; }
.doc__pend { background: var(--blue-50); border-left: 3px solid var(--blue-500); padding: 2px 14px; margin-top: 14px; }
.doc__pend p { font-size: 15px; }

/* =============================================================================
   Adaptable
   ============================================================================= */

@media (max-width: 1023px) {
  :root { --pad: 28px; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px var(--pad) 20px;
  }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .site-header__inner { position: relative; gap: 12px; }
  .site-header .btn { display: none; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
  .lines { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .line--wide { grid-column: span 2; }
  .sectors { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .closer { padding: 44px 40px; }
}

@media (max-width: 767px) {
  :root { --pad: 20px; }
  .section, .section--tint { padding: 56px 0; }
  .section--tight { padding: 56px 0 16px; }
  .section__head { margin-bottom: 28px; }

  .hero__inner { min-height: 0; padding-top: 48px; padding-bottom: 52px; }
  .hero__mark { right: -130px; top: -90px; width: 440px; height: 440px; }
  .hero__veil { background: linear-gradient(160deg, rgba(4,24,36,.90) 0%, rgba(4,24,36,.76) 55%, rgba(4,24,36,.36) 100%); }
  .hero__cta { flex-direction: column; align-items: stretch; margin-top: 28px; }
  .hero__cta .btn { width: 100%; }
  .photo-slot { position: static; margin-top: 22px; }

  .stats__grid { grid-template-columns: 1fr; gap: 20px; }
  .lines { grid-template-columns: 1fr; }
  .line, .line--wide { grid-column: auto; min-height: 168px; padding: 22px; border-radius: 16px 16px 16px 52px; }
  .line__icon, .line--wide .line__icon { width: 170px; height: 170px; right: -20px; bottom: -26px; }
  .line__more { display: none; }

  .sectors { grid-template-columns: 1fr; gap: 20px; }
  .mq-fade { width: 56px; }
  .mq-track { gap: 30px; animation-duration: 70s; }
  .mq-track--rev { animation-duration: 68s; }
  .mq-item { font-size: 19px; }

  .orders { grid-template-columns: 1fr; gap: 14px; padding: 24px; }
  .orders .btn { width: 100%; }

  .closer { grid-template-columns: 1fr; padding: 32px 24px; border-radius: 18px 18px 18px 64px; }
  .closer .btn { width: 100%; }

  .site-footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .note-bar { padding: 18px 20px; }
  .note-bar .btn { width: 100%; }
}

/* =============================================================================
   Catálogo — páginas generadas en catalogo/*.html + buscador de catalogo/index.html
   Fuente: data/catalogo.csv, vía scripts/generar_catalogo.py. No se edita a
   mano el resultado; se edita este bloque.
   ============================================================================= */

/* ---------- Buscador (catalogo/index.html) ---------- */
.cat-search {
  margin-top: 32px; max-width: 560px;
}
.cat-search label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px;
}
.cat-search input[type="search"] {
  width: 100%; font: inherit; font-size: 16px; padding: 14px 18px;
  border: 1px solid var(--rule); border-radius: 12px; color: var(--body); background: var(--paper);
}
.cat-search input[type="search"]:focus-visible {
  outline: 3px solid var(--blue-500); outline-offset: 1px; border-color: var(--blue-500);
}
.cat-search__resultados {
  margin-top: 10px; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper);
}
.cat-search__resultados:empty { display: none; }
.cat-search__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; border-bottom: 1px solid var(--rule-2); text-decoration: none;
}
.cat-search__item:last-child { border-bottom: 0; }
.cat-search__item:hover { background: var(--blue-50); }
.cat-search__cod { font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--blue-700); }
.cat-search__desc { font-size: 15px; color: var(--body); }
.cat-search__linea { font-size: 12px; color: var(--muted); }
.cat-search__vacio { padding: 14px 16px; font-size: 14px; color: var(--muted); }
.cat-search__mas {
  display: block; width: 100%; padding: 12px 16px; border: 0; background: var(--paper-2);
  color: var(--blue-700); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cat-search__mas:hover { background: var(--blue-50); }

/* ---------- Subgrupos (catalogo/<linea>.html) ---------- */
.cat-grupo {
  border: 1px solid var(--rule); border-radius: 14px; margin-top: 14px; overflow: hidden;
}
.cat-grupo summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink);
  background: var(--paper-2);
}
.cat-grupo summary::-webkit-details-marker { display: none; }
.cat-grupo summary::before {
  content: "+"; display: inline-block; width: 18px; color: var(--blue-700); font-weight: 700;
}
.cat-grupo[open] summary::before { content: "–"; }
.cat-grupo summary:focus-visible { outline: 3px solid var(--blue-500); outline-offset: -3px; }

/* ---------- Tabla de productos ---------- */
.cat-tabla-wrap { overflow-x: auto; }
.cat-tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.cat-tabla th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--rule);
}
.cat-tabla td { padding: 10px 20px; border-bottom: 1px solid var(--rule-2); color: var(--body); vertical-align: top; }
.cat-tabla tr:last-child td { border-bottom: 0; }
.cat-tabla td:first-child { font-family: var(--display); font-size: 13px; color: var(--muted); white-space: nowrap; }
.cat-tabla td:last-child { color: var(--muted); white-space: nowrap; }

@media (max-width: 767px) {
  .cat-search { max-width: none; }
  .cat-tabla td:last-child { display: none; }
  /* .line__more se oculta en movil a los 767px (regla original, linea ~359)
     porque en la home solo dice "Ver la linea ->", texto redundante en una
     tarjeta que ya es un enlace. Las tarjetas de catalogo/index.html
     reutilizan .line__more para un dato real (el conteo de productos), asi
     que llevan TAMBIEN .line__count como marca -- esta regla, mas
     especifica por combinar dos clases, gana sobre la original sin tocarla
     ni duplicar el layout/color por variante que .line__more ya trae. */
  .line__more.line__count { display: inline-flex; }
}

/* =============================================================================
   Movimiento — el scroll no dispara, MANDA
   =============================================================================
   La diferencia con una animación normal es que aquí el navegador liga el
   fotograma a la posición de la rueda, no al reloj: si el visitante sube, la
   animación retrocede con él. Eso es `animation-timeline: view()`, CSS puro,
   cero librerías y cero JavaScript de animación.

   Dos reglas de seguridad gobiernan este bloque entero:

   1. Donde el navegador SÍ sabe ligar animación y scroll, quien esconde y
      quien revela es la misma regla CSS. Si assets/js/efectos.js no llega a
      cargar, el contenido se ve igual — no hay estado "escondido para
      siempre".
   2. Donde NO sabe (Safari anterior al 26, Firefox), el escondido depende de
      `html.js`, una clase que pone el propio efectos.js en su primera línea.
      Sin JS no hay clase, sin clase no hay escondido, y la página se ve como
      hoy. El fail-soft nunca puede dejar contenido invisible.

   `prefers-reduced-motion` apaga el bloque completo, no una parte.
   ============================================================================= */

/* ---------- Titulares que se encienden palabra por palabra ----------
   Los <span class="w"> los crea efectos.js en el navegador. En el HTML
   servido el titular sigue siendo una frase contigua — que es lo que exige
   el control de contenido de .github/workflows/verificar-sitio.yml. */
.w { display: inline-block; }

@supports (animation-timeline: view()) {
  /* --i lo pone efectos.js: es el índice de la palabra, y es lo único que
     escalona el encendido. Sin él las palabras se encenderían a la vez. */
  .w {
    opacity: .13; filter: blur(7px); transform: translateY(.18em);
    animation: encender linear both;
    animation-timeline: view();
    animation-range: cover calc(17% + var(--i) * .9%) cover calc(43% + var(--i) * .9%);
  }

  /* Tarjetas y bloques: suben y entran en foco mientras cruzan la pantalla. */
  [data-anima] {
    animation: subir linear both;
    animation-timeline: view();
    animation-range: entry 4% cover 30%;
  }

  /* El banner se retira en vez de irse: el contenido se aleja y el glifo
     gira despacio mientras la portada sale por arriba. */
  .hero__inner { animation: retirar linear both; animation-timeline: view(); animation-range: exit 0% exit 88%; }
  .hero__mark  { animation: girar   linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }

  /* Lo que ya viaja dentro de .hero__inner no debe animarse dos veces. */
  .hero__inner [data-anima] { animation: none; opacity: 1; transform: none; }

  /* Y la banda de cifras vive SOBRE el pliegue en escritorio. Con la entrada
     ligada al scroll, quien abra la pagina y no baje la deja a media opacidad
     para siempre --- un estado en reposo, no un fotograma. Ahi el efecto es el
     contador, que corre solo. */
  .stats [data-anima] { animation: none; opacity: 1; transform: none; }
}

/* Sin scroll timelines: mismo lenguaje, disparado al entrar en pantalla.
   El escondido cuelga de html.js — ver la regla 2 de la cabecera. */
@supports not (animation-timeline: view()) {
  .js .w {
    opacity: .13; filter: blur(7px); transform: translateY(.18em);
    transition: opacity .8s cubic-bezier(.22,1,.36,1),
                filter  .8s cubic-bezier(.22,1,.36,1),
                transform .8s cubic-bezier(.22,1,.36,1);
  }
  .js .w.is-lit { opacity: 1; filter: blur(0); transform: none; }

  .js [data-anima] {
    opacity: 0; transform: translateY(28px) scale(.972);
    transition: opacity .85s cubic-bezier(.22,1,.36,1),
                transform .85s cubic-bezier(.22,1,.36,1);
  }
  .js [data-anima].is-in { opacity: 1; transform: none; }
}

@keyframes encender { to   { opacity: 1; filter: blur(0); transform: none; } }
@keyframes subir    { from { opacity: 0; transform: translateY(30px) scale(.972); }
                      to   { opacity: 1; transform: none; } }
@keyframes retirar  { from { opacity: 1; transform: none; }
                      to   { opacity: 0; transform: translateY(-48px) scale(.975); } }
@keyframes girar    { from { transform: scale(1)    rotate(0deg);  }
                      to   { transform: scale(1.24) rotate(16deg); } }

/* ---------- Banner: malla en deriva y grano ----------
   El grano es lo que separa "plano" de "material" sin tocar un solo color:
   es ruido en blanco y negro al 6%, no un tinte. */
.hero__mesh {
  position: absolute; inset: -25%; pointer-events: none; filter: blur(30px);
  background:
    radial-gradient(38% 46% at 22% 26%, rgba(18,165,220,.60), transparent 62%),
    radial-gradient(34% 40% at 80% 16%, rgba(143,215,242,.34), transparent 64%),
    radial-gradient(46% 52% at 64% 90%, rgba(10,110,158,.68), transparent 62%);
  animation: derivar 34s ease-in-out infinite alternate;
}
@keyframes derivar {
  from { transform: translate3d(-2%,-1%,0) scale(1); }
  to   { transform: translate3d(3%,2%,0)   scale(1.09); }
}
.hero__grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-size: 170px 170px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Cabecera que se contrae al despegar del banner ---------- */
.site-header { transition: background-color .28s ease, box-shadow .28s ease, border-color .28s ease; }
.site-header__inner { transition: min-height .28s cubic-bezier(.22,1,.36,1); }
.logo { transition: height .28s cubic-bezier(.22,1,.36,1); }
.site-header.is-stuck {
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: transparent;
  box-shadow: 0 10px 30px -18px rgba(7,58,84,.55);
}
.site-header.is-stuck .site-header__inner { min-height: 60px; }
.site-header.is-stuck .logo { height: 38px; }

/* ---------- Las cinco líneas: foco que sigue al cursor ----------
   El gesto es lento a propósito (.55s): un hover rápido se lee como reflejo,
   uno lento se lee como material. El tinte del foco cambia por variante
   porque un blanco al 34% sobre .line--pale (que ya es casi blanco) no se
   vería, y sobre .line--ink sería un fogonazo. */
.line { transition: transform .55s cubic-bezier(.22,1,.36,1), box-shadow .55s cubic-bezier(.22,1,.36,1); }
.line:hover { transform: translateY(-10px) scale(1.014); box-shadow: 0 34px 60px -28px rgba(7,58,84,.6); }
.line::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(340px circle at var(--mx,50%) var(--my,50%), var(--foco, rgba(255,255,255,.22)), transparent 62%);
}
.line:hover::after { opacity: 1; }
.line__name, .line__more { z-index: 2; }
.line--brand { --foco: rgba(255,255,255,.34); }
.line--ink   { --foco: rgba(143,215,242,.20); }
.line--mid   { --foco: rgba(255,255,255,.20); }
.line--pale  { --foco: rgba(255,255,255,.80); }
.line--soft  { --foco: rgba(18,165,220,.16); }

/* ---------- Sectores: de ocho cajas iguales a una retícula con ritmo ----------
   Ocho piezas en cuatro columnas con dos anchas arriba, cuatro compactas en
   medio y dos anchas abajo suman doce celdas exactas: tres filas llenas, sin
   hueco al final. Es lo que quita el aire de plantilla. */
.sectors { gap: 18px; }
.sector {
  background: var(--paper); border: 1px solid var(--rule);
  border-top: 3px solid var(--blue-500); border-radius: 16px;
  padding: 20px 22px 24px;
  transition: transform .5s cubic-bezier(.22,1,.36,1), box-shadow .5s cubic-bezier(.22,1,.36,1);
}
.sector:hover { transform: translateY(-7px); box-shadow: 0 28px 52px -28px rgba(7,58,84,.5); }
.sector--ancho { grid-column: span 2; }
.sector--ancho h3 { font-size: 22px; line-height: 1.25; }
.sector--ancho p { font-size: 15px; }
.sector--acento { background: var(--blue-50); border-color: #BFE4F5; border-top-color: var(--blue-500); }

/* ---------- El riel se detiene donde el ojo se detiene ---------- */
.marquee-zone:hover .mq-track { animation-play-state: paused; }
.mq-item img { transition: filter .25s ease, opacity .25s ease, transform .25s cubic-bezier(.22,1,.36,1); }
.mq-item img:hover { transform: scale(1.09); }

/* ---------- El menú sabe en qué sección estás ---------- */
.nav a { position: relative; padding-bottom: 5px; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; border-radius: 2px; background: var(--blue-500);
  transition: right .32s cubic-bezier(.22,1,.36,1);
}
.nav a:hover::after, .nav a.is-active::after { right: 0; }
.nav a.is-active { color: var(--blue-700); }

@media (max-width: 1023px) {
  /* En el menú desplegable cada enlace es una fila con su propia raya
     inferior; el subrayado de sección se pisaría con ella. */
  .nav a::after { display: none; }
}

@media (max-width: 767px) {
  /* A una columna, `span 2` inventaría una segunda columna vacía. */
  .sector--ancho { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .w, .js .w { opacity: 1; filter: none; transform: none; animation: none; transition: none; }
  [data-anima], .js [data-anima] { opacity: 1; transform: none; animation: none; transition: none; }
  .hero__inner, .hero__mark, .hero__mesh { animation: none; }
  .line:hover, .sector:hover { transform: none; }
}
