/* ═══════════════════════════════════════════════════════════
   Landing "Caos operativo" — FOCUS Systems
   Híbrido dirigido: hero oscuro → cuerpo claro cálido → cierre oscuro.
   Mobile-first. Si no se entiende a 390 px, no sirve.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #faf7f2;   /* nunca blanco puro: ensucia las fotos de luz cálida */
  --bg-alt:    #f2ece3;
  --bg-dark:   #14110f;   /* negro cálido, no azulado */
  --ink:       #1c1917;
  --ink-soft:  #57534e;
  --ink-inv:   #f5f0e8;
  --brand:     #6eb631;
  --brand-ink: #14110f;   /* texto SOBRE el verde: con blanco da 2,5:1 y reprueba AA */
  --accent:    #e8a33d;
  --link:      #4767bd;

  --ancho:      1180px;
  --ancho-texto: 680px;
  --radio:      10px;
  --sombra:     0 1px 2px rgb(28 25 23 / .06), 0 8px 24px -6px rgb(28 25 23 / .16);

  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
            Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;       /* la franja no debe desbordar el body en mobile */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2 { line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; margin: 0; }

p { text-wrap: pretty; }

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

.saltar {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--brand-ink);
  padding: .75rem 1.25rem; font-weight: 700; border-radius: 0 0 var(--radio) 0;
}
.saltar:focus { left: 0; }

.contenedor { width: min(100% - 2rem, var(--ancho)); margin-inline: auto; }
.contenedor--angosto { width: min(100% - 2rem, var(--ancho-texto)); }

/* ─────────────── Botones ─────────────── */

.boton {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);          /* verde con texto oscuro = 6,7:1 */
  font: inherit; font-weight: 700;
  text-decoration: none;
  padding: .95rem 1.75rem;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow: 0 2px 10px rgb(110 182 49 / .3);
}
.boton:hover { background: #7cc93a; transform: translateY(-1px); }
.boton:active { transform: translateY(0); }
.boton--grande { font-size: 1.125rem; padding: 1.1rem 2.25rem; }
.boton--bloque { display: block; text-align: center; }

/* ─────────────── Bloque 1 — Hero ─────────────── */

.hero {
  position: relative;
  background: var(--bg-dark);
  color: var(--ink-inv);
  padding: clamp(4rem, 14vh, 8rem) 0 clamp(3.5rem, 10vh, 6rem);
  overflow: hidden;
  isolation: isolate;
}

/* Reemplazar por el último frame del reel.
   Con imagen:  background-image: linear-gradient(...), url("../img/hero/ultimo-frame.webp"); */
.hero__fondo {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 70% 8%,  rgb(232 163 61 / .22), transparent 55%),
    radial-gradient(90% 60% at 12% 92%, rgb(232 163 61 / .10), transparent 60%),
    linear-gradient(170deg, #221c17 0%, #14110f 55%, #0d0b0a 100%);
}

.hero__contenido { width: min(100% - 2rem, var(--ancho-texto)); margin-inline: auto; text-align: center; }

.hero__marca {
  margin: 0 0 2.25rem;
  font-size: .8125rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent);
}

.hero__titulo { font-size: clamp(2.15rem, 8.5vw, 3.75rem); font-weight: 800; }

.hero__bajada {
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  color: #ddd5c8;
  margin: 1.5rem auto 2.5rem;
  max-width: 34ch;
}

