/* ===========================================================
   INTEGRAL DE FACHADAS — sistema visual
   Concepto: "el plano vertical". La empresa trabaja en vertical
   (trabajos verticales, andamios): el sitio tiene un eje vertical
   persistente y profundidad por capas de parallax — la página se
   recorre como se recorre una fachada, de arriba abajo.
   Paleta: noche cálida mediterránea + luz de hora dorada.
   Todos los valores viven aquí. Nunca hardcodear en el HTML.
   =========================================================== */

:root {
  /* --- color --- */
  --ink:      #14110E;   /* base, negro cálido (nunca negro puro) */
  --ink-2:    #1D1813;   /* superficie elevada */
  --ink-3:    #2A231B;   /* bordes sobre oscuro */
  --lime:     #F4EFE6;   /* cal / texto principal sobre oscuro */
  --lime-2:   #DED5C6;
  --ochre:    #C89B5C;   /* acento cálido, uso escaso */
  --ochre-dk: #8F6E3F;
  --muted:    #9C9184;
  --muted-dk: #6E655A;

  /* --- tipografía --- */
  --serif: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans:  'Bricolage Grotesque', system-ui, sans-serif;

  /* --- espaciado, 8pt. Escala COMPLETA: no volver a usar un token inexistente --- */
  --s-1: .5rem;  --s-2: 1rem;   --s-3: 1.5rem; --s-4: 2rem;
  --s-5: 2.5rem; --s-6: 3rem;   --s-7: 3.5rem; --s-8: 4rem;
  --s-10: 5rem;  --s-12: 6rem;  --s-16: 8rem;  --s-20: 10rem;

  --wrap: 1240px;
  --nav-h: 76px;
  --ease: cubic-bezier(.22,1,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ochre); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-4); }
@media (max-width: 560px) { .wrap { padding-inline: var(--s-3); } }

/* ---------- tipografía de rol ---------- */
.d1, .d2, .d3 { font-family: var(--serif); font-weight: 600; margin: 0; color: var(--lime); }
.d1 { font-size: clamp(2.2rem, 4.8vw, 4.2rem); line-height: 1.1; letter-spacing: -.03em; }
.d2 { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.12; letter-spacing: -.025em; }
.d3 { font-size: clamp(1.3rem, 2.2vw, 1.85rem); line-height: 1.15; letter-spacing: -.015em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.28rem); line-height: 1.62; color: var(--lime-2); margin: 0; }
.body { color: var(--muted); margin: 0; }
.eyebrow {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .26em; color: var(--ochre);
  margin: 0 0 var(--s-3);
  display: flex; align-items: center; gap: var(--s-2);
}
.eyebrow::before {
  content: ''; width: 28px; height: 1px; background: var(--ochre-dk); flex: none;
}
.idx { font-family: var(--serif); font-weight: 400; font-size: .95rem; color: var(--ochre-dk); font-variant-numeric: tabular-nums; }

/* ---------- botones ---------- */
.btn {
  --btn-bg: var(--ochre); --btn-fg: var(--ink); --btn-bd: var(--ochre);
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2); min-height: 52px; padding: 0 var(--s-5);
  font-family: var(--sans); font-size: .94rem; font-weight: 600; letter-spacing: .01em;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); border-radius: 2px;
  overflow: hidden; cursor: pointer; isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
/* barrido de relleno desde abajo — motion con intención, no un scale genérico */
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--lime); transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover::after, .btn:focus-visible::after { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--ink); border-color: var(--lime); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--lime); --btn-bd: #4A4036; }
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 90; height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(20,17,14,.82); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--ink-3);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 42px; width: auto; }
@media (max-width: 560px) { .brand img { height: 34px; } }
.nav-links { display: flex; align-items: center; gap: var(--s-6); }
.nav-links a {
  position: relative; font-size: .9rem; font-weight: 500; color: var(--lime-2);
  padding-block: 4px; transition: color .3s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--ochre); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav-links a:hover { color: var(--lime); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { flex: none; }
@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 480px) { .nav-cta { display: none; } }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 78svh; display: flex; align-items: flex-end;
  overflow: hidden; padding-top: var(--nav-h);
}
.hero-media { position: absolute; inset: -6% 0 0; z-index: 0; will-change: transform; }
/* Dos capas: el póster es una <img> propia detrás, y el vídeo entra por encima
   cuando puede reproducir. Así nunca hay negro ni salto — y si el autoplay se
   bloquea o hay ahorro de datos, lo que queda es el póster, no un hueco. */
