/* ==========================================================
   Kilómetro 88 — estilos
   Concepto: el hito kilométrico. Asfalto, línea vial y señal.
   Layout 100 % Flexbox.
   ========================================================== */

:root {
	--asfalto: #24282B;
	--asfalto-2: #33393D;
	--vial: #F5B800;
	--hito: #F8F8F5;
	--hormigon: #E2E4E0;
	--suave: #5B6166;

	--f-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
	--f-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

	--wrap: 1240px;
	--pad: clamp(1.25rem, 4vw, 3rem);
	--gap: clamp(1rem, 2.5vw, 2rem);
	--radius: 4px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font: 400 1.0625rem/1.65 var(--f-body);
	color: var(--asfalto);
	background: var(--hito);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--vial); }
:focus-visible { outline: 3px solid var(--asfalto); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: .98; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(3rem, 8.5vw, 7rem); }
h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--vial); padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- Botones ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: .9rem 1.6rem; border: 2px solid transparent; border-radius: var(--radius);
	font: 700 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}
.btn--vial { background: var(--vial); color: var(--asfalto); }
.btn--vial:hover { background: #ffc91f; }
.btn--line { border-color: var(--hito); color: var(--hito); }
.btn--line:hover { background: var(--hito); color: var(--asfalto); }
.btn--dark { background: var(--asfalto); color: var(--hito); }
.btn--dark:hover { background: var(--vial); color: var(--asfalto); }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--hito); border-bottom: 1px solid var(--hormigon); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand__logo { height: 2.25rem; width: auto; }
.brand__text { font: 900 2rem/1 var(--f-display); letter-spacing: .02em; }
.brand__text b { background: var(--vial); padding: 0 .2em; margin-left: .1em; border-radius: 2px; }

.nav__list { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.nav a { display: block; padding: .35rem 0; font-weight: 500; text-decoration: none; box-shadow: inset 0 -3px 0 transparent; transition: box-shadow .2s; }
.nav a:hover, .nav .current-menu-item a { box-shadow: inset 0 -3px 0 var(--vial); }

.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle i, .nav-toggle i::before, .nav-toggle i::after { display: block; width: 1.5rem; height: 2px; background: var(--asfalto); position: relative; transition: transform .2s, background-color .2s; }
.nav-toggle i::before, .nav-toggle i::after { content: ''; position: absolute; left: 0; }
.nav-toggle i::before { top: -7px; }
.nav-toggle i::after { top: 7px; }
.nav-toggle[aria-expanded="true"] i { background: transparent; }
.nav-toggle[aria-expanded="true"] i::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--hito); border-bottom: 1px solid var(--hormigon); padding: .5rem var(--pad) 1.25rem; }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav a { padding: .85rem 0; font-size: 1.15rem; }
}

/* ---------- Ruta (línea vial) ---------- */
.ruta {
	height: 2rem;
	background:
		repeating-linear-gradient(90deg, var(--vial) 0 3rem, transparent 3rem 6rem) center / 100% 4px no-repeat,
		var(--asfalto-2);
}

/* ---------- Hero ---------- */
.hero { background: var(--asfalto); color: var(--hito); overflow: hidden; }
.hero__in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 4rem; padding-top: clamp(3rem, 8vw, 6.5rem); }
.hero__text { flex: 1 1 520px; padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { max-width: 12ch; }
.hero__lead { max-width: 52ch; margin: 1.5rem 0 2rem; color: #D6D9D4; font-size: 1.15rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__hito { flex: 0 0 auto; margin-inline: auto; }

/* El hito: poste con la parte superior redondeada */
.hito {
	display: flex; flex-direction: column; align-items: center;
	width: clamp(11rem, 22vw, 17rem);
	padding: clamp(1.4rem, 3vw, 2.2rem) 1rem 1rem;
	border-radius: 999px 999px 0 0;
	background: linear-gradient(var(--vial) 0 32%, var(--hito) 32%);
	color: var(--asfalto);
	box-shadow: inset 0 -10px 0 var(--hormigon);
	text-align: center;
}
.hito__km { font: 800 clamp(1.5rem, 3vw, 2.2rem)/1 var(--f-display); text-transform: lowercase; margin-bottom: clamp(.8rem, 2vw, 1.4rem); }
.hito__n { font: 900 clamp(5.5rem, 13vw, 10rem)/.85 var(--f-display); font-variant-numeric: tabular-nums; min-width: 2ch; }
.hito__desde { font: 700 .95rem/1 var(--f-body); margin: 1rem 0 .75rem; color: var(--suave); }

/* ---------- Secciones ---------- */
.sec { padding-block: clamp(3.5rem, 8vw, 7rem); scroll-margin-top: 4.5rem; }
.sec--flush { padding-top: 0; }
.sec--tint { background: var(--hormigon); }
.sec--dark { background: var(--asfalto); color: var(--hito); }
.sec__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.sec__more { display: flex; justify-content: center; margin: clamp(2rem, 5vw, 3.5rem) 0 0; }

.filtros { display: flex; flex-wrap: wrap; gap: .5rem; }
.filtros a { padding: .5rem 1rem; border: 2px solid var(--asfalto); border-radius: var(--radius); font-weight: 700; font-size: .95rem; text-decoration: none; }
.filtros a:hover { background: var(--vial); border-color: var(--vial); }
.filtros a.is-on { background: var(--asfalto); color: var(--hito); }

/* ---------- Proyectos ---------- */
.proyectos { display: flex; flex-wrap: wrap; gap: clamp(2rem, 4vw, 3rem) var(--gap); }
.card { flex: 0 1 calc((100% - 2 * var(--gap)) / 3); min-width: 0; }
.card__link { display: block; text-decoration: none; }
.card__img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--hormigon); border-radius: var(--radius); }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__title { margin-top: .9rem; text-decoration: underline 3px transparent; text-underline-offset: .15em; transition: text-decoration-color .2s; }
.card__link:hover .card__title, .card__link:focus-visible .card__title { text-decoration-color: var(--vial); }
.card__meta { display: flex; justify-content: space-between; gap: 1rem; margin: .35rem 0 0; font-size: .95rem; color: var(--suave); }