.hero__nota { font-size: .9375rem; color: #a29a8e; margin: 1.25rem 0 0; }

/* ─────────────── Bloque 1b — Franja de locales ─────────────── */

.franja { background: var(--bg-alt); padding: 2.25rem 0 2rem; }

.franja__titulo {
  font-size: .8125rem; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.franja__pista {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;      /* no captura el scroll vertical de la página */
  scrollbar-width: none;
  /* el padding lateral alinea la 1ª tarjeta con el contenedor y deja asomar la última */
  padding-inline: max(1rem, calc((100% - var(--ancho)) / 2));
  padding-block: .25rem;
}
.franja__pista::-webkit-scrollbar { display: none; }

/* El peek no es estético: la tarjeta cortada es la única señal de que hay más.
   1,5 tarjetas en mobile · 2,25 en tablet · 3,25 en desktop. */
.local {
  flex: 0 0 auto;
  width: calc((100% - 1rem) / 1.5);
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 88px;
  /* sin recuadro, sin borde, sin sombra: los logos flotan sobre el fondo */
}

.local__nombre {
  margin: 0 0 .3rem;
  font-size: 1.0625rem; font-weight: 700;
  color: var(--ink); opacity: .8;
}

.local__ciudad {
  margin: 0;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
}

.franja__controles { display: none; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }

.flecha {
  width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 1px solid rgb(28 25 23 / .18);
  border-radius: 50%; cursor: pointer; color: var(--ink-soft);
}
.flecha:hover { border-color: rgb(28 25 23 / .4); color: var(--ink); }
.flecha svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Menos de 6 locales con permiso → fila estática centrada, sin carrusel */
.franja--estatica .franja__pista {
  flex-wrap: wrap; justify-content: center; overflow: visible;
  gap: 1rem 2.5rem;
}
.franja--estatica .local { width: auto; min-width: 150px; text-align: center; }
.franja--estatica .franja__controles { display: none !important; }

/* ─────────────── Bloque 2 — Demostración ─────────────── */

.movimiento { padding: clamp(3.5rem, 9vw, 6rem) 0 0; }

.movimiento__numero {
  font-size: .8125rem; font-weight: 700;
  letter-spacing: .14em;
  color: var(--brand);
  margin: 0 0 .5rem;
}

.movimiento__titulo {
  font-size: clamp(1.5rem, 5.5vw, 2.25rem);
  font-weight: 800;
  max-width: 20ch;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.grilla { display: grid; gap: clamp(2.5rem, 6vw, 3.5rem); }

.interfaz { margin: 0; }

/* Foto nocturna sobre fondo claro: sin contorno queda como un bloque negro flotando */
.interfaz img {
  width: 100%;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  background: var(--bg-alt);
}

.interfaz figcaption {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
}

/* ─────────────── Bloque 3 — Capacitación ─────────────── */

.capacitacion {
  background: var(--bg-alt);
  margin-top: clamp(4rem, 10vw, 7rem);
  padding: clamp(3.5rem, 9vw, 5.5rem) 0;
}

.titulo-seccion {
  font-size: clamp(1.5rem, 5.5vw, 2.125rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.capacitacion p, .autoridad p { margin: 0 0 1.25rem; }

.lista { list-style: none; padding: 0; margin: 0 0 2.25rem; }
.lista li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 1rem;
}
.lista li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}

/* ─────────────── Bloque 4 — Autoridad ─────────────── */

.autoridad { padding: clamp(3.5rem, 9vw, 5.5rem) 0; }

.testimonio {
  margin: 2.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--brand);
}
.testimonio p { font-size: 1.125rem; margin-bottom: .75rem; }
.testimonio cite { font-style: normal; font-size: .875rem; color: var(--ink-soft); }

.datos { list-style: none; padding: 0; margin: 0; font-size: .9375rem; color: var(--ink-soft); }
.datos li { padding: .4rem 0; border-top: 1px solid rgb(28 25 23 / .1); }

/* ─────────────── Bloque 5 — Cierre ─────────────── */

.cierre {
  background: var(--bg-dark);
  color: var(--ink-inv);
  padding: clamp(4rem, 10vw, 6.5rem) 0 clamp(3rem, 8vw, 4rem);
  text-align: center;
}

.cierre__titulo { font-size: clamp(1.85rem, 7vw, 2.75rem); font-weight: 800; }

.cierre__bajada {
  color: #ddd5c8;
  margin: 1.25rem auto 2.25rem;
  max-width: 40ch;
  font-size: 1.0625rem;
}

.faq { margin-top: clamp(3rem, 8vw, 4.5rem); text-align: left; }

.faq details { border-top: 1px solid rgb(245 240 232 / .16); }
.faq details:last-of-type { border-bottom: 1px solid rgb(245 240 232 / .16); }

.faq summary {
  padding: 1.15rem 2rem 1.15rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: ""; position: absolute; right: .35rem; top: 1.55rem;
  width: 9px; height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.75rem; }

.faq p { margin: 0 0 1.35rem; color: #c9c0b4; }

.cierre__pie { margin-top: 3rem; font-size: .875rem; color: #8a8177; }

/* ─────────────── CTA sticky (solo mobile) ─────────────── */

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: rgb(250 247 242 / .92);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgb(28 25 23 / .1);
  transform: translateY(110%);
  transition: transform .28s ease;
}
.sticky[data-visible] { transform: translateY(0); }

@media (min-width: 900px) { .sticky { display: none; } }

/* ─────────────── Revelado al scroll ─────────────── */

/* Solo se esconden si hay JS para volver a mostrarlas */
.js .revelar { opacity: 0; transform: translateY(22px); }
.js .revelar.visible {
  opacity: 1; transform: none;
  transition: opacity .65s ease, transform .65s cubic-bezier(.22,.61,.36,1);
}

/* ─────────────── Breakpoints ─────────────── */

@media (min-width: 768px) {
  .local { width: calc((100% - 2rem) / 2.25); }   /* 2 completas + peek */

  .grilla {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
  .interfaz[data-formato="ancho"] { grid-column: 1 / -1; }
  .interfaz[data-formato="ancho"] figcaption { max-width: 60ch; }
}

@media (min-width: 1080px) {
  .local { width: calc((100% - 3rem) / 3.25); }   /* 3 completas + 25% de la cuarta */
  .franja__controles { display: flex; }           /* en desktop nadie arrastra por instinto */

  .grilla { gap: 4rem 3rem; }
}

/* ─────────────── Accesibilidad y ahorro ─────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .revelar, .js .revelar.visible { opacity: 1; transform: none; transition: none; }
  .sticky { transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .sticky, .franja__controles, .saltar { display: none !important; }
  .hero, .cierre { background: #fff; color: #000; }
}
