/* ============================================
   NIMBUS XP — SISTEMA DE MEDIOS
   Logo de marca · Screenshots · Galerías
   Logo wall · Equipo · Badges · Lightbox
   --------------------------------------------
   Depende de los tokens de design-system.css
   ============================================ */


/* ═══════════════════════════════════════════
   1 · LOGO DE MARCA
   ═══════════════════════════════════════════ */

/* El PNG del logo trae padding horneado (la marca ocupa
   ~66% del alto del archivo), por eso se ve más chico de
   lo que el número de px sugiere. Estas medidas ya lo
   compensan. */

/* Nav — sube de 36px a 44px */
.brand-logo { height: 44px; width: auto; display: block; }

@media (max-width: 600px) {
  .brand-logo { height: 36px; }
}

/* ── Logo grande de hero ──────────────────── */
/* Un solo knob para calibrar el tamaño en todo el sitio. */
:root { --hero-logo-w: clamp(300px, 36vw, 560px); }

.hero-brand {
  display: block;
  width: var(--hero-logo-w);
  max-width: 100%;
  height: auto;
  /* El PNG trae 200px de margen transparente por lado (18% del alto,
     5.9% del ancho). Como el escalado es uniforme, ese aire equivale
     siempre al 5.88% del ancho renderizado: se cancela con margen
     negativo para que el logo se alinee con el texto y no flote. */
  margin-top: calc(var(--hero-logo-w) * -0.0588);
  margin-left: calc(var(--hero-logo-w) * -0.0588);
  margin-bottom: clamp(4px, 0.8vw, 12px);
}

/* Variante centrada a pantalla completa (estilo del sitio
   anterior): logo dominante sobre banda de marca. */
.brand-band {
  --hero-logo-w: clamp(300px, 62vw, 980px);
  text-align: center;
  padding: clamp(48px, 8vw, 96px) 0;
}
.brand-band .hero-brand {
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
}

/* Banda de marca sobre el degradado morado de NimbusXP */
.brand-band-indigo {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(111,0,255,0.18), transparent 70%),
    linear-gradient(120deg, var(--indigo-deep) 0%, var(--indigo) 100%);
  color: #fff;
}
.brand-band-indigo .section-title,
.brand-band-indigo p { color: #fff; }
.brand-band-indigo .section-title em { color: var(--neon); }

/* Footer — sube de 32px a 40px */
.foot-brand img { height: 40px; width: auto; }


/* ═══════════════════════════════════════════
   2 · FIGURE BASE
   ═══════════════════════════════════════════ */

.figure {
  margin: 0;
  display: block;
}

.figure > img,
.figure picture > img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.figure figcaption,
.figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.figure figcaption strong,
.figcaption strong {
  color: var(--text-1);
  font-weight: 550;
}

/* Etiqueta mono sobre la imagen (fuente, módulo, versión…) */
.figure-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-wrap: wrap;
}

/* Relación de aspecto fija — evita saltos de layout (CLS) */
.ar {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 16 / 9);
  overflow: hidden;
  border-radius: 14px;
}
.ar > img,
.ar > video,
.ar > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: inherit;
}
.ar-contain > img { object-fit: contain; }


/* ═══════════════════════════════════════════
   3 · SCREENSHOTS CON CHROME
   Para capturas de Epicor Kinetic
   ═══════════════════════════════════════════ */

.shot {
  margin: 0;
  position: relative;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.14);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
[data-theme="dark"] .shot {
  box-shadow:
    0 30px 80px -30px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.shot:hover {
  border-color: var(--line-indigo);
  box-shadow: 0 28px 70px -20px rgba(111,0,255,0.22);
}

/* Barra superior */
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.shot-dots {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}
.shot-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  display: block;
}
.shot-url {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.shot-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-readable);
  border: 1px solid rgba(57,255,20,0.3);
  background: rgba(57,255,20,0.07);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Cuerpo */
.shot-body {
  position: relative;
  background: var(--bg-0);
}
.shot-body > img {
  width: 100%;
  height: auto;
  display: block;
}

/* Caption fuera del marco */
.shot + .figcaption,
.shot-wrap > .figcaption { margin-top: 14px; }

/* Variante app (sin URL, con etiqueta de módulo) */
.shot-app .shot-chrome { background: var(--bg-2); }

