/* =============================================
   FABRICADOS LIGEROS — web-lujo
   Concepto: "oficio y materia". Editorial cálido (hueso / negro forja),
   titulares en serif, un único acento azul pavonado del logo,
   piezas con doble marco como metal mecanizado y movimiento con inercia.
   ============================================= */

:root {
  --paper: #111214;
  --paper-2: #17191C;
  --paper-3: #1E2024;
  --ink: #F4F5F7;
  --ink-2: #BCC1C8;
  --muted: #8C929B;
  --line: #2A2D33;
  --steel: #8FAAD3;
  --steel-600: #C9D6EA;
  --steel-300: #8FAAD3;
  --steel-100: #1A2233;
  --night: #050506;
  --night-2: #0E0F12;
  --fog: #A0A6AF;
  --wa: #1F9D55;

  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 88px;

  /* Escala de z-index */
  --z-grain: 30;
  --z-float: 40;
  --z-menu: 45;
  --z-header: 50;
  --z-modal: 100;
}

/* ---- Tipografías alojadas en el propio servidor ---- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Grano de papel: capa fija, nunca sobre contenedores que hacen scroll */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--steel);
  color: #050506;
}

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--steel-300);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: calc(var(--z-header) + 1);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 2px;
  font-weight: 600;
  transition: top 0.4s var(--ease-fluid);
}

.skip-link:focus {
  top: 12px;
}

/* ---- Tipografía ---- */
.font-display {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-weight: 560 !important;
  letter-spacing: -0.01em;
}

.font-display em,
.font-display i,
.font-serif em,
.serif-italic {
  font-style: normal;
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-weight: 520;
}

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.tabular { font-variant-numeric: tabular-nums; }

/* Etiqueta en píldora sobre los titulares */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--steel);
}

