/* ==========================================================================
   KREIS S.A. de C.V. — Sistema de diseño "Editorial industrial"
   Colores de marca (logo): royal #334d95, navy, carbón, acero.
   Tipografía: Archivo (grotesca industrial) + IBM Plex Mono (datos).
   ========================================================================== */

:root {
  /* Marca (del logo) */
  --royal-700: #26386e;
  --royal-600: #334d95;   /* azul KREIS */
  --royal-500: #4059a8;
  --royal-400: #5f77c4;
  --royal-300: #93a4d8;

  --navy-950: #141a30;
  --navy-900: #1a2140;
  --navy-850: #1f2748;
  --navy-800: #262f56;
  --navy-700: #313c68;

  /* Neutros */
  --ink:     #20222b;
  --ink-2:   #383b46;
  --steel-600: #565a66;
  --steel-500: #6d717d;
  --steel-400: #9a9ea9;
  --bg:      #ffffff;
  --bg-2:    #f2f3f7;
  --bg-3:    #e8eaf1;
  --line:    #e3e5ed;
  --line-2:  #d3d6e0;

  --shadow-md: 0 14px 30px -18px rgba(20,26,48,.5);
  --shadow-lg: 0 30px 70px -30px rgba(20,26,48,.55);

  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1280px;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --section-y: clamp(3.25rem, 5.5vw, 5.75rem);

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --z-header: 100;
  --z-menu: 200;
  --z-top: 300;
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 120px; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font);
  font-size: clamp(1rem, 0.97rem + 0.14vw, 1.06rem);
  line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  /* Sin overflow-x aquí: rompe el position:sticky del header. El clip horizontal
     lo hace html (scroller raíz), que sí es compatible con sticky. */
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--royal-500); outline-offset: 3px; }
::selection { background: var(--royal-600); color: #fff; }

/* ----- Tipografía ----- */
h1, h2, h3, h4 { font-family: var(--font); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); }
h1, h2, h3, h4, .display, .h-xl, .h-lg, .cap__name, .proj__name, .client__main, .iso__num { overflow-wrap: break-word; word-break: normal; }
p { text-wrap: pretty; overflow-wrap: break-word; }

.display {
  font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.7rem, 1.05rem + 2.15vw, 3.3rem);
  line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; padding-right: .04em;
}
.h-xl { font-weight: 800; text-transform: uppercase; font-size: clamp(1.6rem, 1.15rem + 2.1vw, 3.4rem); line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance; padding-right: .05em; }
.h-lg { font-weight: 700; font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem); line-height: 1.1; letter-spacing: -0.015em; }
.h-md { font-weight: 700; font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); line-height: 1.12; }

.lead { font-size: clamp(1.08rem, 1rem + 0.5vw, 1.35rem); line-height: 1.5; color: var(--steel-600); }
.prose { color: var(--steel-600); max-width: 66ch; }
.prose strong { color: var(--ink); font-weight: 600; }

