/* ziuton.com — rediseño 2026 basado en el diseño de Lovable (tema claro, plano técnico, acento naranja) */

:root {
	--paper: oklch(95.8% 0.011 85);
	--card: oklch(97.5% 0.008 85);
	--secondary: oklch(92% 0.012 85);
	--ink: oklch(20.5% 0 0);
	--muted: oklch(50% 0 0);
	--primary: oklch(66% 0.21 38);
	--primary-ink: oklch(52% 0.19 38); /* naranja para texto pequeño: 4.5:1 sobre papel */
	--on-primary: oklch(98.5% 0 0);
	--border: oklch(20.5% 0 0 / 0.14);
	--radius: 2px;

	/* Nombres que usan las demos de módulo */
	--accent: var(--primary);
	--accent-ink: var(--on-primary);

	--display: "Archivo", system-ui, sans-serif;
	--text: "Inter Tight", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, monospace;

	--wrap: 80rem;
	--gutter: 24px;

	/* Curvas fuertes: respuesta inmediata al entrar, movimiento natural en pantalla */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
	--t-press: 160ms;
	--t-ui: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--text);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

h1, h2, h3, .display {
	font-family: var(--display);
	font-weight: 900;
	letter-spacing: -0.035em;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.dot { color: var(--primary); }
.label {
	font-family: var(--mono);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}
/* Textos largos en la fuente de texto, tipo frase: la mono queda para lo corto (FIG., números, años) */
.kicker { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.caption { font-size: 0.875rem; color: var(--muted); }
.label b { font-weight: 400; color: var(--primary-ink); }
.contact .label b, .marquee .label b { color: var(--primary); }

.skip {
	position: fixed; left: var(--gutter); top: 8px; z-index: 60;
	padding: 10px 14px; background: var(--ink); color: var(--paper);
	transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Cabecera ---------- */
.site-head {
	position: sticky; top: 0; z-index: 40;
	background: color-mix(in oklch, var(--paper) 92%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.site-head__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.logo { font-family: var(--display); font-weight: 900; font-size: 1.125rem; letter-spacing: -0.02em; }
.nav { display: flex; gap: 28px; font-size: 0.875rem; }
.nav a { color: var(--muted); transition: color var(--t-ui) ease; }
.nav a[aria-current="page"] {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 8px;
}
.lang { display: flex; border: 1px solid var(--border); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; }
.lang > * { padding: 4px 10px; }
.lang [aria-current="true"] { background: var(--ink); color: var(--paper); }
.lang [aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.nav-mobile { display: none; }

/* ---------- Botones ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 20px;
	font-size: 0.875rem; font-weight: 600;
	border: 1px solid var(--ink);
	transition: background-color var(--t-ui) ease, color var(--t-ui) ease, border-color var(--t-ui) ease, transform var(--t-press) var(--ease-out);
}
.btn--solid { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(0.97); }
.arrow { display: inline-block; transition: transform var(--t-ui) var(--ease-out); }

/* Hover solo con puntero fino: en táctil el tap dispara hovers falsos */
@media (hover: hover) and (pointer: fine) {
	.nav a:hover { color: var(--ink); }
	.btn--solid:hover { background: var(--primary); border-color: var(--primary); }
	.btn--line:hover { border-color: var(--primary); color: var(--primary); }
	.btn:hover .arrow, .link-row:hover .arrow, .card:hover .arrow, .more:hover .arrow { transform: translateX(4px); }
	.link-row:hover, .more:hover, .card:hover .card__name { color: var(--primary); }
	.card:hover .fig { border-color: color-mix(in oklch, var(--ink) 40%, transparent); }
	.build__btn:hover .build__name { color: var(--primary); }
	.marquee:hover .marquee__track { animation-play-state: paused; }
}

/* ---------- Bloques comunes ---------- */
.section { padding-block: 80px; }
.sec-head {
	display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px;
	border-top: 1px solid var(--border);
	padding-top: 24px;
}
.sec-head .label { grid-column: span 3; }
.sec-head__body { grid-column: span 9; }
.sec-head h2 { font-size: clamp(2.25rem, 4.2vw, 3.75rem); line-height: 0.95; }
.sec-head__body p { margin-top: 20px; max-width: 42rem; font-size: 1.125rem; color: var(--muted); }

.page-head { padding-top: 96px; padding-bottom: 48px; }
.page-head h1 { margin-top: 16px; font-size: clamp(2.5rem, 8vw, 7rem); line-height: 0.9; }

.grid-paper {
	background-color: var(--card);
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 48px 48px;
}
.fig {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--border);
	transition: border-color var(--t-ui) ease;
}
.fig__label { position: absolute; left: 12px; top: 12px; z-index: 2; }
.fig--43 { aspect-ratio: 4 / 3; }

.link-row {
	display: flex; justify-content: space-between; align-items: baseline;
	padding-block: 16px;
	border-bottom: 1px solid var(--border);
	font-family: var(--display); font-weight: 700; font-size: 1.5rem;
	transition: color var(--t-ui) ease;
}
.more { display: inline-flex; gap: 6px; margin-top: 16px; transition: color var(--t-ui) ease; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px; padding-top: 80px; padding-bottom: 64px; }
.hero__copy { grid-column: span 8; }
.hero h1 { margin-top: 24px; font-size: clamp(3.75rem, 9.4vw, 8.5rem); line-height: 0.88; }
.hero__lead { margin-top: 32px; max-width: 36rem; font-size: 1.5rem; line-height: 1.3; }
.hero__cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.portrait { grid-column: span 4; align-self: start; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; border: 1px solid var(--border); background: var(--secondary); }
.portrait figcaption { margin-top: 8px; display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Cifras ---------- */
.stats { border-block: 1px solid var(--border); }
.stats__row { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 32px var(--gutter); border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat__n { font-family: var(--display); font-weight: 900; font-size: 3rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__desc { display: block; margin-top: 8px; font-size: 0.875rem; line-height: 1.35; color: var(--muted); }

/* ---------- Lo que construyo ---------- */
.build { margin-top: 48px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px; }
.build__list { grid-column: span 5; }
.build__item { border-bottom: 1px solid var(--border); }
.build__btn { display: flex; width: 100%; align-items: baseline; gap: 16px; padding-block: 20px; text-align: left; }
.build__btn .label { width: 24px; flex: none; }
.build__name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; transition: color var(--t-ui) ease; }
.build__btn[aria-expanded="true"] .build__name { color: var(--primary); }
/* El texto se abre a su altura real sin medir en JS */
.build__panel {
	display: grid; grid-template-rows: 0fr;
	transition: grid-template-rows 260ms var(--ease-out);
}
.build__panel > div { min-height: 0; overflow: hidden; }
.build__panel p { padding: 0 0 24px 40px; color: var(--muted); opacity: 0; transition: opacity 200ms ease; }
.build__btn[aria-expanded="true"] + .build__panel { grid-template-rows: 1fr; }
.build__btn[aria-expanded="true"] + .build__panel p { opacity: 1; transition-delay: 60ms; }
.build__fig { grid-column: span 7; }
.build__fig svg { width: 100%; height: auto; aspect-ratio: 560 / 440; }

/* Diagramas (los dibuja diagrams.js) */
.dg-box rect { stroke-width: 1; transition: fill var(--t-ui) ease, stroke var(--t-ui) ease; }
.dg-t { font-family: var(--display); font-size: 12px; font-weight: 700; text-anchor: middle; transition: fill var(--t-ui) ease; }
.dg-s { font-family: var(--mono); font-size: 9px; text-anchor: middle; }
.dg-ink rect { fill: var(--ink); }
.dg-ink .dg-t, .dg-ink .dg-s { fill: var(--paper); }
.dg-paper rect { fill: var(--paper); stroke: color-mix(in oklch, var(--ink) 45%, transparent); }
.dg-paper .dg-t { fill: var(--ink); }
.dg-paper .dg-s { fill: var(--muted); }
.dg-accent rect { fill: var(--primary); }
.dg-accent .dg-t, .dg-accent .dg-s { fill: var(--on-primary); }
.dg-accent .dg-t { font-size: 14px; font-weight: 900; }
.dg-dash rect { fill: var(--paper); stroke: var(--primary); stroke-dasharray: 4 3; }
.dg-dash .dg-t { fill: var(--primary-ink); }
.dg-s--accent { fill: var(--primary-ink); }
.dg-s--left { text-anchor: start; fill: var(--muted); }
.dg-progress { fill: var(--primary); transform-box: fill-box; transform-origin: left; }
.dg-pill rect { fill: var(--paper); stroke: var(--border); }
.dg-pill text { fill: var(--muted); font-family: var(--mono); font-size: 10px; text-anchor: middle; }
.dg-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--muted); }
.dg-tag--accent { fill: var(--primary-ink); }
.dg-wire { fill: none; stroke: color-mix(in oklch, var(--ink) 35%, transparent); stroke-width: 1.25; stroke-dasharray: 3 4; }
.dg-wire.solid { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: none; }
.dg-wire.dash { stroke-dasharray: 4 4; }
.dg-pulse { fill: var(--primary); }
.dg-frame, .dg-cap rect { fill: var(--paper); stroke: var(--border); }
.dg-cap-title { font-family: var(--display); font-size: 15px; font-weight: 700; fill: var(--ink); }
.dg-cap-text { font-family: var(--text); font-size: 13px; fill: var(--muted); }
.dg-cap-title, .dg-cap-text, .dg-s { transition: opacity 170ms ease, filter 170ms ease; }
/* El desenfoque une el texto viejo y el nuevo en un solo cambio */
.dg-swap { opacity: 0; filter: blur(2px); }
.dg-pick { cursor: pointer; }
.dg-pick:focus-visible { outline: none; }
.dg-pick:focus-visible rect { stroke: var(--primary); stroke-width: 2; }
.dg-pick.is-active rect { fill: var(--primary); }
.dg-pick.is-active .dg-t { fill: var(--ink); }
.dg-spark { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 260; }
.dg-sync__arc { fill: none; stroke: var(--paper); stroke-width: 1.5; stroke-linecap: round; }
.dg-sync { transform-box: fill-box; transform-origin: center; }
.dg-bar { fill: var(--ink); transform-box: fill-box; transform-origin: bottom; }
.dg-bar--accent { fill: var(--primary); }
.dg-line-chart { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 300; }
.dg-loop { stroke-dasharray: none; stroke: color-mix(in oklch, var(--ink) 45%, transparent); }
.dg-step { fill: var(--ink); }
.dg-step__t { fill: var(--paper); font-family: var(--display); font-size: 12px; font-weight: 700; text-anchor: middle; }
@media (hover: hover) and (pointer: fine) {
	.dg-pick:not(.is-active):hover rect { fill: color-mix(in oklch, var(--ink) 80%, var(--primary)); }
}

/* ---------- Marquesina ---------- */
.marquee { background: var(--ink); color: var(--paper); padding-block: 24px; border-block: 1px solid var(--border); overflow: hidden; }
.marquee .label { color: oklch(72% 0 0); margin-bottom: 16px; }
.marquee__track {
	display: flex; width: max-content;
	white-space: nowrap;
	font-family: var(--display); font-weight: 900; letter-spacing: -0.03em;
	font-size: clamp(2.25rem, 4.6vw, 3.75rem);
}
.marquee__track span { margin-right: 40px; }
.marquee__track span::after { content: "/"; margin-left: 40px; color: var(--primary); }

/* ---------- Maia Suite en vivo ---------- */
.suite-wrap { margin-top: 40px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; }
.suite-wrap > .fig { grid-column: span 7; }
.suite-links { grid-column: span 5; display: flex; flex-direction: column; justify-content: flex-end; }
/* Prueba real junto al producto: la foto de la inversión */
.proof { margin-bottom: 24px; }
.proof img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); background: var(--secondary); }
.proof figcaption { margin-top: 8px; }
.project__copy .proof { margin: 24px 0 0; }
.suite { display: grid; grid-template-columns: max-content 1fr; gap: 16px; padding: 44px 16px 16px; }
.suite__tabs { display: grid; align-content: center; gap: 8px; }
.suite__tab {
	display: flex; align-items: center; gap: 8px;
	padding: 8px 10px;
	border: 1px solid var(--border);
	background: var(--paper);
	font-size: 0.875rem; text-align: left; white-space: nowrap;
	transition: border-color var(--t-ui) ease, color var(--t-ui) ease, transform var(--t-press) var(--ease-out);
}
.suite__tab::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--muted); transition: background-color var(--t-ui) ease; }
.suite__tab[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }
.suite__tab[aria-selected="true"]::before { background: var(--primary); }
.suite__tab:active { transform: scale(0.97); }
.suite__tab--static { color: var(--muted); cursor: default; }
.suite__tab--static:active { transform: none; }
.suite__stage { position: relative; display: grid; aspect-ratio: 4 / 3; }
.suite__stage > .frag {
	grid-area: 1 / 1;
	opacity: 0; filter: blur(4px); visibility: hidden;
	transition: opacity 220ms ease, filter 220ms ease, visibility 0s linear 220ms;
}
/* El desenfoque une los dos estados del cambio: se lee como una sola transformación */
.suite__stage > .frag.is-active { opacity: 1; filter: none; visibility: visible; transition-delay: 0s; }
@media (hover: hover) and (pointer: fine) {
	.suite__tab:not(.suite__tab--static):hover { border-color: var(--ink); }
}

/* ---------- Sistemas en uso (figuras) ---------- */
.cards { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { display: block; }
.card__name { margin-top: 12px; display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; transition: color var(--t-ui) ease; }

.f-tm { position: absolute; inset: 0; display: grid; grid-template-columns: 34% 1fr; gap: 16px; padding: 44px 20px 20px; }
.f-tm__left { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.f-tm__left .f-time__face { width: 5.5rem; height: 6.5rem; margin-inline: 0; }
.f-tm__right { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
/* Calendario de horarios por turno */
.f-cal { padding: 10px; border: 1px solid color-mix(in oklch, var(--ink) 45%, transparent); background: var(--paper); }
.f-cal__title { font-family: var(--mono); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.f-cal__grid { display: grid; grid-template-columns: 34px repeat(5, 1fr); gap: 4px; align-items: center; font-family: var(--mono); font-size: 9px; }
.f-cal__grid > span:not(.f-cal__c):not(.f-cal__t) { color: var(--muted); text-align: center; }
.f-cal__t { color: var(--muted); }
.f-cal__c { display: flex; height: 18px; background: var(--secondary); }
/* Todos los turnos miden lo mismo; la extra crece hacia la derecha, fuera del horario */
.f-cal__c .sh { width: 72%; flex: none; background: var(--ink); }
.f-cal__c .sh--b { background: color-mix(in oklch, var(--ink) 35%, transparent); }
.f-cal__c .x { width: 22%; flex: none; background: var(--primary); transform-origin: left; }
/* Aprobación de horas extra */
.f-ot { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); background: var(--paper); }
.f-ot p { display: grid; line-height: 1.25; }
.f-ot b { font-family: var(--display); font-weight: 700; font-size: 11px; }
.f-ot small { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.f-ot__state { display: grid; font-family: var(--mono); font-size: 9px; }
.f-ot__state em { grid-area: 1 / 1; font-style: normal; padding: 2px 6px; }
.f-ot__state .pend { background: var(--secondary); color: var(--muted); opacity: 0; }
.f-ot__state .ok { background: var(--ink); color: var(--paper); }
.f-ot__btn { padding: 4px 10px; font-family: var(--display); font-weight: 700; font-size: 9px; border: 1px solid var(--ink); }
.f-time__face { position: relative; width: 7rem; height: 8rem; margin-inline: auto; border: 2px solid var(--ink); overflow: hidden; }
.f-time__face svg { width: 100%; height: 100%; }
.f-time__scan { position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--primary); }
.f-time__log { display: grid; gap: 8px; font-family: var(--mono); font-size: 9px; }
.f-time__log span { padding: 4px 8px; border-left: 2px solid var(--primary); background: var(--paper); }

.f-jp {
	position: absolute; inset: 0;
	display: grid; grid-template-columns: 38% 12% 1fr; align-items: center; gap: 12px;
	padding: 44px 20px 20px;
}
.f-card { padding: 12px; border: 1px solid color-mix(in oklch, var(--ink) 45%, transparent); background: var(--paper); }
.f-card__head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.f-ava { width: 30px; height: 30px; flex: none; background: var(--ink); }
.f-card__head p { display: grid; line-height: 1.2; }
.f-card__head b { font-family: var(--display); font-weight: 700; font-size: 11px; }
.f-card__head small { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.f-card dl { margin: 10px 0 0; display: grid; gap: 6px; font-family: var(--mono); font-size: 9px; }
.f-card dl div { display: flex; justify-content: space-between; gap: 8px; }
.f-card dt { color: var(--muted); }
.f-card dd { margin: 0; color: var(--ink); }
/* Flujo: los datos de la ficha viajan hacia las plantillas */
.f-flow { position: relative; height: 2px; background: color-mix(in oklch, var(--ink) 30%, transparent); }
.f-flow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--ink); border-right: 0; }
.f-flow i { position: absolute; left: 0; right: 0; top: -3px; height: 8px; }
.f-flow i::before { content: ""; position: absolute; left: -4px; width: 8px; height: 8px; background: var(--primary); }
.f-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-doc { position: relative; display: grid; gap: 4px; padding: 10px 8px 8px; border: 1px solid var(--border); background: var(--paper); }
.f-doc__bar { width: 40%; height: 4px; background: var(--primary); margin-bottom: 2px; }
.f-doc b { font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 1.15; }
.f-doc i { display: block; height: 3px; background: color-mix(in oklch, var(--muted) 35%, transparent); }
.f-doc i:nth-of-type(2) { width: 80%; }
.f-doc i:nth-of-type(3) { width: 55%; }
.f-doc em {
	position: absolute; right: 6px; top: -8px;
	padding: 1px 6px;
	background: var(--ink); color: var(--paper);
	font-family: var(--mono); font-size: 9px; font-style: normal;
	opacity: 0;
}

.f-route { position: absolute; inset: 0; width: 100%; height: 100%; }
.f-route .path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 5; }
.f-route .stop { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.f-route .truck { fill: var(--primary); }
.f-ticket { position: absolute; right: 20px; bottom: 20px; width: 6.5rem; padding: 8px; border: 1px solid var(--border); background: var(--paper); font-family: var(--mono); font-size: 9px; line-height: 1.5; }
.f-ticket .total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); color: var(--primary); }

.f-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.f-map .land { fill: var(--secondary); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.f-map .pin { fill: var(--primary); }
.f-map .ring { fill: none; stroke: var(--primary); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }

/* ---------- Experiencia (resumen) ---------- */
.xp { margin-top: 40px; }
.xp__row { display: grid; grid-template-columns: repeat(12, 1fr); align-items: baseline; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--border); }
.xp__row .label { grid-column: span 3; color: var(--primary-ink); }
.xp__co { grid-column: span 5; font-family: var(--display); font-weight: 900; font-size: 1.875rem; letter-spacing: -0.03em; }
.xp__role { grid-column: span 4; text-align: right; color: var(--muted); }

/* ---------- Contacto ---------- */
.contact { background: var(--ink); color: var(--paper); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding-block: 80px; }
.contact h2 { margin-top: 16px; font-size: clamp(3rem, 6vw, 4.5rem); }
.contact .label { color: oklch(72% 0 0); }
.contact .link-row { border-color: color-mix(in oklch, var(--paper) 20%, transparent); }
.contact .link-row .label { font-family: var(--mono); }

.site-foot { border-top: 1px solid var(--border); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 8px; padding-block: 32px; }

/* ---------- Páginas internas ---------- */
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px; padding-bottom: 80px; }
.about .portrait { grid-column: span 4; }
.about__copy { grid-column: span 8; }
.about__lead { font-family: var(--display); font-weight: 700; font-size: 1.875rem; line-height: 1.2; letter-spacing: -0.02em; }
.about__body { margin-top: 24px; max-width: 46rem; color: var(--muted); font-size: 1rem; }
.chips { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 10px; border: 1px solid var(--border); font-size: 0.875rem; }