/* Variante con resplandor indigo — para el hero */
.shot-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(111,0,255,0.35), transparent 45%, rgba(57,255,20,0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

/* Marco de dispositivo móvil / tablet (MES en piso de planta) */
.shot-device {
  border-radius: 26px;
  padding: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  max-width: 340px;
}
.shot-device .shot-body { border-radius: 18px; overflow: hidden; }
.shot-device .shot-chrome { display: none; }


/* ═══════════════════════════════════════════
   4 · PLACEHOLDERS
   Permiten maquetar ANTES de tener la imagen.
   Se reemplazan por <img> sin tocar el layout.
   ═══════════════════════════════════════════ */

.media-ph {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 16 / 9);
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 10px,
      rgba(111,0,255,0.035) 10px, rgba(111,0,255,0.035) 20px
    ),
    var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}
.shot-body .media-ph {
  border: 0;
  border-radius: 0;
  aspect-ratio: var(--ar, 16 / 10);
}

.media-ph-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-soft);
  max-width: 34ch;
  line-height: 1.5;
}
.media-ph-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.media-ph::before {
  content: '';
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
  background: currentColor;
  color: var(--text-3);
  -webkit-mask: var(--ph-icon) center / contain no-repeat;
  mask: var(--ph-icon) center / contain no-repeat;
  --ph-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
}


/* ═══════════════════════════════════════════
   5 · MEDIA SPLIT — texto + imagen alternados
   ═══════════════════════════════════════════ */

.media-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.media-split.reverse > :first-child { order: 2; }

.media-split-copy h3 {
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.media-split-copy p {
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 52ch;
}
.media-split-copy .tag,
.media-split-copy .tag-indigo { margin-bottom: 18px; }

/* Lista de beneficios con check */
.media-split-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.media-split-list li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.media-split-list li::before {
  content: '';
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(57,255,20,0.12);
  border: 1px solid rgba(57,255,20,0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231FA800' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}
[data-theme="dark"] .media-split-list li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2339FF14' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

@media (max-width: 860px) {
  .media-split { grid-template-columns: 1fr; }
  .media-split.reverse > :first-child { order: 0; }
}


/* ═══════════════════════════════════════════
   6 · GALERÍA / GRID DE MEDIOS
   ═══════════════════════════════════════════ */

.media-grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
  grid-template-columns: repeat(var(--cols, 3), 1fr);
}
.media-grid-2 { --cols: 2; }
.media-grid-3 { --cols: 3; }
.media-grid-4 { --cols: 4; }

@media (max-width: 980px) { .media-grid { --cols: 2; } }
@media (max-width: 620px) { .media-grid { --cols: 1; } }

/* Tarjeta con imagen arriba */
.media-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
}
.media-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-indigo);
  box-shadow: 0 18px 44px -18px rgba(111,0,255,0.28);
}
.media-card .ar,
.media-card .media-ph { border-radius: 0; }
.media-card-body { padding: 20px 22px 24px; }
.media-card-body h4 {
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.media-card-body p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.media-card-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo-soft);
  margin-bottom: 10px;
  display: block;
}


/* ═══════════════════════════════════════════
   7 · LOGO WALL — clientes / certificaciones
   ═══════════════════════════════════════════ */

.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.logo-wall-item {
  background: var(--bg-1);
  display: grid;
  place-items: center;
  padding: 28px 24px;
  min-height: 108px;
  transition: background .3s;
}
.logo-wall-item:hover { background: var(--bg-2); }
.logo-wall-item img {
  max-height: 44px;
  max-width: 100%;
  width: auto;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter .3s, opacity .3s;
}
.logo-wall-item:hover img { filter: grayscale(0); opacity: 1; }
[data-theme="dark"] .logo-wall-item img { filter: grayscale(1) brightness(2.2); }
[data-theme="dark"] .logo-wall-item:hover img { filter: grayscale(0) brightness(1.1); }

/* Fallback textual mientras no haya logo real */
.logo-wall-item .logo-wall-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}


/* ═══════════════════════════════════════════
   8 · BADGES DE CERTIFICACIÓN
   Epicor Platinum Partner, etc.
   ═══════════════════════════════════════════ */

.badge-strip {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.5vw, 48px);
  flex-wrap: wrap;
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 14px;
}
.badge-item img {
  height: clamp(40px, 5vw, 56px);
  width: auto;
}

/* El badge oficial de Epicor es azul petróleo sobre transparente:
   en tema oscuro desaparece. Va sobre una placa blanca en lugar de
   recolorearlo (alterar la marca viola los lineamientos de Epicor). */
[data-theme="dark"] .badge-item img,
[data-theme="dark"] .badge-plate img {
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
}
.badge-plate img {
  height: clamp(34px, 3.4vw, 48px);
  width: auto;
}

