/* =========================================================
   Proye — Desarrollo a Medida
   Hoja de estilos unificada. CSS puro, sin frameworks.
   ========================================================= */

:root {
  /* Paleta clara y tecnológica */
  --color-bg: #ffffff;
  --color-bg-alt: #f5f8fb;
  --color-bg-soft: #eef2f7;
  --color-border: #dde4ec;

  --color-navy: #0a1f44;        /* Tipografía principal / titulares */
  --color-navy-soft: #1e3a5f;
  --color-body: #3c4a5e;        /* Texto de párrafo */
  --color-muted: #55637a;

  --color-blue: #1e40af;        /* Azul corporativo — enlaces */
  --color-accent: #0f766e;      /* Esmeralda tecnológico — fondo de CTAs (5.5:1 con texto blanco) */
  --color-accent-hover: #0b5c56; /* Hover de botones, más oscuro */
  --color-accent-text: #0b7c72;  /* Acento sobre fondos claros (kickers, iconos, enlaces destacados) */
  --color-accent-light: #e6f5f3;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(10, 31, 68, 0.06), 0 1px 2px rgba(10, 31, 68, 0.08);
  --shadow-md: 0 8px 24px rgba(10, 31, 68, 0.08);

  --container: 1120px;
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.25rem; }

a {
  color: var(--color-blue);
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }

/* Enlaces dentro de texto de contenido: subrayado permanente para no depender solo del color */
main p a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* -------------------- Tipografía -------------------- */
h1, h2, h3, h4 {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

.lead {
  font-size: 1.2rem;
  color: var(--color-navy-soft);
}

.section-kicker {
  display: inline-block;
  color: var(--color-accent-text);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 4rem 0;
}

.section-alt { background-color: var(--color-bg-alt); }

.section-head {
  max-width: 720px;
  margin: 0 0 2.5rem;
}
.section-head.center { margin-inline: auto; text-align: center; }

/* -------------------- Header / Navegación -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  max-width: var(--container);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-navy);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--color-accent-text); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  color: var(--color-navy);
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--color-navy-soft);
  font-weight: 600;
  text-decoration: none;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: var(--color-accent-text);
}
.nav-menu a:hover { text-decoration: none; }

.nav-cta {
  background-color: var(--color-accent);
  color: #ffffff !important;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700 !important;
}
.nav-cta:hover {
  background-color: var(--color-accent-hover);
  text-decoration: none !important;
}

/* -------------------- Botones -------------------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-navy);
  text-decoration: none;
}

.btn-lg { padding: 1rem 2.2rem; font-size: 1.05rem; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* -------------------- Migas de pan -------------------- */
.breadcrumbs {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.75rem 0;
  font-size: 0.85rem;
}
.breadcrumbs li { display: flex; align-items: center; gap: 0.4rem; }
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--color-muted);
}
.breadcrumbs a { color: var(--color-muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--color-accent-text); }
.breadcrumbs [aria-current="page"] { color: var(--color-navy-soft); font-weight: 600; }

/* -------------------- Hero -------------------- */
.hero {
  padding: 4.5rem 0 4rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--color-bg-alt) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-content { max-width: 620px; }

.hero-badge {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent-text);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.hero-visual {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}
.hero-visual svg { width: 100%; height: auto; display: block; }

.hero-panel {
  background: var(--color-navy);
  color: #eaf1fb;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
}
.hero-panel .code-line { white-space: pre; margin: 0 0 0.35rem; }
.hero-panel .tok-comment { color: #7b93b8; }
.hero-panel .tok-key { color: #5eead4; }
.hero-panel .tok-string { color: #93c5fd; }

/* -------------------- Tarjetas -------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

/* Grid fijo para secciones con exactamente 4 tarjetas: evita el
   reparto desigual (3+1) que produce auto-fit en anchos intermedios. */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}
@media (min-width: 900px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--color-accent-light);
  color: var(--color-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }

/* Comparativa problema / solución */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.compare-card {
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--color-border);
}
.compare-card.problem { background: #fbf4f2; border-color: #f2ded8; }
.compare-card.solution { background: var(--color-accent-light); border-color: #cfe9e5; }

.compare-card h3 { margin-bottom: 0.9rem; }
.compare-card ul { list-style: none; padding: 0; margin: 0; }
.compare-card li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(10, 31, 68, 0.1);
  display: flex;
  gap: 0.6rem;
}
.compare-card li:last-child { border-bottom: none; }
.compare-card .mark { font-weight: 800; }
.problem .mark { color: #b3452f; }
.solution .mark { color: var(--color-accent-text); }

/* -------------------- Timeline / Metodología -------------------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: step;
}

.timeline-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline-step:last-child { padding-bottom: 0; }

.timeline-num {
  counter-increment: step;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}
.timeline-num::before { content: counter(step); }

.timeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-body h3 { margin-bottom: 0.4rem; }

/* -------------------- Stats -------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.stat-num {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--color-accent-text);
}
.stat-label {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* -------------------- Servicios (páginas de detalle) -------------------- */
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.service-block:last-child { border-bottom: none; }
.service-block:nth-child(even) .service-visual { order: -1; }

.service-visual {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.service-visual ul { list-style: none; padding: 0; margin: 0; }
.service-visual li {
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
  color: var(--color-navy-soft);
}
.service-visual li:last-child { border-bottom: none; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  background: var(--color-bg-soft);
  color: var(--color-navy-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* -------------------- FAQ -------------------- */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 1.5rem;
}

.faq-item summary {
  cursor: pointer;
  padding: 1.1rem 0;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
  display: inline;
  font-size: 1.05rem;
  margin: 0;
}
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 1.1rem;
  color: var(--color-accent-text);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p {
  margin: 0 0 1.1rem;
  color: var(--color-body);
}

/* -------------------- Equipo / Nosotros -------------------- */
blockquote.pull-quote {
  margin: 2.5rem 0;
  padding: 1.75rem 2rem;
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-navy-soft);
  font-size: 1.15rem;
  font-style: italic;
}

/* -------------------- CTA final -------------------- */
.cta-band {
  background: var(--color-navy);
  color: #eaf1fb;
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
}
.cta-band h2 { color: #ffffff; }
.cta-band p { color: #c7d4e6; max-width: 560px; margin-inline: auto; }
.cta-band p a { color: #ffffff; text-decoration: underline; }
.cta-band .cta-group { justify-content: center; }

.cta-band .btn-secondary {
  color: #ffffff;
  border-color: rgba(255,255,255,0.35);
}
.cta-band .btn-secondary:hover { border-color: #ffffff; }

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 0.9rem;
}

.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-grid a { color: var(--color-body); }
.footer-grid a:hover { color: var(--color-accent-text); }

.footer-brand p { color: var(--color-muted); max-width: 340px; }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

/* -------------------- Utilidades -------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.text-center { text-align: center; }

/* -------------------- Responsive -------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .service-block { grid-template-columns: 1fr; gap: 1.75rem; padding: 2.5rem 0; }
  .service-block:nth-child(even) .service-visual { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem 1.5rem;
    gap: 0.25rem;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu li { width: 100%; }
  .nav-menu a {
    display: block;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid var(--color-bg-soft);
  }
  .nav-cta { text-align: center; margin-top: 0.5rem; }

  section { padding: 3rem 0; }
  .cta-band { padding: 2rem 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
