/* Mogging — capa de aplicación sobre tokens.css y bundle.css (SuperHumanos).
   Todo valor sale de un token. Sin color, sin sombras, sin radios, sin gradientes. */

html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font-text); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums tabular-nums; -webkit-tap-highlight-color: transparent; }
body.sh-negro, .m-negro { background: var(--negro-fondo); }
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: var(--stroke-restriccion) solid var(--ink); outline-offset: 3px; }
.sh-negro :focus-visible { outline-color: var(--negro-tinta); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .rv { opacity: 0; transition: opacity 320ms cubic-bezier(.4, 0, .2, 1); transition-delay: var(--rd, 0ms); }
.js .rv.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1; transition: none; } }

/* ── Escala φ con clamp(): 16 · 26 · 42 · 68 · 110 · 178 ───────── */
:root {
  --f-26: clamp(21px, 5.4vw, 26px);
  --f-42: clamp(28px, 7.4vw, 42px);
  --f-68: clamp(36px, 10vw, 68px);
  --f-110: clamp(54px, 15vw, 110px);
  --f-178: clamp(76px, 25vw, 178px);
  --gutter: clamp(16px, 5vw, 48px);
}
.m-dato { font-family: var(--font-headline); font-size: var(--f-178); line-height: .88; font-weight: 700; letter-spacing: -.04em; margin: 0; white-space: nowrap; }
.m-dato small { font-size: 30%; font-weight: 300; letter-spacing: 0; margin-left: .08em; }
.m-display { font-family: var(--font-headline); font-size: var(--f-110); line-height: .9; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.m-titulo { font-family: var(--font-headline); font-size: var(--f-42); line-height: 1.05; font-weight: 700; letter-spacing: -.015em; margin: 0 0 var(--space-6); text-wrap: balance; max-width: 22ch; }
.m-titulo--xl { font-size: var(--f-68); line-height: .95; letter-spacing: -.02em; max-width: 14ch; }
.m-titulo .l, .m-titulo--xl .l { font-weight: 200; }
.lead, .m-lead { font-family: var(--font-headline); font-size: var(--f-26); line-height: 1.3; font-weight: 300; margin: 0; max-width: 34ch; text-wrap: pretty; }
.m-t3 { font-family: var(--font-headline); font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.m-t3.l { font-weight: 300; }
.m-b { font-family: var(--font-text); font-weight: 700; }   /* negrita chica: Text, no Headline (confunde i/I) */
.m-body { font-family: var(--font-text); font-size: 16px; line-height: 1.6; font-weight: 400; margin: 0; max-width: 60ch; }
.m-mute { color: var(--ink-2); }
.m-cap { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 11px; line-height: 1.2; color: var(--ink-3); font-family: var(--font-headline); }
.m-num { font-variant-numeric: tabular-nums lining-nums; }

/* ── Lámina: marco de cada pantalla ───────────────────────────── */
.m-lamina { padding: var(--space-6) var(--gutter) var(--space-8); max-width: 1040px; margin: 0 auto; }
.m-lamina--full { min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-start; gap: var(--space-5); }
.m-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding-bottom: var(--space-2); border-bottom: var(--stroke-hair) solid var(--rule); margin-bottom: var(--space-6); }
.m-head .indice { color: var(--ink-3); text-transform: uppercase; }
.m-epi { display: flex; gap: var(--space-3); align-items: baseline; margin-top: var(--space-4); max-width: 62ch; }
.m-epi .fig { flex: none; }
.m-epi .epigrafe { color: var(--ink-2); }
.m-nota { margin: var(--space-3) 0 0; font-family: var(--font-headline); font-size: 11px; font-weight: 300; color: var(--ink-3); }   /* nota al margen: «Valores de ejemplo» */
.m-pad { padding: var(--space-6) var(--gutter); }

/* ── Botones: rectángulos, sin radio ──────────────────────────── */
.m-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 52px; padding: 0 var(--space-6); font-family: var(--font-text); font-size: 16px; font-weight: 600; letter-spacing: .01em; text-decoration: none; cursor: pointer; border: var(--stroke-hair) solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 0; transition: none; }
.m-btn:hover { background: var(--paper); color: var(--ink); }
.m-btn--ghost { background: transparent; color: var(--ink); }
.m-btn--ghost:hover { background: var(--ink); color: var(--paper); }
.m-btn--inv { background: var(--negro-tinta); color: var(--negro-fondo); border-color: var(--negro-tinta); }
.m-btn--inv:hover { background: transparent; color: var(--negro-tinta); }
.m-btn--ghost-inv { background: transparent; color: var(--negro-tinta); border-color: var(--negro-tinta); }
.m-btn--ghost-inv:hover { background: var(--negro-tinta); color: var(--negro-fondo); }
.m-btn--block { width: 100%; }
.m-btn[disabled] { opacity: .35; cursor: not-allowed; }
.m-btn--text { background: none; border: 0; color: var(--ink); padding: 0; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; font-weight: 400; }
.m-btn--text:hover { background: none; color: var(--ink); text-decoration-thickness: 2px; }
.m-acciones { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* ── Formularios: línea inferior, rótulo en MAYÚSCULAS ─────────── */
.m-campo { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-6); }
.m-campo > label, .m-campo > .m-cap { color: var(--ink-3); }
.m-input { font-family: var(--font-headline); font-size: var(--f-26); font-weight: 300; color: var(--ink); background: transparent; border: 0; border-bottom: var(--stroke-hair) solid var(--ink); border-radius: 0; padding: var(--space-2) 0; min-height: 52px; width: 100%; }
.m-input:focus { outline: none; border-bottom-width: var(--stroke-restriccion); padding-bottom: calc(var(--space-2) - 1.5px); }
.m-input::placeholder { color: var(--ink-3); }
.sh-negro .m-input { color: var(--negro-tinta); border-bottom-color: var(--negro-tinta); }
.m-area { font-family: var(--font-text); font-size: 16px; line-height: 1.5; min-height: 88px; resize: vertical; }
.m-ayuda { font-family: var(--font-headline); font-size: 13px; font-weight: 300; color: var(--ink-2); margin: 0; }
.m-campo.is-error .m-input { border-bottom-width: var(--stroke-restriccion); }

