/* ============================================
   EANSA — Electrónica y Automatización del Noreste
   Sistema de diseño: azul rey corporativo / precisión
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --royal: #1E40C9;
  --royal-deep: #142B7A;
  --royal-soft: #3D5CDB;
  --cyan: #2DC9E8;
  --gray-light: #EEF0F4;
  --gray-mid: #D5D9E0;
  --graphite: #5B6472;
  --ink: #131A2B;
  --white: #FFFFFF;

  --font-display: 'Space Grotesk', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--white);
  background-image: url('img/circuit-pattern.png');
  background-repeat: repeat;
  background-size: 500px 500px;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== SIGNATURE: trazo de circuito ===== */
.circuit-divider {
  width: 100%;
  height: 28px;
  display: block;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--royal);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--cyan);
  display: inline-block;
}

/* ===== HEADER / NAV ===== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-mid);
}

.nav-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.brand-logo-box {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #0B1B33;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-box img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.brand-mark { width: 36px; height: 36px; flex-shrink: 0; }

.brand-sub {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--graphite);
  letter-spacing: 0.2px;
  display: block;
  margin-top: 2px;
}

nav.links {
  display: flex;
  gap: 34px;
  align-items: center;
}

nav.links a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--graphite);
  letter-spacing: 0.1px;
  transition: color 0.2s;
  position: relative;
  padding: 6px 0;
}

nav.links a:hover { color: var(--royal); }
nav.links a.current { color: var(--royal); }
nav.links a.current::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--royal);
  border-radius: 2px;
}

.nav-cta {
  background: var(--royal);
  color: var(--white) !important;
  padding: 10px 22px;
  border-radius: 7px;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--royal-deep); color: var(--white) !important; }
.nav-cta::after { display: none !important; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 880px) {
  nav.links {
    position: fixed;
    top: 74px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--gray-mid);
  }
  nav.links.open { max-height: 420px; }
  nav.links a {
    padding: 18px 32px;
    width: 100%;
    border-bottom: 1px solid var(--gray-light);
  }
  nav.links a.current::after { display: none; }
  .nav-cta { margin: 16px 32px; text-align: center; }
  .mobile-toggle { display: block; }
}

/* ===== HERO ===== */
.hero {
  background-color: var(--white);
  background-image: url('img/circuit-pattern.png');
  background-repeat: repeat;
  background-size: 460px 460px;
  padding: 156px 0 0;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-inner > * { min-width: 0; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1px;
  color: var(--ink);
}

.hero-copy h1 .accent { color: var(--royal); }

.hero-copy p.lead {
  font-size: 17px;
  color: var(--graphite);
  max-width: 480px;
  margin-top: 20px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--royal);
  color: var(--white);
}
.btn-primary:hover { background: var(--royal-deep); transform: translateY(-1px); }

.btn-outline {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--gray-mid);
}
.btn-outline:hover { border-color: var(--royal); color: var(--royal); }

/* Hero visual: tarjeta de imagen contenida, no full-bleed */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
}

.hero-visual-frame {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 4/3.3;
  max-height: 420px;
  box-shadow: 0 24px 60px -20px rgba(20,43,122,0.35);
}

.hero-visual-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  max-height: 420px;
}

.hero-badge {
  position: absolute;
  bottom: 18px; left: 18px;
  background: rgba(19,26,43,0.85);
  backdrop-filter: blur(6px);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(45,201,232,0.2);
}

.hero-stat-card {
  position: absolute;
  top: -18px; right: -18px;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 16px 40px -12px rgba(20,43,122,0.18);
}

@media (max-width: 980px) {
  .hero-stat-card { display: none; }
}

.hero-stat-card .num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--royal);
}
.hero-stat-card .lbl {
  font-size: 11.5px;
  color: var(--graphite);
  margin-top: 2px;
}

/* ===== STATS STRIP ===== */
.stats-strip {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--gray-mid);
}

.stat-cell {
  padding: 26px 4px;
  border-right: 1px solid var(--gray-mid);
}
.stat-cell:last-child { border-right: none; }

.stat-num {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  color: var(--royal);
}

.stat-label {
  font-size: 12.5px;
  color: var(--graphite);
  margin-top: 4px;
  letter-spacing: 0.1px;
}

@media (max-width: 700px) {
  .stats-strip { grid-template-columns: 1fr; }
  .stat-cell { border-right: none; border-bottom: 1px solid var(--gray-mid); }
}

/* ===== SECTIONS ===== */
section { padding: 86px 0; }
.section-alt { background: var(--gray-light); }

