.hero-grid {
  /* Portada del inicio: texto de valor + mockup inspirado en la app móvil. */
  width: 100%;
  max-width: none;
  min-height: auto;
  padding-left: max(18px, calc((100% - var(--max)) / 2));
  padding-right: max(18px, calc((100% - var(--max)) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 38px;
  align-items: center;
  color: var(--black);
  background:
    linear-gradient(115deg, rgba(246, 196, 0, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff, #f7f7f2);
  border-bottom: 1px solid rgba(6, 6, 6, 0.08);
}
.hero-copy {
  align-self: start;
}

body[data-page="inicio"] {
  background: var(--paper);
}

body[data-page="inicio"] main {
  overflow: hidden;
}

.hero-copy h1 {

  max-width: 840px;
  /*min-height: calc(var(--hero-title-lines) * 1.02em);*/
  min-height: 0;
  margin-bottom: 22px;
  font-size: clamp(38px, 4.45vw, 62px);
  line-height: 1.05;
  text-wrap: balance;
}

/* Titulo animado del inicio. */
.home-title-prefix {
  white-space: nowrap;
}

.home-title-suffix {
  overflow-wrap: normal;
  word-break: normal;
}

.hero-copy h1 .title-accent {
  position: relative;
}

.hero-copy h1.is-typing .title-accent::after {
  content: "";
  position: absolute;
  left: calc(100% + 0.08em);
  top: 0.12em;
  width: 0.08em;
  height: 0.82em;
  background: var(--black);
  animation: title-caret-blink 0.82s steps(1) infinite;
}

@keyframes title-caret-blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

.hero-text {
  max-width: 690px;
  color: var(--muted-dark);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 26px 0 28px;
}

.signal-row {
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal-row div {
  min-height: 88px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}

.signal-row strong {
  display: block;
  margin-bottom: 8px;
  color: var(--yellow);
  font-size: 30px;
  font-weight: 950;
}

.signal-row span {
  color: var(--muted-dark);
  font-size: 13px;
  font-weight: 850;
}

.hero-visual {
  display: grid;
  place-items: center;
}

.device-frame {
  width: min(100%, 470px);
  min-height: 560px;
  padding: 22px;
  color: var(--black);
  background: #ffffff;
  border: 3px solid #151515;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

/* Mockup de menú y cálculo para mostrar el estilo real de Metalink. */
.device-top {
  min-height: 56px;
  margin-bottom: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--black);
  font-weight: 950;
}

.mockup-logo {
  width: 190px;
  height: 56px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.device-top b {
  margin-left: auto;
  padding: 7px 9px;
  color: var(--black);
  background: var(--yellow);
  border-radius: var(--radius);
  font-size: 10px;
}

.app-search-pill {
  height: 54px;
  margin-bottom: 18px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #2e2e2e;
  background: #eeeeee;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 850;
}

.app-search-pill b {
  width: 14px;
  height: 22px;
  border: 3px solid #777;
  border-radius: 999px;
  border-top: 0;
}

.app-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.app-menu-grid article {
  min-height: 130px;
  padding: 14px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  background: #fff;
  border: 1px solid #dddddd;
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.app-menu-grid img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.app-menu-grid strong {
  font-size: 16px;
  font-weight: 950;
}

.line-icon {
  position: relative;
  width: 74px;
  height: 72px;
  display: block;
}

.line-icon::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 5px solid var(--black);
  border-radius: 8px;
}

.line-icon::after {
  content: "";
  position: absolute;
  width: 21px;
  height: 21px;
  right: 9px;
  bottom: 11px;
  background: var(--yellow);
  border-radius: 999px;
}

.academy-icon::before {
  border-radius: 50% 50% 8px 8px;
  transform: skewY(-10deg);
}

.support-icon::before {
  border-radius: 50%;
}

.formula-icon::after {
  width: 28px;
  height: 3px;
  right: 18px;
  bottom: 21px;
  border-radius: 0;
  box-shadow: 0 -12px 0 var(--yellow), 0 -24px 0 var(--yellow);
}

.calc-preview-card {
  overflow: hidden;
  background: #fff8b7;
  border: 3px solid var(--black);
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--yellow);
}

.calc-preview-top {
  padding: 14px 18px;
  color: #fff;
  background: var(--black);
  border-bottom: 3px solid var(--yellow);
  text-align: center;
}

.calc-preview-top span {
  display: block;
  margin-bottom: 10px;
  font-weight: 950;
}

.calc-preview-top strong {
  display: block;
  padding: 13px;
  color: var(--black);
  background: #dff5d9;
  border: 3px solid #58bd65;
  border-radius: 10px;
  font-size: 22px;
}

.calc-preview-card dl {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
}

.calc-preview-card div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-weight: 950;
}

.calc-preview-card dt,
.calc-preview-card dd {
  font-weight: 950;
}

.module-strip {
  /* Tarjetas de módulos: resumen escaneable de las herramientas principales. */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-tile {
  position: relative;
  min-height: 340px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.module-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(246, 196, 0, 0.12), transparent 38%),
    linear-gradient(rgba(6, 6, 6, 0.035) 1px, transparent 1px);
  background-size: auto, 100% 34px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.module-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(246, 196, 0, 0.7);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.11);
}

.module-tile:hover::before {
  opacity: 1;
}

.module-top,
.module-index,
.module-body,
.module-tags {
  position: relative;
}

.module-top {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-index {
  width: fit-content;
  padding: 7px 9px;
  color: var(--black);
  background: var(--yellow);
  border-radius: var(--radius);
  font-weight: 950;
}

.module-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.module-body {
  display: grid;
  gap: 10px;
}

.module-body ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: var(--muted-dark);
  font-size: 13px;
  line-height: 1.35;
}

.module-tile span {
  color: var(--yellow-dark);
  font-weight: 950;
}

.module-tile strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.module-tile p {
  color: var(--muted-dark);
}

.module-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-tags span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--black);
  background: rgba(246, 196, 0, 0.16);
  border: 1px solid rgba(246, 196, 0, 0.32);
  border-radius: 999px;
  font-size: 11px;
}

.process-section {
  padding-top: 32px;
  /* Flujo de uso centrado: de selección de herramienta a historial. */
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.process-header {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.process-header h2 {
  margin: 0 auto 12px;
}

.process-header .kicker {
  margin-left: auto;
  margin-right: auto;
}

.process-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.process-rail::before {
  display: none;
}

.process-rail article {
  position: relative;
  min-height: 210px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}

.process-rail article::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--yellow);
  opacity: 0.7;
}

.process-index {
  position: static;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--black);
  background: var(--yellow);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  transform: none;
  z-index: 1;
}