.hero-media > * {
  position: absolute; inset: 0;
  width: 100%; height: 112%; object-fit: cover; object-position: center 42%;
}
.hero-media video { opacity: 0; transition: opacity 1.2s var(--ease-out); }
.hero-media video.is-ready { opacity: 1; }
/* Gradientes: legibilidad garantizada sobre cualquier fotograma del vídeo */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(20,17,14,.86) 26%, rgba(20,17,14,.30) 62%, rgba(20,17,14,.55) 100%);
}
.hero::after { /* viñeta lateral suave */
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(20,17,14,.55) 100%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding-block: var(--s-4) var(--s-6); }
.hero-title { max-width: 34ch; }
.hero-title .amber { color: var(--ochre); font-style: italic; font-weight: 400; }
.hero-title em.amber { font-style: italic; }
.hero-lead { max-width: 46ch; margin-top: var(--s-3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* Pantallas bajas o móvil: el hero tiene que caber sin empujar los datos
   de confianza fuera de la primera pantalla. */
/* Portátiles bajos (720p): el titular manda menos y los datos siguen entrando. */
@media (max-height: 780px) and (min-width: 561px) {
  .hero .d1 { font-size: clamp(2.2rem, 4.3vw, 3.5rem); }
  .hero-lead { font-size: .98rem; }
}
@media (max-height: 780px), (max-width: 560px) {
  .hero-lead { font-size: 1rem; max-width: 40ch; }
  .hero-actions { margin-top: var(--s-4); }
  .hero-facts { margin-top: var(--s-4); padding-top: var(--s-3); gap: var(--s-2) var(--s-4); }
  .fact-n { font-size: 1.35rem; }
  .fact-l { font-size: .68rem; }
  .hero-inner { padding-block: var(--s-4) var(--s-6); }
}

.hero-facts {
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6);
  margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px solid rgba(244,239,230,.16);
}
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact-n { font-family: var(--serif); font-size: clamp(1.45rem, 2.2vw, 1.9rem); font-weight: 600; line-height: 1; }
.fact-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }

