/* Estudio Ladera · layout y componentes.
   Sin valores de marca: todo color y tipografía sale de brand.css.
   Familia Editorial: silencio y proporción. Grilla de 12 columnas (8 en tablet, 4 en mobile),
   sin botones con caja, imágenes sin borde ni radio. Blanco, negro y un solo color de material. */

:root {
  --gutter: clamp(16px, 4vw, 56px);
  --gap: 16px;
  --header-h: 60px;
  --bar-h: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --arrow-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M2 9h13M10 4l5 5-5 5'/%3E%3C/svg%3E");
  --stage-h: clamp(640px, 100svh, 960px);
  --muted-on-dark: color-mix(in srgb, var(--brand-primary-contrast) 70%, var(--brand-primary));
}
@media (min-width: 768px) { :root { --gap: 20px; --header-h: 68px; } }
@media (min-width: 1024px) { :root { --gap: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: var(--bar-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 1024px) { body { padding-bottom: 0; } }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; letter-spacing: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 60;
  padding: 12px 16px; background: var(--text); color: var(--bg);
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
::selection { background: var(--text); color: var(--bg); }

/* ---------- Grilla ---------- */
.wrap { width: 100%; max-width: 1600px; margin-inline: auto; padding-inline: var(--gutter); }
.grid-12 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); }
.grid-12 > * { grid-column: 1 / -1; }
@media (min-width: 768px) { .grid-12 { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* Número de sección, en tipografía mínima, al inicio de cada bloque */

/* ---------- Enlaces (no hay botones con caja) ---------- */
.link {
  display: inline-flex; align-items: baseline; gap: 0.5em;
  min-height: 44px; align-items: center;
  font-weight: 400; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em;
  background: none; border: 0; padding: 0; text-align: left;
}
/* CTA primario: botón sólido, rectangular y sin radio. Es el único con caja; WhatsApp sigue siendo enlace */
.link-primary {
  justify-content: center; min-height: 48px; padding: 0 22px;
  background: var(--brand-primary); color: var(--brand-primary-contrast); border: 1px solid var(--brand-primary);
  font-weight: 600; text-decoration: none;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), transform 120ms var(--ease-out);
}
.link-primary .arrow { color: inherit; }
.link-primary:active { opacity: 1; transform: translateY(1px); }
.arrow {
  position: relative; display: inline-block; flex: none; width: 1.125rem; height: 1.125rem; overflow: hidden;
  font-size: 0; line-height: 0; color: var(--brand-accent);
}
.arrow::before, .arrow::after {
  content: ""; position: absolute; inset: 0; background: currentColor;
  -webkit-mask: var(--arrow-shape) center / contain no-repeat; mask: var(--arrow-shape) center / contain no-repeat;
  transition: transform 320ms var(--ease-out);
}
.arrow::after { transform: translateX(-130%); }
.link:active { opacity: 0.7; }
@media (hover: hover) and (pointer: fine) {
  .link:hover .arrow::before { transform: translateX(130%); }
  .link:hover .arrow::after { transform: none; }
  .link:hover { text-decoration-thickness: 2px; }
  .link-primary:hover { background: var(--bg); color: var(--text); text-decoration: none; }
}

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--header-h); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-logo { display: block; flex: none; line-height: 0; }
.brand-logo { height: 26px; width: auto; }
.header-cta { display: none; flex: none; }
.menu-toggle { background: none; border: 0; padding: 0 0 0 16px; min-height: 44px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.site-nav { position: fixed; inset: var(--header-h) 0 auto 0; padding: 8px var(--gutter) 24px; background: var(--bg); display: none; }
.site-nav.is-open { display: block; }
.site-nav ul { display: grid; }
.site-nav a { display: block; padding: 14px 0; font-size: 1.25rem; letter-spacing: -0.02em; text-decoration: none; }
@media (min-width: 1024px) {
  .menu-toggle { display: none; }
  .site-nav { position: static; display: block; padding: 0; background: none; margin-left: auto; margin-right: 8px; }
  .site-nav ul { display: flex; gap: clamp(20px, 2.4vw, 40px); }
  .site-nav a { padding: 8px 0; font-size: 0.875rem; letter-spacing: 0; }
  .header-cta { display: inline-flex; margin-left: 16px; min-height: 40px; padding: 0 16px; font-size: 0.875rem; }
}
@media (hover: hover) and (pointer: fine) { .site-nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px; } }