.section-head {
  max-width: 600px;
  margin-bottom: 48px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head.center .eyebrow { justify-content: center; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.18;
}

.section-head p {
  color: var(--graphite);
  font-size: 15.5px;
  margin-top: 14px;
  line-height: 1.7;
}

/* ===== SERVICE CARDS ===== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 12px;
  padding: 30px 26px;
  color: var(--ink);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  border-color: var(--royal);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -16px rgba(20,43,122,0.2);
}

.card-icon {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--royal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--royal);
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  display: block;
  font-weight: 600;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--graphite);
  line-height: 1.65;
}

/* ===== IMAGE + TEXT SPLIT ===== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
}

.split-img {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 48px -20px rgba(20,43,122,0.25);
}

.split-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3.2;
}

.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }

.split-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.22;
  margin-bottom: 16px;
  color: var(--ink);
}

.split-text {
  color: var(--graphite);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 14px;
}

/* ===== CTA BAND ===== */
.cta-band {
  background: var(--royal);
  background-image: linear-gradient(135deg, var(--royal) 0%, var(--royal-deep) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
  border-radius: 20px;
  margin: 0 auto 80px;
  max-width: var(--container);
  width: calc(100% - 64px);
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  margin-bottom: 10px;
}

.cta-band p {
  color: rgba(255,255,255,0.82);
  margin-bottom: 26px;
  font-size: 15px;
}

.cta-band .btn-primary {
  background: var(--white);
  color: var(--royal-deep);
}
.cta-band .btn-primary:hover { background: var(--gray-light); }

/* ===== FOOTER ===== */
footer {
  background: var(--ink);
  color: var(--gray-mid);
  padding: 52px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  color: var(--white);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer-grid a, .footer-grid p {
  display: block;
  font-size: 14px;
  color: #9098AA;
  margin-bottom: 10px;
}

.footer-grid a:hover { color: var(--cyan); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 22px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #6B7385;
}

/* ===== PAGE HERO (sub-pages) ===== */
.page-hero {
  background-color: var(--gray-light);
  background-image: url('img/circuit-pattern.png');
  background-repeat: repeat;
  background-size: 460px 460px;
  padding: 148px 0 52px;
  position: relative;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ink);
}

.page-hero p.lead {
  color: var(--graphite);
  max-width: 540px;
  margin-top: 14px;
  font-size: 16px;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}
.breadcrumb .sep { margin: 0 8px; color: var(--gray-mid); }
.breadcrumb .here { color: var(--royal); }

/* ===== SERVICE LIST (services page) ===== */
.service-block {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 30px 0;
  border-bottom: 1px solid var(--gray-mid);
}

.service-block:first-child { padding-top: 0; }

.service-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-block h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 9px;
  color: var(--ink);
}

.service-block p {
  color: var(--graphite);
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 620px;
}

.service-tags {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.service-tags span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--gray-light);
  color: var(--royal-deep);
  padding: 4px 10px;
  border-radius: 5px;
  letter-spacing: 0.2px;
  border: 1px solid var(--gray-mid);
}

/* ===== TEAM / ABOUT ===== */
.timeline {
  border-left: 2px solid var(--gray-mid);
  padding-left: 32px;
  margin-left: 8px;
}

.timeline-item {
  position: relative;
  padding-bottom: 36px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -39px; top: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--royal);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--royal);
  font-weight: 700;
  letter-spacing: 0.4px;
}

.timeline-item h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 6px 0 6px;
  color: var(--ink);
}

.timeline-item p {
  font-size: 14.5px;
  color: var(--graphite);
  max-width: 540px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 700px) {
  .value-grid { grid-template-columns: 1fr; }
}

.value-item {
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 12px;
  border-left: 3px solid var(--royal);
}

.value-item h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.value-item p {
  font-size: 14px;
  color: var(--graphite);
}

/* ===== CONTACT PAGE ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
}

@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-method {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-mid);
}

.contact-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal);
  font-size: 17px;
  font-weight: 700;
}

.contact-method h4 {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}

.contact-method p, .contact-method a {
  font-size: 14px;
  color: var(--graphite);
}

form.contact-form {
  background: var(--gray-light);
  padding: 34px;
  border-radius: 14px;
  color: var(--ink);
  border: 1px solid var(--gray-mid);
}

form.contact-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: var(--graphite);
  margin-bottom: 7px;
  margin-top: 18px;
  text-transform: uppercase;
}
form.contact-form label:first-of-type { margin-top: 0; }

form.contact-form input,
form.contact-form select,
form.contact-form textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--gray-mid);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

form.contact-form input:focus,
form.contact-form select:focus,
form.contact-form textarea:focus {
  border-color: var(--royal);
}

form.contact-form textarea { resize: vertical; min-height: 110px; }

form.contact-form button {
  margin-top: 22px;
  width: 100%;
  justify-content: center;
}

.form-note {
  font-size: 12px;
  color: var(--graphite);
  margin-top: 14px;
  text-align: center;
}

.map-note {
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--graphite);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== FLOATING WHATSAPP BUTTON ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 58px;
  height: 58px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,0.35);
  transition: transform 0.2s;
}

.whatsapp-float:hover { transform: scale(1.08); }

.whatsapp-float svg { width: 30px; height: 30px; }

@media (max-width: 600px) {
  .whatsapp-float { width: 52px; height: 52px; bottom: 18px; right: 18px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}