/* pista de scroll, se desvanece al bajar */
.scroll-cue {
  position: absolute; right: var(--s-4); bottom: var(--s-6); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  font-size: .66rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted);
  writing-mode: vertical-rl;
}
.scroll-cue span { display: block; }
.scroll-cue i {
  display: block; width: 1px; height: 54px; background: linear-gradient(var(--ochre), transparent);
  animation: cueDrop 2.4s var(--ease) infinite;
}
@keyframes cueDrop { 0%{transform:scaleY(0);transform-origin:top} 55%{transform:scaleY(1);transform-origin:top} 56%{transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }
@media (max-width: 900px) { .scroll-cue { display: none; } }

/* ---------- secciones ---------- */
.section { position: relative; padding-block: clamp(2.75rem, 5.5vw, 5rem); }
.section-head { max-width: 640px; margin-bottom: var(--s-6); }

/* raíl vertical: el eje del concepto, recorre toda la página */
.rail { display: none; }
@media (max-width: 900px) { .rail { display: none; } }

/* ---------- sobre la empresa ---------- */
.about-grid {
  display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.about-copy { min-width: 0; }
.about-grid .ba { margin-top: 0; min-width: 0; }
.about-copy p + p { margin-top: var(--s-4); }
.about-figure { position: relative; }
.about-figure .frame { position: relative; overflow: hidden; border-radius: 2px; aspect-ratio: 4/5; }
.about-figure .frame img { width: 100%; height: 112%; object-fit: cover; will-change: transform; }
.about-note {
  position: absolute; left: calc(var(--s-5) * -1); bottom: var(--s-6);
  background: var(--ink-2); border: 1px solid var(--ink-3); border-left: 2px solid var(--ochre);
  padding: var(--s-3) var(--s-4); max-width: 260px;
}
.about-note b { font-family: var(--serif); font-weight: 600; display: block; font-size: 1.05rem; }
.about-note span { font-size: .82rem; color: var(--muted); }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ---------- servicios: lista editorial con un icono de línea por servicio ----------
   Los iconos son SVG propios (i18n/iconos.py) con el trazo fino del logo: línea crema,
   una pieza en ocre y un tinte ocre suave. Se dibujan al entrar en pantalla. */
.svc { border-top: 1px solid var(--ink-3); }
.svc-item {
  position: relative; display: grid; grid-template-columns: 3.25rem 5.25rem 1fr 1.15fr;
  gap: var(--s-4); align-items: center;
  padding-block: var(--s-5); border-bottom: 1px solid var(--ink-3);
  transition: background .5s var(--ease);
}
.svc-item::before { /* barrido de luz desde la izquierda al hover */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(200,155,92,.10), transparent 62%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.svc-item:hover::before { opacity: 1; }
.svc-item:hover .svc-name { color: var(--ochre); transform: translateX(6px); }
.svc-name {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1.15; margin: 0; transition: color .4s var(--ease), transform .5s var(--ease);
}
.svc-desc { color: var(--muted); font-size: .95rem; margin: 0; }

.svc-ic { width: 4.75rem; height: 4.75rem; color: var(--lime-2); overflow: visible; transition: color .5s var(--ease); }
.svc-ic .ln {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  /* «1 2»: con pathLength=1 el trazo queda oculto sin dejar el punto del extremo redondeado */
  stroke-dasharray: 1 2; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.3s var(--ease-out), stroke .5s var(--ease);
  transition-delay: calc(var(--d, 0s) + .12s + var(--i, 0) * .09s), 0s;
}
.svc-ic .ln.ac { stroke: var(--ochre); }
.svc-ic .fl {
  fill: var(--ochre); fill-opacity: 0; stroke: none;
  transition: fill-opacity 1s var(--ease-out); transition-delay: calc(var(--d, 0s) + .9s);
}
.svc-item.is-in .svc-ic .ln { stroke-dashoffset: 0; }
.svc-item.is-in .svc-ic .fl { fill-opacity: .2; }
.svc-item:hover .svc-ic { color: var(--lime); }
.svc-item:hover .svc-ic .fl { fill-opacity: .34; transition-delay: 0s; }
@media (max-width: 820px) {
  .svc-item { grid-template-columns: 3.75rem 1fr; column-gap: var(--s-3); row-gap: 2px; align-items: start; padding-block: var(--s-4); }
  .svc-item > .idx { display: none; }
  .svc-ic { grid-column: 1; grid-row: 1 / span 2; width: 3.5rem; height: 3.5rem; }
  .svc-name { grid-column: 2; grid-row: 1; align-self: end; }
  .svc-desc { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-ic .ln { stroke-dashoffset: 0 !important; }
  .svc-ic .fl { fill-opacity: .2 !important; }
}

/* ---------- franja: zona de trabajo, con parallax ---------- */
.band { position: relative; overflow: hidden; }
.band-media { position: absolute; inset: -12% 0; z-index: 0; }
.band-media img { width: 100%; height: 124%; object-fit: cover; will-change: transform; }
.band::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to right, var(--ink) 4%, rgba(20,17,14,.80) 42%, rgba(20,17,14,.55) 100%);
}
.band .wrap { position: relative; z-index: 2; }
.band-inner { max-width: 560px; padding-block: clamp(5rem, 12vw, 9rem); }

/* ---------- obras: un tipo de obra por tarjeta, cada una abre su galería ---------- */
.types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.type-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 2px; overflow: hidden;
  transition: border-color .45s var(--ease), transform .6s var(--ease);
}
.type-card:hover, .type-card:focus-visible { border-color: var(--ochre-dk); }
.tc-img { display: block; aspect-ratio: 4/5; overflow: hidden; background: var(--ink-3); }
.tc-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.4s var(--ease);
}
.type-card:hover .tc-img img, .type-card:focus-visible .tc-img img { transform: scale(1.04); }
.tc-body { display: flex; flex-direction: column; gap: 6px; padding: var(--s-3); flex: 1; }
.tc-count { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .15em; color: var(--ochre); }
.tc-name { font-family: var(--serif); font-weight: 600; font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.15; margin: 0; }
.tc-sum { font-size: .86rem; line-height: 1.5; color: var(--muted); margin: 0; }
.tc-go {
  margin-top: auto; padding-top: var(--s-2); display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--lime-2); transition: color .4s var(--ease);
}
.tc-go svg { transition: transform .45s var(--ease); }
.type-card:hover .tc-go, .type-card:focus-visible .tc-go { color: var(--ochre); }
.type-card:hover .tc-go svg { transform: translate(3px, -3px); }
.obras-lead { margin-top: var(--s-3); max-width: 52ch; }
@media (max-width: 1000px) { .types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .types { gap: var(--s-2); }
  .tc-body { padding: var(--s-2); gap: 4px; }
  .tc-sum { display: none; }
  .tc-name { font-size: 1.02rem; }
  .tc-go { padding-top: 4px; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .type-card:hover .tc-img img, .type-card:hover .tc-go svg { transform: none; }
}

.works-note {
  margin-top: var(--s-5); font-size: .84rem; color: var(--muted-dk); max-width: 62ch;
}
/* inline-block, no flex: en flex el enlace se separa del texto al envolver */
.works-note::before {
  content: ''; display: inline-block; width: 18px; height: 1px; background: var(--ochre-dk);
  vertical-align: middle; margin-right: var(--s-2);
}
.works-note a { color: var(--muted); border-bottom: 1px solid var(--ochre-dk); padding-bottom: 1px; }
.works-note a:hover { color: var(--ochre); }

/* ---------- contacto ---------- */
.contact { background: var(--ink-2); border-top: 1px solid var(--ink-3); }
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact-side { min-width: 0; }
.contact-list { display: flex; flex-direction: column; gap: 0; margin-top: var(--s-2); }
.contact-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-block: var(--s-4); border-bottom: 1px solid var(--ink-3);
  transition: padding-left .45s var(--ease), border-color .45s var(--ease);
}
.contact-row:first-child { border-top: 1px solid var(--ink-3); }
a.contact-row:hover { padding-left: var(--s-2); border-color: var(--ochre-dk); }
a.contact-row:hover .contact-val { color: var(--ochre); }
.contact-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted-dk); }
.contact-val { font-family: var(--serif); font-size: clamp(1.02rem, 1.5vw, 1.22rem); font-weight: 600; transition: color .4s var(--ease); }
.contact-val small { display: block; font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.contact-arrow { color: var(--ochre-dk); flex: none; transition: transform .45s var(--ease); }
a.contact-row:hover .contact-arrow { transform: translate(4px, -4px); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.footer { border-top: 1px solid var(--ink-3); padding-block: var(--s-4); }
.footer-in { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); justify-content: space-between; align-items: center; }
.footer-legal { font-size: .76rem; color: var(--muted); line-height: 1.7; max-width: 62ch; }
.footer-legal a { white-space: nowrap; } /* con Bricolage el reflujo partía «Aviso / legal» entre dos líneas a 390 px */
.footer-by { font-size: .78rem; color: var(--muted); }
.footer-by a { color: var(--lime-2); border-bottom: 1px solid var(--ink-3); transition: color .3s, border-color .3s; }
.footer-by a:hover { color: var(--ochre); border-color: var(--ochre-dk); }


/* ---------- reveals (IntersectionObserver) ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
  transition-delay: var(--d, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Revelado por líneas de titular: clip vertical, encaja con el eje del concepto.
   El padding-bottom deja sitio a los descendentes (la "j" de trabajos se cortaba
   contra el overflow:hidden); el margen negativo lo compensa para que el
   interlineado no cambie. El translate sube a 125% para que la línea siga
   escondida pese a ese hueco extra. */
.line-mask {
  display: block; overflow: hidden;
  /* La itálica del titular baja mucho: la cola de la "j" de "trabajos" necesita
     ~.32em por debajo de la caja de línea o el overflow la corta en plano.
     El margen negativo devuelve el interlineado a su sitio. */
  padding-bottom: .34em; margin-bottom: -.34em;
}
.line-mask > span {
  display: block;
  /* > 134% (alto de línea 1em + .34em de padding) para que la línea siga
     escondida antes de subir, pese al hueco extra del descendente. */
  transform: translateY(145%);
  transition: transform 1s var(--ease-out); transition-delay: var(--d, 0s);
}
.is-in .line-mask > span, .line-mask.is-in > span { transform: none; }

/* ---------- accesibilidad: sin movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .line-mask > span { transform: none !important; }
    [data-parallax] { transform: none !important; }
}

/* ---------- antes / después: dos fotos de la misma obra ----------
   Sin deslizador: las dos tomas son de la misma obra pero no del mismo
   encuadre, y un comparador con clip-path solo funciona si lo son. */
.ba { position: relative; margin: var(--s-6) 0 0; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.ba-shot {
  position: relative; overflow: hidden; border-radius: 2px; background: var(--ink-2);
}
.ba-shot img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; display: block; }
.ba-tag {
  position: absolute; left: var(--s-2); bottom: var(--s-2); z-index: 2;
  font-family: var(--sans); font-size: .64rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  padding: .35rem .6rem; border-radius: 2px;
  background: rgba(20,17,14,.78); color: var(--lime); backdrop-filter: blur(4px);
}
.ba-tag.is-after { color: var(--ochre); }
.ba-note { margin-top: var(--s-3); font-size: .84rem; line-height: 1.7; color: var(--muted-dk); }
@media (max-width: 560px) { .ba-pair { grid-template-columns: 1fr; gap: var(--s-3); } }

/* ---------- calculadora de presupuesto ---------- */
.quote-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; } }

