/* ==========================================================================
   CONDUCHISA — Construcciones Dunas de Chihuahua
   Hoja de estilos única. Sin build step: editar y recargar.

   Orden: fuentes · reset · tokens · base · layout · componentes · utilidades
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fuentes (self-hosted, variable 300–700, un solo archivo por subset)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-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: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-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;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa el header fijo al saltar a un ancla. Es el ÚNICO sitio donde se
     descuenta su altura: añadir además `scroll-margin-top` a los destinos la
     contaría dos veces. */
  scroll-padding-top: var(--header-h);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img { height: auto; }

input,
button,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; }

a { color: inherit; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; font-weight: inherit; }

p { text-wrap: pretty; }

/* --------------------------------------------------------------------------
   3. Tokens de diseño
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Marca — muestreados del logotipo oficial */
  --brand-navy: #022856;
  --brand-navy-deep: #01142c;
  --brand-navy-soft: #0a3a75;
  --brand-graphite: #2b2b2c;
  --brand-sand: #c2b280;
  --brand-sand-light: #ddd2b2;

  /* Superficies */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f5f4f1;
  --surface-sunken: #edeae4;
  --surface-inverse: var(--brand-navy-deep);

  /* Texto */
  --ink: #14181f;
  --ink-muted: #4e5765;
  --ink-subtle: #737d8c;
  --ink-inverse: #ffffff;
  --ink-inverse-muted: #b9c4d4;

  /* Acentos */
  --accent: var(--brand-navy);
  --accent-hover: var(--brand-navy-soft);
  --accent-ink: #7d6838;       /* arena oscurecida: 5.3:1 sobre blanco */
  --accent-rule: var(--brand-sand);

  /* Bordes y sombras */
  --border: #e2ded7;
  --border-strong: #cdc7bc;
  --shadow-sm: 0 1px 2px rgb(1 20 44 / 0.06), 0 2px 8px rgb(1 20 44 / 0.04);
  --shadow-md: 0 4px 12px rgb(1 20 44 / 0.08), 0 12px 32px rgb(1 20 44 / 0.06);
  --shadow-lg: 0 12px 32px rgb(1 20 44 / 0.12), 0 32px 64px rgb(1 20 44 / 0.08);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-y: clamp(4.5rem, 9vw, 8.75rem);
  --header-h: 84px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;

  /* Tipografía fluida */
  /* El logotipo es azul marino sólido: se invierte a blanco sobre fondos
     oscuros. `brightness(0) invert(1)` respeta el canal alfa, así que basta
     un único archivo de imagen para ambos temas. */
  --logo-filter: none;

  --font-sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --step-display: clamp(2.75rem, 1.6rem + 5.2vw, 5rem);
  --step-h2: clamp(1.9rem, 1.3rem + 2.4vw, 2.85rem);
  --step-h3: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem);
  --step-h4: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --step-lead: clamp(1.05rem, 0.99rem + 0.35vw, 1.2rem);
  --step-body: 1rem;
  --step-eyebrow: 0.75rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --bg: #0b1220;
    --surface: #111a2b;
    --surface-alt: #0e1626;
    --surface-sunken: #16203385;
    --surface-inverse: #060d18;

    --ink: #eef2f8;
    --ink-muted: #b2bdcd;
    --ink-subtle: #8996a8;

    --accent: #7ba7e0;
    --accent-hover: #a3c2ec;
    --accent-ink: var(--brand-sand);
    --logo-filter: brightness(0) invert(1);

    --border: #23304a;
    --border-strong: #33425f;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.5);
  }
}

/* --------------------------------------------------------------------------
   4. Base
   -------------------------------------------------------------------------- */
body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.65;
}

::selection {
  background: var(--brand-navy);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Salto directo al contenido para usuarios de teclado / lector de pantalla */
.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 200;
  translate: -50% -120%;
  padding: 0.75rem 1.5rem;
  background: var(--brand-navy);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: translate 0.2s var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; }

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

/* Una sección enlazada tiene hasta 140px de padding superior, que tras un salto
   por ancla se vería como un hueco vacío bajo el header. El margen negativo
   descuenta ese padding y deja el encabezado a ~2rem del header. Escala solo
   con --section-y, así que sigue cuadrando en móvil. */
.section[id] { scroll-margin-top: calc(2rem - var(--section-y)); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt { background: var(--surface-alt); }
.section--sunken { background: var(--surface-sunken); }

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* --------------------------------------------------------------------------
   6. Tipografía
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  color: var(--accent-ink);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 2px;
  background: var(--accent-rule);
}
.section-head--center .eyebrow::after {
  content: '';
  width: 1.75rem;
  height: 2px;
  background: var(--accent-rule);
}