/* Aviso sin color: filete grueso + rótulo + texto en peso */
.m-aviso { border-left: var(--stroke-restriccion) solid var(--ink); padding: var(--space-2) 0 var(--space-2) var(--space-4); margin: 0 0 var(--space-5); }
.m-aviso .indice { display: block; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--space-1); }
.m-aviso p { margin: 0; font-family: var(--font-text); font-weight: 700; font-size: 16px; line-height: 1.4; }
.sh-negro .m-aviso { border-left-color: var(--negro-tinta); }

/* ── Navegación: texto en MAYÚSCULAS, activo en bold con filete ── */
.m-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border-top: var(--stroke-hair) solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
.m-nav a { display: flex; align-items: center; justify-content: center; min-height: 56px; text-decoration: none; font-family: var(--font-headline); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 300; color: var(--ink-2); border-top: var(--stroke-restriccion) solid transparent; margin-top: -1px; }
.m-nav a[aria-current="page"] { font-weight: 700; color: var(--ink); border-top-color: var(--ink); }
.m-nav a:hover { color: var(--ink); }
.is-app main { padding-bottom: 72px; }
.is-app.no-nav main { padding-bottom: 0; }
@media (min-width: 900px) {
  .m-nav { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: var(--stroke-hair) solid var(--rule); max-width: 1040px; margin: 0 auto; grid-template-columns: repeat(4, max-content); gap: var(--space-7); padding: 0 var(--gutter); background: var(--paper); }
  .m-nav a { border-top: 0; border-bottom: var(--stroke-restriccion) solid transparent; margin: 0 0 -1px; min-height: 52px; }
  .m-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
  .is-app main { padding-bottom: 0; }
}

/* ── Listas: filas con filete ─────────────────────────────────── */
.m-lista { list-style: none; margin: 0; padding: 0; border-top: var(--stroke-hair) solid var(--rule); }
.m-lista > li { border-bottom: var(--stroke-hair) solid var(--rule); }
.m-fila { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4); align-items: baseline; padding: var(--space-4) 0; min-height: 64px; text-decoration: none; color: inherit; width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
a.m-fila:hover .m-fila__t, button.m-fila:hover .m-fila__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.m-fila__t { font-family: var(--font-headline); font-size: 20px; line-height: 1.2; font-weight: 300; }
.m-fila__t.r { font-weight: 700; }
.m-fila__s { display: block; margin-top: var(--space-1); font-family: var(--font-headline); font-size: 13px; font-weight: 300; color: var(--ink-2); line-height: 1.4; }
.m-fila__v { font-family: var(--font-headline); font-size: 15px; font-weight: 600; text-align: right; white-space: nowrap; }
.m-fila__v .l { font-weight: 300; color: var(--ink-3); }
.m-marca { display: inline-block; width: 10px; height: 10px; border: var(--stroke-hair) solid var(--ink); margin-right: var(--space-3); }
.m-marca.ok { background: var(--ink); }