/* ---------- Placeholders de imagen ---------- */
figure[data-slot] { position: relative; background: transparent; }
figure.is-missing { background: var(--surface); aspect-ratio: var(--ar, auto); }
figure.is-missing > img { opacity: 0; }
figure.is-missing::after {
  content: attr(data-slot);
  position: absolute; left: 12px; top: 10px;
  font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.3; color: var(--text-muted);
}

/* ---------- Hero: una obra a pantalla completa que se cierra en un marco y recorre las seis ----------
   Momento firma. --k (0 a 1) lo escribe main.js según el scroll sobre .hero-track: 0 es la foto a sangre,
   1 es el marco centrado. Solo se anima clip-path, opacity y transform. Sin JS, o con movimiento reducido,
   el hero es una sola pantalla estática con la primera obra. */
.hero { --k: 0; --it: 14%; --ix: 28%; --ib: 10%; position: relative; }
@media (max-width: 1023px) { .hero { --it: 17%; --ix: 7%; --ib: 33%; } }
.hero-stage { position: relative; height: var(--stage-h); overflow: hidden; background: var(--surface); }
html.motion-ok .hero-track { height: calc(var(--stage-h) + 6 * 70svh); }
html.motion-ok .hero-stage { position: sticky; top: 0; background: var(--bg); }

.hero-frame {
  position: absolute; inset: 0; background: var(--surface);
  clip-path: inset(calc(var(--k) * var(--it)) calc(var(--k) * var(--ix)) calc(var(--k) * var(--ib)) calc(var(--k) * var(--ix)));
  will-change: clip-path;
}
figure.hero-slide { position: absolute; inset: 0; display: none; background: var(--surface); }
figure.hero-slide.is-missing { aspect-ratio: auto; }
figure.hero-slide.is-missing::after { left: var(--gutter); top: calc(var(--header-h) + 14px); }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 58%); }
.hero-slide.is-active { display: block; z-index: 2; }
.hero-slide.is-prev { display: block; z-index: 1; }
.hero-slide.is-entering { animation: slide-in 900ms var(--ease-out) both; }
@keyframes slide-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
/* Velo oscuro desde abajo: sostiene el contraste del texto blanco sobre muros claros */
.hero-veil {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--brand-primary) 74%, transparent) 0%,
    color-mix(in srgb, var(--brand-primary) 52%, transparent) 42%,
    color-mix(in srgb, var(--brand-primary) 0%, transparent) 78%);
  opacity: clamp(0, calc(1 - var(--k) * 1.5), 1);
}

.hero-copy {
  position: absolute; left: 0; right: 0; bottom: clamp(28px, 6svh, 64px); z-index: 4;
  row-gap: 16px; align-items: end;
  color: var(--brand-primary-contrast);
  opacity: clamp(0, calc(1 - var(--k) * 2.4), 1);
  transform: translateY(calc(var(--k) * 28px));
}
.hero-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.75rem, 1rem + 2.6vw, 3.5rem); line-height: 1.08; letter-spacing: -0.012em; text-wrap: balance; max-width: 22ch; }
.hero-side { display: grid; gap: 4px; justify-items: start; }
.hero-sub { max-width: 46ch; }
.hero-copy .link-primary { margin-top: 8px; background: var(--brand-primary-contrast); color: var(--brand-primary); border-color: var(--brand-primary-contrast); }
@media (hover: hover) and (pointer: fine) { .hero-copy .link-primary:hover { background: transparent; color: var(--brand-primary-contrast); } }
.hero-copy .arrow { color: inherit; }
@media (max-width: 767px) { .hero-sub { font-size: 0.875rem; line-height: 1.55; } }
@media (min-width: 1024px) {
  .hero-title { grid-column: 1 / span 8; }
  .hero-side { grid-column: 10 / span 3; }
}

