/* ==========================================================================
   FRASE — sitio corporativo estático
   Paleta de marca (hex exactos del SVG del logo):
     azul marino  #041F5F      gris de letras  #808080
   Sin dependencias externas. Sin build. Sin localStorage.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --azul: #041F5F;
  --azul-900: #04113a;
  --azul-700: #123a86;
  --azul-050: #eef1f7;
  --gris: #808080;          /* solo decoración / texto grande, nunca cuerpo */
  --ink: #1a1f2b;
  --muted: #55606f;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e2e5ea;
  --maxw: 1120px;
  --radius: 14px;
  --pad-section: clamp(3.25rem, 8vw, 6rem);
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--azul); }
a:hover { color: var(--azul-700); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.4vw, 3.15rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }

/* ---------- Accesibilidad ---------- */
:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 2px;
  border-radius: 3px;
}
.section--dark :focus-visible,
.hero :focus-visible { outline-color: #fff; }

.skip-link {
  position: absolute;
  left: 8px; top: -48px;
  background: #fff; color: var(--azul);
  padding: .55rem .9rem; border-radius: 8px; font-weight: 700;
  z-index: 200;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  background: var(--azul);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: .7rem 1.15rem;
  border-radius: 10px;
  border: 2px solid var(--azul);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--azul-700); border-color: var(--azul-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--sm { padding: .5rem .85rem; font-size: .9rem; border-radius: 8px; }
.btn--lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-logo { height: 44px; width: auto; }
.brand-logo--light { display: none; }

.main-nav { display: flex; gap: 1.1rem; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .96rem;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--azul); border-bottom-color: var(--azul); }

.header-actions { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
.lang-toggle {
  background: transparent; border: 2px solid var(--line);
  color: var(--ink); font-weight: 800; font-size: .82rem;
  width: 42px; height: 38px; border-radius: 8px; cursor: pointer;
  letter-spacing: .04em;
}
.lang-toggle:hover { border-color: var(--azul); color: var(--azul); }

.nav-toggle {
  display: none;
  width: 42px; height: 38px; border: 2px solid var(--line); border-radius: 8px;
  background: transparent; cursor: pointer; padding: 0;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; margin: 3px auto; background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(4,17,58,.38) 0%, rgba(4,17,58,.48) 45%, rgba(4,17,58,.80) 100%);
}
.hero-content { position: relative; z-index: 2; padding-block: clamp(3rem, 9vw, 6rem); }
.hero-content h1 { max-width: 20ch; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700;
  color: rgba(255,255,255,.82); margin-bottom: 1rem;
}
.hero-sub { max-width: 56ch; font-size: 1.12rem; color: rgba(255,255,255,.92); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- Secciones ---------- */
.section { padding-block: var(--pad-section); }
.section--alt { background: var(--azul-050); }
.section--dark { background: var(--azul); color: #fff; }
.section--dark a { color: #fff; }

.kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 800;
  color: var(--muted); margin-bottom: .6rem;
}
.section--dark .kicker { color: rgba(255,255,255,.7); }
.section-title { max-width: 22ch; }
.lead { font-size: 1.2rem; max-width: 60ch; }
.body { max-width: 62ch; }
.section--dark .stat-desc { color: rgba(255,255,255,.9); }

/* ---------- Misión / Visión ---------- */
.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 2rem; }
.mv-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--azul);
  border-radius: var(--radius); padding: 1.4rem 1.5rem;
}
.mv-card h3 { color: var(--azul); }
.mv-card p { margin: 0; color: var(--muted); }

/* ---------- Servicios ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 2rem; }
.svc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; position: relative;
}
.svc-num {
  font-size: .85rem; font-weight: 800; color: var(--muted); letter-spacing: .06em;
}
.svc-card h3 { margin-top: .5rem; }
.svc-card p { margin: 0; color: var(--muted); font-size: .98rem; }
.svc-card--feature {
  grid-column: 1 / -1;
  border: 2px solid var(--azul);
  background: linear-gradient(180deg, #fff, var(--azul-050));
}
.svc-flag {
  display: inline-block; background: var(--azul); color: #fff;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  padding: .28rem .6rem; border-radius: 6px; margin: .35rem 0 .6rem;
}
.svc-card--feature h3 { font-size: 1.35rem; }
.svc-card--feature p { color: var(--ink); max-width: 70ch; }
.svc-card--feature .svc-flag { color: #fff; max-width: none; }

/* ---------- Imágenes destacadas (fuentes >= 1280 px; render <= mitad del nativo) ---------- */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-top: 2rem; }
.feature { margin: 0; }
.feature img {
  width: 100%; max-width: 620px;      /* regla dura: <= mitad del ancho nativo */
  border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff;
}
.section--dark .feature img { border-color: rgba(255,255,255,.25); }
.feature figcaption {
  font-size: .88rem; color: var(--muted); margin-top: .55rem; max-width: 620px;
}
.section--dark .feature figcaption { color: rgba(255,255,255,.8); }
.feature--wide { margin-top: 2.4rem; }
.feature--wide img { max-width: 620px; }

