/* Noble Forma v2 — "Del plano a la madera". Fuente: docs/direccion-diseno.md. Lo compila scripts/build.mjs (con hash en el nombre). */

/* ---------- fuentes (autoalojadas, subconjunto latino) ---------- */
@font-face { font-family: "Antonio"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/antonio-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/hanken-grotesk-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/hanken-grotesk-latin-500.woff2) format("woff2"); }
/* respaldos con las métricas de Antonio y Hanken (medidas sobre los archivos: ancho medio de mayúsculas y minúsculas
   frente a Arial, más ascendente/descendente) para que el cambio de fuente no mueva nada (CLS ≈ 0) */
@font-face { font-family: "Antonio respaldo"; src: local("Arial"), local("Helvetica"), local("Roboto"); size-adjust: 65.4%; ascent-override: 176.6%; descent-override: 21.3%; line-gap-override: 0%; }
@font-face { font-family: "Hanken respaldo"; src: local("Arial"), local("Helvetica"), local("Roboto"); size-adjust: 101.1%; ascent-override: 98.9%; descent-override: 30%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  --carbon: #141210; --carbon-2: #1d1a17; --linea: #2c2824;
  --marfil: #efe8dc; --marfil-2: #b9afa2; --madera: #c49a6c; --ambar: #d8a25e;
  --scrim: linear-gradient(to top, rgb(20 18 16 / .82), rgb(20 18 16 / 0) 55%);
  --scrim-alto: linear-gradient(to bottom, rgb(20 18 16 / .6), rgb(20 18 16 / 0) 45%);
  --velo: rgb(20 18 16 / .6);
  --brillo: radial-gradient(closest-side, rgb(216 162 94 / .20), transparent);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-entra: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mueve: cubic-bezier(0.77, 0, 0.175, 1); --ease-dibujo: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-vt: cubic-bezier(0.32, 0.72, 0, 1);
  --f-display: "Antonio", "Antonio respaldo", "Arial Narrow", sans-serif;
  --f-text: "Hanken Grotesk", "Hanken respaldo", system-ui, sans-serif;
  --t-marca: clamp(8rem, 30vw, 30rem);
  --t-cierre: clamp(3.5rem, 15vw, 14rem);
  --t-h1: clamp(2.75rem, 7vw, 6rem);
  --t-fila: clamp(2rem, 5.2vw, 4.75rem);
  --t-h2: clamp(2rem, 4.5vw, 3.75rem);
  --t-frase: clamp(1.75rem, 3.6vw, 3.25rem);
  --t-body: clamp(1rem, .96rem + .2vw, 1.125rem);
  --t-small: .9375rem;
  --m: clamp(16px, 4vw, 56px);
  --g: clamp(16px, 2.5vw, 32px);
  --r: 4px; --r-pill: 999px;
  --cab: 72px;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; background: var(--carbon); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--carbon); color: var(--marfil); font: 400 var(--t-body)/1.55 var(--f-text); caret-color: var(--madera); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: 90; background: url(/img/grano.webp); opacity: .06; pointer-events: none; }
::selection { background: var(--madera); color: var(--carbon); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--madera); outline-offset: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.salta { position: fixed; left: var(--m); top: 12px; z-index: 100; padding: 12px 18px; background: var(--madera); color: var(--carbon); border-radius: var(--r-pill); transform: translateY(-160%); }
.salta:focus-visible { transform: none; }
.c { width: min(100% - 2 * var(--m), 1440px); margin-inline: auto; }
.display { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; line-height: .9; letter-spacing: -0.01em; }
.h1 { font: 600 var(--t-h1)/.9 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; }
.h2 { font: 600 var(--t-h2)/.95 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; }
.frase { font: 500 var(--t-frase)/1.1 var(--f-text); letter-spacing: -0.01em; max-width: 24ch; }
.sub { color: var(--marfil-2); max-width: 62ch; }