/* Ficha de la obra en el marco: nombre, tipo, m², año y ubicación */
.hero-caps {
  position: absolute; z-index: 4; pointer-events: none;
  opacity: clamp(0, calc((var(--k) - 0.7) * 3.3), 1);
  inset: 0; max-width: 1600px; margin-inline: auto;
}
/* Sin el recorrido del momento firma (movimiento reducido o sin JS) las leyendas nunca llegan a verse:
   se quitan del todo. Los mismos datos están completos en la lista de obras. */
html:not(.motion-ok) .hero-caps { display: none; }
.hero-cap {
  position: absolute; left: var(--gutter); right: calc(var(--gutter) + 80px); top: calc(100% - var(--ib) + 18px);
  opacity: 0; transform: translateY(10px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.hero-cap.is-active { opacity: 1; transform: none; }
.cap-name { font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 6px; }
.cap-meta { font-size: 0.75rem; color: var(--text-muted); }
.cap-place { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
@media (min-width: 1024px) {
  .hero-cap { top: auto; bottom: var(--ib); right: auto; width: calc(var(--ix) - var(--gutter) - 24px); }
  .cap-name { font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem); }
}

/* ---------- Secciones ---------- */
.section { padding-top: clamp(80px, 11vw, 176px); }
.head { row-gap: 14px; margin-bottom: clamp(40px, 6vw, 88px); }
h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.25rem); line-height: 1.12; letter-spacing: -0.01em; }
h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; line-height: 1.25; letter-spacing: -0.006em; }
.head-text { color: var(--text-muted); max-width: 52ch; }
@media (min-width: 1024px) {
  .head h2 { grid-column: 1 / span 5; }
  .head .head-text { grid-column: 7 / span 4; }
}

/* ---------- Criterio ---------- */
.statement-text { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.75rem, 0.9rem + 3.4vw, 4rem); line-height: 1.08; letter-spacing: -0.014em; text-wrap: balance; max-width: 22ch; }
@media (min-width: 1024px) { .statement-text { grid-column: 1 / span 10; max-width: 24ch; } }

/* ---------- Proyectos ---------- */
.feat figcaption { font-family: var(--font-mono); }

.index-head { align-items: end; row-gap: 12px; margin-bottom: 8px; }
.index-title { font-family: var(--font-display); font-weight: 400; font-size: 0.875rem; color: var(--text-muted); letter-spacing: 0; }
.filter { display: flex; flex-wrap: wrap; gap: 0 24px; }
.filter-btn {
  min-height: 44px; padding: 0; background: none; border: 0;
  color: var(--text-muted); font-size: 0.875rem;
  text-underline-offset: 0.35em; text-decoration-thickness: 1px;
}
.filter-btn .mono { font-size: 0.6875rem; vertical-align: super; margin-left: 2px; }
.filter-btn[aria-pressed="true"] { color: var(--brand-accent); text-decoration: underline; }
.filter-btn:active { opacity: 0.7; }
@media (hover: hover) and (pointer: fine) { .filter-btn:hover { color: var(--text); text-decoration: underline; } .filter-btn[aria-pressed="true"]:hover { color: var(--brand-accent); } }
@media (min-width: 1024px) {
  .index-title { grid-column: 1 / span 3; }
  .filter { grid-column: 7 / span 6; }
}

/* Modo mobile y tablet: imagen arriba, fila de texto debajo, alternando el ancho de forma asimétrica */
.obra { padding-top: 40px; }
.obra-thumb { margin-bottom: 14px; }
.obra-thumb img { width: 100%; }
.obra:nth-child(even) .obra-thumb { width: 78%; margin-left: auto; }
.obra-row {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 2px 14px; align-items: baseline;
  padding: 14px 0 16px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left;
}
.obra-n { color: var(--brand-accent); font-size: 0.75rem; }
.obra-name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.008em; }
.obra-year { grid-column: 3; grid-row: 1; font-size: 0.75rem; color: var(--text-muted); }
.obra-type { grid-column: 2; grid-row: 2; font-size: 0.8125rem; color: var(--text-muted); }
.obra-m2 { grid-column: 3; grid-row: 2; font-size: 0.75rem; color: var(--text-muted); text-align: right; }
.obra-toggle { display: none; }
.obra-row[aria-expanded="true"] .obra-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.obra-ficha { padding: 4px 0 8px 0; }
.obra-ficha figure { display: none; }
.ficha-data { display: grid; grid-template-columns: 1fr 1fr; gap: 14px var(--gap); margin-bottom: 18px; }
.ficha-data dt { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); text-transform: none; margin-bottom: 2px; }
.ficha-data dd { font-size: 0.875rem; line-height: 1.4; }
.ficha-text p { max-width: 54ch; color: var(--text-muted); }
.index-preview { display: none; }

