/* =========================================================
   ALSEN — Estilos base
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --c-bg:        #ffffff;
  --c-text:      #1a1f2b;
  --c-text-soft: #5b6473;
  --c-text-mute: #8a93a3;
  --c-border:    #e7eaef;
  --c-line:      #eef0f4;

  --c-brand:     #007AA2;   /* azul ALSEN */
  --c-brand-d:   #00607F;
  --c-brand-l:   #e0eef4;

  --header-h:    70px;
  --container:   1200px;

  --shadow-sm:   0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
  --shadow-md:   0 4px 14px rgba(15,23,42,.08);
  --shadow-lg:   0 10px 30px rgba(15,23,42,.12);

  --ease-out:    cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  font-family: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Header ---------- */
.header {
  position: relative;
  height: var(--header-h);
  background: #fff;
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.5);
  z-index: 100;
}
.header.is-scrolled {
  background: rgba(255,255,255,.96);
  border-bottom-color: var(--c-line);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.header__logo {
  display: inline-flex;
  align-items: center;
  height: 48px;
}
.header__logo img {
  height: 38px;       /* +20% (32 → 38) */
  width: auto;
  display: block;
  opacity: .85;       /* gris muy oscuro casi negro */
}

/* ---------- Nav ---------- */
.nav__list {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav__list a {
  font-weight: 300;
  font-size: 13px;
  color: var(--c-brand);
  letter-spacing: .2px;
  position: relative;
  padding: 6px 0;
  transition: color .2s var(--ease-out);
}
.nav__list a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease-out);
}
.nav__list a:hover { color: var(--c-brand-d); }
.nav__list a:hover::after { transform: scaleX(1); }

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  transition: transform .2s var(--ease-out);
}
.lang-btn:hover { transform: scale(1.08); }
.flag {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}
.flag--es {
  background:
    linear-gradient(to bottom,
      #c60b1e 0%, #c60b1e 25%,
      #ffc400 25%, #ffc400 75%,
      #c60b1e 75%, #c60b1e 100%);
}
.flag--en {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'><clipPath id='c'><path d='M0,0 v30 h60 v-30 z'/></clipPath><clipPath id='t'><path d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/></clipPath><g clip-path='url(%23c)'><path d='M0,0 v30 h60 v-30 z' fill='%23012169'/><path d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/><path d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/><path d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/><path d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/></g></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Botón hamburguesa (oculto en escritorio) */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}

/* ---------- Hero ---------- */
body { padding-top: 0; }

.hero {
  position: relative;
  height: 400px;
  background: #fff;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 40px;
}

/* Contenido (texto, izquierda) */
.hero__content {
  position: relative;
  z-index: 2;
  padding: 22px 0 12px;
  max-width: 620px;
}

/* Imagen (derecha) */
.hero__media {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  animation: heroMediaEntry 5s linear .1s backwards;
}
@keyframes heroMediaEntry {
  0%   { opacity: 0; transform: scale(1.08); }
  20%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@media (min-width: 1400px) {
  .hero__media {
    /* sangra hasta el borde derecho del viewport en pantallas amplias */
    width: calc(58% + ((100vw - var(--container)) / 2));
  }
}
.hero__image {
  position: absolute;
  inset: -3%;
  background-image: url("../img/hero-mobile.jpg");
  background-size: cover;
  background-position: center center;
  transform-origin: 60% 50%;
  animation: kenburns 14s ease-in-out infinite alternate;
  will-change: transform;
}
@media (min-width: 768px) {
  .hero__image { background-image: url("../img/hero.jpg"); }
}
/* Difuminado del borde izquierdo de la imagen para fundir con el fondo blanco */
.hero__media-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,1) 0%,
      rgba(255,255,255,.85) 6%,
      rgba(255,255,255,0) 22%);
}

