/* ══════════════════════════════════════════════════════════════
   INICIO — clases hm-*  ·  se carga solo en index.html / en/index.html
   Lenguaje visual alineado con POLYKRAN (css/polykran.css):
   títulos planos, sin tablas ni barras, secciones sobrias.
   ══════════════════════════════════════════════════════════════ */

/* ── Cabeceras de sección (un poco más grandes que el default) ── */
.hm-head { max-width: 640px; margin-bottom: 44px; }
.hm-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.hm-head .section-tag { font-size: 11px; letter-spacing: 2.5px; margin-bottom: 14px; }
.hm-head .section-title { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.16; margin-bottom: 14px; }
.hm-head .section-subtitle { font-size: 15.5px; line-height: 1.7; color: var(--text-muted); margin: 0; max-width: 620px; }
.hm-head.center .section-subtitle { margin-left: auto; margin-right: auto; }

/* ── HERO: video a pantalla completa de fondo + capa oscura ── */
.hero-title { text-transform: uppercase; letter-spacing: 0; }
/* el H1 en español es más largo que el inglés → en escritorio se baja el tope para que quepa en 3 líneas */
@media (min-width: 769px) {
  .hero-title.is-es { font-size: clamp(30px, 3.6vw, 44px); }
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 42% center; z-index: 0;
}
.hero-bg .hero-img { position: absolute; inset: 0; z-index: 0; object-fit: cover; object-position: 42% center; }
.hero .hero-overlay {
  background:
    linear-gradient(100deg, rgba(2,24,56,.95) 0%, rgba(2,24,56,.86) 44%, rgba(2,24,56,.62) 100%),
    linear-gradient(270deg, rgba(2,24,56,.55) 0%, transparent 22%);
}
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
@media (max-width: 768px) {
  .hero .hero-overlay {
    background: linear-gradient(180deg, rgba(2,24,56,.82) 0%, rgba(2,24,56,.88) 55%, rgba(2,24,56,.96) 100%);
  }
}

/* ════════ 1 · FRANJA DE CONTEXTO ════════ */
.hm-context { background: var(--blue-dark); padding: 34px 0; border-top: 1px solid rgba(255,255,255,.12); }
.hm-context .container {
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.hm-ctx-item { padding: 4px 28px; border-left: 1px solid rgba(255,255,255,.16); }
.hm-ctx-item:first-child { border-left: none; padding-left: 0; }
.hm-ctx-num { font-size: 30px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -0.5px; }
.hm-ctx-label { font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.66); margin-top: 8px; }

/* ════════ 2 · LÍNEAS DE PRODUCTO ════════ */
.hm-lines { padding: 92px 0; background: #F5F8FC; }
.hm-lines-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hm-line {
  display: grid; grid-template-columns: 104px 1fr auto; gap: 24px; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 26px;
  transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease, border-color .4s ease;
}
.hm-line:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(3,48,109,.4); border-color: var(--blue-mid); }
.hm-line-fig {
  position: relative; width: 104px; height: 104px; border-radius: 11px; background: #F4F7FB;
  border: 1px solid var(--border); overflow: hidden; flex-shrink: 0;
}
.hm-line-fig img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; z-index: 0;
}
/* la nueva aparece YA, opaca y encima; la anterior se desvanece por debajo (no se ve) */
.hm-line-fig img.on { opacity: 1; z-index: 2; }
.hm-line-fig img.prev { opacity: 0; z-index: 1; transition: opacity .4s ease; }
@media (prefers-reduced-motion: reduce) {
  .hm-line-fig img.prev { transition: none; }
  .hm-line-fig img:not(.on) { display: none; }
}
.hm-line-body { display: block; align-self: center; }
.hm-line-n { display: block; font-size: 11px; font-weight: 800; color: var(--blue-mid); letter-spacing: 2px; margin-bottom: 7px; }
.hm-line-t { display: block; font-size: 17.5px; font-weight: 700; color: var(--blue-dark); margin: 0 0 7px; line-height: 1.25; }
.hm-line-d { display: block; font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0 0 10px; }
.hm-line-tags { display: block; font-size: 11.5px; font-weight: 600; color: var(--blue-mid); letter-spacing: .2px; }
.hm-line-arrow { font-size: 18px; color: var(--blue-dark); transition: transform .3s ease; }
.hm-line:hover .hm-line-arrow { transform: translateX(4px); }

