/* ============ NOSOTROS · HISTORIA · #nosotros-historia (.nh-) ============ */
.nh { padding-block: var(--space-l) var(--space-xl); }
.nh-head { display: grid; gap: clamp(14px, 2vw, 26px); margin-bottom: clamp(2.5rem, 6vw, 5.5rem); max-width: 62rem; }
.nh-title { font-size: var(--step-5); line-height: .92; letter-spacing: -.045em; font-weight: 760; text-wrap: balance; }
.nh-quote { font-size: var(--step-2); line-height: 1.22; letter-spacing: -.02em; color: var(--paper-2); max-width: 30em; text-wrap: pretty; font-family: var(--font-display); font-weight: 520; }
.nh-quote strong { color: var(--paper); font-weight: 650; background: linear-gradient(var(--accent), var(--accent)) 0 92% / 100% .14em no-repeat; }

.nh-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 28px); align-items: start; }
.nh-side { grid-column: 1 / span 5; position: sticky; top: clamp(84px, 13vh, 130px); display: grid; gap: 1.2rem; }
.nh-main { grid-column: 7 / -1; display: grid; gap: clamp(2rem, 4vw, 3.4rem); min-width: 0; }

/* --- retrato (visor) --- */
.nh-portrait { position: relative; overflow: hidden; height: min(56svh, 560px); border: 1px solid var(--line); cursor: crosshair; transition: border-color .4s var(--ease-out); }
.nh-portrait:hover { border-color: rgba(59, 91, 255, .5); }
.nh-c { position: absolute; width: 16px; height: 16px; border: 0 solid var(--line-strong); pointer-events: none; z-index: 3; transition: border-color .4s var(--ease-out); }
.nh-c--tl { top: 0; left: 0; border-width: 1px 0 0 1px; } .nh-c--tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.nh-c--bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; } .nh-c--br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.nh-portrait:hover .nh-c { border-color: var(--cobalt); }
.nh-cap { position: absolute; left: 14px; bottom: 12px; display: grid; gap: .25em; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.nh-cap b { font-family: var(--font-pixel); font-weight: 400; color: var(--paper); font-size: .78rem; }

.nh-now { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: .3rem 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.nh-now-n { font-size: 1.6rem; line-height: 1; color: var(--paper); }
.nh-now-n small { font-size: .8rem; color: var(--muted); }
.nh-now-t { font-size: var(--step-1); line-height: 1.05; letter-spacing: -.02em; font-weight: 700; overflow: hidden; }
.nh-seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nh-seg i { height: 6px; background: var(--ink-3); transition: background .5s var(--ease-out); }
.nh-seg i.is-on { background: var(--accent); }
.nh-seg i.is-on:last-child, .nh-seg i.is-on:nth-child(3) { background: var(--accent); }

/* --- foto: el visor la muestra en lugar de los cubos (una sola a la vez) --- */
.nh-photo { position: absolute; inset: 0; margin: 0; background: var(--accent); overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s .35s; pointer-events: none; }
.nh-portrait.is-photo .nh-photo { opacity: 1; visibility: visible; transition-delay: 0s; }
.nh-photo canvas, .nh-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 12%; image-rendering: pixelated; }
.nh-photo img { image-rendering: auto; opacity: 0; transition: opacity .4s var(--ease-out); }
.nh-photo.is-sharp img { opacity: 1; }
.nh-photo.is-sharp canvas { opacity: 0; }
.nh-portrait.is-photo .nh-cap { opacity: 0; }
.nh-toggle { position: absolute; right: 14px; bottom: 12px; display: inline-flex; align-items: center; gap: .7em; padding: .72em 1em; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(13, 13, 16, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-family: var(--font-pixel); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--paper); z-index: 2; transition: background .4s var(--ease-out), color .4s var(--ease-out), border-color .4s var(--ease-out); }
.nh-toggle:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.nh-toggle-ico { width: .7em; height: .7em; background: var(--accent); box-shadow: .5em .5em 0 -.1em var(--cobalt); margin-right: .45em; }

/* --- prueba contada (datos de clientes.js) --- */
.nh-proof { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.2rem; border-block: 1px solid var(--line-strong); }
.nh-proof-l { margin: 0; display: flex; flex-wrap: wrap; gap: 1rem clamp(1.4rem, 3.4vw, 3rem); }
.nh-proof-l > div { display: grid; gap: .3rem; }
.nh-proof-l dt { order: 2; font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nh-proof-l dd { margin: 0; order: 1; }
.nh-proof-l b { font-family: var(--font-display); font-weight: 760; font-size: clamp(2.4rem, 1.4rem + 3vw, 4.2rem); line-height: .9; letter-spacing: -.045em; color: var(--paper); font-variant-numeric: tabular-nums; }

/* --- 3 casos con captura --- */
.nh-clients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); }
.nh-cl { display: grid; gap: .45rem; color: var(--paper); }
.nh-cl-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-3); border: 1px solid var(--line-strong); }
.nh-cl-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .8s var(--ease-out), filter .4s var(--ease-out); filter: saturate(.85); }
.nh-cl:hover .nh-cl-img img, .nh-cl:focus-visible .nh-cl-img img { transform: scale(1.05); filter: none; }
.nh-cl-n { font-size: var(--step-1); line-height: 1.05; letter-spacing: -.03em; font-weight: 720; background: linear-gradient(currentColor, currentColor) 0 100% / 0 .06em no-repeat; transition: background-size .5s var(--ease-out); justify-self: start; }
.nh-cl:hover .nh-cl-n { background-size: 100% .06em; }
.nh-cl-m { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* --- bio + ficha --- */
.nh-bio { font-size: var(--step-1); line-height: 1.42; color: var(--paper-2); max-width: 34em; text-wrap: pretty; }
.nh-ficha { margin: 0; display: grid; border-top: 1px solid var(--line-strong); }
.nh-ficha > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .95rem 0 .95rem 0; border-bottom: 1px solid var(--line); position: relative; transition: padding .5s var(--ease-out), background .5s var(--ease-out); }
.nh-ficha > div::before { content: ''; position: absolute; left: 0; top: 50%; width: .5rem; height: .5rem; background: var(--accent); box-shadow: .5rem .5rem 0 -.1rem var(--cobalt); transform: translateY(-60%) scale(0); transition: transform .5s var(--ease-out); }
.nh-ficha > div:hover { padding-left: 1.6rem; background: linear-gradient(90deg, rgba(241, 238, 230, .04), transparent 70%); }
.nh-ficha > div:hover::before { transform: translateY(-60%) scale(1); }
.nh-ficha dt { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: .2em; }
.nh-ficha dd { margin: 0; font-size: var(--step-0); color: var(--paper); text-wrap: pretty; }