.display {
  font-size: var(--step-display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: var(--step-h2);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.h3 {
  font-size: var(--step-h3);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.h4 {
  font-size: var(--step-h4);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lead {
  font-size: var(--step-lead);
  color: var(--ink-muted);
  line-height: 1.6;
}

.muted { color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   7. Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.125rem; height: 1.125rem; }

.btn--primary {
  background: var(--brand-navy);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-navy-soft); }

.btn--sand {
  background: var(--brand-sand);
  color: var(--brand-navy-deep);
}
.btn--sand:hover { background: var(--brand-sand-light); }

.btn--outline {
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--outline:hover {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
}

.btn--ghost-light {
  border-color: rgb(255 255 255 / 0.35);
  color: #fff;
  backdrop-filter: blur(6px);
}
.btn--ghost-light:hover {
  background: #fff;
  border-color: #fff;
  color: var(--brand-navy-deep);
}

/* Enlace con subrayado animado */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding-bottom: 2px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-rule);
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}
.link-arrow:hover { gap: 0.85rem; color: var(--accent-hover); }
.link-arrow .icon { width: 1rem; height: 1rem; }

.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   8. Header + navegación
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.site-header__logo img {
  width: auto;
  height: clamp(34px, 4.4vw, 44px);
  filter: var(--logo-filter);
  transition: filter 0.3s var(--ease);
}

/* Sobre el hero (siempre oscuro) el logotipo va en blanco, sea cual sea el tema. */
.site-header:not(.is-solid) .site-header__logo img { filter: brightness(0) invert(1); }
.site-header:not(.is-solid) .nav__link,
.site-header:not(.is-solid) .nav-toggle { color: #fff; }
.site-header:not(.is-solid) .nav__link::after { background: var(--brand-sand); }

/* El botón azul marino se perdería sobre el hero: pasa a arena mientras el
   header es transparente. */
.site-header:not(.is-solid) .site-header__cta {
  background: var(--brand-sand);
  color: var(--brand-navy-deep);
}
.site-header:not(.is-solid) .site-header__cta:hover { background: var(--brand-sand-light); }

.site-header.is-solid {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: none;
  align-items: center;
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
}

.nav__link {
  position: relative;
  padding-block: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.28s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current='true']::after { width: 100%; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-header__cta { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.nav-toggle .icon--close,
.nav-toggle[aria-expanded='true'] .icon--menu { display: none; }
.nav-toggle[aria-expanded='true'] .icon--close { display: block; }

/* Menú móvil */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 7rem var(--gutter) 2.5rem;
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
.mobile-nav.is-open {
  visibility: visible;
  opacity: 1;
}
.mobile-nav__link {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.mobile-nav .btn { margin-top: 1.75rem; }
.mobile-nav__contact {
  margin-top: 2rem;
  display: grid;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.mobile-nav__contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.mobile-nav__contact .icon { width: 1.125rem; height: 1.125rem; color: var(--accent-ink); }

body.nav-open { overflow: hidden; }

/* Con el menú abierto el overlay es claro, así que el header debe abandonar su
   modo transparente aunque sigamos en lo alto del hero: de lo contrario el
   logotipo y el aspa se pintarían en blanco sobre blanco. */
body.nav-open .site-header {
  background: var(--bg);
  border-bottom-color: var(--border);
}
body.nav-open .site-header .site-header__logo img { filter: var(--logo-filter); }
body.nav-open .site-header:not(.is-solid) .nav-toggle { color: var(--ink); }

@media (min-width: 900px) {
  .nav { display: flex; }
  .site-header__cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none; }
}

/* --------------------------------------------------------------------------
   9. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(88vh, 820px);
  padding-block: clamp(8rem, 16vh, 11rem) clamp(4rem, 8vh, 6rem);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #073a72 0%, transparent 60%),
    linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: #fff;
  isolation: isolate;
}

/* Lienzo WebGL con las dunas animadas */
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__canvas.is-ready { opacity: 0.5; }

/* Viñeta: mantiene el texto legible sobre cualquier fotograma de la animación */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(1 20 44 / 0.55) 0%, rgb(1 20 44 / 0.15) 45%, rgb(1 20 44 / 0.8) 100%);
  pointer-events: none;
}

.hero__inner {
  max-width: 56rem;
  text-align: center;
}
.hero .eyebrow { color: var(--brand-sand); }
.hero .eyebrow::before,
.hero .eyebrow::after { background: var(--brand-sand); }
.hero .display { color: #fff; }
.hero__lead {
  max-width: 40rem;
  margin: 1.5rem auto 2.5rem;
  color: rgb(255 255 255 / 0.82);
  font-size: var(--step-lead);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  margin-top: clamp(3rem, 7vh, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid rgb(255 255 255 / 0.16);
  color: rgb(255 255 255 / 0.72);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero__trust li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__trust .icon {
  width: 1.0625rem;
  height: 1.0625rem;
  color: var(--brand-sand);
}

/* --------------------------------------------------------------------------
   10. Franja de cifras
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.75rem, 4vw, 2.5rem);
}
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat { text-align: center; }
.stat__value {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--brand-navy);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .stat__value { color: var(--brand-sand); }
}
.stat__label {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. Servicios (bloques editoriales alternados)
   -------------------------------------------------------------------------- */
.services { display: grid; gap: clamp(4rem, 8vw, 7rem); }

.service {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
@media (min-width: 880px) {
  .service { grid-template-columns: 1.15fr 0.85fr; }
  .service--flip .service__media { order: 2; }
}

.service__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-md);
}
.service__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: scale 0.7s var(--ease);
}
.service:hover .service__media img { scale: 1.04; }

.service__index {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgb(1 20 44 / 0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.service__body { display: flex; flex-direction: column; align-items: flex-start; }
.service__body .h3 { margin-bottom: 0.875rem; }
.service__body p { color: var(--ink-muted); margin-bottom: 1.5rem; }

.service__list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.service__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}
.service__list .icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.28rem;
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   12. Tarjetas (diferenciadores, proceso, proyectos, testimonios)
   -------------------------------------------------------------------------- */
.grid-cards {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.card {
  padding: clamp(1.75rem, 3vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.card:hover {
  border-color: color-mix(in srgb, var(--brand-navy) 35%, var(--border));
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-navy) 8%, transparent);
  color: var(--brand-navy);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .card__icon {
    background: color-mix(in srgb, var(--brand-sand) 16%, transparent);
    color: var(--brand-sand);
  }
}
.card .h4 { margin-bottom: 0.5rem; }
.card p { color: var(--ink-muted); font-size: 0.9375rem; }

/* Proceso — numerado */
.steps {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.step {
  position: relative;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border);
  counter-increment: step;
}
.step::before {
  content: '0' counter(step);
  position: absolute;
  top: 1rem;
  left: 0;
  color: var(--accent-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.step .h4 { margin-bottom: 0.5rem; }
.step p { color: var(--ink-muted); font-size: 0.9375rem; }

/* Portafolio: retícula de obra construida. A diferencia de .grid-cards usa
   columnas fijas por breakpoint, para que la ficha destacada pueda ocupar la
   fila completa con `grid-column: 1 / -1`. */
.portfolio {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .portfolio { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .portfolio { grid-template-columns: repeat(3, 1fr); } }

/* El selector se ancla en .portfolio a propósito: `.project img` fija 3/2 más
   abajo con la misma especificidad y, al ir después, ganaría la cascada. */
.project--wide { grid-column: 1 / -1; }
.portfolio .project--wide img { aspect-ratio: 3 / 1; }
@media (max-width: 639px) {
  /* En móvil un 3:1 se vuelve una franja ilegible */
  .portfolio .project--wide img { aspect-ratio: 16 / 9; }
}

.portfolio__note {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--ink-subtle);
  font-size: 0.9375rem;
}

/* Proyectos */
.project {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.project img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: scale 0.6s var(--ease);
}
.project:hover img { scale: 1.05; }
.project__body { padding: 1.5rem; }
.project__tag {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent-ink);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.project__body p { margin-top: 0.5rem; color: var(--ink-muted); font-size: 0.9375rem; }
.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--ink-subtle);
  font-size: 0.8125rem;
}

/* Testimonios */
/* Columna flexible: las firmas quedan alineadas entre tarjetas aunque las
   citas tengan distinta longitud. */
.quote {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.quote__mark {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.25rem;
  color: var(--brand-sand);
  fill: currentColor;
  stroke: none;
}
.quote blockquote {
  margin-bottom: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
}
.quote figcaption {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}
.quote figcaption strong { font-weight: 600; }
.quote figcaption span { display: block; color: var(--ink-subtle); font-size: 0.875rem; }

/* --------------------------------------------------------------------------
   13. Banda CTA
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: #fff;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 120% at 85% 20%, rgb(194 178 128 / 0.18) 0%, transparent 60%);
  pointer-events: none;
}
.cta-band__inner {
  position: relative;
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 880px) {
  .cta-band__inner { grid-template-columns: 1fr auto; gap: 3rem; }
}
.cta-band .h2 { color: #fff; }
.cta-band p {
  margin-top: 0.875rem;
  max-width: 34rem;
  color: rgb(255 255 255 / 0.78);
}
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.875rem; }

/* --------------------------------------------------------------------------
   14. FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: 52rem; margin-inline: auto; display: grid; gap: 0.75rem; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease);
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.375rem;
  cursor: pointer;
  font-size: 1.0625rem;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-ink);
  transition: rotate 0.25s var(--ease);
}
.faq details[open] summary .icon { rotate: 45deg; }
.faq details > div {
  padding: 0 1.375rem 1.375rem;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   15. Contacto
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
}
@media (min-width: 940px) {
  .contact-grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

.contact-info {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--surface-inverse);
  color: #fff;
}
.contact-info .h3 { color: #fff; }
.contact-info > p { margin: 0.875rem 0 2rem; color: rgb(255 255 255 / 0.75); font-size: 0.9375rem; }
.contact-info dl { display: grid; gap: 1.5rem; }
.contact-item { display: flex; gap: 1rem; }
.contact-item .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--brand-sand); }
.contact-item dt {
  color: rgb(255 255 255 / 0.55);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.contact-item dd { margin: 0.3rem 0 0; font-size: 0.9375rem; line-height: 1.55; }
.contact-item dd a { text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / 0.28); }
.contact-item dd a:hover { border-bottom-color: var(--brand-sand); color: var(--brand-sand); }
.contact-item dd .name { color: rgb(255 255 255 / 0.6); }

.contact-form {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.form-grid {
  display: grid;
  gap: 1.125rem;
  margin-top: 1.75rem;
}
@media (min-width: 620px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.field .req { color: #b3261e; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-navy) 18%, transparent);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #b3261e; }

/* Trampa antispam: invisible para personas, tentadora para bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}
.form-note { color: var(--ink-subtle); font-size: 0.8125rem; max-width: 22rem; }

.form-status {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.form-status:empty { display: none; }
.form-status[data-state='ok'] {
  background: color-mix(in srgb, #1b7f4b 12%, transparent);
  color: #14663c;
}
.form-status[data-state='error'] {
  background: color-mix(in srgb, #b3261e 12%, transparent);
  color: #8c1d18;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .form-status[data-state='ok'] { color: #7fd6a6; }
  :root:not([data-theme='light']) .form-status[data-state='error'] { color: #f2b8b5; }
}

.map-card {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}
.map-card iframe {
  display: block;
  width: 100%;
  height: clamp(280px, 38vw, 400px);
  border: 0;
  filter: saturate(0.85);
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding-block: clamp(3.5rem, 7vw, 5rem) 2rem;
  background: var(--surface-inverse);
  color: rgb(255 255 255 / 0.72);
  font-size: 0.9375rem;
}
.site-footer__top {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
}
@media (min-width: 860px) {
  .site-footer__top { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer__logo { height: 46px; width: auto; margin-bottom: 1.25rem; }
.site-footer__about { max-width: 30rem; }
.site-footer h2 {
  margin-bottom: 1.125rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
/* Redes. Va como lista para poder sumar más perfiles sin rehacer nada. */
.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.5rem;
}
.site-footer__social li + li { margin-top: 0; }
.site-footer__social a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
.site-footer__social a:hover {
  border-color: var(--brand-sand);
  background: rgb(255 255 255 / 0.06);
}
/* El glifo de Facebook es una silueta rellena, no un trazo como el resto
   del sprite: hay que invertir el fill/stroke que impone .icon. */
.site-footer__social .icon {
  width: 1.0625rem;
  height: 1.0625rem;
  fill: currentColor;
  stroke: none;
}

.site-footer li + li { margin-top: 0.625rem; }
.site-footer a { text-decoration: none; transition: color 0.2s var(--ease); }
.site-footer a:hover { color: var(--brand-sand); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-top: 2rem;
  color: rgb(255 255 255 / 0.5);
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   17. Botón flotante de WhatsApp
   -------------------------------------------------------------------------- */
.wa-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  translate: 0 1rem;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), translate 0.3s var(--ease), scale 0.2s var(--ease);
}
.wa-fab.is-visible { opacity: 1; translate: 0; pointer-events: auto; }
.wa-fab:hover { scale: 1.06; }
.wa-fab svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }

/* --------------------------------------------------------------------------
   18. Animación de entrada (sólo si hay JS)
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  translate: 0 1.5rem;
  transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; translate: 0; }
.js .reveal:nth-child(2) { transition-delay: 0.08s; }
.js .reveal:nth-child(3) { transition-delay: 0.16s; }
.js .reveal:nth-child(4) { transition-delay: 0.24s; }

/* --------------------------------------------------------------------------
   19. Preferencias de movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; translate: none; }
  .service:hover .service__media img,
  .project:hover img { scale: 1; }
}

/* --------------------------------------------------------------------------
   20. Impresión
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .mobile-nav,
  .wa-fab,
  .hero__canvas,
  .map-card,
  .contact-form { display: none !important; }
  body { color: #000; background: #fff; }
  .hero { min-height: auto; background: none; color: #000; padding-block: 2rem; }
  .hero::after { display: none; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}