/* ════════ 3 · MATERIALES — franja breve (la profundidad va en su página) ════════ */
.hm-mat { padding: 66px 0; background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hm-mat .section-tag { display: block; font-size: 11px; letter-spacing: 2.5px; margin-bottom: 12px; }
.hm-mat h2 { font-size: clamp(21px, 2.5vw, 28px); font-weight: 800; color: var(--blue-dark); line-height: 1.25; margin: 0 0 12px; }
.hm-mat p { font-size: 15px; line-height: 1.75; color: var(--text-body); margin: 0 0 20px; max-width: 660px; }
.hm-mat-names { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.hm-mat-names span {
  font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--blue-mid);
  background: #F1F5FB; border: 1px solid var(--border); border-radius: 100px; padding: 6px 13px;
}
.hm-mat-names span.pk { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); }
.hm-mat-link { margin: 0; }
.hm-mat-link a { font-size: 13.5px; font-weight: 700; color: var(--blue-dark); }
.hm-mat-link a:hover { color: var(--blue-mid); }

/* ════════ 4 · POLYKRAN — bloque corto y directo (la historia está en /polykran) ════════ */
.hm-pk { position: relative; padding: 84px 0; background: var(--blue-dark); color: #fff; overflow: hidden; }
.hm-pk::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(46% 52% at 84% 22%, rgba(70,140,235,.28), transparent 70%),
    radial-gradient(40% 44% at 6% 96%, rgba(20,70,150,.32), transparent 70%);
}
.hm-pk .container { position: relative; z-index: 1; }
.hm-pk-grid { display: grid; grid-template-columns: 1fr minmax(260px, 360px); gap: 60px; align-items: center; }
.hm-pk-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 14px; }
.hm-pk-word { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; letter-spacing: 1px; line-height: 1; margin: 0 0 16px; }
.hm-pk-word sup { font-size: .3em; top: -1.1em; }
.hm-pk-desc { font-size: clamp(14px, 1.5vw, 15.5px); line-height: 1.8; color: rgba(255,255,255,.82); margin: 0 0 18px; max-width: 520px; }
.hm-pk-variants { font-size: 12.5px; line-height: 1.7; color: #cfe0f7; margin: 0 0 26px; }
.hm-pk-variants b { font-weight: 800; letter-spacing: .5px; }
.hm-pk-media {
  background: #fff; border-radius: 16px; padding: 14px;
  box-shadow: 0 45px 100px -40px rgba(0,0,0,.6);
}
.hm-pk-media img { display: block; width: 100%; height: auto; border-radius: 8px; }

/* ════════ 5 · DESARROLLO BAJO ESPECIFICACIÓN E INGENIERÍA INVERSA
   rutas de entrada → proceso de ingeniería (timeline) → capacidades → resultado ════════ */
.hm-dev { padding: 100px 0; background: #fff; }
.hm-dev-head { max-width: 720px; margin-bottom: 44px; }
.hm-dev-head .section-tag { display: block; font-size: 11px; letter-spacing: 2.5px; margin-bottom: 14px; }
.hm-dev-head h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; color: var(--blue-dark); line-height: 1.16; margin: 0 0 18px; }
.hm-dev-head p { font-size: clamp(15px, 1.65vw, 17px); line-height: 1.75; color: var(--text-body); margin: 0; }

/* ── subtítulos internos (estilo documento técnico) ── */
.hm-dev-sub {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--blue-dark); margin: 0 0 6px;
}
.hm-dev-sub + .hm-dev-note { font-size: 13.5px; line-height: 1.7; color: var(--text-muted); margin: 0 0 6px; max-width: 620px; }

/* ── punto de partida: filas editoriales, sin tarjetas (una es ingeniería inversa) ── */
.hm-input { margin: 18px 0 60px; border-top: 1px solid var(--blue-dark); }
.hm-input-row {
  display: grid; grid-template-columns: 244px 1fr; gap: 40px;
  padding: 22px 0; border-bottom: 1px solid var(--border);
}
.hm-input-k { font-size: 14.5px; font-weight: 700; color: var(--blue-dark); line-height: 1.45; }
.hm-input-k em { display: block; font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-top: 3px; }
.hm-input-row p { font-size: 13.5px; line-height: 1.7; color: var(--text-body); margin: 0; max-width: 600px; }