@keyframes kenburns {
  0%   { transform: scale(1.00) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

.hero__tagline {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text-mute);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: -35px 0 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.hero__tagline .dot {
  color: var(--c-brand);
  font-size: 18px;
  line-height: 0;
  margin-top: 2px;
}

.hero__title {
  font-weight: 300;
  font-size: 34px;
  line-height: 1.28;
  letter-spacing: -.4px;
  color: var(--c-text);
  margin: 5px 0 24px;
  max-width: 720px;
}
.hero__title--accent {
  font-weight: 400;
  background: linear-gradient(90deg, var(--c-text) 0%, var(--c-brand) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  color: #353535;
  max-width: 540px;
  margin: -10px 0 40px;
}

.hero__cta { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero__cta .btn { padding: 7px 20px; }
.hero__msg {
  font-size: 14px;
  color: var(--c-text);
  transition: color .2s var(--ease-out);
}
.hero__msg:hover { color: var(--c-brand); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .25s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease-out); }
.btn--primary {
  background: var(--c-brand);
  color: #fff;
  box-shadow: 0 6px 20px rgba(14,150,180,.30);
}
.btn--primary:hover {
  background: var(--c-brand-d);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(14,150,180,.40);
}
.btn--primary:hover svg { transform: translateX(4px); }

.btn--secondary {
  background: #fff;
  color: var(--c-text);
  border: 1px solid var(--c-line);
}
.btn--secondary:hover {
  background: #f4f5f7;
  transform: translateY(-2px);
}

/* ---------- Container utility ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px;
}

/* ---------- Encabezado de sección reutilizable ---------- */
.section-head {
  text-align: center;
  margin: 0 auto 56px;
  max-width: 720px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--c-brand);
  margin: 0 0 12px;
}
.section-title {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -.2px;
  color: #000000;
  margin: 0;
  line-height: 1.2;
}

/* ---------- Sección Proyectos ---------- */
.projects {
  padding: 50px 0 30px;
  background: #f1f3f6;
}
.projects .section-head { margin-bottom: 46px; }
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}

.variant-label {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 500;
  margin: 32px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #d8dde5;
}
.variant-label:first-of-type { margin-top: 8px; }

/* ---------- Tarjeta base ---------- */
.project-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  display: flex;
  flex-direction: column;
  position: relative;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(15,23,42,.08), 0 16px 36px rgba(15,23,42,.10);
}
.pc__image {
  background: #fff;
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pc__image img {
  max-width: 100%;
  max-height: 170px;
  object-fit: contain;
  display: block;
}
.pc__body {
  padding: 18px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pc__badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: var(--cat-badge-bg);
  color: var(--cat-badge-c);
}
.pc__title {
  font-size: 18px;
  font-weight: 500;
  color: var(--c-text);
  margin: 0 0 8px;
  letter-spacing: -.2px;
}
.pc__desc {
  font-size: 14px;
  line-height: 1.44;
  color: #1C1D1E;
  margin: 0;
  font-weight: 300;
}

/* Variables por categoría */
.cat-log {
  --cat-color:    #2563eb;
  --cat-bg:       linear-gradient(135deg, #dbeafe 0%, #3b82f6 60%, #1e3a8a 100%);
  --cat-bg-soft:  linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
  --cat-badge-bg: #eff6ff;
  --cat-badge-c:  #1e40af;
  --cat-img:      url("../img/contexto/estacion-meteo.jpg");
}
.cat-ind {
  --cat-color:    #ea580c;
  --cat-bg:       linear-gradient(135deg, #fed7aa 0%, #f97316 55%, #7c2d12 100%);
  --cat-bg-soft:  linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  --cat-badge-bg: #fff7ed;
  --cat-badge-c:  #9a3412;
  --cat-img:      url("../img/contexto/produccion.jpg");
}
.cat-iot {
  --cat-color:    #059669;
  --cat-bg:       linear-gradient(135deg, #d1fae5 0%, #10b981 55%, #064e3b 100%);
  --cat-bg-soft:  linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 100%);
  --cat-badge-bg: #ecfdf5;
  --cat-badge-c:  #065f46;
  --cat-img:      url("../img/contexto/iot-domotica.jpg");
}

/* ============================================
   V6 — Esquina diagonal con icono
   ============================================ */
.pc-v6 .pc-v6__corner {
  position: absolute;
  top: 0; right: 0;
  width: 90px;
  height: 90px;
  background: var(--cat-bg);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 14px 0 0;
  z-index: 2;
}
.pc-v6 .pc-v6__corner svg {
  width: 22px; height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.pc-v6 .pc__image { padding-top: 22px; }

/* ============================================
   V7 — V6 con PCB +20% y desplazada 20px a la izquierda
   ============================================ */
.pc-v7 .pc__image {
  padding-top: 32px;       /* +10px arriba */
  padding-bottom: 10px;    /* +10px abajo */
}
.pc-v7 .pc__image img {
  max-height: 220px;
  transform: translate(-30px, -10px) scale(0.864);
  transform-origin: center center;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.22));
}
.pc-v7 .pc__body {
  margin-top: -20px;
}


/* ============================================
   V14 — Triángulo aún mayor + badge dentro · más espacio para bajar el PCB
   ============================================ */
.pc-v14 {
  overflow: hidden;
}
.pc-v14 .pc-v14__top {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: #fff;
}
.pc-v14 .pc-v14__triangle {
  position: absolute;
  top: 0;
  right: 0;
  width: 90%;
  height: 100%;
  background-image: var(--cat-img);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.pc-v14 .pc-v14__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.pc-v14 .pc-v14__top .pc__image {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60%;
  height: 78%;
  padding: 8px 8px 12px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  background: transparent;
  z-index: 1;
}
.pc-v14 .pc-v14__top .pc__image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.18));
  transform: translateX(-20px) scale(1.27);
  transform-origin: bottom left;
}