/* Línea de datos técnicos (reemplaza a los eyebrows) */
.data-line {
  font-family: var(--mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--steel-500);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 1.1rem;
}
.data-line b { color: var(--ink); font-weight: 600; }
.data-line .sep { width: 5px; height: 5px; background: var(--royal-500); border-radius: 1px; }
.data-line--light { color: rgba(255,255,255,.62); }
.data-line--light b { color: #fff; }

/* ----- Layout ----- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--bg-2); }
.section--navy { background: var(--navy-950); color: #fff; }
.section--navy .prose { color: rgba(255,255,255,.72); }

.sec-head { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 40ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.sec-head--wide { max-width: 60ch; }
.sec-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; flex-wrap: wrap; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.sec-head-row h2 { margin: 0; }
.sec-head-row .sh-main { max-width: 40ch; }
.sec-head-row .arrow-link { padding-bottom: .35rem; }

/* ----- Botones ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.65rem;
  padding: 1rem 1.7rem; font-weight: 700; font-size: 0.95rem; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
  transition: transform .16s var(--ease), background-color .22s, color .22s, box-shadow .25s;
}
.btn .ic { transition: transform .25s var(--ease); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--royal-600); color: #fff; }
.btn--primary:hover { background: var(--royal-500); transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(51,77,149,.7); }
.btn--primary:hover .ic { transform: translateX(4px); }
.btn--dark { background: var(--navy-900); color: #fff; }
.btn--dark:hover { background: var(--navy-800); transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-2); }
.btn--outline:hover { box-shadow: inset 0 0 0 2px var(--royal-600); color: var(--royal-700); }
.btn--ondark { background: #fff; color: var(--navy-900); }
.btn--ondark:hover { background: var(--royal-500); color: #fff; transform: translateY(-2px); }
.btn--ondark:hover .ic { transform: translateX(4px); }
.btn--ghostlight { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn--ghostlight:hover { box-shadow: inset 0 0 0 2px #fff; background: rgba(255,255,255,.08); }
.btn--block { display: flex; width: 100%; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.88rem; color: var(--royal-600);
}
.arrow-link .ic { transition: transform .25s var(--ease); }
.arrow-link:hover { color: var(--royal-700); }
.arrow-link:hover .ic { transform: translateX(4px); }
.arrow-link--light { color: #fff; }

/* ----- Topbar ----- */
.topbar { background: var(--navy-950); color: rgba(255,255,255,.7); font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; border-bottom: 1px solid rgba(255,255,255,.07); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
.topbar__group { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.topbar a { display: inline-flex; align-items: center; gap: 0.45rem; color: rgba(255,255,255,.7); transition: color .2s; }
.topbar a:hover { color: #fff; }
.topbar .ic { color: var(--royal-400); }
@media (max-width: 720px) {
  .topbar__inner { justify-content: center; gap: 1.25rem; }
  .topbar__group { gap: 1.1rem; }
  .topbar__group--sec a[href^="tel:"] { display: none; } /* en móvil: correo + WhatsApp (sin teléfonos) */
}

/* ----- Header ----- */
/* Barra superior completa (topbar + nav) fija al hacer scroll, en web y móvil */
.site-top { position: sticky; top: 0; z-index: var(--z-header); }
.site-header { background: var(--navy-900); border-bottom: 1px solid rgba(255,255,255,.08); transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 12px 30px -18px rgba(0,0,0,.6); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 42px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 0.15rem; list-style: none; }
.nav__link { position: relative; padding: 0.6rem 0.95rem; font-weight: 600; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,.72); transition: color .2s; }
.nav__link::after { content: ""; position: absolute; left: 0.95rem; right: 0.95rem; bottom: 0.55rem; height: 2px; background: var(--royal-400); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease); }
.nav__link:hover { color: #fff; }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: #fff; }
.nav__actions { display: flex; align-items: center; gap: 0.7rem; }
.nav__cta { padding: 0.72rem 1.25rem; font-size: 0.82rem; }
.nav__toggle { display: none; width: 46px; height: 46px; color: #fff; align-items: center; justify-content: center; }
@media (max-width: 960px) { .nav__menu, .nav__cta--desktop { display: none; } .nav__toggle { display: inline-flex; } }

/* Menú móvil */
.mobile-menu { position: fixed; inset: 0; z-index: var(--z-menu); display: grid; grid-template-rows: auto 1fr auto; background: var(--navy-950); color: #fff; padding: 0.9rem var(--gutter) 2rem; transform: translateY(-100%); visibility: hidden; transition: transform .5s var(--ease-expo), visibility .5s; }
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.mobile-menu__top img { height: 40px; }
.mobile-menu__list { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; margin-top: 1.5rem; }
.mobile-menu__list a { display: flex; align-items: center; justify-content: space-between; padding: 1.05rem 0.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; font-size: 1.7rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.09); opacity: 0; transform: translateY(12px); }
.mobile-menu.open .mobile-menu__list a { animation: menuIn .5s var(--ease) forwards; animation-delay: calc(var(--i,0) * 55ms + 100ms); }
.mobile-menu__list a.is-active { color: var(--royal-300); }
.mobile-menu__list a .ic { color: var(--royal-400); }
@keyframes menuIn { to { opacity: 1; transform: translateY(0); } }
.mobile-menu__foot { display: flex; flex-direction: column; gap: 0.65rem; font-family: var(--mono); font-size: 0.82rem; color: rgba(255,255,255,.7); }
.mobile-menu__foot a { color: rgba(255,255,255,.85); display: inline-flex; gap: 0.5rem; align-items: center; }
.mobile-menu__foot .ic { color: var(--royal-400); }
body.menu-open { overflow: hidden; }

/* ----- HERO (editorial) ----- */
.hero { position: relative; isolation: isolate; color: #fff; min-height: min(760px, calc(100svh - 118px)); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding-block: clamp(2rem, 3.5vw, 3rem); }
.hero > .container { width: 100%; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(8,8,10,.72) 0%, rgba(8,8,10,.42) 44%, rgba(8,8,10,.1) 76%, rgba(8,8,10,0) 100%),
  linear-gradient(0deg, rgba(8,8,10,.8) 0%, rgba(8,8,10,.04) 58%); }
/* Móvil: overlay más ligero (se ve más la foto), oscureciendo solo la zona del texto */
@media (max-width: 700px) {
  .hero__media::after { background:
    linear-gradient(0deg, rgba(16,20,38,.82) 0%, rgba(16,20,38,.5) 45%, rgba(16,20,38,.12) 75%, rgba(16,20,38,.2) 100%); }
}
.hero__inner { max-width: 62rem; }
.hero__display { color: #fff; }
.hero__lead { margin-top: 1.1rem; max-width: 44ch; color: rgba(255,255,255,.85); font-size: clamp(1rem, 0.95rem + 0.4vw, 1.18rem); line-height: 1.5; }
.hero__cta { margin-top: 1.55rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.hero__data { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.22); }
@media (prefers-reduced-motion: no-preference) { .hero__media img { animation: heroZoom 18s ease-out both; } @keyframes heroZoom { from { transform: scale(1.06); } to { transform: scale(1); } } }
@media (prefers-reduced-motion: no-preference) {
  .hero__display { animation: heroMask 1.05s var(--ease-expo) both; }
  .hero__lead { opacity: 0; animation: heroUp .8s var(--ease) .42s forwards; }
  .hero__cta  { opacity: 0; animation: heroUp .8s var(--ease) .56s forwards; }
  .hero__data { opacity: 0; animation: heroUp .8s var(--ease) .7s forwards; }
  @keyframes heroMask { from { clip-path: inset(0 0 105% 0); transform: translateY(16px); } to { clip-path: inset(0 0 -8% 0); transform: none; } }
  @keyframes heroUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
}

/* ----- Page hero (interiores) ----- */
.page-hero { position: relative; isolation: isolate; color: #fff; overflow: hidden; padding-block: clamp(4.5rem, 9vw, 7rem) clamp(3rem, 6vw, 4.5rem); }
.page-hero__media { position: absolute; inset: 0; z-index: -2; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* Certificaciones: en ESCRITORIO baja el encuadre del hero (ver más la parte
   inferior). Móvil se queda centrado. */
@media (min-width: 701px) {
  body.page-certificaciones .page-hero__media img { object-position: center top; }
}
.page-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16,20,38,.92), rgba(16,20,38,.62) 55%, rgba(16,20,38,.35)); }
.page-hero__title { color: #fff; }
.page-hero__crumbs { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.page-hero__crumbs a:hover { color: #fff; }
.page-hero__crumbs .ic { color: var(--royal-300); }
.page-hero__crumbs .cur { color: var(--royal-300); }
.page-hero__lead { margin-top: 1.15rem; max-width: 52ch; color: rgba(255,255,255,.82); }

/* ----- Intro / split editorial ----- */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--media-left .split__media { order: -1; }
.split__media { position: relative; }
.split__media .ph { position: relative; overflow: hidden; }
.split__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.split__cap { position: absolute; left: 0; bottom: 0; background: var(--navy-950); color: #fff; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.6rem 0.95rem; }
.split__cap b { color: var(--royal-300); }
.split__year { position: absolute; right: -0.5rem; top: -0.5rem; background: var(--royal-600); color: #fff; font-weight: 800; font-size: clamp(1.5rem,1.2rem+1vw,2rem); padding: 0.7rem 1rem; line-height: 1; }
.split__year small { display: block; font-family: var(--mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; opacity: .85; margin-top: 3px; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } .split--media-left .split__media { order: 0; } .split__media { max-width: 28rem; } }

/* Misión / visión */
.mv { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.9rem; }
.mv-card { border-top: 3px solid var(--royal-600); background: var(--bg-2); padding: 1.5rem 1.5rem 1.6rem; }
.mv-card h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--royal-700); }
.mv-card p { margin-top: 0.6rem; color: var(--steel-600); font-size: 0.96rem; line-height: 1.5; }
@media (max-width: 620px) { .mv { grid-template-columns: 1fr; } }
/* Sobre sección con tinte, las tarjetas van en blanco para que contrasten */
.section--tint .mv-card { background: var(--bg); }

/* ----- Capacidades (bento con imagen) ----- */
.cap-bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 236px; gap: 1rem; }
.cap-tile { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; padding: 1.5rem; grid-column: span 3; background: var(--navy-900); }
.cap-tile:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.cap-tile:nth-child(2) { grid-column: span 3; }
.cap-tile:nth-child(3) { grid-column: span 3; }
.cap-tile:nth-child(4), .cap-tile:nth-child(5), .cap-tile:nth-child(6) { grid-column: span 2; }
.cap-tile__img { position: absolute; inset: 0; z-index: -2; }
.cap-tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.cap-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(16,20,38,.93) 6%, rgba(16,20,38,.42) 58%, rgba(16,20,38,.12)); transition: background .4s; }
.cap-tile:hover .cap-tile__img img { transform: scale(1.07); }
.cap-tile:hover::after { background: linear-gradient(0deg, rgba(20,26,48,.95) 6%, rgba(51,77,149,.5) 62%, rgba(51,77,149,.2)); }
.cap-tile__no { position: absolute; top: 1.3rem; left: 1.5rem; font-family: var(--mono); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.05em; color: rgba(255,255,255,.72); }
.cap-tile__ic { position: absolute; top: 1.15rem; right: 1.4rem; color: rgba(255,255,255,.8); }
.cap-tile__name { color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; font-size: clamp(1.1rem, 1rem + 0.6vw, 1.55rem); line-height: 1.04; padding-right: .04em; }
.cap-tile__desc { margin-top: 0.55rem; font-size: 0.88rem; line-height: 1.45; color: rgba(255,255,255,.82); max-width: 44ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cap-tile:nth-child(1) .cap-tile__name { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.2rem); }
.cap-tile:nth-child(1) .cap-tile__desc { -webkit-line-clamp: 3; max-width: 38ch; }
.cap-tile:nth-child(n+4) .cap-tile__desc { display: none; }
@media (max-width: 900px) {
  .cap-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 210px; }
  .cap-tile, .cap-tile:nth-child(1), .cap-tile:nth-child(2), .cap-tile:nth-child(3), .cap-tile:nth-child(4), .cap-tile:nth-child(5), .cap-tile:nth-child(6) { grid-column: span 1; grid-row: auto; }
  .cap-tile:nth-child(1) { grid-column: span 2; }
}
@media (max-width: 560px) {
  .cap-bento { grid-template-columns: 1fr; grid-auto-rows: 200px; }
  .cap-tile:nth-child(1) { grid-column: span 1; }
  .cap-tile:nth-child(n+4) .cap-tile__desc { display: -webkit-box; }
}

/* ----- Certificaciones (bloque navy, ISO gigantes) ----- */
.iso-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.iso { border-top: 3px solid var(--royal-500); padding-top: 1.3rem; }
.iso__num { font-weight: 900; font-size: clamp(2.4rem, 1.9rem + 2.2vw, 3.6rem); line-height: 0.9; letter-spacing: -0.03em; color: #fff; }
.iso__meta { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--royal-300); margin-top: 0.9rem; }
.iso__name { margin-top: 0.5rem; color: rgba(255,255,255,.75); font-size: 0.98rem; line-height: 1.45; max-width: 30ch; }
@media (max-width: 760px) { .iso-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* Detalle de certificación (página) */
.cert-list { border-top: 1px solid var(--line-2); }
.cert-detail { display: grid; grid-template-columns: auto 1fr; gap: 1.75rem; align-items: start; padding: 2rem 0; border-bottom: 1px solid var(--line-2); }
.cert-detail__num { font-weight: 900; font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); line-height: 0.9; color: var(--royal-600); letter-spacing: -0.03em; }
.cert-detail__meta { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel-500); }
.cert-detail__name { font-weight: 700; font-size: 1.2rem; color: var(--ink); margin-top: 0.3rem; }
.cert-detail__desc { color: var(--steel-600); margin-top: 0.5rem; max-width: 62ch; line-height: 1.55; }
@media (max-width: 560px) { .cert-detail { grid-template-columns: 1fr; gap: 0.6rem; } }

/* Certificados con imagen + lightbox */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); }
.cert-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.cert-card__shot { position: relative; display: block; width: 100%; overflow: hidden; background: var(--bg-3); border-bottom: 3px solid var(--royal-600); cursor: zoom-in; }
.cert-card__shot picture, .cert-card__shot img { display: block; width: 100%; aspect-ratio: 1280 / 1020; object-fit: cover; }
.cert-card__shot img { transition: transform .6s var(--ease); }
.cert-card__shot:hover img { transform: scale(1.04); }
.cert-card__zoom { position: absolute; top: .7rem; right: .7rem; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(20,26,48,.72); color: #fff; opacity: 0; transform: translateY(-4px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.cert-card__shot:hover .cert-card__zoom, .cert-card__shot:focus-visible .cert-card__zoom { opacity: 1; transform: none; }
.cert-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.35rem 1.4rem 1.5rem; }
.cert-card__head { display: flex; align-items: baseline; gap: .7rem; }
.cert-card__num { font-weight: 900; font-size: 1.9rem; line-height: 1; letter-spacing: -.03em; color: var(--royal-600); }
.cert-card__meta { font-family: var(--mono); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--steel-500); }
.cert-card__name { margin-top: .7rem; font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.cert-card__desc { margin-top: .5rem; color: var(--steel-600); font-size: .92rem; line-height: 1.5; }
.cert-card__link { display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; margin-top: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; color: var(--royal-600); cursor: pointer; }
.cert-card__link .ic { transition: transform .25s var(--ease); }
.cert-card__link:hover { color: var(--royal-700); }
.cert-card__link:hover .ic { transform: scale(1.12); }
@media (max-width: 900px) { .cert-grid { grid-template-columns: 1fr; max-width: 30rem; margin-inline: auto; } }

.lightbox { position: fixed; inset: 0; z-index: 400; display: none; background: rgba(12,16,30,.92); }
/* Visor de galería: columna (imagen + tira de miniaturas). La imagen usa
   max-width/height:100% del área ya con padding → nunca se desborda y queda
   SIEMPRE centrada (web y móvil). */
.lightbox.open { display: flex; flex-direction: column; animation: cvFade .25s var(--ease); }
.lightbox__main { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: clamp(1rem, 4vw, 3rem); }
.lightbox__stage { display: flex; max-width: 100%; max-height: 100%; }
.lightbox__stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.lightbox__close { position: fixed; top: clamp(.8rem, 2vw, 1.4rem); right: clamp(.8rem, 2vw, 1.4rem); width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; transition: background-color .2s, transform .15s var(--ease); z-index: 2; }
.lightbox__close:hover { background: rgba(255,255,255,.24); }
.lightbox__close:active { transform: scale(.94); }
/* Flechas atrás/adelante */
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; transition: background-color .2s, transform .15s var(--ease); z-index: 2; }
.lightbox__nav:hover { background: rgba(255,255,255,.24); }
.lightbox__nav:active { transform: translateY(-50%) scale(.9); }
.lightbox__nav--prev { left: clamp(.4rem, 2vw, 1.4rem); }
.lightbox__nav--next { right: clamp(.4rem, 2vw, 1.4rem); }
.lightbox__count { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; color: rgba(255,255,255,.7); }
/* Tira de miniaturas */
.lightbox__thumbs { flex: 0 0 auto; display: flex; gap: .5rem; overflow-x: auto; overflow-y: hidden; padding: .7rem clamp(1rem, 4vw, 3rem) 1rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lightbox__thumb { flex: 0 0 auto; width: 92px; height: 66px; padding: 0; border-radius: 6px; overflow: hidden; opacity: .45; outline: 2px solid transparent; transition: opacity .2s, outline-color .2s; cursor: pointer; }
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox__thumb:hover { opacity: .8; }
.lightbox__thumb.is-active { opacity: 1; outline-color: var(--royal-300, #7c8fd6); }
body.lb-open { overflow: hidden; }
@media (max-width: 700px) {
  .lightbox__nav { width: 42px; height: 42px; }
  .lightbox__thumb { width: 72px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .lightbox.open { animation: none; } }

/* ----- Proyectos ----- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.proj { position: relative; isolation: isolate; overflow: hidden; min-height: 360px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; padding: 1.6rem; background: var(--navy-900); }
.proj__img { position: absolute; inset: 0; z-index: -2; }
.proj__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.proj::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(16,20,38,.92) 8%, rgba(16,20,38,.35) 55%, rgba(16,20,38,.15)); }
.proj:hover .proj__img img { transform: scale(1.07); }
.proj__tag { align-self: flex-start; margin-bottom: auto; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; color: #fff; background: var(--royal-600); padding: 0.35rem 0.65rem; }
.proj__name { color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; font-size: 1.15rem; line-height: 1.05; margin-top: 1rem; padding-right: .04em; }
.proj__place { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em; color: rgba(255,255,255,.75); display: flex; gap: 0.45rem; align-items: flex-start; }
.proj__place .ic { flex: none; color: var(--royal-300); margin-top: 1px; }
@media (max-width: 900px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .proj-grid { grid-template-columns: 1fr; } }

/* ----- Experiencia: pestañas por año ----- */
.xp-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.xp-tabs::-webkit-scrollbar { height: 4px; }
.xp-tabs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }
.xp-tab { flex: none; display: inline-flex; align-items: baseline; gap: .5rem; padding: .7rem 1.1rem; background: var(--bg-2); color: var(--steel-600); font-weight: 800; letter-spacing: -.01em; border-bottom: 2px solid transparent; scroll-snap-align: center; transition: background-color .25s var(--ease), color .25s, border-color .25s; }
.xp-tab__yr { font-size: 1.05rem; }
.xp-tab__n { font-family: var(--mono); font-size: .7rem; font-weight: 500; padding: .1rem .42rem; background: rgba(51,77,149,.12); color: var(--royal-600); border-radius: 2px; }
.xp-tab:hover { color: var(--ink); background: var(--bg-3); }
.xp-tab.is-active { background: var(--navy-900); color: #fff; border-color: var(--royal-400); }
.xp-tab.is-active .xp-tab__n { background: rgba(255,255,255,.16); color: #fff; }
.xp-tab:focus-visible { outline-offset: 1px; }

.xp-panel { display: block; }
html.js .xp-panel { display: none; }
html.js .xp-panel.is-active { display: block; }
.xp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.xp-item { display: flex; flex-direction: column; gap: .85rem; background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--royal-600); padding: 1.3rem 1.4rem 1.45rem; transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.xp-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.xp-item__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.xp-item__tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: var(--royal-600); padding: .3rem .55rem; }
.xp-item__yr { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--steel-400); }
.xp-item__desc { color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
html.js .xp-panel.is-active .xp-item { animation: xpIn .5s var(--ease-expo) both; animation-delay: calc(var(--i,0) * 45ms); }
@keyframes xpIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .xp-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html.js .xp-panel.is-active .xp-item { animation: none; } .xp-item { transition: none; } }

/* ----- Galería (con lightbox) ----- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.gallery__item { position: relative; overflow: hidden; aspect-ratio: 4/3; padding: 0; border: 0; background: var(--bg-3); cursor: zoom-in; }
.gallery__item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(16,20,48,.4), transparent 55%); opacity: 0; transition: opacity .3s var(--ease); }
.gallery__item:hover::after, .gallery__item:focus-visible::after { opacity: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery__item:hover img { transform: scale(1.08); }
.gallery__item:nth-child(1), .gallery__item:nth-child(6) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } .gallery__item:nth-child(1), .gallery__item:nth-child(6) { grid-column: auto; grid-row: auto; aspect-ratio: 4/3; } }
.gallery__note { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--steel-500); }
.gallery__note .ic { color: var(--royal-500); flex: none; }

/* Valores */
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.value { background: var(--bg); padding: 1.7rem 1.6rem; transition: background-color .35s var(--ease); }
.value:hover { background: var(--bg-2); }
.value__ic { color: var(--royal-600); transition: transform .35s var(--ease), color .35s var(--ease); }
.value:hover .value__ic { transform: translateY(-3px); color: var(--royal-500); }
@media (prefers-reduced-motion: reduce) { .value__ic { transition: none; } .value:hover .value__ic { transform: none; } }

/* ----- Currículum (visor PDF de Google Drive) ----- */
.cv-embed { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.cv-viewer { border: 1px solid var(--line-2); background: #fff; box-shadow: var(--shadow-md); overflow: hidden; }
.cv-viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy-900); padding: 0.7rem 1rem; }
.cv-viewer__title { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; color: #fff; }
.cv-viewer__title .ic { color: var(--royal-300); }
.cv-viewer__full { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,.78); padding: 0.42rem 0.7rem; border: 1px solid rgba(255,255,255,.22); transition: color .2s, border-color .2s, background-color .2s; }
.cv-viewer__full:hover { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.08); }
.cv-viewer__full .ic { color: var(--royal-300); }
/* El marco recorta la barra superior de Drive (popout/descarga): el iframe se sube 44px */
.cv-viewer__frame { position: relative; overflow: hidden; height: min(78vh, 880px); background: var(--bg-3); }
.cv-viewer__frame iframe { position: absolute; top: -56px; left: 0; width: 100%; height: calc(100% + 56px); border: 0; }
/* Marca de agua: logo KREIS en patrón diagonal, sobre el visor. No bloquea el scroll del PDF. */
.cv-viewer__frame::after {
  content: ""; position: absolute; inset: -35%; z-index: 2; pointer-events: none;
  background: url("../img/logo.svg") repeat; background-size: 175px auto;
  opacity: 0.08; transform: rotate(-24deg);
}
@media (max-width: 899px) { .cv-viewer__frame::after { background-size: 140px auto; opacity: 0.09; } }

.cv-card { display: none; }
@media (max-width: 899px) {
  .cv-embed { display: none; }
  .cv-card {
    display: flex; width: 100%; align-items: center; gap: 1rem; text-align: left;
    margin-top: clamp(1.25rem, 3vw, 2rem); padding: 1.15rem 1.2rem;
    background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-md);
    transition: transform .18s var(--ease);
  }
  .cv-card:active { transform: scale(.99); }
  .cv-card__ic { flex: none; color: var(--royal-600); }
  .cv-card__tx { display: flex; flex-direction: column; gap: 2px; }
  .cv-card__tx b { font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; font-size: 1.04rem; color: var(--ink); }
  .cv-card__tx small { color: var(--steel-500); font-size: 0.85rem; }
  .cv-card__go { margin-left: auto; flex: none; color: var(--royal-600); }
}

/* Modal visor a pantalla completa (móvil con un clic; también en escritorio) */
.cv-modal { position: fixed; inset: 0; z-index: 400; display: none; background: rgba(16,20,38,.55); }
.cv-modal.open { display: block; animation: cvFade .25s var(--ease); }
.cv-modal__panel { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; background: #fff; }
.cv-modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy-900); padding: 0.8rem 1rem; padding-top: max(0.8rem, env(safe-area-inset-top)); }
.cv-modal__close { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; transition: background-color .2s, transform .15s var(--ease); }
.cv-modal__close:hover { background: rgba(255,255,255,.1); }
.cv-modal__close:active { transform: scale(.94); }
.cv-modal__frame { height: 100%; }
body.cv-open { overflow: hidden; }
@media (min-width: 640px) { .cv-modal__panel { inset: clamp(1rem, 4vh, 3rem) clamp(1rem, 6vw, 5rem); box-shadow: var(--shadow-lg); } }
@keyframes cvFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cv-modal.open { animation: none; } }
.value h3 { margin-top: 1rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: -0.01em; color: var(--ink); }
.value p { margin-top: 0.45rem; color: var(--steel-600); font-size: 0.94rem; line-height: 1.5; }
@media (max-width: 820px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .values-grid { grid-template-columns: 1fr; } }