/* ── proceso de desarrollo: timeline vertical numerada ── */
.hm-proc { max-width: 760px; }
.hm-proc-title {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--blue-dark); margin: 0 0 24px;
}
.hm-proc-step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 20px; padding-bottom: 26px; }
.hm-proc-step:last-child { padding-bottom: 0; }
.hm-proc-step::before {
  content: ""; position: absolute; left: 19px; top: 40px; bottom: -4px; width: 2px; background: var(--border);
}
.hm-proc-step:last-child::before { display: none; }
.hm-proc-n {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 2px solid var(--blue-mid); color: var(--blue-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.hm-proc-b { padding-top: 7px; }
.hm-proc-b h5 { font-size: 14.5px; font-weight: 700; color: var(--blue-dark); margin: 0 0 5px; }
.hm-proc-b p { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0; }

/* ── capacidades de manufactura (lista editorial, sin caja) ── */
.hm-cap { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 30px; }
.hm-cap-title { font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue-dark); margin: 0 0 20px; }
.hm-cap ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 44px; }
.hm-cap li { position: relative; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--text-body); }
.hm-cap li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 6px; height: 6px;
  border-right: 2px solid var(--blue-mid); border-bottom: 2px solid var(--blue-mid); transform: rotate(-45deg);
}

/* ── resultado ── */
.hm-dev-out { margin-top: 44px; border-top: 2px solid var(--blue-dark); padding-top: 20px; display: flex; gap: 18px; align-items: baseline; }
.hm-dev-out-k { flex-shrink: 0; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue-mid); }
.hm-dev-out b { font-size: 14px; font-weight: 700; color: var(--blue-dark); line-height: 1.6; }

/* ════════ 6 · FAQ ════════ */
.hm-faq { padding: 92px 0; background: #F5F8FC; }

/* ════════ 6 · FAQ ════════ */
.hm-faq { padding: 92px 0; background: #F5F8FC; }
.hm-faq-wrap { max-width: 820px; margin: 0 auto; }
.hm-faq-list { border-top: 1px solid var(--border); }
.hm-faq-item { border-bottom: 1px solid var(--border); }
.hm-faq-q {
  position: relative; display: block; cursor: pointer; list-style: none;
  padding: 22px 44px 22px 0;
  font-size: 15.5px; font-weight: 700; color: var(--blue-dark); line-height: 1.45;
}
.hm-faq-q::-webkit-details-marker { display: none; }
.hm-faq-q::after {
  content: ""; position: absolute; right: 6px; top: 26px;
  width: 9px; height: 9px; border-right: 2px solid var(--blue-mid); border-bottom: 2px solid var(--blue-mid);
  transform: rotate(45deg); transition: transform .25s ease;
}
.hm-faq-item[open] .hm-faq-q::after { transform: rotate(-135deg); }
.hm-faq-q:hover { color: var(--blue-mid); }
.hm-faq-a { padding: 0 44px 24px 0; font-size: 14.5px; line-height: 1.75; color: var(--text-body); margin: 0; }

/* ════════ reveal ════════ */
.hm-rise { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.hm-rise.in { opacity: 1; transform: none; }
.hm-rise.d1 { transition-delay: .08s; }
.hm-rise.d2 { transition-delay: .16s; }
.hm-rise.d3 { transition-delay: .24s; }
.hm-rise.d4 { transition-delay: .32s; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 1024px) {
  .hm-pk-grid { grid-template-columns: 1fr; gap: 40px; }
  .hm-pk-media { max-width: 380px; }
}
@media (max-width: 820px) {
  .hm-input { margin-bottom: 44px; }
  .hm-input-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }
  .hm-input-k em { display: inline; margin-left: 6px; }
  .hm-cap ul { grid-template-columns: 1fr; }
  .hm-dev-out { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 860px) {
  .hm-lines, .hm-pk, .hm-faq, .hm-dev { padding: 64px 0; }
  .hm-mat { padding: 52px 0; }
  .hm-dev-head { margin-bottom: 30px; }
  .hm-head { margin-bottom: 30px; }
  .hm-context { padding: 30px 0; }
  .hm-context .container { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .hm-ctx-item { padding: 0; border-left: none; }
  .hm-ctx-item:nth-child(even) { border-left: 1px solid rgba(255,255,255,.16); padding-left: 16px; }
  .hm-lines-grid { grid-template-columns: 1fr; gap: 14px; }
  .hm-line { grid-template-columns: 76px 1fr auto; padding: 18px 18px; gap: 16px; }
  .hm-line-fig { width: 76px; height: 76px; }
}
@media (max-width: 480px) {
  .hm-context .container { grid-template-columns: 1fr 1fr; }
  .hm-ctx-num { font-size: 26px; }
  .hm-pk-media { padding: 12px; }
  .hm-line { grid-template-columns: 64px 1fr; }
  .hm-line-fig { width: 64px; height: 64px; }
  .hm-line-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-rise { opacity: 1 !important; transform: none !important; transition: none !important; }
}