/* ---------- controles: un botón, un enlace ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); background: var(--madera); color: var(--carbon); font: 500 1rem/1 var(--f-text); text-decoration: none; white-space: nowrap; transition: background-color 200ms ease, transform 160ms var(--ease-out); }
.btn:hover { background: var(--ambar); }
.btn:active { transform: scale(.97); }
.btn--borde { background: transparent; color: var(--marfil); box-shadow: inset 0 0 0 1px rgb(239 232 220 / .4); }
.btn--borde:hover { background: rgb(239 232 220 / .08); }
.btn svg { width: 18px; height: 18px; flex: none; }
.enlace { position: relative; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--marfil); font-weight: 500; }
.enlace::before, .enlace::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: currentColor; }
.enlace::before { opacity: .35; }
.enlace::after { transform: scaleX(0); transform-origin: right; transition: transform 260ms var(--ease-out); }
.enlace:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- encabezado ---------- */
.cab { position: fixed; inset: 0 0 auto; z-index: 40; height: var(--cab); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--m); }
.cab::before { content: ""; position: absolute; inset: 0 0 -32px; z-index: -1; background: linear-gradient(to bottom, rgb(20 18 16 / .72), rgb(20 18 16 / 0)); pointer-events: none; }
.cab__logo { display: flex; align-items: center; min-height: 44px; view-transition-name: marca; }
.cab__logo img { height: 32px; width: auto; }
.cab__nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 32px); }
.cab__nav .enlace { font-size: var(--t-small); }
.cab__nav .enlace[aria-current="page"]::before { opacity: 1; }
.cab__menu { display: none; }
@media (max-width: 767px) {
  .cab__nav .btn { display: none; }
  html.js .cab__nav { display: none; }
  html.js .cab__menu { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: rgb(20 18 16 / .6); box-shadow: inset 0 0 0 1px rgb(239 232 220 / .25); color: var(--marfil); font: 500 1rem/1 var(--f-text); cursor: pointer; }
}
.menu { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; padding: 0 var(--m) 32px; background: var(--carbon); overflow-y: auto; }
.menu[hidden] { display: none; }
.menu__top { display: flex; align-items: center; justify-content: space-between; height: var(--cab); flex: none; }
.menu__cerrar { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: rgb(20 18 16 / .6); box-shadow: inset 0 0 0 1px rgb(239 232 220 / .25); color: var(--marfil); font: 500 1rem/1 var(--f-text); cursor: pointer; }
.menu nav { display: flex; flex-direction: column; margin: auto 0 32px; }
.menu nav a { font: 600 clamp(3.25rem, 17vw, 5rem)/1 var(--f-display); text-transform: uppercase; text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--linea); }
.menu .btn { align-self: flex-start; }
html.menu-abierto { overflow: hidden; }

/* ---------- botón flotante de WhatsApp ---------- */
.wa { position: fixed; right: var(--m); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; box-shadow: 0 10px 30px rgb(0 0 0 / .35); view-transition-name: whatsapp; transition: background-color 200ms ease, transform 160ms var(--ease-out), opacity 240ms var(--ease-out), translate 240ms var(--ease-out), visibility 0s; }
html.js .wa:not(.on) { opacity: 0; translate: 0 16px; visibility: hidden; pointer-events: none; transition: opacity 240ms var(--ease-out), translate 240ms var(--ease-out), visibility 0s 240ms; }
html.menu-abierto .wa { visibility: hidden; }