/* Filtro por grupo: texto en MAYÚSCULAS, el activo en bold + filete */
.m-filtros { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.m-filtros button { background: none; border: 0; padding: var(--space-2) 0; min-height: 40px; cursor: pointer; font-family: var(--font-headline); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 300; color: var(--ink-2); border-bottom: var(--stroke-restriccion) solid transparent; }
.m-filtros button[aria-pressed="true"] { font-weight: 700; color: var(--ink); border-bottom-color: var(--ink); }

/* ── Bloques Dato (desde afuera) y secciones ─────────────────── */
.m-bloque { padding: var(--space-6) var(--gutter) var(--space-7); }
.m-bloque__in { max-width: 1040px; margin: 0 auto; }
.m-numero { display: inline-flex; flex-direction: column; max-width: 100%; }
.m-numero .sh-cota { margin-top: var(--space-6); }
.m-cotas { display: grid; gap: var(--space-5) var(--space-7); grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.m-dos { display: grid; gap: var(--space-7); }
@media (min-width: 760px) { .m-dos { grid-template-columns: 1fr 1fr; } }
.sh-cota .cota { background: var(--paper); }
.sh-negro .sh-cota .cota { background: var(--negro-fondo); }

/* ── Registro de series: steppers grandes (uso con una mano) ───── */
.m-reg { display: grid; gap: var(--space-5); }
.m-step { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; border-bottom: var(--stroke-hair) solid var(--ink); }
.m-step button { appearance: none; background: none; border: 0; min-height: 64px; font-family: var(--font-headline); font-size: 32px; font-weight: 200; color: var(--ink); cursor: pointer; border-radius: 0; }
.m-step button:hover { background: var(--ink); color: var(--paper); }
.m-step input { appearance: none; -moz-appearance: textfield; text-align: center; border: 0; background: transparent; color: var(--ink); font-family: var(--font-headline); font-size: var(--f-42); font-weight: 700; width: 100%; min-height: 64px; border-radius: 0; font-variant-numeric: tabular-nums; }
.m-step input::-webkit-outer-spin-button, .m-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.m-step input:focus { outline: none; }
.m-step:focus-within { border-bottom-width: var(--stroke-restriccion); }
.m-reg__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.m-reg__row .m-cap { color: var(--ink-3); }
.m-delta { font-family: var(--font-headline); font-size: 13px; font-weight: 600; color: var(--ink); min-height: 1.2em; }
.m-estado { font-family: var(--font-headline); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); min-height: 1.2em; }

/* ── Tabla de historial ───────────────────────────────────────── */
.m-tabla { width: 100%; border-collapse: collapse; font-family: var(--font-headline); font-size: 15px; font-variant-numeric: tabular-nums; }
.m-tabla th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); padding: 0 var(--space-3) var(--space-2) 0; border-bottom: var(--stroke-hair) solid var(--rule); }
.m-tabla td { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-bottom: var(--stroke-hair) solid var(--rule); font-weight: 300; }
.m-tabla td.r, .m-tabla th.r { text-align: right; padding-right: 0; }
.m-tabla tr.is-top td { font-weight: 700; }

/* ── Login / portada negra ───────────────────────────────────── */
.m-auth { min-height: 100dvh; display: flex; flex-direction: column; }
.m-auth .m-lamina { flex: 1; width: 100%; }
.m-logo { width: 96px; height: auto; margin-bottom: var(--space-8); }
.m-tabs { display: flex; gap: var(--space-6); margin-bottom: var(--space-6); }
.m-tabs button { background: none; border: 0; padding: var(--space-2) 0; min-height: 44px; cursor: pointer; color: var(--negro-tinta-2); font-family: var(--font-headline); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 300; border-bottom: var(--stroke-restriccion) solid transparent; }
.m-tabs button[aria-selected="true"] { color: var(--negro-tinta); font-weight: 700; border-bottom-color: var(--negro-tinta); }

