/* ==========================================================================
   jdominios.com — web renovada, Actualización 2
   Concepto: "trazas". El isotipo es una J hecha de pistas de circuito que
   terminan en nodos. Línea + nodo es el único motivo gráfico del sitio:
   tablero del hero, marcadores de servicio, método e ilustraciones.
   Marca: navy #0A2540 · celeste #2DAAE1 · verde #4CAF50 · naranja #FF6A00
   Tipografía: Poppins (títulos) + Open Sans (texto)
   Superficies: se separan por escalón de tono, no por líneas ni sombras.
   ========================================================================== */

:root {
  --navy: #0A2540;
  --navy-2: #11335A;          /* escalón de tono sobre navy: tablero, tarjeta */
  --blue: #2DAAE1;
  --green: #4CAF50;
  --orange: #FF6A00;

  --blue-ink: #0B6E9F;
  --green-ink: #2E7D32;
  --ink: #12243A;
  --muted: #3E5166;           /* 8:1 sobre blanco */
  --soft: #F1F6FA;
  --tint-green: #EAF3E7;
  --line-strong: #A9BED0;     /* solo bordes de campos de formulario */
  --on-navy: #D6E3EE;
  --on-navy-soft: #BFD0E0;

  --font-head: 'Poppins', 'Open Sans', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --header-h: 96px;
  --gutter: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65;
  color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5vw, 4.75rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.02; }
h2 { font-size: clamp(1.7rem, 3.3vw, 2.75rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }

.container { width: min(1160px, 100% - var(--gutter) * 2); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.section-dark :focus-visible, .hero :focus-visible { outline-color: #8ED6F5; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; font: 600 1rem/1 var(--font-head);
  border-radius: 10px; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .16s ease-out, background-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
/* Texto navy sobre naranja: 5.4:1. El blanco sobre #FF6A00 solo llega a 2.9:1. */
.btn-primary { background: var(--orange); color: var(--navy); }
.btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #FF7F26; }
  .btn-outline-light:hover { background: #fff; color: var(--navy); }
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(10,37,64,.08); }
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 76px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:not(.nav-cta) { font: 500 .98rem/1 var(--font-head); color: var(--navy); padding: 10px 0; position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); } }
.nav-cta { min-height: 46px; padding: 0 22px; font-size: .95rem; }

.menu-btn {
  display: none; width: 48px; height: 48px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: #fff; cursor: pointer; padding: 0; position: relative; transition: transform .16s ease-out;
}
.menu-btn:active { transform: scale(.94); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  position: absolute; left: 13px; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; content: "";
  transition: transform .22s var(--ease-out), opacity .18s ease;
}
.menu-btn span { top: 22px; }
.menu-btn span::before { left: 0; top: -6px; }
.menu-btn span::after { left: 0; top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Secciones ---------- */
.section { padding: 128px 0; }
.section-soft { background: var(--soft); }
.section-dark { background: var(--navy); color: var(--on-navy); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-green { background: var(--tint-green); }
.lede { color: var(--ink); max-width: 52ch; text-wrap: pretty; }
.section-dark .lede { color: var(--on-navy); }

.section-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: end; margin-bottom: 72px; }
.section-head:has(.quick) { align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: start; }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }

.figure { margin: 0; border-radius: 20px; overflow: hidden; }
.figure svg { width: 100%; height: auto; }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: var(--on-navy); padding: 96px 0 104px; }
.hero h1 { color: #fff; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 64px; align-items: center; }
.hero .lede { color: var(--on-navy); font-size: 1.2rem; max-width: 34em; margin-top: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

/* Tablero de trazas */
.board-wrap { width: 100%; max-width: 500px; margin-left: auto; }
.board { position: relative; aspect-ratio: 100 / 105; background: var(--navy-2); border-radius: 24px; overflow: hidden; }
.board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace {
  fill: none; stroke: var(--c); stroke-width: .5; stroke-linecap: round; opacity: .85;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: draw 1s var(--ease-out) both; animation-delay: calc(var(--i) * 60ms + 100ms);
  transition: opacity .25s ease, stroke-width .25s ease;
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.board.has-active .trace { opacity: .25; }
.board.has-active .trace.on { opacity: 1; stroke-width: .9; }
.hub { position: absolute; left: 17%; top: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%); background: #fff; border-radius: 50%; display: grid; place-items: center; }
.hub img { width: 56%; height: auto; }
.node {
  position: absolute; left: calc(60% - 11px); top: var(--t); transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  background: none; border: 0; padding: 6px 10px 6px 0; margin: 0; cursor: pointer;
  font: 500 .98rem/1 var(--font-head); color: #fff; text-align: left;
  animation: fade .4s ease both; animation-delay: calc(var(--i) * 60ms + 450ms);
}
.node i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--c); background: var(--navy-2); transition: background-color .2s ease, transform .2s var(--ease-out); }
.node:hover i, .node.on i { background: var(--c); transform: scale(1.12); }
.node.on { font-weight: 600; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.board-caption { margin-top: 24px; min-height: 6em; font-size: 1rem; line-height: 1.6; color: var(--on-navy); transition: opacity .14s ease-out; }
.board-caption.swap { opacity: 0; }
.board-caption strong { display: block; font: 600 1.1rem/1.3 var(--font-head); color: #fff; margin-bottom: 4px; }

/* ---------- Pilares ---------- */
.pillars { padding: 64px 0; background: var(--soft); }
.pillars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.pillars-grid li { position: relative; padding-left: 28px; }
.pillars-grid li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--c, var(--blue)); background: var(--soft); }
.pillars-grid li:nth-child(2) { --c: var(--orange); }
.pillars-grid li:nth-child(3) { --c: var(--green); }
.pillars-grid b { display: block; font: 600 1.15rem/1.3 var(--font-head); color: var(--navy); }
.pillars-grid span { display: block; margin-top: 6px; font-size: 1rem; color: var(--ink); line-height: 1.55; }

/* ---------- Servicios ---------- */
.svc-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: start; }
.sticky-col { position: sticky; top: calc(var(--header-h) + 32px); }
.svc-list { display: grid; gap: 44px; }
.svc-list > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 20px; }
.svc-list .dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c, var(--blue)); background: #fff; margin-top: 7px; transition: background-color .2s ease; }
.svc-list > li:hover .dot { background: var(--c, var(--blue)); }
.svc-list p { color: var(--ink); margin-top: 8px; max-width: 56ch; }
.svc-tags { display: grid; gap: 4px; margin-top: 16px; }
.svc-tags li { display: block; position: relative; font-size: .97rem; color: var(--navy); font-weight: 600; line-height: 1.55; }
.svc-tags li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--blue)); margin-right: 9px; vertical-align: middle; position: relative; top: -1px; }