/* ---------- Proyectos ---------- */
.year-block { margin-top: 2.4rem; }
.year-label {
  font-size: 1rem; font-weight: 800; color: var(--azul);
  border-bottom: 2px solid var(--line); padding-bottom: .4rem; margin-bottom: 1.1rem;
}
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.proj { margin: 0; }
.proj img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  aspect-ratio: 4 / 3; object-fit: cover;
}
.proj figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }

.plain-list { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.plain-list li { margin-bottom: .5rem; }

.gallery-label { margin: 2.6rem 0 1.1rem; color: var(--azul); }

/* Cuadrícula compacta: fuentes < 1280 px. Nunca supera ~300 px CSS ni la
   mitad del ancho nativo (2 col en móvil, 3-4 col en pantallas grandes). */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; max-width: 940px; }
.tile { margin: 0; }
.tile img {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  aspect-ratio: 1 / 1; object-fit: cover;
}

/* ---------- Capacidad ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 2rem; }
.stat {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius); padding: 1.5rem;
}
.stat-num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 .4rem; }
.stat-num span { font-size: .9rem; font-weight: 700; opacity: .8; }
.stat-desc { margin: 0; font-size: .96rem; }

/* ---------- Clientes ---------- */
.client-grid {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem;
}
.client-grid li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1rem; font-weight: 600; font-size: .93rem;
  display: flex; align-items: center;
}

/* ---------- Infraestructura ---------- */
.infra-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.8rem; margin-top: 2rem; align-items: start; }
.infra-list { margin: 0; padding: 0; list-style: none; }
.infra-list li {
  padding: .9rem 0 .9rem 1.6rem; border-bottom: 1px solid var(--line); position: relative;
  font-weight: 600;
}
.infra-list li:last-child { border-bottom: 0; }
.infra-list li::before {
  content: ""; position: absolute; left: 0; top: 1.2rem;
  width: .7rem; height: .7rem; background: var(--azul); border-radius: 2px;
}
.safety { margin-top: 2.6rem; padding-top: 2rem; border-top: 2px solid var(--line); }
.safety h3 { color: var(--azul); }
.safety-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: center; }
.tile--safety img { aspect-ratio: 4 / 3; }
.tile--safety figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }

/* ---------- Contacto ---------- */
.contact-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; margin-top: 2rem; }
.contact-row { display: flex; flex-direction: column; gap: .1rem; margin-bottom: 1.1rem; }
.contact-k {
  text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 800;
  color: rgba(255,255,255,.65);
}
.contact-row a { font-size: 1.05rem; font-weight: 600; text-decoration: none; word-break: break-word; }
.contact-row a:hover { text-decoration: underline; }

.contact-form { display: grid; gap: .9rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 1.5rem; }
.contact-form label { display: grid; gap: .35rem; font-size: .85rem; font-weight: 700; letter-spacing: .02em; }
.contact-form input, .contact-form textarea {
  font: inherit; padding: .65rem .75rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35); background: #fff; color: var(--ink);
}
.contact-form textarea { resize: vertical; }
.form-note { font-size: .82rem; color: rgba(255,255,255,.8); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--azul-900); color: rgba(255,255,255,.85); padding-block: 2.5rem; }
.footer-inner { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.footer-inner img { height: 44px; width: auto; }
.footer-text p { margin: .2rem 0; font-size: .9rem; }
.footer-legal { color: rgba(255,255,255,.55); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .infra-layout { grid-template-columns: 1fr; }
  .safety-layout { grid-template-columns: 1fr; }
  .tile--safety { max-width: 320px; }
  .contact-layout { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
  .main-nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1.1rem, 4vw, 2rem) 1rem;
    transform: translateY(-120%);
    transition: transform .22s ease;
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
  }
  @media (prefers-reduced-motion: reduce) { .main-nav { transition: none; } }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: block; }
  .cta-header { display: none; }
  .header-inner { min-height: 60px; }
  .site-header { --h: 60px; }
  html { scroll-padding-top: 72px; }
}

@media (max-width: 620px) {
  body { font-size: 1rem; }
  .mv-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero-actions .btn { width: 100%; text-align: center; }
  .feature img, .feature figcaption { max-width: 100%; }
}

/* ---------- Modo oscuro del sistema: se respeta el diseño claro de marca,
   solo se suaviza el fondo para reducir brillo ---------- */
@media (prefers-color-scheme: dark) {
  :root { --bg: #eef0f3; }
}