@media (min-width: 901px) {
	.proyectos--home .card:first-child { flex-basis: 100%; }
	.proyectos--home .card:first-child .card__img { aspect-ratio: 21 / 9; }
	.proyectos--home .card:first-child .card__title { font-size: clamp(2.2rem, 4vw, 3.2rem); }
}
@media (max-width: 900px) { .card { flex-basis: calc((100% - var(--gap)) / 2); } }
@media (max-width: 560px) { .card { flex-basis: 100%; } }

/* ---------- Servicios ---------- */
.servicios li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 3rem; padding-block: 1.6rem; border-top: 2px solid var(--asfalto); }
.servicios li:last-child { border-bottom: 2px solid var(--asfalto); }
.servicios h3 { flex: 1 1 320px; font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.servicios p { flex: 1 1 360px; max-width: 52ch; margin: 0; }

/* ---------- Proceso (secuencia real, por eso numerado) ---------- */
.pasos { display: flex; flex-wrap: wrap; gap: var(--gap); counter-reset: paso; }
.pasos li { flex: 1 1 220px; counter-increment: paso; border-top: 8px solid var(--vial); padding-top: 1rem; }
.pasos li::before { content: counter(paso); display: block; font: 900 3.5rem/1 var(--f-display); margin-bottom: .5rem; }
.pasos h3 { margin-bottom: .5rem; }
.pasos p { color: var(--suave); margin: 0; }

/* ---------- Nosotros ---------- */
.nosotros { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem clamp(2rem, 6vw, 5rem); }
.nosotros__img { flex: 1 1 340px; margin: 0; }
.nosotros__img img { width: 100%; border-radius: var(--radius); }
.nosotros__text { flex: 1 1 420px; max-width: 60ch; }
.nosotros__text h2 { margin-bottom: 1.25rem; }

/* ---------- Clientes ---------- */
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); }
.logos li { flex: 0 0 auto; }
.logos img { height: 3.5rem; width: auto; mix-blend-mode: multiply; }

/* ---------- Testimonios ---------- */
.quotes { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding: .25rem var(--pad) 1.5rem; scroll-padding-inline: var(--pad); }
.quote { flex: 0 0 min(32rem, 86%); scroll-snap-align: start; margin: 0; padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--hito); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; }
.quote blockquote { margin: 0; font-size: 1.1rem; }
.quote p { margin: 0; }
.quote figcaption { display: flex; flex-direction: column; font-size: .95rem; color: var(--suave); }
.quote figcaption strong { color: var(--asfalto); }