/* ---------- brillo ámbar (uno por página) y forma orgánica ---------- */
.brillo { position: relative; isolation: isolate; }
.brillo::before { content: ""; position: absolute; z-index: -1; width: 80vmax; aspect-ratio: 1; left: var(--bx, 50%); top: var(--by, 50%); translate: -50% -50%; background: var(--brillo); pointer-events: none; }
.veta { clip-path: url(#veta); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- fotos ---------- */
.foto { position: relative; overflow: hidden; background: var(--carbon-2) center / cover no-repeat; }
.foto > img { width: 100%; height: 100%; object-fit: cover; }
a.foto { display: block; }
@media (hover: hover) {
  a.foto > img, a .foto > img { transition: transform 300ms var(--ease-entra); }
  a.foto:hover > img, a:hover .foto > img { transform: scale(1.03); transition-duration: 600ms; }
}
.foto--scrim::after { content: ""; position: absolute; inset: 0; background: var(--scrim); pointer-events: none; }
/* revelado (solo con JS; sin JS todo se ve) */
html.js .revela { clip-path: inset(0 0 100% 0); transition: clip-path 1000ms var(--ease-entra); }
html.js .revela > img { scale: 1.12; transition: scale 1000ms var(--ease-entra), transform 300ms var(--ease-entra); }
html.js .revela.visto { clip-path: inset(0); }
html.js .revela.visto > img { scale: 1; }

/* cursor "Ver" */
.cursor { position: fixed; left: 0; top: 0; z-index: 80; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; border-radius: 50%; background: var(--madera); color: var(--carbon); font: 500 .9375rem/1 var(--f-text); pointer-events: none; opacity: 0; scale: .6; transition: opacity 140ms var(--ease-out), scale 140ms var(--ease-out); }
.cursor.on { opacity: 1; scale: 1; transition-duration: 200ms; }

/* ---------- frase por palabras ---------- */
.pal .w { display: inline; }
@supports (animation-timeline: view()) {
  .pal .w { animation: palabra linear both; animation-timeline: view(); animation-range: cover calc(20% + var(--i) * 1.5%) cover calc(35% + var(--i) * 1.5%); }
}
@keyframes palabra { from { opacity: .18; } to { opacity: 1; } }
@supports not (animation-timeline: view()) {
  html.js .pal .w { opacity: .18; transition: opacity 400ms var(--ease-out); transition-delay: min(calc(var(--i) * 18ms), 600ms); }
  html.js .pal.visto .w { opacity: 1; }
}

/* =========================================================
   INICIO — momento firma
   ========================================================= */
@property --d-in { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --d-scroll { syntax: "<number>"; inherits: true; initial-value: 0; }

.firma { position: relative; height: 180svh; view-timeline: --firma block; }
.firma__stage { position: sticky; top: 0; height: 100svh; overflow: clip; }
.marca { position: absolute; margin: 0; font: 600 var(--t-marca)/.82 var(--f-display); letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap; pointer-events: none; overflow: clip; overflow-clip-margin: 0.1em; }
.marca span { display: block; animation: sube 900ms var(--ease-entra) both; }
.marca--noble { top: 7svh; left: -0.04em; color: var(--marfil); opacity: .92; z-index: 1; }
.marca--forma { right: -0.05em; bottom: -0.12em; color: transparent; -webkit-text-stroke: 1.5px var(--marfil); z-index: 5; }
.marca--forma span { animation-delay: 80ms; }

.firma__foto { position: absolute; z-index: 2; top: 12svh; right: calc(var(--m) + 4vw); width: min(46vw, 680px); aspect-ratio: 1006 / 1258; }
.firma__foto > img, .firma__foto > .suave, .firma__foto > .velo, .firma__foto > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.firma__foto > img { animation: asienta 1400ms 120ms var(--ease-entra) both; }
.firma__foto > .suave { background: var(--lqip) center / cover; opacity: .65; }
.firma__foto > .velo { background: var(--carbon); opacity: .6; }
.firma__foto > svg { color: var(--ambar); overflow: visible; }
.firma__foto > svg path { vector-effect: non-scaling-stroke; stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: calc(var(--d-in) - var(--d-scroll)); animation: dibuja-in 1100ms 200ms var(--ease-dibujo) both; }

.firma__texto { position: absolute; z-index: 6; left: var(--m); bottom: 8svh; max-width: min(36vw, 500px); }
.firma__texto > * { animation: aparece 600ms var(--ease-out) both; }
.firma__texto h1 { margin: 0 0 18px; font: 600 clamp(2.5rem, 4.6vw, 4.5rem)/.95 var(--f-display); text-transform: uppercase; letter-spacing: -0.005em; animation-delay: 350ms; }
.firma__texto p { margin: 0 0 28px; font-size: clamp(1.05rem, 1.2vw, 1.25rem); color: var(--marfil-2); max-width: 38ch; animation-delay: 410ms; }
.firma__botones { display: flex; flex-wrap: wrap; gap: 12px; animation-delay: 470ms !important; }
.baja { position: absolute; z-index: 6; right: var(--m); bottom: 4svh; font-size: .875rem; color: var(--marfil-2); }

@keyframes sube { from { transform: translateY(18%); opacity: 0; } }
@keyframes asienta { from { transform: scale(1.04); } }
@keyframes dibuja-in { from { --d-in: 1; } to { --d-in: .65; } }
@keyframes aparece { from { opacity: 0; transform: translateY(12px); } }
@keyframes dibuja-scroll { to { --d-scroll: .65; } }
@keyframes aclara { to { opacity: 0; } }
@keyframes disuelve { to { opacity: 0; transform: scale(1.015); } }
@keyframes apaga { to { opacity: 0; } }

@supports (animation-timeline: view()) {
  .firma__foto > svg path { animation: dibuja-in 1100ms 200ms var(--ease-dibujo) both, dibuja-scroll linear both; animation-timeline: auto, --firma; animation-range: normal, contain 0% contain 45%; }
  .firma__foto > svg path { animation-timing-function: var(--ease-dibujo), var(--ease-dibujo); }
  .firma__foto > .suave { animation: aclara ease-in-out both; animation-timeline: --firma; animation-range: contain 30% contain 70%; }
  .firma__foto > .velo { animation: aclara ease-in-out both; animation-timeline: --firma; animation-range: contain 25% contain 70%; }
  .firma__foto > svg { animation: disuelve var(--ease-mueve) both; animation-timeline: --firma; animation-range: contain 65% contain 100%; }
  .baja { animation: apaga linear both; animation-timeline: --firma; animation-range: contain 85% contain 100%; }
}
/* sin animation-timeline: la misma secuencia por tiempo tras la entrada; el dibujo se apaga con el primer scroll */
@supports not (animation-timeline: view()) {
  .firma__foto > svg path { animation: dibuja-in 1100ms 200ms var(--ease-dibujo) both, dibuja-scroll 1600ms 1300ms var(--ease-dibujo) both; }
  .firma__foto > .suave, .firma__foto > .velo { animation: aclara 600ms 2900ms ease-in-out both; }
  .firma__foto > svg { transition: opacity 400ms var(--ease-mueve), transform 400ms var(--ease-mueve); }
  .firma.ya .firma__foto > svg { opacity: 0; transform: scale(1.015); }
  .firma.ya .baja { opacity: 0; transition: opacity 300ms linear; }
}

@media (max-width: 767px) {
  .firma__foto { inset: 0; width: 100%; aspect-ratio: auto; }
  .firma__foto::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--scrim-alto); pointer-events: none; }
  .firma__foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(20 18 16 / .9), rgb(20 18 16 / .55) 38%, rgb(20 18 16 / 0) 62%); pointer-events: none; }
  .marca { font-size: 31vw; }
  .marca--noble { top: calc(var(--cab) + 2svh); z-index: 3; opacity: .95; }
  .marca--forma { bottom: auto; top: calc(var(--cab) + 2svh + 26vw); right: auto; left: -0.03em; }
  .firma__texto { max-width: none; right: var(--m); bottom: max(5svh, 24px); }
  .firma__texto h1 { font-size: clamp(2.25rem, 11vw, 2.75rem); margin-bottom: 12px; }
  .firma__texto p { margin-bottom: 20px; color: var(--marfil); }
  .baja { display: none; }
}
@media (max-width: 767px) and (max-height: 640px) {
  .marca--forma { display: none; }
}