/* ============================================
   V15 — V14 con foto extendida hacia abajo en el lado izquierdo
   ============================================ */
.pc-v15 .pc-v14__top {
  height: 240px;
}
.pc-v15 .pc-v14__triangle {
  width: 100%;
  /* La foto cubre todo menos un triángulo bottom-left;
     el lado izquierdo empieza ahora en 50% (más abajo) */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 50%);
}
.pc-v15 .pc-v14__top .pc__image img {
  transform: translate(-30px, 35px) scale(1.52);
  filter: drop-shadow(0 0 3px rgba(255,255,255,.95));
}
.pc-v15 .pc__body {
  padding-top: 33px;
}

/* ============================================
   V16 — V15 con la pastilla de categoría dentro del cuerpo
   ============================================ */
.pc-v16 .pc__body {
  padding-top: 28px;
  margin-top: -50px;
  background: #fff;
  position: relative;
  z-index: 1;
}
.pc-v16 .pc-v14__top {
  height: 320px;          /* +50px → la diagonal cae 50px más abajo */
}
.pc-v16 .pc-v14__triangle {
  /* Diagonal con la misma pendiente que antes, pero 50px más abajo:
     antes (0,59.4) → (400,270), ahora (0,109.4) → (400,320) → 109.4/320 = 34.2% */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 34.2%);
  z-index: 2;             /* foto por encima del body */
}
.pc-v16 .pc-v14__top .pc__image {
  width: 100%;
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
  z-index: 3;             /* PCB por encima de foto + body */
}
.pc-v16 .pc-v14__top .pc__image img {
  max-height: 242px;      /* +10% (220 → 242) */
  width: auto;
  transform: translateY(-40px);
  transform-origin: bottom center;
  filter: drop-shadow(0 0 3.5px rgba(255,255,255,1));
}

/* ---------- Sección FAQ ---------- */
.faq {
  padding: 50px 0 50px;
  background: #fff;
}
.faq .section-head { margin-bottom: 36px; }
.faq__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.faq__col { display: flex; flex-direction: column; }

.faq-item {
  border-top: 1px solid #e0e3e9;
  background: transparent;
  interpolate-size: allow-keywords;
}
.faq-item::details-content {
  block-size: 0;
  overflow: clip;
  opacity: 0;
  transition: block-size .35s var(--ease-out), opacity .25s var(--ease-out), content-visibility .35s var(--ease-out);
  transition-behavior: allow-discrete;
}
.faq-item[open]::details-content {
  block-size: auto;
  opacity: 1;
}
.faq-item:last-child { border-bottom: 1px solid #e0e3e9; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 14px 16px 38px;
  font-size: 15px;
  font-weight: 400;
  color: var(--c-brand);
  letter-spacing: -.1px;
  position: relative;
  user-select: none;
  transition: color .2s var(--ease-out);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }
.faq-item summary:hover { color: var(--c-brand-d); }