/* ---------- Contacto ---------- */
.contacto { display: flex; flex-wrap: wrap; gap: 2.5rem clamp(2rem, 7vw, 6rem); }
.contacto__info { flex: 1 1 320px; }
.contacto__info h2 { margin-bottom: 1.25rem; }
.contacto__info a { font-weight: 700; text-decoration-color: var(--vial); }
.form { flex: 1 1 420px; display: flex; flex-direction: column; gap: 1.1rem; max-width: 36rem; }
.form__row { display: flex; flex-direction: column; gap: .35rem; }
.form label { font-weight: 700; font-size: .95rem; }
.form input, .form select, .form textarea { font: inherit; color: var(--asfalto); background: var(--hito); border: 2px solid transparent; border-radius: var(--radius); padding: .8rem 1rem; width: 100%; }
.form :focus-visible { outline: 3px solid var(--vial); outline-offset: 2px; }
.form .btn { align-self: flex-start; }
.form__trampa { position: absolute; left: -9999px; }
.aviso { padding: .9rem 1rem; border-radius: var(--radius); margin: 0; font-weight: 500; }
.aviso--ok { background: var(--vial); color: var(--asfalto); }
.aviso--error, .aviso--espera { background: var(--hito); color: var(--asfalto); border-left: 6px solid #C5372C; }

/* ---------- Archivo y ficha ---------- */
.archivo__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.archivo__head h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
.nav-links, .pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 3rem; }
.page-numbers { padding: .5rem 1rem; border: 2px solid var(--asfalto); border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.page-numbers.current { background: var(--asfalto); color: var(--hito); }

.proyecto__head { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; padding-block: clamp(2.5rem, 6vw, 4.5rem) 2rem; }
.volver { font-weight: 700; }
.proyecto__resumen { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 48ch; margin: 0; }
.ficha { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 0; padding-block: 1.25rem; border-block: 2px solid var(--asfalto); width: 100%; }
.ficha div { display: flex; flex-direction: column; }
.ficha dt { font-size: .9rem; color: var(--suave); }
.ficha dd { margin: 0; font-weight: 700; }
.proyecto__img { margin-block: 0 clamp(2rem, 5vw, 4rem); }
.proyecto__img img { width: 100%; border-radius: var(--radius); }

.entry { max-width: 70ch; margin-inline: 0; }
.entry > * + * { margin-top: 1.25em; }
.entry h2, .entry h3 { margin-top: 1.75em; }
.entry .alignwide { max-width: var(--wrap); margin-inline: auto; }
.entry img { border-radius: var(--radius); }

.proyecto__nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding-block: clamp(3rem, 6vw, 5rem); }
.proyecto__nav a { display: flex; flex-direction: column; max-width: 24rem; font: 800 1.8rem/1.05 var(--f-display); text-decoration: none; }
.proyecto__nav a:hover { text-decoration: underline 3px var(--vial); }
.proyecto__nav small { font: 500 .9rem var(--f-body); color: var(--suave); }
.proyecto__nav .is-next { margin-left: auto; text-align: right; }
.proyecto__cta { background: var(--vial); padding-block: clamp(3rem, 7vw, 5rem); }
.proyecto__cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem; }

.entrada { padding-block: 1.5rem; border-top: 2px solid var(--hormigon); }

/* ---------- Pie ---------- */
.site-footer { background: var(--hormigon); }
.site-footer__in { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.5rem 3rem; padding-block: 2.5rem; }
.site-footer__brand { flex: 1 1 280px; }
.site-footer__brand p { margin: .75rem 0 0; color: var(--suave); max-width: 36ch; }
.social { display: flex; gap: 1.5rem; font-weight: 700; }
.copy { flex: 1 0 100%; margin: 0; font-size: .9rem; color: var(--suave); }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Contenido de fichas ---------- */
.entry ul { list-style: disc; padding-left: 1.4rem; }
.entry li + li { margin-top: .35em; }
.entry blockquote { margin-inline: 0; padding: .25rem 0 .25rem 1.5rem; border-left: 8px solid var(--vial); font-size: 1.2rem; }
.entry blockquote p { margin: 0 0 .75rem; }
.entry blockquote footer { font-size: .95rem; color: var(--suave); font-weight: 700; }
.entry .material { display: flex; flex-wrap: wrap; gap: var(--gap); max-width: none; }
.entry .material > * { margin: 0; flex: 1 1 100%; }
.entry .material figure, .entry .material a { flex: 1 1 calc(50% - var(--gap)); min-width: 260px; }
.entry .material img, .entry .material video { width: 100%; height: auto; border-radius: var(--radius); }
.entry .material video { flex: 1 1 100%; }
.entry:has(.material) { max-width: var(--wrap); }
.entry:has(.material) > :not(.material) { max-width: 70ch; }

/* ---------- Vista en vivo ---------- */
.vivo { margin-bottom: clamp(2rem, 5vw, 4rem); }
.vivo__marco { max-width: 100%; margin-inline: auto; border: 2px solid var(--asfalto); border-radius: 10px; overflow: hidden; background: var(--hito); }
.vivo__browser { display: flex; align-items: center; gap: .9rem; padding: .6rem .9rem; background: var(--hormigon); border-bottom: 2px solid var(--asfalto); font-size: .9rem; }
.vivo__dots { width: .7rem; height: .7rem; border-radius: 50%; background: var(--asfalto); box-shadow: 1.1rem 0 var(--asfalto), 2.2rem 0 var(--asfalto); margin-right: 2.4rem; opacity: .35; }
.vivo__host { font-weight: 700; }
.vivo__vista { position: relative; height: min(78vh, 760px); background: var(--hormigon); }
.vivo__poster { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.vivo__vista iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.vivo__cargar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 6px 24px rgb(0 0 0 / .3); }
.vivo__nota { margin: .75rem 0 0; font-size: .9rem; color: var(--suave); text-align: center; }

/* ---------- Desafío y resultado ---------- */
.caso { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: clamp(2rem, 5vw, 4rem); }
.caso > div { flex: 1 1 320px; padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--radius); background: var(--hormigon); }
.caso h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: .75rem; }
.caso p:last-child { margin-bottom: 0; }
.caso__res { background: var(--vial) !important; }