/* --- recorrido --- */
.nh-steps-wrap { position: relative; padding-left: clamp(26px, 3.4vw, 44px); }
.nh-rail { position: absolute; left: 4px; top: .6rem; bottom: .6rem; width: 2px; background: var(--line); }
.nh-rail i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.nh-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.nh-step { position: relative; display: grid; gap: .8rem; padding-block: clamp(1.4rem, 5vh, 3.4rem); min-height: 34vh; align-content: start; }
/* inactivos: se atenúa el titular (texto grande, 3:1) y el cuerpo pasa a --muted (5.7:1). Nada baja de AA */
.nh-step .nh-step-h { opacity: .5; transition: opacity .6s var(--ease-out); }
.nh-step.is-done .nh-step-h { opacity: .7; }
.nh-step.is-on .nh-step-h { opacity: 1; }
.nh-step:not(.is-on) .nh-step-p { color: var(--muted); }
.nh-step .nh-step-p { transition: color .6s var(--ease-out); }
.nh-step::before { content: ''; position: absolute; left: calc(clamp(26px, 3.4vw, 44px) * -1 - 2px); top: clamp(1.6rem, 5vh, 3.6rem); width: 10px; height: 10px; background: var(--ink); border: 2px solid var(--line-strong); transition: background .4s var(--ease-out), border-color .4s var(--ease-out), transform .6s var(--ease-out); }
.nh-step.is-done::before { background: var(--accent); border-color: var(--accent); }
.nh-step.is-on::before { background: var(--accent); border-color: var(--paper); transform: scale(1.5) rotate(45deg); }
.nh-step-n { font-size: .8rem; letter-spacing: .08em; color: var(--muted); }
.nh-step.is-on .nh-step-n { color: var(--accent); }
.nh-step-h { font-size: var(--step-3); line-height: .98; letter-spacing: -.035em; font-weight: 740; }
.nh-step-btn { text-align: left; display: inline; font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; background: linear-gradient(currentColor, currentColor) 0 100% / 0 .06em no-repeat; transition: background-size .5s var(--ease-out); }
.nh-step-btn:hover { background-size: 100% .06em; }
.nh-step-p { max-width: 36em; color: var(--paper-2); text-wrap: pretty; }
.nh-tags { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nh-tags li { padding: .45em .8em; border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--paper-2); transition: background .35s var(--ease-out), color .35s var(--ease-out), border-color .35s var(--ease-out), transform .5s var(--ease-out); cursor: default; }
.nh-tags li:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); transform: translateY(-3px); }
.nh-step.is-on .nh-tags li { border-color: rgba(255, 79, 31, .5); }

.nh-methods { display: grid; gap: .9rem; }
.nh-methods-h { color: var(--paper-2); cursor: pointer; list-style: none; display: inline-flex; gap: .8em; align-items: center; padding-block: .4em; }
.nh-methods-h::-webkit-details-marker { display: none; }
.nh-methods-h:hover { color: var(--paper); }
.nh-methods[open] .nh-methods-h span { display: inline-block; transform: rotate(45deg); }
.nh-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.nh-links-s { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 1100px) {
  .nh-side { grid-column: 1 / span 5; }
  .nh-main { grid-column: 6 / -1; }
  .nh-ficha > div { grid-template-columns: 1fr; gap: .2rem; }
}
@media (max-width: 760px) {
  .nh-grid { display: block; }
  .nh-side { position: relative; top: auto; margin-bottom: 2rem; }
  .nh-portrait { height: 36svh; }
  .nh-now { display: none; }
  .nh-cap span { display: none; }
  .nh-proof-l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 1rem; }
  .nh-proof-l dt { line-height: 1.25; }
  .nh-clients { grid-template-columns: 1fr; }
  .nh-cl { grid-template-columns: 38% 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: start; }
  .nh-cl-img { grid-row: 1 / span 2; }
  .nh-cl-n { align-self: end; }
  .nh-main { gap: 2.2rem; }
  .nh-step { min-height: 0; padding-block: 1.4rem 1.8rem; }
  .nh-step .nh-step-h, .nh-step.is-done .nh-step-h { opacity: 1; }
  .nh-step:not(.is-on) .nh-step-p { color: var(--paper-2); }
  .nh-step-h { font-size: var(--step-2); }
  .nh-links { display: grid; }
  .nh-links .btn { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .nh-step { transition: none; } }