/* Icono › por defecto, − cuando está abierto */
.faq-item summary::before {
  content: "›";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 600;
  color: var(--c-brand);
  line-height: 1;
  width: 14px;
  text-align: center;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::before {
  content: "−";
  font-size: 22px;
  font-weight: 400;
}
.faq-item[open] summary { color: #1C1D1E; font-weight: 400; }

.faq-item__body {
  padding: 0 14px 18px 38px;
  font-size: 14px;
  line-height: 1.6;
  color: #1C1D1E;
  font-weight: 300;
}

@media (max-width: 800px) {
  .faq__grid { grid-template-columns: 1fr; gap: 0; }
  .faq__col + .faq__col .faq-item:first-child { border-top: 0; }
}

/* ---------- Sección Servicios + Proceso ---------- */
.services {
  padding: 50px 0 50px;
  background: #fff;
}
.services .section-head { margin-bottom: 46px; }

/* Fila de servicios con foto */
.services__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
.service {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.service__photo {
  width: 100%;
  aspect-ratio: 16 / 9;       /* ~30% menos alto que 4:3 */
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
}
.service__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease-out);
}
.service:hover .service__photo img { transform: scale(1.04); }
.service__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--c-text);
  margin: 0 0 10px;
  line-height: 1.3;
  letter-spacing: -.1px;
}
.service__desc {
  font-size: 14px;
  line-height: 1.5;
  color: #1C1D1E;
  font-weight: 300;
  margin: 0 0 6px;
}
.service__more {
  font-size: 12.5px;
  color: var(--c-brand);
  font-weight: 300;
  letter-spacing: .2px;
  align-self: flex-start;
  transition: color .2s var(--ease-out);
}
.service__more:hover { color: var(--c-brand-d); }

/* Versión unificada (servicios con paso numerado) */
.service-v2 .service__photo { position: relative; overflow: hidden; }

/* Esquina diagonal con el número del paso (estilo proyectos) */
.service-v2 .service__corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.service-v2 .service__corner span {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 0 0 10px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.30));
}

