/* Erostec · rediseño 2026
   Layout: banda navy con el "chip" de circuito como héroe; secciones claras alineadas a la izquierda
   sobre una retícula de 12 columnas; un único panel elevado (el formulario). */
:root {
  --navy: #022859;
  --blue-700: #16558C;
  --blue: #2477BF;
  --teal: #038C7F;
  --ink: #0D0D0D;

  --bg: #FFFFFF;
  --bg-alt: #F3F7FB;
  --surface: #FFFFFF;
  --fg: #0D0D0D;
  --muted: #4A5A6E;
  --line: #D5E0EC;
  --accent: #2477BF;
  --accent-strong: #16558C;
  --accent-2: #038C7F;
  --hero-bg: #022859;
  --hero-fg: #F1F6FC;
  --hero-muted: #A9C1DD;
  --hero-line: #2E5C93;
  --focus: #2477BF;
  --ok-bg: #E3F4F1; --ok-fg: #02645B;
  --err-bg: #FCEBEB; --err-fg: #9B1C1C;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.4vw, 4.9rem);

  --radius: 10px;
  --max: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #061427; --bg-alt: #0A1D36; --surface: #0E2442; --fg: #E7EEF7; --muted: #9CB0C8;
    --line: #1D395C; --accent: #5AA2E6; --accent-strong: #8CC0F0; --accent-2: #2CC0AE;
    --hero-bg: #021E44; --hero-fg: #F1F6FC; --hero-muted: #A9C1DD; --hero-line: #2A5487;
    --focus: #8CC0F0; --ok-bg: #0C3A36; --ok-fg: #9BE7DC; --err-bg: #43161A; --err-fg: #F7B4B4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #061427; --bg-alt: #0A1D36; --surface: #0E2442; --fg: #E7EEF7; --muted: #9CB0C8;
  --line: #1D395C; --accent: #5AA2E6; --accent-strong: #8CC0F0; --accent-2: #2CC0AE;
  --hero-bg: #021E44; --hero-fg: #F1F6FC; --hero-muted: #A9C1DD; --hero-line: #2A5487;
  --focus: #8CC0F0; --ok-bg: #0C3A36; --ok-fg: #9BE7DC; --err-bg: #43161A; --err-fg: #F7B4B4;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--step-0)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--hero-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-stretch: 80%; font-weight: 750; line-height: 1.04; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-stretch: 88%; font-weight: 700; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.wrap {
  max-width: var(--max); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--hero-bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--hero-fg); border-bottom: 1px solid var(--hero-line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; color: #5AA2E6; flex: none; }
.brand-word { font-family: var(--font-display); font-stretch: 72%; font-weight: 700; font-size: 1.45rem; letter-spacing: 0.06em; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--hero-fg); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: #fff; text-decoration: underline; }
.nav .nav-cta { background: var(--blue); color: #fff; padding: 9px 16px; border-radius: 8px; }
.nav .nav-cta:hover { background: #2D86D6; text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: inherit; width: 44px; height: 44px; cursor: pointer; border-radius: 8px; }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; margin-inline: auto; transition: transform .2s ease; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; } .bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--hero-bg); border-bottom: 1px solid var(--hero-line);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--hero-line); font-size: 1.05rem; }
  .nav .nav-cta { margin-top: 16px; text-align: center; border-bottom: 0; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px; font: 600 1rem/1 var(--font-body); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { opacity: .65; cursor: progress; }
.btn-ghost { color: var(--hero-fg); border-color: var(--hero-line); }
.btn-ghost:hover { border-color: var(--hero-muted); }

/* Hero */
.hero { background: var(--hero-bg); color: var(--hero-fg); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center; padding-block: clamp(56px, 8vw, 104px); }
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero-kicker { color: var(--hero-muted); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.hero-kicker::before { content: ""; width: 28px; height: 2px; background: #2CC0AE; }
.hero h1 { font-size: var(--step-4); font-stretch: 68%; font-weight: 800; line-height: 0.98; letter-spacing: -0.005em; max-width: 13ch; }
.hero-lead { color: var(--hero-muted); font-size: var(--step-1); max-width: 54ch; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-art { margin: 0; min-width: 0; }
.hero-art svg { width: 100%; height: auto; max-width: 520px; margin-inline: auto; display: block; overflow: visible; }
.trace { stroke: #4C8FD6; stroke-dasharray: 260; animation: draw 1.1s cubic-bezier(.4,0,.2,1) var(--d, 0s) backwards; }
.nodes circle { stroke: #2CC0AE; fill: var(--hero-bg); }
.labels text { fill: var(--hero-muted); font: 500 13px var(--font-body); }
.chip { fill: #0A3A75; stroke: #5AA2E6; stroke-width: 2; }
.chip-mark { stroke: #E7F0FA; fill: none; }
@keyframes draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-art svg { max-width: 420px; }
}

/* Sections */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-alt { background: var(--bg-alt); }
.section-head { display: grid; gap: 16px; max-width: 62ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p, .about-copy p:not(.lead) { color: var(--muted); }
.lead { font-size: var(--step-1); line-height: 1.55; }

.about-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-copy { display: grid; gap: 20px; max-width: 60ch; min-width: 0; }
.about-photo { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-photo { aspect-ratio: 16 / 10; } }

/* Services: filas, no tarjetas */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.service { display: grid; grid-template-columns: 48px minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 16px 32px; align-items: start; padding-block: 32px; border-bottom: 1px solid var(--line); }
.service-icon { width: 40px; height: 40px; color: var(--accent); }
.service h3 { padding-top: 4px; }
.service p { color: var(--muted); max-width: 62ch; }
@media (max-width: 760px) { .service { grid-template-columns: 40px minmax(0, 1fr); } .service p { grid-column: 1 / -1; } }

/* Cifras */
.figures-band { background: var(--blue-700); color: #fff; padding-block: clamp(48px, 7vw, 80px); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 0; }
.figure { display: flex; flex-direction: column-reverse; gap: 10px; border-left: 2px solid rgba(255,255,255,.28); padding-left: 18px; min-width: 0; }
.figure dd { margin: 0; font-family: var(--font-display); font-stretch: 70%; font-weight: 800; font-size: clamp(2.6rem, 2rem + 2.4vw, 3.8rem); line-height: 1; font-variant-numeric: tabular-nums; }
.figure dd small { font-size: .55em; margin-left: 2px; }
.figure dt { color: #D4E4F5; font-size: var(--step--1); line-height: 1.5; max-width: 26ch; }
@media (max-width: 860px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .figures { grid-template-columns: 1fr; } }

/* Valores */
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.value { display: grid; gap: 14px; align-content: start; border-top: 2px solid var(--accent-2); padding-top: 22px; }
.value p { color: var(--muted); }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-info { display: grid; gap: 20px; min-width: 0; }
.contact-info > p { color: var(--muted); max-width: 46ch; }
.contact-list { display: grid; gap: 18px; margin: 12px 0 0; }
.contact-list div { display: grid; gap: 2px; }
.contact-list dt { color: var(--muted); font-size: var(--step--1); }
.contact-list dd { margin: 0; font-size: var(--step-1); font-weight: 600; overflow-wrap: anywhere; }
.contact-list a { color: var(--fg); text-decoration-color: var(--accent); }

.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 4vw, 36px); box-shadow: 0 18px 40px -24px rgba(2, 40, 89, .35); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.92rem; }
.opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 13px; min-height: 48px;
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--err-fg); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 4px; }
.form-status { flex: 1 1 240px; padding: 12px 14px; border-radius: 8px; font-size: 0.95rem; }
.form-status[data-type="success"] { background: var(--ok-bg); color: var(--ok-fg); }
.form-status[data-type="error"] { background: var(--err-bg); color: var(--err-fg); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .contact-form { grid-template-columns: 1fr; } .form-foot .btn { width: 100%; } }

/* Footer */
.site-footer { background: var(--hero-bg); color: var(--hero-muted); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.site-footer .brand { color: var(--hero-fg); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: var(--hero-fg); text-decoration: none; font-size: 0.95rem; }
.footer-nav a:hover { text-decoration: underline; }
.copy { font-size: var(--step--1); width: 100%; border-top: 1px solid var(--hero-line); padding-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trace { animation: none; }
  * { transition: none !important; }
}