.process-rail strong {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.05;
}

.process-rail p {
  color: var(--muted-dark);
  font-size: 14px;
  line-height: 1.42;
}

.process-rail ul {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  list-style: none;
}

.process-rail li {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--black);
  background: rgba(246, 196, 0, 0.14);
  border: 1px solid rgba(246, 196, 0, 0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.process-rail b {
  min-width: 0;
  padding: 5px 8px;
  color: var(--yellow-dark);
  background: rgba(246, 196, 0, 0.08);
  border: 1px solid rgba(246, 196, 0, 0.28);
  border-radius: var(--radius);
  text-align: center;
  font-size: 11px;
  line-height: 1;
}

@media (min-width: 981px) {
  .process-rail strong {
    white-space: nowrap;
  }
}

.split-showcase {
  /* Cierre de propuesta de valor con contraste negro/blanco. */
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.metric-panel,
.journey-panel {
  padding: 28px;
  border-radius: var(--radius);
}

.metric-panel {
  color: var(--white);
  background: #000000;
  border: 1px solid rgba(246, 196, 0, 0.24);
}

.metric-panel span {
  color: var(--yellow);
  font-weight: 950;
}

.metric-panel strong {
  display: block;
  margin: 18px 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
}

.metric-panel p {
  color: var(--muted);
}

.journey-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: #ededE7;
  border: 1px solid var(--line-dark);
}

.journey-panel div {
  min-height: 150px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}

.journey-panel span {
  display: block;
  margin-bottom: 18px;
  color: var(--yellow-dark);
  font-size: 12px;
  font-weight: 950;
}

.journey-panel b {
  display: block;
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.1;
}

.journey-panel p {
  color: var(--muted-dark);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .hero-grid,
  .split-showcase {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    --hero-title-lines: 4.5;
  }

  .module-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-header {
    position: static;
  }

  .process-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-grid {
    min-height: auto;
  }

  .hero-copy h1 {
    --hero-title-lines: 6;
  }

  .signal-row,
  .module-strip,
  .process-rail,
  .journey-panel {
    grid-template-columns: 1fr;
  }

  .device-frame {
    min-height: 0;
    padding: 14px;
    border-width: 2px;
    border-radius: 22px;
  }

  .device-top {
    min-height: 44px;
    margin-bottom: 12px;
  }

  .mockup-logo {
    width: 146px;
    height: 44px;
  }

  .device-top b {
    padding: 5px 7px;
    font-size: 9px;
  }

  .app-search-pill {
    height: 42px;
    margin-bottom: 12px;
    padding: 0 14px;
    font-size: 14px;
  }

  .app-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }

  .app-menu-grid article {
    min-height: 112px;
    padding: 10px;
    gap: 7px;
    border-radius: 14px;
  }

  .app-menu-grid img {
    width: 58px;
    height: 58px;
  }

  .app-menu-grid strong {
    font-size: 13px;
  }

  .module-tile,
  .process-rail article,
  .journey-panel div {
    min-height: 0;
  }

  .metric-panel,
  .journey-panel {
    padding: 22px;
  }
}

@media (max-width: 420px) {
  .hero-copy h1 {
    --hero-title-lines: 7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy h1.is-typing .title-accent::after {
    animation: none;
  }
}