/* Colores lógicos por paso (azul → verde, progresión natural del proyecto) */
.service-v2.step-1 .service__corner { background: linear-gradient(135deg, #dbeafe 0%, #3b82f6 60%, #1e3a8a 100%); }
.service-v2.step-2 .service__corner { background: linear-gradient(135deg, #cffafe 0%, #06b6d4 60%, #155e75 100%); }
.service-v2.step-3 .service__corner { background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 60%, #78350f 100%); }
.service-v2.step-4 .service__corner { background: linear-gradient(135deg, #fed7aa 0%, #f97316 55%, #7c2d12 100%); }
.service-v2.step-5 .service__corner { background: linear-gradient(135deg, #d1fae5 0%, #10b981 55%, #064e3b 100%); }
.services__note {
  margin: 40px auto 0;
  max-width: 820px;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  font-size: 14.5px;
  color: var(--c-text-soft);
  font-weight: 300;
  font-style: italic;
  line-height: 1.55;
}
.services__note .ico--ayuda {
  display: inline-block;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  -webkit-mask-image: url("../img/iconos/ayuda.svg");
          mask-image: url("../img/iconos/ayuda.svg");
}

/* Responsive */
@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}
@media (max-width: 640px) {
  .services__grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .services { padding: 70px 0 80px; }
}
@media (max-width: 420px) {
  .services__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sección Features (situaciones / por qué) ---------- */
.features {
  padding: 40px 0 50px;
  background: #fff;
  position: relative;
  z-index: 50;
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.5);
}
.features__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
.features__col {
  display: flex;
  flex-direction: column;
}
.features__title {
  font-size: 22px;
  font-weight: 300;
  color: #000000;
  text-align: center;
  letter-spacing: -.2px;
  margin: 0 0 32px;
}
.features__items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 16px;
}

.feature {
  text-align: center;
  padding: 0 8px;
}
.feature__icon {
  width: 51px;
  height: 51px;
  margin: 0 auto 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* V3 fila — iconos un pelin más pequeños */
.features--row .feature__icon { width: 42px; height: 42px; }

/* Iconos por mask-image (los SVG son negros; los recoloreamos con CSS) */
.ico {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--c-brand);
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat:   no-repeat;
          mask-repeat:   no-repeat;
  -webkit-mask-size:     contain;
          mask-size:     contain;
}
.ico--idea        { -webkit-mask-image: url("../img/iconos/path725.svg"); mask-image: url("../img/iconos/path725.svg"); }
.ico--lupa        { -webkit-mask-image: url("../img/iconos/path724.svg"); mask-image: url("../img/iconos/path724.svg"); }
.ico--equipo      { -webkit-mask-image: url("../img/iconos/path204.svg"); mask-image: url("../img/iconos/path204.svg"); }
.ico--control     { -webkit-mask-image: url("../img/iconos/path670.svg"); mask-image: url("../img/iconos/path670.svg"); }
.ico--proyecto    { -webkit-mask-image: url("../img/iconos/path722.svg"); mask-image: url("../img/iconos/path722.svg"); }
.ico--ahora       { -webkit-mask-image: url("../img/iconos/path723.svg"); mask-image: url("../img/iconos/path723.svg"); }
.ico--imprevistos { -webkit-mask-image: url("../img/iconos/path448.svg"); mask-image: url("../img/iconos/path448.svg"); }
.ico--innovar     { -webkit-mask-image: url("../img/iconos/path72.svg");  mask-image: url("../img/iconos/path72.svg");  }
.feature__title {
  font-size: 16px;
  font-weight: 400;
  color: #333333;
  margin: 0 0 9px;
  letter-spacing: -.1px;
}
.feature__desc {
  font-size: 14px;
  line-height: 1.65;
  color: #1C1D1E;
  margin: 0;
  font-weight: 300;
}

/* ---------- Sección Sobre nosotros ---------- */
.about {
  padding: 50px 0 50px;
  background: #f1f3f6;
}
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.about__title {
  font-size: 24px;
  font-weight: 300;
  color: #000;
  letter-spacing: -.2px;
  margin: 0 0 24px;
  line-height: 1.2;
}
.about__text p {
  font-size: 14px;
  line-height: 1.65;
  color: #1C1D1E;
  font-weight: 300;
  margin: 0 0 18px;
}
.about__text p:last-child { margin-bottom: 0; }

.about__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.about__image {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 8px;
  overflow: hidden;
  background: #d8dde5;
  margin-bottom: 34px;
}
.about__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.about__cta .btn { padding: 7px 20px; }
.about__msg {
  font-size: 14px;
  color: var(--c-text);
  transition: color .2s var(--ease-out);
}
.about__msg:hover { color: var(--c-brand); }

@media (max-width: 880px) {
  .about__grid { grid-template-columns: 1fr; gap: 32px; }
  .about__visual { align-items: stretch; }
  .about__cta { align-items: center; }
}

/* ---------- Modal contacto ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s var(--ease-out), visibility 0s linear .35s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .35s var(--ease-out), visibility 0s linear 0s;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}
.modal__panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.30);
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.modal__panel--wide { max-width: 720px; padding: 40px 40px 32px; }

/* Detalle de servicio */
.service-detail h2 {
  font-size: 24px;
  font-weight: 400;
  color: var(--c-text);
  margin: 0 0 14px;
  letter-spacing: -.3px;
}
.service-detail > p {
  font-size: 14.5px;
  line-height: 1.65;
  color: #1C1D1E;
  font-weight: 300;
  margin: 0 0 16px;
}
.service-detail ul {
  list-style: disc;
  padding-left: 22px;
  margin: 14px 0 6px;
}
.service-detail li {
  font-size: 14px;
  line-height: 1.6;
  color: #1C1D1E;
  font-weight: 300;
  margin-bottom: 10px;
  padding-left: 4px;
}
.service-detail li::marker { color: var(--c-text-soft); }
.service-detail li strong {
  color: var(--c-brand);
  font-weight: 500;
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 1;
  color: var(--c-text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.modal__close:hover { background: #f4f5f7; color: var(--c-text); }
.modal__title {
  font-size: 22px;
  font-weight: 400;
  color: var(--c-text);
  margin: 0 0 8px;
  letter-spacing: -.2px;
}
.modal__sub {
  font-size: 14px;
  color: #5b6473;
  margin: 0 0 24px;
  line-height: 1.5;
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cf-field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  letter-spacing: .2px;
}
.cf-field input,
.cf-field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--c-text);
  padding: 10px 12px;
  border: 1px solid #d8dde5;
  border-radius: 6px;
  background: #fff;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
  resize: vertical;
}
.cf-field input:focus,
.cf-field textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(0,122,162,.15);
}
.cf-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
.cf-submit {
  margin-top: 8px;
  padding: 7px 20px;
  align-self: flex-start;
}
.cf-status {
  margin: 6px 0 0;
  font-size: 13.5px;
  text-align: center;
  min-height: 18px;
}
.cf-status.is-loading { color: var(--c-text-soft); }
.cf-status.is-success { color: #15803d; }
.cf-status.is-error   { color: #c1212c; }

/* ---------- Toast (notificación central) ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 12px)) scale(.96);
  z-index: 250;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  background: #fff;
  color: var(--c-text);
  font-size: 15px;
  font-weight: 400;
  border-radius: 12px;
  border: 1px solid var(--c-line);
  box-shadow: 0 20px 60px rgba(15,23,42,.25), 0 4px 12px rgba(15,23,42,.10);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .3s var(--ease-out);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.toast svg {
  width: 22px;
  height: 22px;
  color: #15803d;
  flex-shrink: 0;
}

/* ---------- Footer ---------- */
.footer {
  background: #e8eaee;
  padding: 28px 0;
  margin-top: 50px;
  border-top: 1px solid var(--c-line);
}
.footer .container { max-width: 980px; }
.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.footer__col--left { justify-self: start; }
.footer__col--center { justify-self: center; }
.footer__col--right {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.footer__line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--c-text);
  font-weight: 400;
}
.footer__line:last-child { margin-bottom: 0; }
.footer__line svg {
  width: 16px;
  height: 16px;
  color: var(--c-text-soft);
  flex-shrink: 0;
}
.footer__line a {
  color: var(--c-text);
  transition: color .2s var(--ease-out);
}
.footer__line a:hover { color: var(--c-brand); }

.footer__logo img {
  height: 28px;
  width: auto;
  display: block;
}

.footer__link {
  font-size: 13px;
  color: var(--c-text);
  transition: color .2s var(--ease-out);
}
.footer__link:hover { color: var(--c-brand); }

@media (max-width: 760px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .footer__col--left,
  .footer__col--right { justify-self: center; align-items: center; }
  .footer__col--right { flex-direction: row; gap: 16px; }
  .footer__line { justify-content: center; }
}

/* ---------- Animaciones de entrada (.reveal) ---------- */
.reveal {
  opacity: 0;
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Modificador: entra desde la derecha */
.reveal--right { transform: translateX(50px); }
/* Modificador: entra desde abajo (comportamiento por defecto anterior) */
.reveal--up { transform: translateY(24px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .hero__image { animation: none; transform: scale(1.04); }

  /* Excepciones: fade-ins suaves que no causan problemas vestibulares */
  .modal,
  .modal__panel,
  .toast {
    transition-duration: .35s !important;
  }
  .reveal {
    transition-duration: .9s !important;
  }
  .hero__media {
    animation: heroMediaEntry 5s linear .1s backwards !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --header-h: 72px; }

  .header__inner { padding: 0 20px; }
  .header__logo img { height: 26px; }

  .nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: min(86vw, 360px);
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    background: #fff;
    border-left: 1px solid var(--c-line);
    box-shadow: -10px 0 30px rgba(0,0,0,.08);
    transform: translateX(100%);
    transition: transform .35s var(--ease-out);
    overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
    gap: 4px;
  }
  .nav__list li { width: 100%; }
  .nav__list a {
    display: block;
    padding: 14px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--c-line);
  }
  .nav__list a::after { display: none; }
  .nav__lang { padding-top: 20px; }

  .nav__toggle { display: inline-flex; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Hero en una sola columna en móvil */
  .hero { height: auto; min-height: 500px; }
  .hero__inner {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .hero__media {
    position: relative;
    width: 100%;
    height: 240px;
    order: -1;
  }
  .hero__media-fade {
    background: linear-gradient(180deg, rgba(255,255,255,0) 70%, rgba(255,255,255,.95) 100%);
  }
  .hero__content { padding: 28px 24px 40px; max-width: 100%; }
  .hero__title { font-size: clamp(30px, 7vw, 40px); }
  .hero__desc  { font-size: 15.5px; }
  .hero__tagline { letter-spacing: 2px; gap: 10px; font-size: 11.5px; }
}

@media (max-width: 1080px) {
  .features__grid { gap: 60px; }
  .features__items { gap: 48px 12px; }
  .projects__grid { gap: 22px; }
}

@media (max-width: 860px) {
  .projects { padding: 70px 0 80px; }
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
  .projects__grid > .project-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
  }
}

@media (max-width: 600px) {
  .projects__grid {
    grid-template-columns: 1fr;
  }
  .projects__grid > .project-card:nth-child(3) {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 860px) {
  .features { padding: 60px 0 70px; }
  .features__grid {
    grid-template-columns: 1fr;
    gap: 64px;
  }
  .features__title { margin-bottom: 40px; }
}

@media (max-width: 480px) {
  .hero__cta .btn { width: 100%; justify-content: center; }
  .features__items { grid-template-columns: 1fr; gap: 40px; }
  .feature { padding: 0; }
}

/* =========================================================
   SKIP LINK (accesibilidad)
   ========================================================= */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 300;
  background: var(--c-brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: top .2s var(--ease-out);
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 122, 162, .35);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), background .2s var(--ease-out);
}
.back-to-top[hidden] { display: none; }
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--c-brand-d);
  transform: translateY(-2px);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* En móvil, separar del banner de cookies */
@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .back-to-top svg { width: 18px; height: 18px; }
}

/* =========================================================
   PÁGINA 404
   ========================================================= */
.page-404 {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: #f1f3f6;
}
.page-404__inner {
  max-width: 560px;
  text-align: center;
}
.page-404__code {
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-brand);
  margin: 0 0 16px;
  letter-spacing: -3px;
}
.page-404__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--c-text);
}
.page-404__desc {
  font-size: 16px;
  color: var(--c-text-soft);
  margin: 0 0 32px;
  line-height: 1.7;
}
.page-404__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .page-404__code { font-size: 72px; }
  .page-404__title { font-size: 22px; }
}

/* =========================================================
   COOKIE BANNER
   ========================================================= */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
  max-width: 980px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.cookie-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--c-text-soft);
}
.cookie-banner__text a {
  color: var(--c-brand);
  text-decoration: underline;
}
.cookie-banner__text a:hover { color: var(--c-brand-d); }
.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-banner__actions .btn {
  padding: 10px 22px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .cookie-banner { padding: 16px 18px; }
  .cookie-banner__inner { gap: 14px; }
  .cookie-banner__actions { width: 100%; }
  .cookie-banner__actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition-duration: .35s !important;
  }
}

