/* ============================================================================
   Servicio verde de optimización de rutas — OptimoIA / New Soft Ideas
   Identidad NSI: monocroma tinta + hairlines (Site.css), acento verde funcional.
   Autocontenido: sin dependencias JS, sin assets externos salvo las fuentes.
   ============================================================================ */

:root {
  --paper:      #ffffff;
  --paper-2:    #fafafa;
  --soft:       #f4f5f4;
  --line:       #e6e7e9;
  --line-2:     #d5d7da;
  --ink:        #0b0b0c;
  --ink-2:      #20242b;
  --body:       #555b63;
  --muted:      #8b9098;
  --green:      #1a9e5f;
  --green-deep: #0f6b3f;
  --green-wash: #eef7f1;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rule: 1px solid var(--line);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0b0b0c;
    --paper-2:    #0e0f11;
    --soft:       #16181b;
    --line:       #23262b;
    --line-2:     #31353b;
    --ink:        #f2f3f4;
    --ink-2:      #d9dcdf;
    --body:       #a8aeb6;
    --muted:      #7b818a;
    --green:      #35c07d;
    --green-deep: #6fd6a1;
    --green-wash: #12241a;
  }
}

:root[data-theme="dark"] {
  --paper:      #0b0b0c;
  --paper-2:    #0e0f11;
  --soft:       #16181b;
  --line:       #23262b;
  --line-2:     #31353b;
  --ink:        #f2f3f4;
  --ink-2:      #d9dcdf;
  --body:       #a8aeb6;
  --muted:      #7b818a;
  --green:      #35c07d;
  --green-deep: #6fd6a1;
  --green-wash: #12241a;
}

:root[data-theme="light"] {
  --paper:      #ffffff;
  --paper-2:    #fafafa;
  --soft:       #f4f5f4;
  --line:       #e6e7e9;
  --line-2:     #d5d7da;
  --ink:        #0b0b0c;
  --ink-2:      #20242b;
  --body:       #555b63;
  --muted:      #8b9098;
  --green:      #1a9e5f;
  --green-deep: #0f6b3f;
  --green-wash: #eef7f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
a:hover { color: var(--green-deep); border-bottom-color: var(--green); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--muted);
}

/* ── Barra superior ─────────────────────────────────────────────── */
.topbar {
  border-bottom: var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.5rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  border: 0;
}
.brand span { color: var(--muted); font-weight: 500; }
.tag-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--body);
  letter-spacing: 0.02em;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-wash);
}
.topbar-right { display: inline-flex; align-items: center; gap: 1rem; }
.lang {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  line-height: 1.4;
}
.lang:hover { color: var(--green-deep); border-color: var(--green); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  line-height: 1.05;
  font-weight: 700;
  margin-top: 1.25rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--green-deep);
}
.hero-lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.2rem);
  max-width: 46ch;
  margin-top: 1.5rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.chip {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
}

/* ── Diagrama de ruta ───────────────────────────────────────────── */
.viz {
  border: var(--rule);
  border-radius: 4px;
  background: var(--paper-2);
  padding: 1.25rem 1.25rem 1rem;
}
.viz svg { display: block; width: 100%; height: auto; }
.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: var(--rule);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.viz-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.swatch { width: 22px; height: 0; border-top-width: 2px; border-top-style: solid; }
.swatch-manual { border-color: var(--line-2); border-top-style: dashed; }
.swatch-opt { border-color: var(--green); }

