/* ==========================================================================
   SIMA DESARROLLOS — SITE.CSS
   Sistema de diseño corporativo: Blanco, Rojo y Negro
   Tipografía principal: MONTSERRAT
   ========================================================================== */

:root {
  /* Paleta Corporativa Principal: Blanco, Rojo y Negro */
  --white: #ffffff;
  --surface-light: #f8fafc;
  --surface-alt: #f1f4f8;
  
  --black: #07090e;
  --black-surface: #0e1219;
  --black-card: #141a24;
  --black-border: #202735;
  
  --ink: #0b0f17;
  --ink-2: #121822;
  --ink-3: #1a2230;
  --text-dark: #090d14;
  --slate: #475569;
  --slate-light: #64748b;
  
  --line: #e2e8f0;
  --line-light: #edf2f7;
  --line-dark: #1e2635;
  --mist: #94a3b8;
  
  /* Rojo Corporativo de Ingeniería */
  --red: #d31027;
  --red-hover: #b30b1e;
  --red-dark: #910817;
  --red-light: #e52d27;
  --red-soft: rgba(211, 16, 39, 0.08);
  --red-glow: rgba(211, 16, 39, 0.35);
  --red-gradient: linear-gradient(135deg, #e52d27 0%, #b31217 100%);
  
  /* Alias de compatibilidad semántica con páginas existentes */
  --bone: var(--surface-light);
  --paper: var(--white);

  /* Tipografía Oficial: MONTSERRAT */
  --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Espaciado y estructura */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
  --measure: 44rem;
  
  /* Radios modernos */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  /* Elevación y sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-red: 0 6px 20px -2px rgba(211, 16, 39, 0.4);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-light);
  color: var(--text-dark);
  font: 400 1rem/1.65 var(--font-body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
p { text-wrap: pretty; }
a { color: inherit; transition: color 0.2s ease, border-color 0.2s ease; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.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;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--black); color: #fff; padding: .6rem 1.2rem; z-index: 100;
  font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}
.skip:focus { top: .5rem; }

/* ---------- Cabecera Corporativa ---------- */
.site-header, .site-header *, .site-header *::before, .site-header *::after { box-sizing: border-box; }
.site-header {
  position: sticky; top: 0; z-index: 99;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
  font: 500 0.95rem/1.5 var(--font-body);
  color: var(--text-dark);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.85rem;
}
.brand { display: flex; align-items: center; flex: none; line-height: 0; }
.brand img {
  display: block; width: 200px; height: auto; max-width: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
  transition: transform 0.2s ease;
}
.brand:hover img { transform: scale(1.02); }

.nav-toggle {
  display: none; font: 600 .9rem var(--font-body); background: #fff;
  border: 1.5px solid var(--black); border-radius: var(--radius-md);
  padding: .5rem 1rem; min-height: 2.6rem; cursor: pointer; color: var(--black);
  transition: all 0.2s ease;
}
.nav-toggle:hover { background: var(--black); color: #fff; }

.nav-list {
  display: flex; align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem); list-style: none; margin: 0; padding: 0;
}
.nav-list li { margin: 0; padding: 0; }
.nav-list a {
  color: var(--text-dark); text-decoration: none; font-weight: 600; font-size: .88rem;
  letter-spacing: 0.02em; padding: .5rem 0; position: relative;
  transition: color 0.2s ease;
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--red); transform: scaleX(0); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}
.nav-list a:hover { color: var(--red); }
.nav-list a:hover::after { transform: scaleX(1); }
.nav-list a[aria-current="page"] { color: var(--red); font-weight: 700; }
.nav-list a[aria-current="page"]::after { transform: scaleX(1); }

.nav-list .nav-cta {
  background: var(--red-gradient); color: #fff;
  padding: .6rem 1.35rem; border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(211, 16, 39, 0.3); font-weight: 700;
  letter-spacing: 0.03em; border: 0;
}
.nav-list .nav-cta::after { display: none; }
.nav-list .nav-cta:hover {
  background: linear-gradient(135deg, #eb342e 0%, #bd151b 100%);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(211, 16, 39, 0.45);
}

/* ---------- Encabezado de página Hero (Páginas interiores) ---------- */
.page-head {
  background: 
    radial-gradient(circle at 85% 20%, rgba(211, 16, 39, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(211, 16, 39, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #05070a 0%, #0e1219 100%);
  color: #fff;
  position: relative;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 10px rgba(211, 16, 39, 0.25);
  overflow: hidden;
}

/* Marca de agua de cuadrícula técnica */
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.7;
}

.page-head .wrap {
  position: relative;
  z-index: 1;
  padding-top: clamp(2.75rem, 5vw, 4rem);
  padding-bottom: clamp(2.75rem, 5vw, 4rem);
}

/* Rejilla de dos columnas del encabezado */
.page-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}

/* Badge / Kicker */
.page-head-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(211, 16, 39, 0.12);
  border: 1px solid rgba(211, 16, 39, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font: 700 0.78rem/1.2 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff858d;
  margin-bottom: 1.15rem;
}
.page-head-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.page-head h1 {
  font: 800 clamp(2.2rem, 4.2vw, 3.4rem)/1.1 var(--font-display);
  letter-spacing: -0.03em;
  margin: 0 0 1.15rem;
  text-wrap: balance;
  color: #ffffff;
}
.page-head h1 span {
  color: var(--red-light);
}

.page-head p {
  color: #cbd5e1;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.6;
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  text-wrap: pretty;
}

.page-head .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: #f1f5f9;
  font-weight: 500;
  margin: 0 0 0.85rem;
  text-wrap: pretty;
}

.page-head .desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0 0 1.5rem;
  max-width: 44rem;
}

/* Tags técnicos */
.page-head-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-head-tags li {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}
.page-head-tags li:hover {
  border-color: rgba(211, 16, 39, 0.4);
  background: rgba(211, 16, 39, 0.1);
  color: #fff;
}

/* Tarjeta flotante técnica (columna derecha) */
.page-head-card {
  background: rgba(14, 18, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 3px solid var(--red);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(211, 16, 39, 0.1);
  position: relative;
}
.page-head-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at top right, rgba(211, 16, 39, 0.15) 0%, transparent 70%);
  pointer-events: none;
  border-top-right-radius: var(--radius-lg);
}
.page-head-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 0.88rem/1.3 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.page-head-card-title svg {
  color: var(--red);
  flex-shrink: 0;
}
.page-head-card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.page-head-card-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.page-head-card-list li svg {
  color: var(--red);
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.page-head-card-list strong {
  color: #fff;
}
.page-head-card-cta {
  width: 100%;
}

.page-head .jump {
  display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; list-style: none;
  margin: 1.75rem 0 0; padding: 0;
}
.page-head .jump a {
  color: #fff; font-weight: 600; text-underline-offset: .35em;
  text-decoration-thickness: 2px; text-decoration-color: var(--red);
}
.page-head .jump a:hover { color: var(--red-light); }

/* Índice de la página interior (Cards de navegación rápida) */
.overview {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
}
.overview-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 100%;
}
.overview a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--black-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.overview a:hover {
  border-left-color: var(--red);
  border-color: rgba(211, 16, 39, 0.3);
  background: rgba(211, 16, 39, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.overview-num {
  font: 800 0.8rem/1 var(--font-display);
  letter-spacing: 0.08em;
  color: var(--red-light);
  margin-bottom: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.overview strong {
  display: block;
  font: 700 1.12rem/1.3 var(--font-display);
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
  color: #fff;
}
.overview span {
  display: block;
  color: var(--mist);
  font-size: 0.9rem;
  line-height: 1.45;
}
.overview-arrow {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  transition: transform 0.2s ease, color 0.2s ease;
}
.overview a:hover .overview-arrow {
  transform: translateX(4px);
  color: var(--red-light);
}

@media (max-width: 58rem) {
  .page-head-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
@media (max-width: 42rem) {
  .overview {
    grid-template-columns: 1fr;
  }
}

/* ---------- Botones Corporativos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  text-decoration: none; font: 600 0.95rem/1.35 var(--font-body);
  letter-spacing: 0.02em; padding: .85rem 1.65rem; border-radius: var(--radius-md);
  border: 1.5px solid transparent; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-red {
  background: var(--red-gradient); color: #fff;
  box-shadow: var(--shadow-red);
}
.btn-red:hover {
  background: linear-gradient(135deg, #eb342e 0%, #bd151b 100%);
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(211, 16, 39, 0.5);
}
.btn-line {
  border-color: rgba(255, 255, 255, 0.35); color: #fff;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}
.btn-line:hover {
  border-color: #fff; background: rgba(255, 255, 255, 0.16);
  color: #fff; transform: translateY(-2px);
}
.btn-ink {
  border-color: var(--black); color: #fff; background: var(--black);
  box-shadow: var(--shadow-sm);
}
.btn-ink:hover {
  background: var(--red); border-color: var(--red); color: #fff;
  transform: translateY(-2px); box-shadow: var(--shadow-red);
}

/* Enlaces de texto corporativos con acento rojo */
.text-link {
  font-weight: 600; text-underline-offset: .3em;
  text-decoration-thickness: 2px; text-decoration-color: var(--red);
  color: var(--ink); transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.text-link:hover { color: var(--red); text-decoration-color: var(--red-hover); }

/* ---------- Pie de Página Corporativo (Deep Black & Red) ---------- */
.site-footer {
  background: var(--black); color: var(--mist);
  font-size: .95rem; border-top: 1px solid var(--black-border);
}
.site-footer a { text-decoration: none; color: #cbd5e1; transition: color 0.15s ease; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: .25em; }

.footer-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 2.5rem 3.5rem; padding-top: clamp(3rem, 6vw, 4.5rem); padding-bottom: 2.5rem;
}
.footer-name {
  font: 700 1.15rem/1.4 var(--font-display); color: #fff;
  letter-spacing: -0.01em; margin: 0 0 1rem; max-width: 24rem;
}
.site-footer address { font-style: normal; line-height: 1.6; color: var(--mist); }

.footer-title {
  font: 700 .82rem/1.4 var(--font-body); letter-spacing: .1em;
  text-transform: uppercase; color: #fff; margin: 0 0 1.15rem;
  position: relative; padding-bottom: .45rem;
}
.footer-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 2px;
  background: var(--red); border-radius: 1px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: .5rem; }
.footer-base {
  padding-bottom: 1.75rem; font-size: .88rem; color: #64748b;
}
.footer-base::before {
  content: ""; display: block; height: 1px; background: var(--black-border);
  margin-bottom: 1.5rem;
}

/* ---------- Visor de Imágenes (Lightbox) ---------- */
.viewer { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; overflow: visible; }
.viewer::backdrop { background: rgba(7, 9, 14, .94); backdrop-filter: blur(6px); }
.viewer img {
  display: block; max-width: 92vw; max-height: 86vh; width: auto; height: auto;
  border-radius: var(--radius-md); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.viewer-btn, .viewer-close {
  position: fixed; border: 0; cursor: pointer; color: #fff;
  background: rgba(14, 18, 25, .8); backdrop-filter: blur(8px);
  width: 3.25rem; height: 3.25rem; font-size: 1.75rem; line-height: 1;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.viewer-btn:hover, .viewer-close:hover {
  background: var(--red); border-color: var(--red);
  transform: scale(1.08); box-shadow: var(--shadow-red);
}
.viewer-btn { top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 1.5rem; }
.viewer-next { right: 1.5rem; }
.viewer-close { top: 1.5rem; right: 1.5rem; }

/* ---------- Micro-animaciones ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity .7s cubic-bezier(0.16, 1, 0.3, 1), transform .7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 64rem) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 2px solid var(--black);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1); display: none;
  }
  .nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: .75rem var(--gutter) 1.5rem; }
  .nav-list a { display: block; padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
  .nav-list a::after { display: none; }
  .nav-list .nav-cta { margin-top: 1rem; text-align: center; }
}

@media (max-width: 48rem) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