/* Modo escritorio con mouse: lista tipográfica, la imagen aparece junto al cursor */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .obra { padding-top: 0; }
  .obra-thumb { display: none; }
  .obra:nth-child(even) .obra-thumb { width: auto; }
  .obra-row {
    grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 0;
    align-items: center; padding: 22px 0; min-height: 76px;
  }
  .obra-n { grid-column: 1; grid-row: 1; }
  .obra-name { grid-column: 2 / span 5; grid-row: 1; font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2rem); }
  .obra-type { grid-column: 7 / span 2; grid-row: 1; font-size: 0.875rem; }
  .obra-year { grid-column: 9 / span 2; grid-row: 1; font-size: 0.8125rem; }
  .obra-m2 { grid-column: 11; grid-row: 1; text-align: left; font-size: 0.8125rem; }
  .obra-toggle { display: block; grid-column: 12; grid-row: 1; justify-self: end; position: relative; width: 14px; height: 14px; }
  .obra-toggle::before, .obra-toggle::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid currentColor; }
  .obra-toggle::after { transform: rotate(90deg); transition: transform 200ms var(--ease-out); }
  .obra-row[aria-expanded="true"] .obra-toggle::after { transform: rotate(0deg); }
  .obra-row[aria-expanded="true"] .obra-name { text-decoration: none; }
  .index:hover .obra:not(:hover) .obra-name { color: var(--text-muted); }
  .obra-name { transition: color 200ms ease; }
  .obra:last-child { border-bottom: 1px solid var(--line); }
  .obra-ficha { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: 8px 0 56px; }
  .obra-ficha[hidden] { display: none; }
  .obra-ficha figure { display: block; grid-column: 2 / span 5; }
  .ficha-text { grid-column: 8 / span 5; align-self: end; }
  .ficha-data { grid-template-columns: 1fr 1fr; }
  .index-wrap { position: relative; }
  .index-preview {
    display: block; position: fixed; top: 0; left: 0; z-index: 10; pointer-events: none;
    width: clamp(260px, 24vw, 400px); aspect-ratio: 4 / 3; overflow: hidden;
    background: var(--surface); opacity: 0; will-change: transform;
  }
  .index-preview.is-on { opacity: 1; }
  figure.pv { position: absolute; inset: 0; margin: 0; }
  .pv img { width: 100%; height: 100%; object-fit: cover; }
  .pv.is-missing { aspect-ratio: auto; }
  .pv:not(.is-active) { visibility: hidden; }
}

/* ---------- Etapas ---------- */
.stage-list { border-top: 1px solid var(--line); }
.stage { padding: 28px 0 32px; row-gap: 6px; border-bottom: 1px solid var(--line); }
.stage-n { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.5rem, 1.6rem + 3vw, 4.75rem); line-height: 0.9; letter-spacing: -0.018em; color: color-mix(in srgb, var(--text) 20%, var(--bg)); }
.stage-time { font-size: 0.75rem; color: var(--text-muted); }
.stage-text { color: var(--text-muted); max-width: 46ch; }
@media (max-width: 1023px) {
  .stage > * { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .stage { padding: 36px 0 40px; align-items: baseline; }
  .stage-n { grid-column: 1; }
  .stage-n { margin-top: -6px; }
  .stage h3 { grid-column: 2 / span 4; font-size: 1.375rem; }
  .stage-time { grid-column: 6 / span 3; }
  .stage-text { grid-column: 9 / span 4; }
}

/* ---------- Servicios ---------- */
.service-list { border-top: 1px solid var(--line); }
.service { padding: 28px 0 32px; row-gap: 8px; border-bottom: 1px solid var(--line); }
.service-name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.008em; }
.service-text { color: var(--text-muted); max-width: 46ch; }
.service-fee { font-size: 0.8125rem; color: var(--text); }
@media (min-width: 1024px) {
  .service { padding: 36px 0 40px; align-items: baseline; }
  .service-name { grid-column: 1 / span 4; font-size: 1.5rem; }
  .service-text { grid-column: 5 / span 4; }
  .service-fee { grid-column: 10 / span 3; }
}