.certs { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); }
.cert { padding: 24px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cert:nth-child(2n) { border-right: 0; }
.cert:nth-last-child(-n + 2) { border-bottom: 0; }
.cert h3 { margin-top: 12px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.cert .label:last-child { display: block; margin-top: 12px; }

.job { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; padding-block: 40px; border-top: 1px solid var(--border); }
.job .label { grid-column: span 3; color: var(--primary-ink); }
.job__head { grid-column: span 4; }
.job__head h2 { font-size: 1.875rem; line-height: 1; }
.job__head p { margin-top: 12px; color: var(--muted); }
.job ul { grid-column: span 5; display: grid; gap: 12px; }
.job li { position: relative; padding-left: 20px; }
.job li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; background: var(--primary); }

.project { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; gap: 32px; padding-top: 32px; border-top: 1px solid var(--border); }
.project + .project { margin-top: 80px; }
.project > .fig, .project > .suite-fig { grid-column: span 7; }
.project__copy { grid-column: span 5; }
.project--flip > .fig, .project--flip > .suite-fig { order: 2; }
.project__copy h2 { margin-top: 12px; font-size: 3rem; line-height: 0.95; }
.project__copy p:not(.label) { margin-top: 16px; color: var(--muted); font-size: 1rem; }
.project__copy .link-row { font-size: 1.5rem; }

.archive { margin-top: 32px; }
.archive__row { display: grid; grid-template-columns: 4fr 5fr 3fr; align-items: baseline; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--border); }
.archive__row h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.archive__row span:last-child { text-align: right; }
.archive__row .client { color: var(--muted); }