.q-tabs { display: flex; gap: 0; border: 1px solid var(--ink-3); border-radius: 2px; overflow: hidden; margin-bottom: var(--s-5); }
.q-tab {
  flex: 1; min-height: 52px; padding: 0 var(--s-2);
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  font-family: var(--sans); font-size: .92rem; font-weight: 600;
  border-right: 1px solid var(--ink-3);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.q-tab:last-child { border-right: 0; }
.q-tab:hover { color: var(--lime); }
.q-tab[aria-selected="true"] { background: var(--ochre); color: var(--ink); }

.q-block { margin-bottom: var(--s-5); }
.q-block > h3 {
  font-family: var(--sans); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em; color: var(--ochre);
  margin: 0 0 var(--s-3);
}
.q-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s-2); }
/* móvil: dos por fila — el formulario tiene 5 grupos y a una columna se hacía interminable */
@media (max-width: 560px) { .q-cards { grid-template-columns: 1fr 1fr; gap: var(--s-2); } .q-card { padding: var(--s-2); } .q-card b { font-size: .92rem; } .q-card span { font-size: .74rem; } }
.q-card {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: var(--s-3); border: 1px solid var(--ink-3); border-radius: 2px;
  background: var(--ink-2); cursor: pointer;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.q-card:hover { border-color: var(--ochre-dk); }
.q-card input { position: absolute; opacity: 0; pointer-events: none; }
.q-card b { font-size: .98rem; font-weight: 600; color: var(--lime); }
.q-card span { font-size: .8rem; color: var(--muted); }
.q-card:has(input:checked) { border-color: var(--ochre); background: #241D14; }
.q-card:has(input:focus-visible) { outline: 2px solid var(--ochre); outline-offset: 2px; }

.q-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-block: var(--s-3); border-bottom: 1px solid var(--ink-3);
}
.q-row:first-of-type { border-top: 1px solid var(--ink-3); }
.q-row-l b { display: block; font-size: .96rem; font-weight: 600; color: var(--lime); }
.q-row-l span { font-size: .8rem; color: var(--muted); }
.q-step { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.q-step button {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--ink-3); color: var(--lime);
  font-size: 1.1rem; line-height: 1; transition: border-color .25s, background .25s;
}
.q-step button:hover { border-color: var(--ochre); background: var(--ink-2); }
.q-step output { min-width: 26px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.q-check { position: relative; display: flex; align-items: center; }
.q-check input { position: absolute; opacity: 0; pointer-events: none; }
.q-check span {
  width: 24px; height: 24px; border: 1px solid var(--ink-3); border-radius: 2px;
  display: grid; place-items: center; cursor: pointer; transition: all .25s var(--ease);
}
.q-check input:checked + span { background: var(--ochre); border-color: var(--ochre); }
.q-check input:checked + span::after { content: '✓'; color: var(--ink); font-size: .8rem; font-weight: 700; }
.q-check input:focus-visible + span { outline: 2px solid var(--ochre); outline-offset: 2px; }

.q-field { display: flex; flex-direction: column; gap: 6px; }
.q-field label { font-size: .8rem; color: var(--muted); }
.q-field input, .q-field textarea {
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 2px;
  color: var(--lime); font-family: var(--sans); font-size: .96rem;
  padding: var(--s-2); min-height: 48px; width: 100%;
}
.q-field input:focus, .q-field textarea:focus { outline: none; border-color: var(--ochre); }
.q-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 560px) { .q-fields { grid-template-columns: 1fr; } }

.q-panel {
  position: sticky; top: calc(var(--nav-h) + var(--s-3));
  border: 1px solid var(--ink-3); background: var(--ink-2); padding: var(--s-4); border-radius: 2px;
}
.q-total-lb { font-size: .74rem; text-transform: uppercase; letter-spacing: .2em; color: var(--ochre); }
.q-total {
  font-family: var(--serif); font-weight: 600; line-height: 1;
  font-size: clamp(2rem, 4vw, 2.9rem); color: var(--lime); margin: var(--s-2) 0 var(--s-1);
  font-variant-numeric: tabular-nums;
}
.q-total small { font-size: .9rem; font-family: var(--sans); color: var(--muted); font-weight: 400; }
.q-lines { margin: var(--s-3) 0; border-top: 1px solid var(--ink-3); }
.q-line {
  display: flex; justify-content: space-between; gap: var(--s-2);
  padding-block: 7px; font-size: .85rem; color: var(--muted-dk);
  border-bottom: 1px solid var(--ink-3);
}
.q-line b { color: var(--lime-2); font-weight: 500; }
.q-panel .btn { width: 100%; margin-top: var(--s-2); }
.q-warn {
  margin-top: var(--s-3); font-size: .76rem; color: var(--muted-dk); line-height: 1.55;
  border-left: 2px solid var(--ochre-dk); padding-left: var(--s-2);
}
.q-hidden { display: none !important; }

/* ---------- selector de idioma (ES · CA · EN) ----------
   Fuera de .nav-links a propósito: esos se ocultan en móvil y el idioma tiene que verse siempre. */
.nav-end { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.lang { display: flex; align-items: center; gap: 2px; }
.lang a {
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; color: var(--muted);
  padding: 6px 7px; border-radius: 2px; transition: color .3s var(--ease);
}
.lang a:hover { color: var(--lime); }
.lang a[aria-current] { color: var(--ochre); }
@media (max-width: 480px) { .lang a { padding: 6px 5px; } }

/* ---------- redes sociales (contacto y pie) ----------
   Solo las que existen de verdad. Para añadir otra (TikTok, Google…) basta una <a> más en
   i18n/generar-obras.py (SOCIAL) y volver a ejecutarlo. */
.social { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-5); }
.social-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted-dk); margin-right: var(--s-1); }
.social-l { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.social a {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1px solid var(--ink-3); border-radius: 50%; color: var(--lime-2);
  transition: color .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease), transform .5s var(--ease);
}
.social a:hover, .social a:focus-visible { color: var(--ink); background: var(--ochre); border-color: var(--ochre); transform: translateY(-3px); }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact-side .social { margin-bottom: var(--s-5); }
.footer-social { margin-top: 0; }
.footer-social a { width: 40px; height: 40px; }
.footer-social svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .social a:hover { transform: none; } }

