/* Asertiz — sistema de diseño
   Marino   #0B2A50  fondo de marca, texto principal
   Profundo #071D38  footer, texto sobre azul
   Azul     #1E8FEA  símbolo, acentos estructurales
   Pizarra  #44678C  código del logo, texto secundario
   Hielo    #D6E4EE  líneas y texto sobre marino
   Papel    #F3F6F9  fondo claro
   Ámbar    #FFC23D  acción y "ya pasó" (CTA, sellos)          */

:root {
  --navy: #0B2A50;
  --navy-deep: #071D38;
  --blue: #1E8FEA;
  --slate: #44678C;
  --ice: #D6E4EE;
  --paper: #F3F6F9;
  --white: #FFFFFF;
  --amber: #FFC23D;
  --amber-dark: #E5A50F;
  --muted: #4E6580;

  --f-sans: "Archivo", system-ui, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, monospace;

  /* escala 4:3 sobre 18px */
  --t-sm: 0.875rem;
  --t-base: 1.125rem;
  --t-md: 1.5rem;
  --t-lg: clamp(1.75rem, 1.2rem + 2vw, 2.625rem);
  --t-xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
  --t-hero: clamp(2.4rem, 1.2rem + 3.9vw, 4.5rem);

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(72px, 10vw, 140px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--amber); color: var(--navy-deep); padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  font: inherit; font-weight: 700; font-size: 1rem;
  font-variation-settings: "wdth" 108;
  text-decoration: none; border: 2px solid transparent; border-radius: 6px;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-amber { background: var(--amber); color: var(--navy-deep); }
.btn-amber:hover { background: var(--amber-dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { color: var(--white); border-color: rgba(214, 228, 238, .45); }
.btn-ghost:hover { border-color: var(--white); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: var(--t-sm); background: var(--white); color: var(--navy); }
.btn-small:hover { background: var(--amber); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); color: var(--white); border-bottom: 1px solid rgba(214, 228, 238, .12); }
.header-row { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; }
.brand-mark use:first-child { fill: var(--blue); stroke: var(--blue); }
.brand-mark use:last-child { stroke: var(--ice); }
.brand-word { font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; font-variation-settings: "wdth" 125; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-size: .95rem; color: var(--ice); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--white); border-bottom-color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; border: 1px solid rgba(214, 228, 238, .3); border-radius: 6px; overflow: hidden; }
.lang button { font: inherit; font-size: .8rem; font-weight: 700; background: none; border: 0; color: var(--ice); padding: 8px 10px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ice); color: var(--navy); }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: var(--white); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: end; gap: 24px;
  min-height: min(calc(100vh - 72px), 820px);
  padding-top: clamp(48px, 7vw, 96px);
}
.hero-copy { padding-bottom: clamp(56px, 8vw, 120px); align-self: center; }
.hero-sign { color: var(--blue); font-weight: 700; font-size: var(--t-base); font-variation-settings: "wdth" 115; margin-bottom: 20px; }
.hero-title {
  font-size: var(--t-hero); line-height: 1; font-weight: 850;
  font-variation-settings: "wdth" 112; letter-spacing: -.02em;
  max-width: 16ch; text-wrap: balance;
}
.hero-lede { margin-top: 28px; color: var(--ice); max-width: 46ch; font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* El símbolo monumental; la tarjeta sale de su muesca (60% de altura) */
.hero-stage { position: relative; align-self: end; }
.a-box { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1; margin: 0 auto -7%; }
.hero-a { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--blue); stroke: var(--blue); }
.demo { position: absolute; left: 50%; top: 47%; transform: translateX(-50%); width: min(340px, 74%); }
.demo-tabs { display: flex; gap: 4px; margin-bottom: 8px; justify-content: center; flex-wrap: wrap; }
.demo-tabs button {
  font: inherit; font-size: .8rem; font-weight: 700; font-variation-settings: "wdth" 108;
  color: var(--navy-deep); background: rgba(243, 246, 249, .55);
  border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.demo-tabs button[aria-selected="true"] { background: var(--navy-deep); color: var(--white); }
.demo-card {
  background: var(--white); color: var(--navy); border-radius: 10px;
  padding: 18px 20px 20px; position: relative;
  box-shadow: 0 30px 60px -20px rgba(7, 29, 56, .65);
  min-height: 228px;
}
.demo-code {
  display: block; font-family: var(--f-code); font-size: .85rem; color: var(--slate);
  padding-bottom: 12px; border-bottom: 1px dashed var(--ice); min-height: 1.6em; white-space: nowrap; overflow: hidden;
}
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; background: var(--blue); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-result { padding-top: 14px; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.demo.is-done .demo-result { opacity: 1; transform: none; }
.demo-title { font-weight: 800; font-variation-settings: "wdth" 110; font-size: 1.05rem; margin-bottom: 10px; }
.demo-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: .9rem; }
.demo-rows dt { color: var(--muted); }
.demo-rows dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stamp {
  position: absolute; right: 16px; top: 54px;
  font-weight: 900; font-size: 1rem; font-variation-settings: "wdth" 125;
  color: var(--navy-deep); background: var(--amber);
  padding: 4px 12px; border-radius: 4px;
  transform: rotate(-6deg) scale(1.8); opacity: 0;
}
.demo.is-done .stamp { animation: stamp .45s .35s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes stamp { to { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* ---------- Títulos de sección ---------- */
.section-title {
  font-size: var(--t-xl); line-height: 1.04; font-weight: 800;
  font-variation-settings: "wdth" 118; letter-spacing: -.01em; max-width: 18ch; text-wrap: balance;
}

/* ---------- Servicios ---------- */
.services { padding: var(--section) 0; }
.service-list { margin-top: clamp(40px, 6vw, 72px); border-bottom: 2px solid var(--navy); }
.service {
  display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: 16px 40px;
  padding: 32px 0 36px; border-top: 2px solid var(--navy);
}
.service h3 { font-size: var(--t-lg); line-height: 1.05; font-weight: 750; font-variation-settings: "wdth" 112; max-width: 14ch; }
.service-what { max-width: 40ch; }
.service-detail { color: var(--muted); font-size: 1rem; padding-left: 16px; border-left: 3px solid var(--blue); align-self: start; }

/* ---------- Audiencia ---------- */
.audience { padding: 0 0 var(--section); }
.audience-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-top: 48px; }
.aud { background: var(--white); border-radius: 10px; padding: clamp(28px, 4vw, 48px); border-top: 8px solid var(--blue); }
.aud:last-child { border-top-color: var(--navy); }
.aud h3 { font-size: var(--t-lg); font-weight: 800; font-variation-settings: "wdth" 120; margin-bottom: 14px; }
.aud p { max-width: 44ch; }

/* ---------- Postura ---------- */
.stance { background: var(--blue); color: var(--navy-deep); padding: var(--section) 0; }
.stance-big {
  font-size: clamp(2rem, 1.1rem + 3.8vw, 4.4rem); line-height: 1.02; font-weight: 850;
  font-variation-settings: "wdth" 122; letter-spacing: -.015em; max-width: 20ch; text-wrap: balance;
}
.stance-small { margin-top: 36px; max-width: 52ch; font-size: clamp(1.05rem, 1rem + .3vw, 1.3rem); font-weight: 500; }

/* ---------- Clientes ---------- */
.clients { padding: var(--section) 0; }
.clients-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.clients-since { color: var(--muted); max-width: 30ch; }
.logo-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 48px; background: var(--ice); border: 1px solid var(--ice); border-radius: 10px; overflow: hidden; }
.logo-wall li { background: var(--white); display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; padding: 10% 14%; min-width: 0; }
.logo-wall img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: grayscale(1) contrast(1.1); opacity: .8; }

/* ---------- Proceso (secuencia real) ---------- */
.process { background: var(--navy); color: var(--white); padding: var(--section) 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 56px; counter-reset: step; }
.step { counter-increment: step; position: relative; padding-top: 88px; }
.step::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font-size: 4.5rem; line-height: 1; font-weight: 900; font-variation-settings: "wdth" 125;
  color: var(--blue);
}
.step::after { content: ""; position: absolute; top: 2.25rem; left: 4.2rem; right: -16px; height: 2px; background: rgba(214, 228, 238, .25); }
.step:last-child::after { display: none; }
.step h3 { font-size: var(--t-md); font-weight: 750; font-variation-settings: "wdth" 115; margin-bottom: 8px; }
.step p { color: var(--ice); font-size: 1rem; max-width: 28ch; }