/* ---------- El estudio (bloque negro) ---------- */
.band-dark { background: var(--brand-primary); color: var(--brand-primary-contrast); margin-top: clamp(80px, 11vw, 176px); padding-bottom: clamp(72px, 9vw, 144px); }
.studio-grid { row-gap: 32px; }
.studio-lead { font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.015em; margin-bottom: 20px; max-width: 34ch; }
.studio-text p:not(.studio-lead) { color: var(--muted-on-dark); max-width: 54ch; }
.studio-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 32px var(--gap); margin-top: 16px; }
.studio-facts dt { font-size: 0.8125rem; color: var(--muted-on-dark); margin-bottom: 6px; }
.studio-facts dd { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.25rem, 1.2rem + 3.6vw, 5rem); line-height: 1; letter-spacing: -0.016em; font-variant-numeric: tabular-nums; }
@media (min-width: 1024px) {
  .studio-grid h2 { grid-column: 1 / span 3; }
  .studio-text { grid-column: 5 / span 6; }
  .studio-lead { font-size: 1.75rem; max-width: 26ch; }
  .studio-facts { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin-top: clamp(40px, 6vw, 88px); padding-top: 32px; border-top: 1px solid color-mix(in srgb, var(--brand-primary-contrast) 24%, var(--brand-primary)); }
}

/* ---------- Preguntas ---------- */
.faq-grid { row-gap: 32px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  position: relative; list-style: none; cursor: pointer;
  padding: 22px 36px 22px 0; font-size: 1.0625rem; line-height: 1.35; letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before, .faq-item summary::after { content: ""; position: absolute; right: 2px; top: 50%; width: 14px; border-top: 1px solid currentColor; }
.faq-item summary::after { transform: rotate(90deg); transition: transform 200ms var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(0deg); }
.faq-item p { padding: 0 0 26px; max-width: 62ch; color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .faq-item summary:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; } }
@media (min-width: 1024px) {
  .faq-grid h2 { grid-column: 1 / span 3; }
  .faq-list { grid-column: 5 / span 8; }
}