.route-manual { stroke: var(--line-2); stroke-width: 1.75; fill: none; stroke-dasharray: 5 4; }
.route-opt {
  stroke: var(--green);
  stroke-width: 2.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.35s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.stop { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.depot { fill: var(--ink); }
.viz-label { font-family: var(--font-body); font-size: 9px; font-weight: 700; fill: var(--muted); letter-spacing: 0.12em; }

@media (prefers-reduced-motion: reduce) {
  .route-opt { animation: none; stroke-dashoffset: 0; }
}

/* ── Secciones ──────────────────────────────────────────────────── */
section { border-top: var(--rule); padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head { max-width: var(--measure); }
.section-head h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  line-height: 1.15;
  margin-top: 0.75rem;
}
.section-head p { margin-top: 1rem; max-width: 62ch; }

/* ── Motores ────────────────────────────────────────────────────── */
.engines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 2.5rem;
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.engine { padding: 1.75rem; border-right: var(--rule); }
.engine:last-child { border-right: 0; }
.engine-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--green-deep);
}
.engine h3 {
  font-size: 1.0625rem;
  margin-top: 0.6rem;
  letter-spacing: -0.01em;
}
.engine p { margin-top: 0.75rem; font-size: 0.95rem; }
.engine dl {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: var(--rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
}
.engine dt { color: var(--muted); font-weight: 600; }
.engine dd { margin: 0; color: var(--ink-2); font-family: var(--font-mono); font-size: 0.72rem; word-break: break-word; }

/* ── Bloque IA ──────────────────────────────────────────────────── */
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-top: 2.5rem;
  align-items: start;
}
.quote {
  border-left: 2px solid var(--green);
  background: var(--green-wash);
  padding: 1.5rem 1.75rem;
  border-radius: 0 4px 4px 0;
}
.quote p {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
}
.quote footer {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--body);
  font-family: var(--font-body);
}
.guardrails { display: grid; gap: 1.5rem; }
.guardrail h3 { font-size: 1rem; }
.guardrail p { margin-top: 0.4rem; font-size: 0.95rem; }

/* ── Palancas ───────────────────────────────────────────────────── */
.levers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 2.5rem;
  border-top: var(--rule);
  border-left: var(--rule);
}
.lever {
  padding: 1.75rem;
  border-right: var(--rule);
  border-bottom: var(--rule);
}
.lever-rank {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-deep);
  letter-spacing: 0.04em;
}
.lever h3 { font-size: 1.125rem; margin-top: 0.5rem; }
.lever p { margin-top: 0.7rem; font-size: 0.95rem; }

/* ── Método / fórmula ───────────────────────────────────────────── */
.method {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.formula {
  background: var(--soft);
  border: var(--rule);
  border-radius: 4px;
  padding: 1.5rem;
  overflow-x: auto;
}
.formula pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre;
}
.formula .op { color: var(--green-deep); font-weight: 600; }
.factors { margin-top: 1.25rem; width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.factors th, .factors td { text-align: left; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: var(--rule); }
.factors th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 700; }
.factors td:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.note {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border: var(--rule);
  border-radius: 4px;
  font-size: 0.9rem;
}
.note strong { color: var(--ink); }

/* ── Confianza ──────────────────────────────────────────────────── */
.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.trust-item h3 { font-size: 0.95rem; }
.trust-item p { margin-top: 0.5rem; font-size: 0.9rem; }

/* ── Cierre ─────────────────────────────────────────────────────── */
.closing { background: var(--soft); border-top: var(--rule); }
.closing-inner { padding: clamp(3rem, 6vw, 5rem) 0; max-width: var(--measure); }
.closing h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.15; }
.closing p { margin-top: 1.25rem; }
.cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.8rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 3px;
  border: 0;
}
.cta:hover { background: var(--green-deep); color: #fff; border: 0; }

footer.site {
  border-top: var(--rule);
  padding: 2rem 0 3rem;
  font-size: 0.82rem;
  color: var(--muted);
}
footer.site p { max-width: var(--measure); }
footer.site p + p { margin-top: 0.6rem; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid, .ai-grid, .method { grid-template-columns: minmax(0, 1fr); }
  .engines { grid-template-columns: minmax(0, 1fr); }
  .engine { border-right: 0; border-bottom: var(--rule); }
  .engine:last-child { border-bottom: 0; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .levers { grid-template-columns: minmax(0, 1fr); }
  .trust { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 1rem; }
}