/* ---------- inicio: frase ---------- */
.home-frase { padding: clamp(96px, 18svh, 200px) 0; --bx: 30%; }
.home-frase .frase { max-width: 18ch; font-size: clamp(2rem, 5vw, 5.25rem); line-height: 1.04; letter-spacing: -0.02em; }

/* ---------- inicio: proyectos, uno por pantalla ---------- */
.proy { position: relative; margin-bottom: clamp(72px, 12svh, 160px); }
.proy__texto { position: relative; z-index: 3; }
.proy__titulo { font: 600 var(--t-h1)/.9 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; }
.proy__fecha { margin-top: 14px; color: var(--marfil-2); font-size: var(--t-small); }
.proy__texto .enlace { margin-top: 8px; }
.foto--lado::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
@media (min-width: 768px) {
  .proy--alta { display: grid; grid-template-columns: 50vw 1fr; align-items: end; }
  .proy--alta .foto { aspect-ratio: 4 / 5; max-height: 100svh; width: 100%; }
  .proy--alta .proy__texto { margin-left: -9vw; padding: 0 var(--m) 10svh 0; }
  .proy--alta .foto--lado::after { background: linear-gradient(to left, rgb(20 18 16 / .85), rgb(20 18 16 / 0) 36%); }
  .proy--der { grid-template-columns: 1fr 50vw; }
  .proy--der .foto { grid-column: 2; grid-row: 1; }
  .proy--der .proy__texto { grid-column: 1; grid-row: 1; margin: 0 -9vw 0 0; padding: 0 0 10svh var(--m); justify-self: end; text-align: right; }
  .proy--der .foto--lado::after { background: linear-gradient(to right, rgb(20 18 16 / .85), rgb(20 18 16 / 0) 36%); }
  .proy--par .proy__texto { position: absolute; left: var(--m); bottom: clamp(32px, 6svh, 72px); max-width: calc(50vw - 2 * var(--m)); }
  /* titular gigante que cruza el borde de la foto alta */
  .proy--alta .proy__titulo { font-size: clamp(3.5rem, 7.5vw, 8.5rem); }
}
.proy__par { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.proy__par .foto { aspect-ratio: 4 / 5; }
@media (max-width: 767px) {
  .proy--alta .foto { aspect-ratio: 4 / 5; }
  .proy--alta .proy__texto { margin-top: -22vw; padding: 0 var(--m); }
  .proy--alta .foto--lado::after { background: var(--scrim); }
  /* par en teléfono: la 01 a sangre con el título encima y la 02 montada sobre su esquina, no dos cajitas */
  .proy--par { display: grid; }
  .proy--par .proy__par { display: contents; }
  .proy--par .proy__par > .foto:first-child { grid-area: 1 / 1; }
  .proy--par .proy__par > .foto:first-child::after { background: linear-gradient(to top, rgb(20 18 16 / .9), rgb(20 18 16 / .6) 50%, rgb(20 18 16 / 0) 85%); }
  .proy--par .proy__texto { grid-area: 1 / 1; align-self: end; padding: 0 var(--m) calc(22vw + 20px); }
  .proy--par .proy__par > .foto:nth-child(2) { grid-area: 2 / 1; z-index: 4; width: 64%; justify-self: end; margin: -22vw var(--m) 0 0; }
}
.home-mas { display: flex; justify-content: center; margin-bottom: clamp(96px, 16svh, 180px); }
.home-mas .enlace { font: 600 var(--t-h2)/1 var(--f-display); text-transform: uppercase; }
.home-mas .enlace::before, .home-mas .enlace::after { bottom: -4px; }

/* ---------- inicio: servicios (ventana orgánica) ---------- */
.home-serv { display: grid; gap: var(--g); align-items: center; padding-bottom: clamp(96px, 16svh, 180px); }
.home-serv .foto { aspect-ratio: 4 / 5; background-color: transparent; }
.home-serv .h2 { max-width: 16ch; margin-bottom: 20px; }
@media (min-width: 768px) {
  .home-serv { grid-template-columns: repeat(12, 1fr); }
  .home-serv .foto { grid-column: 1 / span 5; width: min(100%, 40vw); }
  .home-serv__texto { grid-column: 7 / span 6; }
}

/* ---------- cierre común ---------- */
.cierre { padding: clamp(80px, 14svh, 160px) 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.cierre__gran { display: block; width: fit-content; margin-left: -0.03em; font: 600 var(--t-cierre)/.85 var(--f-display); text-transform: uppercase; letter-spacing: -0.015em; text-decoration: none; transition: color 200ms ease; }
.cierre__gran:hover { color: var(--madera); }
.cierre__datos { display: flex; flex-wrap: wrap; gap: 4px clamp(16px, 4vw, 48px); margin: clamp(28px, 5svh, 56px) 0 0; padding: 0; list-style: none; }
.cierre__linea { margin-top: 28px; color: var(--marfil-2); font-size: var(--t-small); }
.cierre__pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: clamp(48px, 8svh, 96px); padding-top: 20px; border-top: 1px solid var(--linea); color: var(--marfil-2); font-size: var(--t-small); }
.cierre__pie img { height: 28px; width: auto; }
.cierre__pie nav { display: flex; gap: 24px; }
.cierre__pie .enlace { color: var(--marfil-2); font-weight: 400; }

/* =========================================================
   PROYECTOS — índice
   ========================================================= */
.pag-cab { padding: calc(var(--cab) + clamp(56px, 12svh, 140px)) 0 clamp(40px, 7svh, 72px); }
.pag-cab .h1 { margin-bottom: clamp(20px, 3svh, 32px); }
.pag-cab .sub { font-size: clamp(1.0625rem, 1.3vw, 1.25rem); }
.idx-cab { --bx: 18%; --by: 40%; }
.filtro { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(24px, 4svh, 40px); padding: 0; list-style: none; }
html:not(.js) .filtro { display: none; }
.filtro button { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--marfil); box-shadow: inset 0 0 0 1px rgb(239 232 220 / .3); font: 500 var(--t-small)/1 var(--f-text); cursor: pointer; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.filtro button:hover { background: rgb(239 232 220 / .08); }
.filtro button:active { transform: scale(.97); }
.filtro button[aria-pressed="true"] { background: var(--madera); color: var(--carbon); box-shadow: none; }
.filtro span { color: inherit; opacity: .7; }
.indice { margin: 0 0 clamp(80px, 14svh, 160px); padding: 0; list-style: none; border-top: 1px solid var(--linea); }
.fila { border-bottom: 1px solid var(--linea); transition: opacity 220ms ease; view-transition-class: fila; }
.fila[hidden] { display: none; }
.fila > a { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: clamp(14px, 2.2vw, 24px) 0; text-decoration: none; }
.fila__txt { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.fila__t { font: 600 var(--t-fila)/.95 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; transition: translate 220ms ease; }
.fila__acab { color: var(--marfil-2); }
.fila__fecha { color: var(--marfil-2); font-size: var(--t-small); white-space: nowrap; }
.fila__mini { display: none; width: 88px; height: 110px; flex: none; border-radius: var(--r); object-fit: cover; background: var(--carbon-2); }
.indice:has(> .fila > a:hover) > .fila:not(:has(> a:hover)) { opacity: .35; }
.fila > a:hover .fila__t { translate: 12px 0; }
@media (max-width: 767px) {
  .fila__txt { flex-direction: column; align-items: flex-start; }
  .fila__mini { display: block; }
}
.preview { position: fixed; left: 0; top: 0; z-index: 30; width: min(26vw, 360px); aspect-ratio: 4 / 5; pointer-events: none; opacity: 0; scale: .96; transition: opacity 200ms var(--ease-out), scale 200ms var(--ease-out); }
.preview.on { opacity: 1; scale: 1; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px), (hover: none) { .preview { display: none; } }
::view-transition-group(*.fila) { animation-duration: 300ms; animation-timing-function: var(--ease-mueve); }

/* =========================================================
   FICHA DE PROYECTO
   ========================================================= */
.ficha-cab { display: grid; --bx: 75%; --by: 45%; }
.ficha-cab__foto { aspect-ratio: 4 / 5; }
.ficha-cab__foto > img.vt-foto { view-transition-name: foto-proyecto; }
.ficha-cab__resumen { max-width: 52ch; }
.datos { margin: 32px 0; border-top: 1px solid var(--linea); }
.datos div { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.datos dt { width: 7.5rem; flex: none; color: var(--marfil-2); }
.datos dd { margin: 0; }
@media (min-width: 768px) {
  .ficha-cab { grid-template-columns: 50vw 1fr; min-height: 100svh; }
  .ficha-cab__foto { height: 100svh; aspect-ratio: auto; position: sticky; top: 0; }
  .ficha-cab__texto { display: flex; flex-direction: column; justify-content: center; padding: calc(var(--cab) + 48px) var(--m) 64px clamp(32px, 5vw, 96px); }
  .ficha-cab__texto .h1 { margin-bottom: 28px; }
  .ficha-cab__texto .btn { align-self: flex-start; }
}
@media (max-width: 767px) {
  .ficha-cab__texto { display: contents; }
  .ficha-cab__foto { grid-area: 1 / 1; }
  .ficha-cab__foto::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
  .ficha-cab .h1 { grid-area: 1 / 1; align-self: end; z-index: 2; padding: 0 var(--m) 24px; }
  .ficha-cab__resumen, .ficha-cab .datos, .ficha-cab .btn { margin-inline: var(--m); }
  .ficha-cab__resumen { margin-top: 24px; }
  .ficha-cab .btn { justify-self: start; }
}
.galeria { display: grid; gap: 8px; margin-top: 8px; }
.galeria .foto { aspect-ratio: 4 / 5; }
@media (min-width: 768px) { .galeria { grid-template-columns: 1fr 1fr; } }
.ficha-fin { margin-top: 8px; }
/* tarjeta del siguiente proyecto (ocupa el último hueco de un par, o una franja propia) */
.sig { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: clamp(32px, 6vw, 88px) var(--m); background: var(--carbon-2); text-decoration: none; }
.sig .foto { width: min(72%, 420px); aspect-ratio: 4 / 5; background-color: transparent; }
.sig__t { font: 600 var(--t-h2)/.95 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; }
.sig__t span { display: block; color: var(--marfil-2); font: 400 var(--t-small)/1.4 var(--f-text); text-transform: none; letter-spacing: 0; margin-bottom: 10px; }
.sig__ver { display: block; margin-top: 24px; color: var(--madera); font-weight: 500; }
.sig--franja { display: grid; justify-content: normal; gap: var(--g); padding: clamp(56px, 10svh, 120px) var(--m); margin-top: 8px; }
@media (min-width: 768px) {
  .galeria .sig { aspect-ratio: 4 / 5; }
  .sig--franja { grid-template-columns: repeat(12, 1fr); align-items: center; }
  .sig--franja .foto { grid-column: 2 / span 4; width: 100%; max-width: 40vw; }
  .sig--franja .sig__cuerpo { grid-column: 7 / span 6; }
  .sig--franja .sig__t { font-size: var(--t-h1); line-height: .9; }
}
@media (max-width: 767px) {
  .sig .foto { width: 100%; }
  .sig--franja { padding: 0 0 56px; }
  .sig--franja .sig__cuerpo { padding-inline: var(--m); }
}

/* =========================================================
   SERVICIOS
   ========================================================= */
.serv-cab .frase { max-width: 30ch; font-size: clamp(1.375rem, 2.6vw, 2.25rem); color: var(--marfil-2); }
.serv { position: relative; isolation: isolate; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--linea); }
.serv__i { border-bottom: 1px solid var(--linea); transition: opacity 220ms ease; }
.serv__a { position: relative; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; min-height: 44px; padding: clamp(18px, 2.6vw, 30px) var(--m); text-decoration: none; }
.serv__n { font: 600 var(--t-fila)/.95 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; transition: translate 220ms ease; }
.serv__d { margin-top: 8px; color: var(--marfil-2); max-width: 46ch; }
.serv__c { color: var(--marfil-2); font-size: var(--t-small); white-space: nowrap; }
.serv__foto { position: absolute; z-index: 0; inset: 0; background: var(--carbon-2); pointer-events: none; }
.serv__foto img { width: 100%; height: 100%; object-fit: cover; }
.serv__foto::after { content: ""; position: absolute; inset: 0; background: var(--velo); }
@media (min-width: 768px) {
  .serv__foto { left: 50%; opacity: 0; scale: 1.04; transition: opacity 260ms var(--ease-out), scale 260ms var(--ease-out); }
  .serv__i:hover .serv__foto, .serv__i:focus-within .serv__foto { opacity: 1; scale: 1; }
  /* sin puntero encima, la lista no queda en texto plano: se ve la foto del primer servicio */
  .serv:not(:has(.serv__i:hover, .serv__i:focus-within)) .serv__i:first-child .serv__foto { opacity: 1; scale: 1; }
  .serv:has(.serv__i:hover) .serv__i:not(:hover) .serv__a { opacity: .35; }
  .serv__a { transition: opacity 220ms ease; }
  .serv__i:hover .serv__n { translate: 12px 0; }
  .serv__c { text-align: right; color: var(--marfil); }
}
@media (max-width: 767px) {
  .serv { border-top: 0; display: grid; gap: 8px; }
  .serv__i { position: relative; min-height: 80svh; display: flex; border: 0; }
  .serv__a { flex: 1; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding-bottom: 32px; }
  .serv__foto::after { background: linear-gradient(to top, rgb(20 18 16 / .85), rgb(20 18 16 / 0) 50%); }
  .serv__d, .serv__c { color: var(--marfil); }
}
.serv-no { padding: clamp(40px, 7svh, 72px) 0 clamp(80px, 14svh, 160px); color: var(--marfil-2); font-size: clamp(1.0625rem, 1.4vw, 1.375rem); }
.franja-clara { background: var(--marfil); color: var(--carbon); padding: clamp(96px, 18svh, 200px) 0; }
.franja-clara ::selection { background: var(--carbon); color: var(--marfil); }
.franja-clara :focus-visible { outline-color: var(--carbon); }
.franja-clara .h2 { margin-bottom: clamp(24px, 4svh, 40px); }
.franja-clara .frase { max-width: 26ch; }
.quien { display: grid; gap: var(--g); align-items: center; padding: clamp(96px, 18svh, 200px) 0; --bx: 70%; }
.quien .foto { aspect-ratio: 4 / 5; background-color: transparent; }
.quien p { max-width: 52ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); }
.quien .h2 { margin-bottom: 24px; }
@media (min-width: 768px) {
  .quien { grid-template-columns: repeat(12, 1fr); }
  .quien .foto { grid-column: 1 / span 5; width: min(100%, 40vw); }
  .quien__texto { grid-column: 7 / span 6; }
}

/* =========================================================
   transiciones entre páginas
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms ease both vt-sale; }
::view-transition-new(root) { animation: 280ms var(--ease-out) both vt-entra; }
::view-transition-group(marca), ::view-transition-group(whatsapp), ::view-transition-group(foto-proyecto) { animation-duration: 450ms; animation-timing-function: var(--ease-vt); }
::view-transition-old(foto-proyecto), ::view-transition-new(foto-proyecto) { height: 100%; object-fit: cover; }
@keyframes vt-sale { to { opacity: 0; } }
@keyframes vt-entra { from { opacity: 0; } }

/* =========================================================
   movimiento reducido: todo quieto y visible
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .firma__foto > .suave, .firma__foto > .velo { opacity: 0; }
  .firma__foto > svg { opacity: .6; }
  .firma__foto > svg path { stroke-dashoffset: 0; }
  .pal .w { opacity: 1 !important; }
  html.js .revela { clip-path: none; opacity: 0; transition: opacity 300ms ease !important; }
  html.js .revela.visto { opacity: 1; }
  html.js .revela > img { scale: 1; }
  a.foto:hover > img, a:hover .foto > img { transform: none; }
  .fila > a:hover .fila__t, .serv__i:hover .serv__n { translate: none; }
  .serv__foto { scale: 1 !important; }
  .enlace::after { transform-origin: left; }
  .btn:active, .filtro button:active { transform: none; }
}

/* inicio: la frase cruza una foto que se sale por la derecha (50vw), con degradado para que se lea */
.home-frase { position: relative; isolation: isolate; min-height: 100svh; display: flex; align-items: center; }
.home-frase__foto { position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 50vw; }
.home-frase__foto img { width: 100%; height: 100%; object-fit: cover; }
.home-frase__foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, var(--carbon) 0%, rgb(20 18 16 / .55) 45%, rgb(20 18 16 / .2) 100%); }
@media (max-width: 767px) { .home-frase__foto { width: 100%; } .home-frase__foto::after { background: rgb(20 18 16 / .72); } }