/* ---------- Consulta ---------- */
.consult { padding-bottom: clamp(80px, 11vw, 176px); }
.consult-grid { row-gap: 40px; }
.consult-copy h2 { margin-bottom: 16px; }
.consult-alt { margin-top: 28px; }
.consult-form { counter-reset: campo; display: grid; gap: 22px; padding: clamp(20px, 3vw, 44px); background: var(--surface); }
.field label::before { counter-increment: campo; content: "(0" counter(campo) ")"; margin-right: 0.7em; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--brand-accent); }
.form-required, .field-help { font-size: 0.8125rem; color: var(--text-muted); }
.field { position: relative; display: grid; gap: 6px; }
.field label { font-size: 0.8125rem; color: var(--text-muted); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 6px 0; border-radius: 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--text);
  font-size: 1rem; appearance: none; -webkit-appearance: none;
}
.field select { padding-right: 28px; cursor: pointer; }
.field:has(select)::after { content: "↓"; position: absolute; right: 2px; bottom: 14px; color: var(--brand-accent); pointer-events: none; }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.field input:user-invalid, .field select:user-invalid { border-bottom-width: 2px; }
.link-submit { justify-self: start; font-size: 1.0625rem; margin-top: 6px; }
.link-submit[disabled] { opacity: 0.5; cursor: progress; }
.form-error { font-size: 0.875rem; padding-top: 4px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.form-success h3 { font-size: 1.5rem; font-weight: 400; margin-bottom: 8px; }
.form-success:focus { outline: none; }
@media (min-width: 1024px) {
  .consult-copy { grid-column: 1 / span 5; }
  .consult-form, .form-success { grid-column: 7 / span 6; }
  .consult-form { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .consult-form > .form-required, .consult-form > .field:nth-of-type(3), .consult-form > .field:nth-of-type(4),
  .consult-form > .link-submit, .consult-form > .form-error { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-primary); color: var(--brand-primary-contrast); padding: 72px 0 32px; position: relative; z-index: 5; }
.site-footer .brand-logo { height: 24px; margin-bottom: 16px; }
.footer-grid { row-gap: 40px; }
.footer-brand p { max-width: 34ch; color: color-mix(in srgb, var(--brand-primary-contrast) 72%, var(--brand-primary)); }
.footer-title { font-family: var(--font-mono); font-weight: 400; font-size: 0.6875rem; margin-bottom: 12px; color: color-mix(in srgb, var(--brand-primary-contrast) 65%, var(--brand-primary)); }
.footer-contact p, .footer-nav li { padding: 3px 0; }
.site-footer a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.footer-mark {
  margin: clamp(56px, 8vw, 120px) 0 0; padding-inline: var(--gutter); overflow: hidden; white-space: nowrap;
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2.75rem, 14.6vw, 16rem); line-height: 0.9; letter-spacing: -0.022em;
}
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 40px; font-size: 0.8125rem; color: color-mix(in srgb, var(--brand-primary-contrast) 65%, var(--brand-primary)); }
@media (min-width: 1024px) {
  .footer-brand { grid-column: 1 / span 4; }
  .footer-contact { grid-column: 6 / span 4; }
  .footer-nav { grid-column: 10 / span 3; }
}

/* ---------- Ir arriba (solo desktop; en mobile está la barra fija) ----------
   Cuadrado blanco con borde negro: se ve sobre el blanco de la página y sobre el negro del footer. */
.to-top { display: none; }
@media (min-width: 1024px) {
  .to-top {
    position: fixed; right: var(--gutter); bottom: 24px; z-index: 40;
    display: grid; place-items: center; width: 48px; height: 48px; min-height: 0; padding: 0;
    background: var(--bg); color: var(--text); border: 1px solid var(--text); text-decoration: none;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .to-top .arrow { color: inherit; transform: rotate(-90deg); }
  .to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .to-top.is-visible:active { transform: translateY(1px); }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .to-top:hover { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-primary-contrast); text-decoration: none; }
}

/* ---------- Barra fija mobile ----------
   Aparece cuando el CTA del hero sale de pantalla (main.js). El body reserva su alto. */
.mobile-bar {
  position: fixed; inset: auto 0 0 0; z-index: 25; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  background: var(--bg); border-top: 1px solid var(--line);
}
.mobile-bar .link-primary { flex: 1; min-height: 44px; }
.mobile-bar { transform: translateY(100%); transition: transform 250ms var(--ease-out); }
.mobile-bar.is-on { transform: none; }
@media (min-width: 1024px) { .mobile-bar { display: none; } }

/* ---------- Soporte de scroll ----------
   Solo con JS y sin movimiento reducido (html.motion-ok). Una vez por elemento. El contenido nunca queda oculto sin JS. */
html.motion-ok [data-in] { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
html.motion-ok [data-in].is-in { opacity: 1; transform: none; }
html.motion-ok .obra-thumb[data-in] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 800ms var(--ease-out); }
html.motion-ok .obra-thumb[data-in].is-in { clip-path: inset(0); }
/* Separadores que se dibujan */
.stage, .service { position: relative; border-bottom: 0; }
.stage::after, .service::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px solid var(--line); transform-origin: left; transition: transform 900ms var(--ease-out); transition-delay: var(--d, 0ms); }
html.motion-ok .stage[data-in]::after, html.motion-ok .service[data-in]::after { transform: scaleX(0); }
html.motion-ok .stage[data-in].is-in::after, html.motion-ok .service[data-in].is-in::after { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .arrow::before, .arrow::after, .mobile-bar, .hero-cap, .to-top { transition: none; }
  .hero-slide.is-entering { animation: none; }
}