/* Placa clara para artes con texto oscuro (diagramas oficiales de
   Epicor, por ejemplo) que desaparecerían en tema oscuro.
   A diferencia de .badge-plate, NO impone tamaño: la imagen
   conserva el suyo. */
.on-light img {
  background: #fff;
  border-radius: 14px;
}
[data-theme="dark"] .on-light img {
  padding: 14px;
}

/* El widget .hw-badge de nosotros.html es una tarjeta oscura
   incluso en tema claro, así que ahí la placa va siempre. */
.hw-badge .badge-plate img,
.badge-plate.on-dark img {
  background: #fff;
  border-radius: 8px;
  padding: 9px 14px;
}

/* En el hero convive con el logo NIMBUS XP y el H1:
   va como credencial, no como titular. */
.hero-meta.badge-plate {
  gap: 16px;
}
.hero-meta.badge-plate img {
  height: clamp(32px, 3vw, 42px);
}
.badge-item-text .t {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-1);
  line-height: 1.3;
}
.badge-item-text .s {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}

/* Insignia en el pie: credencial discreta, bajo la marca */
.foot-badge {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: 32ch;
}
.foot-badge img {
  height: 38px;
  width: auto;
  opacity: 0.9;
  transition: opacity .2s;
}
.foot-badge:hover img { opacity: 1; }

/* Badge grande destacado (hero / nosotros) */
.badge-hero {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px 14px 16px;
  border: 1px solid var(--line-indigo);
  border-radius: 14px;
  background: rgba(111,0,255,0.05);
}
.badge-hero img { height: 56px; width: auto; }


/* ═══════════════════════════════════════════
   9 · EQUIPO
   ═══════════════════════════════════════════ */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(20px, 2.5vw, 32px);
}
.team-card { text-align: left; }
.team-card .ar,
.team-card .media-ph {
  --ar: 4 / 5;
  border-radius: 16px;
  margin-bottom: 16px;
}
.team-card .ar img {
  filter: grayscale(0.35);
  transition: filter .4s, transform .6s;
}
.team-card:hover .ar img { filter: grayscale(0); transform: scale(1.03); }
.team-name {
  font-size: 16.5px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.team-role {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-soft);
  margin-top: 5px;
}
.team-bio {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: 10px;
}
.team-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: color .2s;
}
.team-link:hover { color: var(--indigo-soft); }
.team-link svg { width: 14px; height: 14px; flex-shrink: 0; }


/* ═══════════════════════════════════════════
   10 · BANDA A SANGRE
   ═══════════════════════════════════════════ */

.media-bleed {
  position: relative;
  width: 100%;
  min-height: clamp(280px, 42vw, 520px);
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.media-bleed > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.media-bleed::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(15,15,40,0.88), rgba(111,0,255,0.72));
}
.media-bleed-copy {
  text-align: center;
  color: #fff;
  max-width: 820px;
  padding: clamp(40px, 6vw, 80px) var(--gutter);
}
.media-bleed-copy h2 {
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
}
.media-bleed-copy h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--neon);
}
.media-bleed-copy p {
  margin-top: 20px;
  font-size: clamp(15px, 1.3vw, 18px);
  color: rgba(255,255,255,0.86);
  line-height: 1.65;
}
.media-bleed-copy .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.media-bleed-copy .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}


/* ═══════════════════════════════════════════
   11 · LIGHTBOX / ZOOM
   Las capturas de ERP tienen mucho detalle:
   hay que poder ampliarlas.
   ═══════════════════════════════════════════ */

[data-zoom] { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(7,7,11,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.open { display: grid; }
.lightbox.visible { opacity: 1; }

.lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,0.9);
  transform: scale(0.97);
  transition: transform .25s ease;
}
.lightbox.visible .lightbox-img { transform: scale(1); }

.lightbox-caption {
  margin-top: 18px;
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 70ch;
}
.lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background .2s, transform .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); transform: rotate(90deg); }
.lightbox-close svg { width: 18px; height: 18px; }


/* ═══════════════════════════════════════════
   12 · UTILIDADES
   ═══════════════════════════════════════════ */

.media-stack { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 96px); }
.media-full { width: 100%; }
.media-round { border-radius: 999px; }
.media-shadow { box-shadow: 0 24px 60px -24px rgba(0,0,0,0.3); }

/* Respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .shot, .media-card, .team-card .ar img, .lightbox, .lightbox-img {
    transition: none !important;
  }
  .shot:hover, .media-card:hover { transform: none; }
  .team-card:hover .ar img { transform: none; }
}