/* ── Diálogo de confirmación: corte seco, sin sombra ──────────── */
.m-confirma { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; align-items: center; justify-content: center; padding: var(--gutter); }
.m-confirma__in { max-width: 520px; width: 100%; border: var(--stroke-restriccion) solid var(--ink); padding: var(--space-6); background: var(--paper); }

/* ── Cargando ─────────────────────────────────────────────────── */
.m-cargando { padding: var(--space-8) var(--gutter); }
.m-cargando .m-cap { color: var(--ink-3); }

/* ── Landing: secciones alternadas ───────────────────────────── */
.l-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: var(--space-5) var(--gutter); }
.l-top img { width: 96px; height: auto; }
.l-top a.m-cap { color: var(--negro-tinta); text-decoration: none; padding: var(--space-3) 0; border-bottom: var(--stroke-hair) solid var(--negro-tinta); }
.l-sec { position: relative; padding: var(--space-9) var(--gutter); }
.l-sec--portada { min-height: 100dvh; display: flex; align-items: flex-end; padding-top: 140px; padding-bottom: var(--space-8); }
.l-in { max-width: 1040px; margin: 0 auto; width: 100%; }
.l-sec .m-head { margin-bottom: var(--space-7); }
.sh-negro .m-head { border-bottom-color: var(--negro-filete); }
.sh-negro .m-head .indice { color: var(--negro-tinta-3); }
.l-pie { border-top: var(--stroke-hair) solid var(--negro-filete); margin-top: var(--space-8); padding-top: var(--space-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); }
.l-pie a { color: var(--negro-tinta-2); }
.l-iso { width: 120px; height: auto; margin-bottom: var(--space-7); }
.m-proceso { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--space-3); gap: 0; }
.m-proceso > div { padding-right: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.m-proceso .m-t3 { font-weight: 300; font-size: clamp(17px, 3.6vw, 26px); }
.m-proceso .m-t3.r { font-weight: 700; }
.m-proceso .epigrafe { color: var(--ink-2); }
@media (max-width: 640px) { .m-proceso { grid-template-columns: 1fr 1fr; row-gap: var(--space-6); } .m-riel { display: none; } }

/* ── Intro de la landing (partículas → isotipo) ───────────────── */
.intro { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity 300ms cubic-bezier(.4, 0, .2, 1); }
.intro.is-hidden { opacity: 0; pointer-events: none; }
.intro__particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.intro__iso { width: 120px; opacity: 0; animation: sh-aparece 400ms cubic-bezier(.4,0,.2,1) 900ms forwards; }
.intro__skip { position: absolute; right: var(--gutter); bottom: var(--space-6); background: none; border: 0; color: var(--negro-tinta-2); cursor: pointer; padding: var(--space-3); text-transform: uppercase; }
html:not(.js) .intro { display: none; }
@media (prefers-reduced-motion: reduce) { .intro__iso { animation: none; opacity: 1; } }

/* Retícula del puntero (solo escritorio con mouse): línea fina, sin decoración de más */
.reticula { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; }
.reticula.is-on { opacity: 1; }
.reticula__h, .reticula__v { position: absolute; background: var(--line); opacity: .45; }
.reticula__h { left: 0; right: 0; height: 1px; top: 0; }
.reticula__v { top: 0; bottom: 0; width: 1px; left: 0; }
@media (hover: none), (pointer: coarse) { .reticula { display: none; } }

/* Trazado en vivo: estado inicial antes de que el diagrama entre en pantalla */
.js .pre .tr { stroke-dasharray: var(--len, 9999); stroke-dashoffset: var(--len, 9999); }
.js .pre .ap { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .js .pre .tr { stroke-dasharray: none; stroke-dashoffset: 0; } .js .pre .ap { opacity: 1; } }

.d1 { --rd: 120ms; } .d2 { --rd: 240ms; }
.upper { text-transform: uppercase; }
.sh-svg text.indice { text-transform: uppercase; }
.sh-ecuacion .m-titulo { margin: 0; max-width: none; }
.sh-ecuacion .m-w4 { font-weight: 400; } .sh-ecuacion .m-w2 { font-weight: 200; }
.m-valores { margin-top: var(--space-8); padding-top: var(--space-4); border-top: var(--stroke-hair) solid var(--rule); }
.sh-ecuacion .op { font-weight: 200; color: var(--ink-3); }
.m-lista--sep { margin-top: var(--space-6); }

.m-auth .lead { margin-bottom: var(--space-7); }