.contact-page .page-head p:not(.label) { margin-top: 16px; color: var(--muted); font-size: 1.125rem; }
.contact-list { padding-bottom: 96px; border-top: 1px solid var(--border); }
.contact-list a {
	display: grid; grid-template-columns: 3fr 8fr 1fr; align-items: center;
	padding-block: 24px;
	border-bottom: 1px solid var(--border);
	transition: color var(--t-ui) ease;
}
.contact-list .value { font-family: var(--display); font-weight: 900; letter-spacing: -0.03em; font-size: clamp(1.75rem, 4.4vw, 3.5rem); line-height: 1; overflow-wrap: anywhere; }
.contact-list .arrow { justify-self: end; font-size: 1.5rem; }
@media (hover: hover) and (pointer: fine) {
	.contact-list a:hover { color: var(--primary); }
	.contact-list a:hover .arrow { transform: translate(3px, -3px); }
}

/* ---------- Teléfono y tableta ---------- */
@media (max-width: 767px) {
	:root { --gutter: 16px; }
	.nav { display: none; }
	.nav-mobile {
		display: flex; gap: 20px; overflow-x: auto;
		padding: 8px var(--gutter);
		border-top: 1px solid var(--border);
		font-size: 0.75rem; white-space: nowrap;
	}
	.nav-mobile a { color: var(--muted); }
	.nav-mobile a[aria-current="page"] { color: var(--primary-ink); }
	.section { padding-block: 64px; }
	.hero, .build, .suite-wrap, .about, .project, .xp__row, .job, .sec-head { grid-template-columns: 1fr; }
	.hero > *, .build > *, .suite-wrap > *, .about > *, .project > *, .job > *, .sec-head > * { grid-column: 1 / -1 !important; }
	.hero { padding-top: 48px; gap: 32px; }
	.hero__lead { font-size: 1.125rem; }
	/* JanusTime y JanusPeople se apilan: la figura crece hacia abajo en lugar de recortarse */
	.fig--43:has(.f-tm), .fig--43:has(.f-jp) { aspect-ratio: auto; }
	.f-tm, .f-jp { position: relative; inset: auto; grid-template-columns: 1fr; gap: 14px; padding: 44px 16px 16px; }
	.f-tm__left { flex-direction: row; align-items: center; gap: 16px; }
	.f-tm__left .f-time__face { width: 4.5rem; height: 5.25rem; flex: none; }
	.f-tm__left .f-time__log { flex: 1; }
	.f-flow { width: 2px; height: 24px; justify-self: center; }
	.f-flow::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
	.f-flow i { display: none; }
	.portrait { max-width: 24rem; }
	.stats__row { grid-template-columns: 1fr 1fr; }
	.stat:nth-child(2) { border-right: 0; }
	.stat:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
	.suite { grid-template-columns: 1fr; padding: 40px 12px 12px; }
	/* Las pestañas bajan de línea: una fila cortada en el borde se lee como recortada, no como desplazable */
	.suite__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
	.suite__tab { flex: none; }
	.cards, .certs { grid-template-columns: 1fr; }
	.cert { border-right: 0; }
	.cert:nth-last-child(2) { border-bottom: 1px solid var(--border); }
	.xp__row { gap: 4px; }
	.xp__role { text-align: left; }
	.contact__grid { grid-template-columns: 1fr; padding-block: 64px; }
	.project--flip > .fig, .project--flip > .suite-fig { order: 0; }
	.archive__row { grid-template-columns: 1fr auto; }
	.archive__row .client { grid-row: 2; }
	.contact-list a { grid-template-columns: 1fr auto; row-gap: 6px; }
	.contact-list .label { grid-column: 1 / -1; }
	.page-head { padding-top: 56px; }
	.site-foot .wrap { flex-direction: column; }
}

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
	/* Entradas: suben poco y aparecen, escalonadas 60 ms; solo una vez */
	.js .rise {
		opacity: 0;
		translate: 0 14px;
		transition: opacity 600ms ease, translate 700ms var(--ease-out);
		transition-delay: calc(var(--i, 0) * 60ms);
	}
	.js .rise.in { opacity: 1; translate: 0 0; }

	.marquee__track { animation: marquee 32s linear infinite; }

	/* Figuras de sistemas: loops decorativos, se pausan fuera de pantalla */
	.f-time__scan { animation: scan 2.4s var(--ease-in-out) infinite; }
	/* JanusTime: el turno del martes se alarga, la extra queda pendiente y se aprueba */
	.f-cal__c .x { animation: ot-grow 6s var(--ease-out) infinite; }
	.f-ot__state .pend { animation: ot-pend 6s linear infinite; }
	.f-ot__state .ok { animation: ot-ok 6s var(--ease-out) infinite; }
	.f-ot__btn { animation: ot-btn 6s var(--ease-out) infinite; }
	.f-time__log span { animation: slidein 4s ease-in-out infinite both; }
	.f-time__log span:nth-child(2) { animation-delay: 0.5s; }
	.f-time__log span:nth-child(3) { animation-delay: 1s; }
	.f-time__log span:nth-child(4) { animation-delay: 1.5s; }
	/* Los documentos siempre se ven; uno a la vez se genera y se destaca */
	.f-flow i { animation: flow 1.2s var(--ease-in-out) infinite; }
	.f-doc em { animation: stamp 4.8s var(--ease-out) infinite; }
	.f-doc:nth-child(2) em { animation-delay: 1.2s; }
	.f-doc:nth-child(3) em { animation-delay: 2.4s; }
	.f-doc:nth-child(4) em { animation-delay: 3.6s; }
	.f-doc { animation: doc-pop 4.8s var(--ease-out) infinite; }
	.f-doc:nth-child(2) { animation-delay: 1.2s; }
	.f-doc:nth-child(3) { animation-delay: 2.4s; }
	.f-doc:nth-child(4) { animation-delay: 3.6s; }
	.f-ticket { animation: print 4s ease-in-out infinite; animation-delay: 1s; }
	.f-map .ring { animation: ping 2.4s var(--ease-out) infinite; }
	.f-map g:nth-of-type(2) .ring { animation-delay: 0.5s; }
	.f-map g:nth-of-type(3) .ring { animation-delay: 1s; }
	.f-map g:nth-of-type(4) .ring { animation-delay: 1.5s; }
	.f-map g:nth-of-type(5) .ring { animation-delay: 2s; }
	.is-off, .is-off * { animation-play-state: paused !important; }

	/* Diagrama: los cables aparecen y los nodos entran escalonados al cambiar de especialidad */
	.dg-enter .dg-wire { opacity: 0; animation: fade-in 420ms ease-out 80ms forwards; }
	.dg-enter .dg-node { opacity: 0; animation: node-in 360ms var(--ease-out) forwards; animation-delay: calc(100ms + var(--i, 0) * 30ms); }
	.dg-enter .dg-bar { transform: scaleY(0); animation: grow-y 700ms var(--ease-out) forwards; animation-delay: calc(300ms + var(--i, 0) * 60ms); }
	.dg-enter .dg-line-chart { stroke-dashoffset: 300; animation: draw 900ms var(--ease-out) 500ms forwards; }
	.dg-leave { opacity: 0; transition: opacity 120ms ease; }
	/* Loops que explican: el módulo en obra avanza, la traza de performance corre, el reloj sincroniza */
	.dg-progress { animation: build-up 3.2s var(--ease-in-out) infinite; }
	.dg-spark { animation: spark 3s linear infinite; }
	.dg-sync { animation: spin 2.4s linear infinite; }
}
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(118px); } }
@keyframes slidein { 0% { opacity: 0; transform: translateX(-12px); } 15%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes flow { from { transform: translateX(0); opacity: 0; } 20%, 80% { opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes stamp { 0%, 6%, 30%, 100% { opacity: 0; transform: translateY(3px); } 10%, 24% { opacity: 1; transform: none; } }
@keyframes ot-grow { 0%, 12% { transform: scaleX(0); } 28%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes ot-pend { 0%, 28% { opacity: 0; } 32%, 56% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes ot-ok { 0%, 58% { opacity: 0; transform: translateY(3px); } 62%, 92% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes ot-btn { 0%, 52% { transform: none; background: transparent; color: var(--ink); } 55% { transform: scale(0.94); background: var(--primary); border-color: var(--primary); color: var(--on-primary); } 62%, 100% { transform: none; background: transparent; color: var(--ink); } }
@keyframes doc-pop { 0%, 30%, 100% { transform: none; border-color: var(--border); } 8%, 22% { transform: translateY(-8px); border-color: var(--ink); } }
@keyframes print { 0% { clip-path: inset(0 0 100% 0); } 60%, 100% { clip-path: inset(0); } }
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes node-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes grow-y { to { transform: scaleY(1); } }
@keyframes build-up { 0% { transform: scaleX(0.08); } 70%, 100% { transform: scaleX(1); } }
@keyframes spark { 0% { stroke-dashoffset: 260; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Movimiento reducido: menos y más suave, no cero. Se queda el fundido, se va el desplazamiento. */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .rise { opacity: 0; transition: opacity 300ms ease; }
	.js .rise.in { opacity: 1; }
	.marquee__track { flex-wrap: wrap; width: auto; row-gap: 8px; padding-inline: var(--gutter); font-size: 2rem; }
	.marquee__track [aria-hidden="true"] { display: none !important; }
	.f-doc em { opacity: 1; }
	.dg-pulse { display: none; }
}
.f-map__city { font-family: var(--mono); font-size: 9px; fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