/* ---------- páginas de obra por tipo (/obras/…) ---------- */
.obras-page { padding-top: calc(var(--nav-h) + var(--s-6)); }
.obras-page .back { display: inline-block; margin-bottom: var(--s-3); color: var(--ochre); font-size: .9rem; }
.obras-page .section-head { max-width: 720px; }
.obras-page h1.d2 { line-height: 1.12; }

.gal { column-count: 3; column-gap: var(--s-3); margin-top: var(--s-2); }
.gal-item {
  display: block; width: 100%; margin: 0 0 var(--s-3); padding: 0; border: 0; border-radius: 2px;
  background: var(--ink-2); overflow: hidden; cursor: zoom-in; break-inside: avoid;
  position: relative; color: inherit; font: inherit;
}
.gal-item img { width: 100%; height: auto; display: block; transition: transform 1.2s var(--ease); }
.gal-item:hover img, .gal-item:focus-visible img { transform: scale(1.035); }
@media (max-width: 900px) { .gal { column-count: 2; } }
@media (max-width: 560px) { .gal { column-gap: var(--s-2); } .gal-item { margin-bottom: var(--s-2); } }
@media (prefers-reduced-motion: reduce) { .gal-item:hover img { transform: none; } }

.type-nav { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--ink-3); }
.type-nav h2 { font-family: var(--sans); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--ochre); margin: 0 0 var(--s-3); }
.type-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.type-nav a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s-3);
  border: 1px solid var(--ink-3); border-radius: 2px; font-size: .92rem; font-weight: 500; color: var(--lime-2);
  transition: color .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.type-nav a:hover, .type-nav a:focus-visible { color: var(--lime); border-color: var(--ochre-dk); background: var(--ink-2); }