.on-dark .eyebrow {
  color: var(--fog);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.on-dark .eyebrow::before {
  background: var(--steel-300);
}

/* Número de índice editorial (01, 02…) */
.index-num {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-weight: 520;
  color: var(--steel);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---- Superficies ---- */

/* La retícula técnica de la versión anterior desaparece: aquí manda el papel */
.blueprint-grid { display: none; }

.grain { position: relative; }

/* Doble marco: bandeja exterior + núcleo interior con radios concéntricos */
.bezel {
  padding: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.bezel-core {
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.3),
    0 24px 48px -32px rgba(0, 0, 0, 0.40);
}

.on-dark .bezel {
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.on-dark .bezel-core {
  background: var(--night-2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.07);
}

/* Imagen con doble marco sin envoltorio: el relleno hace de bandeja y el
   navegador recorta la foto con el radio interior automáticamente */
.bezel-img {
  padding: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 30px 60px -40px rgba(0, 0, 0, 0.63);
}

/* Doble marco en un solo elemento: la bandeja se dibuja con anillos de sombra */
.bezel-solo {
  margin: 7px;
  border-radius: 2px;
  background: var(--paper-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 6px rgba(255, 255, 255, 0.035), 0 0 0 7px rgba(255, 255, 255, 0.06),
    0 30px 60px -40px rgba(0, 0, 0, 0.54);
}

img.bezel-solo { padding: 0; object-fit: cover; }

/* Cota decorativa (línea de medida) */
.cota {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cota::before,
.cota::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

.cota > span { white-space: nowrap; }

/* Filete fino de sección */
.rule {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

/* ---- Entrada al hacer scroll ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition: opacity 1s var(--ease-fluid), transform 1.1s var(--ease-fluid), filter 1s var(--ease-fluid);
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.js .reveal-delay-1 { transition-delay: 0.08s; }
.js .reveal-delay-2 { transition-delay: 0.16s; }
.js .reveal-delay-3 { transition-delay: 0.24s; }

/* Titular de portada: líneas que suben desde una máscara */
.js .line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.js .line-mask > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1.3s var(--ease-fluid);
}

.js .is-loaded .line-mask > span { transform: none; }
.js .is-loaded .line-mask:nth-child(2) > span { transition-delay: 0.09s; }
.js .is-loaded .line-mask:nth-child(3) > span { transition-delay: 0.18s; }
.js .is-loaded .line-mask:nth-child(4) > span { transition-delay: 0.27s; }

/* ---- Botones (píldoras con icono anidado) ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  line-height: 1;
  transition: background-color 0.5s var(--ease-fluid), color 0.5s var(--ease-fluid),
    box-shadow 0.5s var(--ease-fluid), transform 0.5s var(--ease-fluid);
  user-select: none;
  -webkit-user-select: none;
}

.btn:active { transform: scale(0.98); }

/* La flecha vive en su propio círculo, pegada al borde derecho */
.btn svg.arrow {
  box-sizing: content-box;
  width: 14px;
  height: 14px;
  padding: 10px;
  margin-right: -16px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 0.6s var(--ease-fluid), background-color 0.5s var(--ease-fluid);
}

.btn:has(svg.arrow) { padding-right: 24px; }

.btn:hover svg.arrow {
  transform: translate(3px, -1px) scale(1.06);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px -18px rgba(0, 0, 0, 0.90);
}

.btn-primary:hover {
  background: var(--steel-600);
}

.btn-wa {
  background: var(--wa);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 30px -18px rgba(31, 157, 85, 0.8);
}

.btn-wa:hover { background: #198549; }

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  background: var(--paper-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.btn-ghost svg.arrow { background: rgba(255, 255, 255, 0.06); }

.on-dark .btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.on-dark .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn-light {
  background: #FFFFFF;
  color: #0A0B0D;
}

.btn-light:hover { background: var(--steel-600); }

.btn-light svg.arrow { background: rgba(10, 11, 13, 0.08); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.7s var(--ease-fluid), color 0.4s var(--ease-fluid);
}

.link-arrow:hover {
  background-size: 100% 1px;
  color: var(--steel);
}

.link-arrow .arrow {
  transition: transform 0.6s var(--ease-fluid);
}

.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* ---- Cabecera: isla flotante ---- */
#main-header {
  padding-top: 14px;
  pointer-events: none;
}

#main-header .nav-island {
  pointer-events: auto;
  background: rgba(17, 18, 20, 0.72);
  backdrop-filter: saturate(1.3) blur(18px);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 10px 30px -20px rgba(0, 0, 0, 0.63);
  transition: background-color 0.6s var(--ease-fluid), box-shadow 0.6s var(--ease-fluid);
}

#main-header.nav-scrolled .nav-island {
  background: rgba(17, 18, 20, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 40px -24px rgba(0, 0, 0, 0.81);
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.4s var(--ease-fluid), background-color 0.4s var(--ease-fluid);
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link[aria-current="true"],
.nav-link[aria-current="page"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

/* Submenú de servicios */
.has-sub { position: relative; }

.sub-menu {
  position: absolute;
  top: 100%;
  left: -12px;
  padding-top: 16px;
  min-width: 320px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s var(--ease-fluid), transform 0.5s var(--ease-fluid), visibility 0s linear 0.5s;
}

.has-sub:hover .sub-menu,
.has-sub:focus-within .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.4s var(--ease-fluid), transform 0.5s var(--ease-fluid), visibility 0s;
}

.sub-menu-inner {
  padding: 6px;
  border-radius: 2px;
  background: rgba(17, 18, 20, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 30px 60px -30px rgba(0, 0, 0, 0.81);
}

.sub-menu a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 2px;
  font-size: 0.9rem;
  color: var(--ink-2);
  transition: background-color 0.3s var(--ease-fluid), color 0.3s var(--ease-fluid);
}

.sub-menu a:hover,
.sub-menu a[aria-current="page"] {
  background: var(--paper-3);
  color: var(--ink);
}

.sub-menu a span {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-size: 0.85rem;
  color: var(--steel);
}

/* Hamburguesa que se convierte en X */
.burger {
  position: relative;
}

.burger span {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 1.5px;
  margin-left: -10px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.6s var(--ease-fluid), opacity 0.3s var(--ease-fluid);
}

.burger span:nth-child(1) { transform: translateY(-4px); }
.burger span:nth-child(2) { transform: translateY(4px); }
.burger span:nth-child(3) { display: none; }

.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); }

/* ---- Menú móvil: capa a pantalla completa con entrada escalonada ---- */
.mobile-menu {
  z-index: var(--z-menu);
  visibility: hidden;
  opacity: 0;
  background: rgba(17, 18, 20, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  transition: opacity 0.5s var(--ease-fluid), visibility 0s linear 0.5s;
}

.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s var(--ease-fluid), visibility 0s;
}

.mobile-menu .stagger > * {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s var(--ease-fluid), transform 0.8s var(--ease-fluid);
}

.mobile-menu.open .stagger > * {
  opacity: 1;
  transform: none;
}

.mobile-menu.open .stagger > *:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.open .stagger > *:nth-child(2) { transition-delay: 0.13s; }
.mobile-menu.open .stagger > *:nth-child(3) { transition-delay: 0.18s; }
.mobile-menu.open .stagger > *:nth-child(4) { transition-delay: 0.23s; }
.mobile-menu.open .stagger > *:nth-child(5) { transition-delay: 0.28s; }
.mobile-menu.open .stagger > *:nth-child(6) { transition-delay: 0.33s; }

/* ---- Franja de especialidades ---- */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Desplazamiento continuo: aquí lo correcto es velocidad constante */
.marquee-track { animation: marquee 70s linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* ---- Índice de servicios (portada) ---- */
.service-line {
  position: relative;
  border-top: 1px solid var(--line);
}

.service-line::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-fluid);
}

.service-line:hover::before { transform: scaleX(1); }

.service-line .service-name {
  transition: transform 0.8s var(--ease-fluid), color 0.5s var(--ease-fluid);
}

.service-line:hover .service-name {
  transform: translateX(12px);
}

.service-line .service-go {
  pointer-events: none; /* al girar quedaría encima del enlace de la fila */
  transition: transform 0.7s var(--ease-fluid), background-color 0.5s var(--ease-fluid), color 0.5s var(--ease-fluid);
}

.service-line:hover .service-go {
  transform: rotate(-45deg);
  background: var(--ink);
  color: var(--paper);
}

/* Compatibilidad con las filas de la versión anterior */
.service-row { position: relative; }

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ---- Proyectos ---- */
.project-card { isolation: isolate; }

.project-card img {
  transition: transform 1.4s var(--ease-fluid);
}

.project-card:hover img,
.project-card:focus-within img {
  transform: scale(1.045);
}

.project-card .stretched::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
}

.project-card .stretched:focus-visible { outline: none; }

.project-card:has(.stretched:focus-visible) {
  outline: 2px solid var(--steel-300);
  outline-offset: 4px;
}

.project-card .view-hint {
  transition: opacity 0.5s var(--ease-fluid), transform 0.7s var(--ease-fluid);
}

@media (hover: hover) {
  .project-card .view-hint {
    opacity: 0;
    transform: translateY(8px);
  }

  .project-card:hover .view-hint,
  .project-card:focus-within .view-hint {
    opacity: 1;
    transform: none;
  }
}

/* ---- Formulario ---- */
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.field {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  font-size: 1rem; /* 16px: evita el zoom automático en iOS */
  color: var(--ink);
  background: var(--paper-3);
  border: 0;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.4s var(--ease-fluid);
}

.field::placeholder { color: #6E747C; }

.field:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }

.field:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--steel), 0 0 0 4px rgba(19, 41, 75, 0.12);
}