/* ---------- Soluciones + diagnóstico rápido ---------- */
.quick { background: var(--navy-2); border-radius: 20px; padding: 34px; display: grid; gap: 22px; }
.quick h3 { font-size: 1.35rem; }
.quick > p { color: var(--on-navy); margin-top: -12px; }
.quick legend { font: 600 1rem/1.4 var(--font-head); color: #fff; margin-bottom: 10px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--navy); color: #fff; font: 500 .95rem/1 var(--font-head);
  transition: background-color .18s ease, color .18s ease, transform .16s ease-out;
}
.chip:active span { transform: scale(.97); }
.chip input:checked + span { background: var(--orange); color: var(--navy); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid #8ED6F5; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .chip input:not(:checked):hover + span { background: #0E2C4D; box-shadow: inset 0 0 0 2px var(--blue); } }
.quick .btn { width: 100%; }

.sol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.sol-grid li { position: relative; padding-top: 38px; }
.sol-grid .dot { position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c); background: var(--navy); }
.sol-grid b { display: block; font: 600 1.2rem/1.3 var(--font-head); color: #fff; }
.sol-grid li > span:last-child { display: block; margin-top: 8px; color: var(--on-navy); }

/* ---------- Método ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; margin-top: 64px; }
.steps li { position: relative; padding-top: 70px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--soft); border: 3px solid var(--c, var(--blue));
  display: grid; place-items: center; font: 600 1rem/1 var(--font-head); color: var(--navy);
}
.steps li::after { content: ""; position: absolute; top: 21.5px; left: 52px; right: -22px; height: 3px; border-radius: 2px; background: #C4D6E4; }
.steps li:last-child::after { display: none; }
.steps li:nth-child(2) { --c: var(--orange); }
.steps li:nth-child(3), .steps li:nth-child(5) { --c: var(--green); }
.steps h3 { font-size: 1.15rem; }
.steps p { margin-top: 8px; font-size: 1rem; color: var(--ink); line-height: 1.6; }

/* ---------- AgroTech ---------- */
.agro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; margin-top: 40px; }
.agro-grid li { position: relative; padding-left: 28px; }
.agro-grid li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--green); background: var(--tint-green); }
.agro-grid b { display: block; font: 600 1.1rem/1.3 var(--font-head); color: var(--navy); }
.agro-grid span { display: block; font-size: 1rem; color: var(--ink); margin-top: 4px; }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.plan { display: flex; flex-direction: column; padding: 40px 34px; border-radius: 20px; background: var(--soft); }
.plan p { margin-top: 12px; color: var(--ink); }
.plan ul { margin: 26px 0 32px; display: grid; gap: 12px; }
.plan li { position: relative; padding-left: 26px; color: var(--ink); }
.plan li::before { content: ""; position: absolute; left: 0; top: 8px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--blue); }
.plan .plan-cta { margin-top: auto; font: 600 1rem/1 var(--font-head); color: var(--blue-ink); padding: 6px 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; align-self: flex-start; }
.plan.featured { background: var(--navy); }
.plan.featured h3 { color: #fff; }
.plan.featured p, .plan.featured li { color: var(--on-navy); }
.plan.featured li::before { border-color: var(--orange); }
.plan.featured .plan-cta { color: #fff; }

/* ---------- Contacto ---------- */
.contact-lines { margin-top: 36px; display: grid; gap: 18px; }
.contact-lines a, .contact-lines div { display: block; }
.contact-lines small { display: block; font: 500 .92rem/1.3 var(--font-body); color: var(--on-navy-soft); margin-bottom: 2px; }
.contact-lines span, .contact-lines a { font: 600 1.15rem/1.4 var(--font-head); color: #fff; }
.contact-lines a { text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 5px; transition: text-decoration-color .2s ease; }
@media (hover: hover) { .contact-lines a:hover { text-decoration-color: var(--blue); } }

.form-card { background: #fff; border-radius: 20px; padding: 40px; color: var(--ink); }
.form-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-card form { display: grid; gap: 18px; }
.field label { display: block; font: 600 .98rem/1.3 var(--font-head); color: var(--navy); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  display: block; width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; height: 52px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { height: auto; min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(45,170,225,.28); }
.field ::placeholder { color: #5E7189; }
.form-card .btn { width: 100%; }
.form-card small { color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer { background: var(--soft); padding: 44px 0; }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; }
.footer-grid img { height: 50px; width: auto; }
.footer-grid b { display: block; font: 600 1.05rem/1.3 var(--font-head); color: var(--navy); }
.footer-grid span { display: block; font-size: .97rem; color: var(--muted); margin-top: 3px; }
.footer-grid .copy { font-size: .97rem; color: var(--muted); white-space: nowrap; }
.footer-grid .copy span { display: inline; margin: 0; font-size: inherit; }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #06240F; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(10,37,64,.28); transition: transform .16s ease-out;
}
.wa-float:active { transform: scale(.94); }
.wa-float svg { width: 28px; height: 28px; }

/* ---------- Entrada al hacer scroll (solo con JS; el contenido es visible si falla) ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s ease-out, transform .5s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .section { padding: 96px 0; }
  .hero { padding: 64px 0 80px; }
  .hero-grid, .split, .split-even, .section-head, .svc-layout { grid-template-columns: 1fr; gap: 48px; }
  .section-head { margin-bottom: 52px; }
  .board-wrap { margin: 0 auto; max-width: 520px; }
  .sticky-col { position: static; }
  .figure { max-width: 620px; }
  .pillars-grid, .sol-grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; max-width: 560px; }
  .steps { grid-template-columns: 1fr; gap: 0; max-width: 560px; }
  .steps li { padding: 0 0 34px 72px; min-height: 46px; }
  .steps li::after { top: 52px; bottom: 4px; left: 21.5px; right: auto; width: 3px; height: auto; }
}

@media (max-width: 820px) {
  :root { --header-h: 78px; }
  .brand img { height: 60px; }
  .menu-btn { display: block; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0; display: flex;
    flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 8px 24px 28px;
    box-shadow: 0 24px 40px rgba(10,37,64,.14);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transform-origin: top;
    transition: opacity .12s ease-out, transform .12s ease-out, visibility 0s .12s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease-out, transform .18s ease-out, visibility 0s; }
  .nav-links a:not(.nav-cta) { padding: 18px 0; font-size: 1.1rem; }
  .nav-links a:not(.nav-cta)::after { display: none; }
  .nav-cta { margin-top: 14px; min-height: 52px; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 1rem; }
  .section { padding: 80px 0; }
  .hero { padding: 48px 0 64px; }
  .hero .lede { font-size: 1.125rem; }
  .hero-actions .btn { width: 100%; }
  .pillars-grid, .sol-grid { grid-template-columns: 1fr; gap: 28px; }
  .agro-grid, .form-card .row { grid-template-columns: 1fr; }
  .quick { padding: 26px 20px; }
  .form-card { padding: 28px 22px; }
  .plan { padding: 32px 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .node { font-size: .92rem; gap: 9px; }
  .node i { width: 20px; height: 20px; }
  .wa-float { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trace, .node { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .wa-float, .menu-btn, .node i, .chip span, .board-caption, .nav-links { transition: none; }
}