/* ----- Clientes ----- */
/* ---------- Carrusel de clientes (logos SVG) ----------
   Desktop: DOBLE marquee en sentidos opuestos (fila A ←, fila B →), pausa al hover.
   Móvil: coverflow manual con botones (1 grande al centro + peek a los lados).
   Logos normalizados por ALTURA (los SVG ya vienen recortados a su contenido).
   Sin JS: los logos caen en rejilla centrada estática (fallback). */
.clients-carousel { position: relative; margin-top: 2.5rem; }
.clients-carousel__viewport {
  overflow: hidden; display: flex; flex-direction: column;
  gap: clamp(1.1rem, 2.6vw, 2rem);
}
.clients-carousel__track {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  list-style: none; margin: 0; padding: 0;
}
.cli-logo {
  flex: 0 0 auto; display: grid; place-items: center;
  padding: 0 clamp(1.1rem, 3vw, 2.2rem);
}
/* altura fija + width auto → el SVG (recortado, con viewBox) escala proporcional */
.cli-logo img {
  height: clamp(56px, 6vw, 84px); width: auto; max-width: 270px;
  object-fit: contain; -webkit-user-drag: none; user-select: none;
}
.clients-carousel__nav { display: none; }

/* Doble marquee (desktop, activado por JS con .is-marquee) */
.clients-carousel.is-marquee .clients-carousel__viewport {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.clients-carousel.is-marquee .clients-carousel__track {
  flex-wrap: nowrap; justify-content: flex-start; width: max-content;
}
.clients-carousel.is-marquee .clients-carousel__track[data-row="a"] { animation: cli-marq-l 48s linear infinite; }
.clients-carousel.is-marquee .clients-carousel__track[data-row="b"] { animation: cli-marq-r 48s linear infinite; }
.clients-carousel.is-marquee:hover .clients-carousel__track { animation-play-state: paused; }
@keyframes cli-marq-l { to { transform: translateX(-50%); } }
@keyframes cli-marq-r { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Coverflow (móvil, activado por JS con .is-cover) */
.clients-carousel.is-cover .clients-carousel__viewport { gap: 0; -webkit-mask-image: none; mask-image: none; }
.clients-carousel.is-cover .clients-carousel__track--b { display: none; }
.clients-carousel.is-cover .clients-carousel__track[data-row="a"] {
  flex-wrap: nowrap; justify-content: flex-start; width: max-content;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1); will-change: transform;
}
.clients-carousel.is-cover .cli-logo {
  padding: 0; transform: scale(.5); opacity: .42;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .5s ease;
}
.clients-carousel.is-cover .cli-logo.is-active { transform: scale(1); opacity: 1; }
.clients-carousel.is-cover .cli-logo img { height: 92px; max-width: 82%; }

@media (max-width: 700px) {
  .clients-carousel.is-cover .clients-carousel__nav {
    display: grid; place-items: center; position: absolute; top: 50%; left: auto;
    transform: translateY(-50%); z-index: 4;
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; color: var(--navy-900); border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(16, 20, 38, .16); cursor: pointer;
    transition: transform .15s ease, background-color .2s;
  }
  .clients-carousel.is-cover .clients-carousel__nav--prev { left: -4px; }
  .clients-carousel.is-cover .clients-carousel__nav--next { right: -4px; }
  .clients-carousel.is-cover .clients-carousel__nav:active { transform: translateY(-50%) scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
  .clients-carousel.is-marquee .clients-carousel__track { animation: none; }
  .clients-carousel.is-cover .clients-carousel__track[data-row="a"],
  .clients-carousel.is-cover .cli-logo { transition: none; }
}

/* ----- CTA band ----- */
.cta-band { position: relative; isolation: isolate; overflow: hidden; color: #fff; }
.cta-band__bg { position: absolute; inset: 0; z-index: -2; }
.cta-band__bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-band { min-height: 340px; display: flex; flex-direction: column; justify-content: center; }
.cta-band > .container { width: 100%; }
.cta-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(16,20,38,.86) 0%, rgba(16,20,38,.52) 52%, rgba(16,20,38,.22) 100%); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.82); margin-top: 1rem; max-width: 48ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* Fondo del CTA FIJO al viewport (web + móvil), revelado por la "ventana" del
   bloque al hacer scroll (parallax de reveal). background-attachment:fixed no es
   fiable en iOS, así que fijamos el <picture> y lo recortamos con clip-path en la
   sección (clip-path SÍ recorta descendientes position:fixed; overflow:hidden no). */
.cta-band { clip-path: inset(0); }
.cta-band__bg { position: fixed; inset: 0; z-index: -2; }
@media (prefers-reduced-motion: reduce) {
  .cta-band { clip-path: none; }
  .cta-band__bg { position: absolute; }
}
/* CTA "¿Listo…": en móvil el cover recorta al centro (esferas) y deja fuera a la
   cuadrilla KREIS (que está a la izquierda). Corremos el encuadre a la izquierda.
   Solo móvil y solo esta variante (no afecta el CTA del Inicio ni el escritorio). */
@media (max-width: 700px) {
  .cta-band--listo .cta-band__bg img { object-position: 22% center; }
}

/* Las fotos a sangre van dentro de <picture>; sin alto en el picture, el height:100%
   de la <img> no se resuelve y la foto sale a su proporción natural (se "corta"). */
.hero__media picture, .page-hero__media picture, .cta-band__bg picture,
.cap-tile__img picture, .proj__img picture, .contact__bg picture {
  display: block; width: 100%; height: 100%;
}

/* ----- Contacto ----- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.contact-info { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.info-row { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg); padding: 1.3rem 1.4rem; transition: background-color .3s var(--ease); }
.info-row:hover { background: var(--bg-2); }
.info-row__ic { flex: none; color: var(--royal-600); margin-top: 2px; transition: transform .3s var(--ease); }
.info-row:hover .info-row__ic { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .info-row__ic { transition: none; } .info-row:hover .info-row__ic { transform: none; } }
.info-row__k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-500); }
.info-row__v { color: var(--ink); font-size: 1.02rem; margin-top: 0.2rem; font-weight: 500; }
.info-row__v a:hover { color: var(--royal-600); }
.contact-map { margin-top: 1rem; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; }
.contact-map iframe { width: 100%; height: 100%; border: 0; }

.form-card { background: var(--bg-2); border: 1px solid var(--line); padding: clamp(1.6rem, 3vw, 2.4rem); }
.form-card h3 { color: var(--ink); }
.form-card .sub { color: var(--steel-600); font-size: 0.95rem; margin-top: 0.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); font-weight: 500; }
.field label .req { color: var(--royal-600); }
.field input, .field textarea { background: #fff; border: 1.5px solid var(--line-2); padding: 0.85rem 1rem; font-size: 0.98rem; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input::placeholder, .field textarea::placeholder { color: var(--steel-400); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--royal-500); box-shadow: 0 0 0 3px rgba(51,77,149,.15); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.8rem; color: var(--steel-500); margin-top: 1rem; }
.form-alert { padding: 0.9rem 1.1rem; font-size: 0.92rem; margin-top: 1.25rem; display: flex; gap: 0.6rem; align-items: flex-start; }
.form-alert .ic { flex: none; margin-top: 1px; }
.form-alert--ok { background: #e6f4ec; color: #1f6b3d; }
.form-alert--err { background: #fbe9e7; color: #a83224; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ----- Footer ----- */
.footer { background: var(--navy-950); color: rgba(255,255,255,.65); padding-block: clamp(3.5rem, 6vw, 4.75rem) 1.75rem; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer__brand img { height: 46px; margin-bottom: 1.25rem; }
.footer__about { max-width: 34ch; font-size: 0.92rem; line-height: 1.6; }
.footer__data { margin-top: 1.3rem; }
.footer__col h4 { color: #fff; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1.1rem; font-weight: 600; }
.footer__col ul { list-style: none; display: grid; gap: 0.6rem; }
.footer__col a { color: rgba(255,255,255,.68); font-size: 0.93rem; transition: color .2s; display: inline-flex; gap: 0.5rem; align-items: center; }
.footer__col a:hover { color: #fff; }
.footer__col .ic { color: var(--royal-400); }
.footer__bottom { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.09); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: rgba(255,255,255,.5); }
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__legal { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.footer__legal a, .footer__legal button { color: rgba(255,255,255,.62); font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; transition: color .2s; }
.footer__legal a:hover, .footer__legal button:hover { color: #fff; }
.footer__legal button { text-decoration: underline; text-underline-offset: 2px; }

/* ----- Aviso de cookies ----- */
.cookie { position: fixed; left: clamp(1rem, 3vw, 1.6rem); bottom: clamp(1rem, 3vw, 1.6rem); right: auto; z-index: 350; max-width: min(430px, calc(100vw - 2rem)); background: var(--navy-900); color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.12); box-shadow: var(--shadow-lg); padding: 1.15rem 1.25rem 1.25rem; transform: translateY(180%); transition: transform .5s var(--ease-expo); }
.cookie.show { transform: none; }
.cookie__text { font-size: 0.88rem; line-height: 1.55; }
.cookie__text a { color: var(--royal-300); text-decoration: underline; text-underline-offset: 2px; }
.cookie__actions { display: flex; gap: 0.7rem; margin-top: 1rem; }
.cookie__actions .btn { flex: 1; padding: 0.72rem 1rem; font-size: 0.82rem; }
.cookie .btn--outline { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.cookie .btn--outline:hover { box-shadow: inset 0 0 0 1.5px #fff; color: #fff; background: rgba(255,255,255,.06); }
body.cookie-open .wa-float, body.cookie-open .to-top { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .cookie { transition: none; } }

/* ----- Página legal (aviso de privacidad) ----- */
.legal { max-width: 780px; }
.legal__updated { font-family: var(--mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--steel-500); }
.legal h2 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); letter-spacing: -0.01em; margin-top: 2.4rem; color: var(--ink); }
.legal p, .legal li { color: var(--steel-600); line-height: 1.7; max-width: 74ch; }
.legal p { margin-top: 0.9rem; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal ul { margin-top: 0.9rem; padding-left: 1.25rem; }
.legal li { margin-top: 0.45rem; }
.legal a { color: var(--royal-600); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--royal-700); }

/* ----- WhatsApp flotante ----- */
.wa-float { position: fixed; right: clamp(1rem, 3vw, 1.6rem); bottom: calc(clamp(1rem, 3vw, 1.6rem) + 66px); z-index: var(--z-top); width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px -8px rgba(37,211,102,.6); transition: transform .3s var(--ease); }
.wa-float:hover { transform: translateY(-3px) scale(1.05); }
.wa-float::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25D366; animation: waPulse 2.4s ease-out infinite; }
@keyframes waPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wa-float::after { animation: none; } }

/* ----- Botón subir ----- */
.to-top { position: fixed; right: clamp(1rem, 3vw, 1.6rem); bottom: clamp(1rem, 3vw, 1.6rem); z-index: var(--z-top); width: 56px; height: 56px; border-radius: 50%; background: var(--navy-900); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(20,26,48,.7); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s, background-color .2s; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--royal-600); transform: translateY(-3px); }

/* ----- Reveal ----- */
html.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-expo), transform .8s var(--ease-expo); }
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal-stagger > * { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease-expo), transform .7s var(--ease-expo); transition-delay: calc(var(--i,0) * 80ms); }
html.js .reveal-stagger.is-in > * { opacity: 1; transform: none; }
/* imágenes de tarjetas: wipe con clip-path + leve zoom, escalonado */
html.js .reveal-stagger .cap-tile__img, html.js .reveal-stagger .proj__img { clip-path: inset(0 0 100% 0); transition: clip-path .95s var(--ease-expo); transition-delay: calc(var(--i,0) * 85ms); }
html.js .reveal-stagger.is-in .cap-tile__img, html.js .reveal-stagger.is-in .proj__img { clip-path: inset(0 0 0 0); }
html.js .reveal-stagger .cap-tile__img img, html.js .reveal-stagger .proj__img img { transform: scale(1.12); }
html.js .reveal-stagger.is-in .cap-tile__img img, html.js .reveal-stagger.is-in .proj__img img { transform: scale(1); transition: transform 1.1s var(--ease-expo) calc(var(--i,0) * 85ms); }
@media (prefers-reduced-motion: reduce) { html.js .reveal, html.js .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* clip-reveal atado al .reveal padre (que sí observa el JS); sin JS = visible */
html.js .reveal .clip-reveal { clip-path: inset(0 0 100% 0); transition: clip-path .9s var(--ease-expo); }
html.js .reveal.is-in .clip-reveal { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { html.js .reveal .clip-reveal { clip-path: none !important; } }

/* ----- Preloader: blanco sólido → logo que late → puertas que abren ----- */
.preloader { position: fixed; inset: 0; z-index: 9999; overflow: hidden; }
/* Paneles blancos que se solapan 1% al centro: durante la carga = blanco sólido sin costura */
.preloader__panel { position: absolute; top: -2px; bottom: -2px; width: 50.5%; background: #fff; will-change: transform; }
.preloader__panel--l { left: 0;  animation: plDoorL .95s cubic-bezier(0.77,0,0.175,1) 3.15s forwards; }
.preloader__panel--r { right: 0; animation: plDoorR .95s cubic-bezier(0.77,0,0.175,1) 3.15s forwards; }
.preloader__logo { position: absolute; top: 50%; left: 50%; z-index: 2; width: min(380px, 66vw); height: auto; transform: translate(-50%,-50%) scale(.92); opacity: 0; will-change: opacity, filter, transform; animation: plLogo 4.3s ease-in-out forwards; }
.preloader { animation: plGone 0s linear 4.2s forwards; }
/* La sombra (profundidad) SOLO aparece al abrir, no durante la carga */
@keyframes plDoorL {
  0%   { transform: translateX(0);     box-shadow: 8px 0 0 rgba(20,26,48,0); }
  14%  { box-shadow: 10px 0 50px rgba(20,26,48,.28); }
  100% { transform: translateX(-101%); box-shadow: 10px 0 50px rgba(20,26,48,.28); }
}
@keyframes plDoorR {
  0%   { transform: translateX(0);     box-shadow: -8px 0 0 rgba(20,26,48,0); }
  14%  { box-shadow: -10px 0 50px rgba(20,26,48,.28); }
  100% { transform: translateX(101%);  box-shadow: -10px 0 50px rgba(20,26,48,.28); }
}
/* Logo: entra, LATE entre color real y blanco, se apaga antes de abrir */
@keyframes plLogo {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.92); filter: brightness(1) invert(0); }
  6%   { opacity: 1; transform: translate(-50%,-50%) scale(1);   filter: brightness(1) invert(0); }
  20%  { filter: brightness(0) invert(1); }   /* blanco */
  36%  { filter: brightness(1) invert(0); }   /* color real */
  52%  { filter: brightness(0) invert(1); }   /* blanco */
  66%  { opacity: 1; filter: brightness(1) invert(0); } /* color real */
  72%  { opacity: 0; transform: translate(-50%,-50%) scale(1.05); }
  100% { opacity: 0; }
}
@keyframes plGone { to { visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .preloader { display: none; } }

/* Preloader RÁPIDO: 2ª+ vista de la sesión (la página ya cargó antes) → menos de 1s.
   Logo aparece y se apaga sin el latido; las puertas abren enseguida. */
html.pl-fast .preloader__logo   { animation: plLogoFast .55s ease-out forwards; }
html.pl-fast .preloader__panel--l { animation: plDoorL .6s cubic-bezier(0.77,0,0.175,1) .3s forwards; }
html.pl-fast .preloader__panel--r { animation: plDoorR .6s cubic-bezier(0.77,0,0.175,1) .3s forwards; }
html.pl-fast .preloader { animation: plGone 0s linear .92s forwards; }
@keyframes plLogoFast {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.94); }
  35%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  68%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.03); }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