.field[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1.5px #B42318, 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #B42318;
}

.field-error.show { display: block; }

.check {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid #5A6068;
  border-radius: 2px;
  background: var(--paper-3);
  display: grid;
  place-content: center;
  transition: background-color 0.3s var(--ease-fluid), border-color 0.3s var(--ease-fluid);
}

.check::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.4s var(--ease-fluid);
}

.check:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.check:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.check[aria-invalid="true"] { border-color: #B42318; }

.contact-channel {
  transition: background-color 0.5s var(--ease-fluid), box-shadow 0.5s var(--ease-fluid), transform 0.5s var(--ease-fluid);
}

.contact-channel:hover {
  background-color: var(--paper-3);
}

.contact-channel:active { transform: scale(0.99); }

.contact-channel .go {
  transition: transform 0.6s var(--ease-fluid), background-color 0.5s var(--ease-fluid), color 0.5s var(--ease-fluid);
}

.contact-channel:hover .go {
  transform: translate(2px, -1px);
  background: var(--ink);
  color: var(--paper);
}

/* ---- WhatsApp flotante (escritorio) y barra de acción (móvil) ---- */
.wa-float {
  z-index: var(--z-float);
  transition: transform 0.6s var(--ease-fluid), box-shadow 0.6s var(--ease-fluid);
}

.wa-float:hover { transform: translateY(-3px) scale(1.04); }

.mobile-bar {
  z-index: var(--z-float);
  transform: translateY(140%);
  transition: transform 0.7s var(--ease-fluid);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bar.show { transform: none; }

/* ---- Modal de proyecto ---- */
.project-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(6, 10, 18, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 0.5s var(--ease-fluid);
}

.project-modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.project-modal-overlay.visible { opacity: 1; }

.project-modal {
  position: relative;
  background: var(--night);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  max-width: 1000px;
  width: 94%;
  margin: 48px auto;
  overflow: hidden;
  transform: translateY(40px) scale(0.98);
  opacity: 0;
  transition: transform 0.8s var(--ease-fluid), opacity 0.5s var(--ease-fluid);
}

.project-modal-overlay.visible .project-modal {
  transform: none;
  opacity: 1;
}

.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(6, 10, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.4s var(--ease-fluid), transform 0.5s var(--ease-fluid);
}

.project-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(90deg);
}

.project-modal-close:active { transform: scale(0.95); }

.modal-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #060A12;
}