.page-cta { margin-top: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.page-cta p { margin: 0; color: var(--lime-2); max-width: 44ch; }

/* ---------- visor de fotos (<dialog>) ---------- */
.lb {
  border: 0; padding: 0; margin: 0; background: transparent; color: var(--lime);
  width: 100%; max-width: 100vw; height: 100%; max-height: 100dvh;
}
.lb::backdrop { background: rgba(10,8,6,.94); }
.lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; }
.lb-fig { margin: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: var(--s-8) var(--s-3) 0; width: 100%; height: 100%; }
.lb-fig img { max-width: min(100%, 1100px); max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; }
.lb-cap { padding: var(--s-2) var(--s-8) var(--s-4); text-align: center; font-size: .9rem; line-height: 1.5; color: var(--lime-2); max-width: 70ch; }
.lb-count { display: block; margin-top: 2px; font-size: .72rem; letter-spacing: .15em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  background: rgba(20,17,14,.7); color: var(--lime); border: 1px solid var(--ink-3); border-radius: 50%; cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.lb-btn:hover, .lb-btn:focus-visible { background: var(--ochre); border-color: var(--ochre); color: var(--ink); }
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: var(--s-2); right: var(--s-2); }
.lb-prev { left: var(--s-2); top: 50%; transform: translateY(-50%); }
.lb-next { right: var(--s-2); top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) {
  .lb-fig { padding: var(--s-8) var(--s-1) 0; }
  .lb-cap { padding-inline: 4.75rem; min-height: 3.5rem; }
  .lb-prev, .lb-next { top: auto; bottom: var(--s-2); transform: none; }
  .lb-prev { left: var(--s-2); } .lb-next { right: var(--s-2); }
}