/* ---------- Contacto ---------- */
.contact { padding: var(--section) 0; }
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-copy p { margin-top: 20px; color: var(--muted); max-width: 36ch; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; background: var(--white); border-radius: 10px; padding: clamp(24px, 4vw, 44px); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.opt { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  font: inherit; font-size: 1rem; color: var(--navy);
  background: var(--paper); border: 2px solid transparent; border-bottom-color: var(--slate);
  border-radius: 6px 6px 0 0; padding: 12px 14px; width: 100%;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: var(--white); }
.field [aria-invalid="true"] { border-color: #C2362B; }
.choice { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: 8px 10px; }
.choice legend { width: 100%; margin-bottom: 8px; padding: 0; }
.choice label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; background: var(--paper); padding: 10px 16px; border-radius: 999px; cursor: pointer; border: 2px solid transparent; }
.choice label:has(input:checked) { border-color: var(--navy); background: var(--white); }
.choice input { accent-color: var(--navy); margin: 0; }
.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-status { font-size: .95rem; color: var(--muted); }
.form-status.is-error { color: #C2362B; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--ice); padding: 40px 0; }
.footer-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand-footer .brand-word { color: var(--white); }
.footer-sign { color: var(--blue); font-weight: 700; font-variation-settings: "wdth" 115; }
.footer-copy { margin-left: auto; font-size: .9rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1020px) {
  .service { grid-template-columns: 1fr 1fr; }
  .service h3 { grid-column: 1 / -1; max-width: none; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .step:nth-child(2)::after { display: none; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding-bottom: 8px; }
  .a-box { max-width: 520px; margin-bottom: 2%; }
  .audience-grid, .contact-grid { grid-template-columns: 1fr; }
  .logo-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .btn-small { display: none; }
  .service { grid-template-columns: 1fr; }
  .service-detail { padding-left: 12px; }
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .form { grid-template-columns: 1fr; }
  .a-box { margin-bottom: 20%; }
  .demo { width: min(320px, 90%); top: 34%; }
  .footer-copy { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .demo .stamp { opacity: 1; transform: rotate(-6deg); }
  .caret { display: none; }
}