.modal-gallery img,
.modal-gallery video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.7s var(--ease-fluid);
  pointer-events: none;
}

.modal-gallery img.active,
.modal-gallery video.active { opacity: 1; pointer-events: auto; }
.gallery-thumbs button.is-video { position: relative; }
.gallery-thumbs button.is-video::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 0.9rem; background: rgba(0,0,0,.35); }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(6, 10, 18, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.4s var(--ease-fluid);
  z-index: 5;
}

.gallery-nav.show { display: flex; }
.gallery-nav:hover { background: rgba(255, 255, 255, 0.18); }
.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }

.gallery-count {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(6, 10, 18, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  padding: 6px 11px;
  border-radius: 2px;
  max-width: calc(100% - 32px);
  line-height: 1.4;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery-thumbs button {
  flex-shrink: 0;
  width: 68px;
  height: 50px;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0.45;
  box-shadow: inset 0 0 0 1px transparent;
  transition: opacity 0.4s var(--ease-fluid);
}

.gallery-thumbs button[aria-current="true"] {
  opacity: 1;
  outline: 1.5px solid var(--steel-300);
  outline-offset: 2px;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Antes / Después */
.before-after-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 2px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.before-after-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-before { z-index: 2; clip-path: inset(0 50% 0 0); }
.ba-after { z-index: 1; }

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--paper-3);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 2px;
  background: var(--paper-3);
  color: #0A0B0D;
  box-shadow: 0 6px 24px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.ba-label {
  position: absolute;
  top: 14px;
  padding: 5px 11px;
  border-radius: 2px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  z-index: 5;
  pointer-events: none;
}

.ba-label-before { left: 14px; background: rgba(6, 10, 18, 0.6); color: #fff; }
.ba-label-after { right: 14px; background: rgba(255, 255, 255, 0.92); color: #0A0B0D; }

.modal-body { padding: 30px 40px 44px; }

.modal-body h3 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-size: 1.9rem;
  font-weight: 520;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.12;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.modal-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fog);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.modal-description {
  color: var(--fog);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 62ch;
}

.modal-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-300);
  margin: 28px 0 12px;
}

/* ---- Migas de pan ---- */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.breadcrumb li:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  color: var(--fog);
}

.breadcrumb a {
  color: var(--ink-2);
  transition: color 0.3s var(--ease-fluid);
}

.breadcrumb a:hover { color: var(--ink); }

.on-dark .breadcrumb ol { color: var(--fog); }
.on-dark .breadcrumb a { color: #fff; }

/* ---- Contenido de texto largo ---- */
.prose-fl {
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.prose-fl > * + * { margin-top: 1.1em; }

.prose-fl h2 {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 520;
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem);
  line-height: 1.1;
  margin-top: 2.4em;
}

.prose-fl h3 {
  color: var(--ink);
  font-weight: 650;
  font-size: 1.15rem;
  line-height: 1.3;
  margin-top: 1.8em;
}

.prose-fl h2 + *,
.prose-fl h3 + * { margin-top: 0.7em; }

.prose-fl ul {
  display: grid;
  gap: 0.6em;
}

.prose-fl ul > li {
  position: relative;
  padding-left: 1.5em;
}

.prose-fl ul > li::before {
  content: '';
  position: absolute;
  left: 0.15em;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--steel);
}

.prose-fl strong {
  color: var(--ink);
  font-weight: 650;
}

.prose-fl a:not(.btn) {
  color: var(--ink);
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(19, 41, 75, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.4s var(--ease-fluid), color 0.4s var(--ease-fluid);
}

.prose-fl a:not(.btn):hover {
  color: var(--steel);
  text-decoration-color: var(--steel);
}

.prose-fl table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose-fl th,
.prose-fl td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose-fl th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose-fl > :first-child { margin-top: 0; }

.prose-fl ol.steps {
  counter-reset: step;
  display: grid;
  gap: 1em;
}

.prose-fl ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3em;
}

.prose-fl ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -0.05em;
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-weight: 520;
  font-size: 1.35rem;
  color: var(--steel);
}