/* =========================================================
   LEGAL PAGES (privacidad / cookies)
   ========================================================= */
.legal {
  padding: 60px 24px 80px;
  background: #f1f3f6;
  min-height: calc(100vh - var(--header-h) - 200px);
}
.legal__container {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 48px 56px;
  box-shadow: var(--shadow-sm);
}
.legal__title {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.legal__updated {
  margin: 0 0 36px;
  font-size: 13px;
  color: var(--c-text-mute);
}
.legal__container h2 {
  margin: 36px 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}
.legal__container h3 {
  margin: 26px 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
}
.legal__container p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text-soft);
}
.legal__container ul {
  margin: 0 0 14px;
  padding-left: 22px;
  list-style: disc;
}
.legal__container ul li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text-soft);
  margin-bottom: 6px;
}
.legal__container a {
  color: var(--c-brand);
  text-decoration: underline;
}
.legal__container a:hover { color: var(--c-brand-d); }
.legal__container code {
  background: var(--c-brand-l);
  color: var(--c-brand-d);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.legal__table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
}
.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.legal__table thead th {
  text-align: left;
  background: var(--c-brand-l);
  color: var(--c-brand-d);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.legal__table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text-soft);
  vertical-align: top;
}
.legal__table tbody tr:last-child td { border-bottom: 0; }
.legal__inline-btn {
  color: var(--c-brand);
  text-decoration: underline;
  padding: 0;
  font: inherit;
}
.legal__inline-btn:hover { color: var(--c-brand-d); }
.legal__back {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-line);
}

@media (max-width: 640px) {
  .legal { padding: 32px 16px 48px; }
  .legal__container { padding: 32px 24px; }
  .legal__title { font-size: 26px; }
  .legal__container h2 { font-size: 18px; }
}