/* ---- Preguntas frecuentes ---- */
.faq-item {
  border-top: 1px solid var(--line);
  padding: 30px 0 34px;
}

.faq-q {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 125%;
  font-weight: 520;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 12px;
}

.faq-a {
  color: var(--ink-2);
  line-height: 1.75;
  max-width: 62ch;
}

/* ---- Zona de trabajo ---- */
.town {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.4s var(--ease-fluid), padding 0.6s var(--ease-fluid);
}

.town .km {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

a.town:hover { color: var(--steel); }

/* ---- Mapa ---- */
.map-facade { background-color: var(--paper-2); }

/* ---- Textos legales ---- */
.legal h2 { font-size: 1.6rem; }

.pending {
  background: #F6E7B8;
  color: #6B4E00;
  padding: 0 5px;
  border-radius: 2px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
}

/* Dibujos técnicos heredados (ya no se usan) */
.drawing { color: var(--steel); }
.drawing .dim { color: var(--muted); }

/* Pie de foto del modal: número + título de la foto, siempre visible */
.modal-caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 18px 2px;
}
.modal-caption[hidden] { display: none; }
.modal-caption-count {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--steel-300);
}
.modal-caption-text {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 110%;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
}
.modal-caption-count:empty { display: none; }
.modal-gallery .gallery-count { display: none; }
.gallery-thumbs { padding-bottom: 4px; }

/* Escritorio: foto + pie a la izquierda, proyecto a la derecha; todo cabe en pantalla */
@media (min-width: 900px) {
  .project-modal-overlay.active { align-items: center; }
  .project-modal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    max-width: 1320px;
    height: min(calc(100dvh - 64px), 860px);
    margin: 32px auto;
  }
  .modal-media {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 16px;
  }
  .modal-gallery {
    flex: 1;
    min-height: 0;
    aspect-ratio: auto;
  }
  .modal-body {
    overflow-y: auto;
    padding: 84px 32px 32px;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08);
  }
  .modal-body h3 { font-size: 1.6rem; }
  .modal-description { font-size: 0.98rem; }
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .bezel, .bezel-img { border-radius: 2px; padding: 5px; }
  .bezel-core { border-radius: 2px; }

  .project-modal {
    width: 100%;
    margin: 0;
    border-radius: 2px;
    min-height: 100dvh;
  }

  .modal-gallery { aspect-ratio: 4 / 3; }
  .modal-body { padding: 22px 20px 40px; }
  .modal-body h3 { font-size: 1.5rem; }
  .before-after-container { aspect-ratio: 4 / 3; }
}

/* ---- Movimiento reducido ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal { opacity: 1; transform: none; filter: none; }
  .js .line-mask > span { transform: none; }
  .marquee-track { animation: none; }
}

/* Marca y títulos anchos (estilo automoción) */
.font-serif { font-stretch: 125%; letter-spacing: -0.01em; }
.font-serif em { font-style: normal; }
em { font-style: normal; }

/* ---- Cabecera blanca con el logo en su azul ---- */
#main-header .nav-island {
  --ink: #020B2C;
  --ink-2: #3A4255;
  --paper: #FFFFFF;
  --paper-3: #EEF0F4;
  background: #FFFFFF;
  box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.6);
}
#main-header.nav-scrolled .nav-island {
  background: #FFFFFF;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}
#main-header .nav-island .text-ink { color: var(--ink); }
#main-header .nav-island .text-ink-2 { color: var(--ink-2); }
#main-header .nav-island .hover\:text-ink:hover { color: var(--ink); }
/* Sección activa: barrita inferior del azul del logo, sin fondo */
#main-header .nav-island .nav-link { background: none; }
#main-header .nav-island .nav-link::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: #020B2C;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-fluid);
}
#main-header .nav-island .nav-link:hover::after { transform: scaleX(0.5); }
#main-header .nav-island .nav-link[aria-current="true"]::after,
#main-header .nav-island .nav-link[aria-current="page"]::after { transform: scaleX(1); }
#main-header .nav-island .nav-link[aria-current="true"],
#main-header .nav-island .nav-link[aria-current="page"] { color: #020B2C; }
#main-header .nav-island .burger,
#main-header .nav-island .hover\:bg-ink\/5:hover { background: rgba(2, 11, 44, 0.06); }
#main-header .nav-island .btn-primary:hover { background: #1B2A55; }
#main-header .sub-menu-inner {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(2, 11, 44, 0.08), 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
