/* viewport-sections wrapper: cancelar min-height cuando contiene kx-hero */
.viewport-sections:has(.kx-hero) {
  min-height: unset;
}

/* =============================================================================
   KAYROS — Hero (standalone styles)
   ----------------------------------------------------------------------------
   Solo estilos del hero. Depende de variables CSS definidas en
   colors_and_type.css del design system de Kayros:
     --red-500, --red-600, --navy-500, --fg-1, --fg-3,
     --font-display, --font-body, --r-pill, --dur-fast, --dur-base, --ease-out

   Si tu sitio no usa esas variables, el bloque "FALLBACK TOKENS" de más abajo
   las redefine con los valores oficiales de marca para que el hero funcione
   aislado.
   ============================================================================= */

/* ---------- FALLBACK TOKENS (no-op si ya están definidos en el sitio) ---- */
.kx-hero {
  --red-500: var(--red-500, #FA4238);
  --red-600: var(--red-600, #E13129);
  --navy-500: var(--navy-500, #100249);
  --fg-1: var(--fg-1, #0F0A1F);
  --fg-3: var(--fg-3, #6D6E71);
  --font-display: var(--font-display, "Century Gothic", system-ui, sans-serif);
  --font-body: var(--font-body, "Avenir", system-ui, sans-serif);
  --r-pill: var(--r-pill, 999px);
  --dur-fast: var(--dur-fast, 150ms);
  --dur-base: var(--dur-base, 240ms);
  --ease-out: var(--ease-out, cubic-bezier(.2,.7,.2,1));
  --ease-in-out: var(--ease-in-out, cubic-bezier(.65,0,.35,1));
}
.kx-hero * { box-sizing: border-box; }

/* ===== HERO — modern SaaS layout ===== */
.kx-hero {
  position: relative; overflow: hidden; z-index: 1;
  padding: 100px 0 32px;
}
.kx-hero .bg {
  position: absolute; inset: -10%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 32% 40% at 78% 32%, rgba(74, 122, 255, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 28% 36% at 12% 78%, rgba(120, 80, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 24% 30% at 85% 85%, rgba(250, 66, 56, 0.08) 0%, transparent 60%);
}
.kx-hero .grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}
.kx-hero .grid-lines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 0%, transparent 80%);
}
.kx-hero .neural {
  position: absolute; z-index: 2; pointer-events: none;
  color: #6E9CFF; opacity: 0.16;
}
.kx-hero .neural-r { top: -10%; right: -18%; width: 55%; }
.kx-hero .neural img { width: 100%; height: auto; display: block; }
@keyframes kx-hero-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }

.kx-hero .container {
  position: relative; z-index: 5;
  max-width: 1280px; margin: 0 auto; padding: 0 32px;
}
.kx-hero .row {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center;
}

/* ── LEFT: copy column ───────────────────────────────────────── */
.kx-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 14px 8px 10px; border-radius: 999px;
  margin-bottom: 28px;
}
.kx-hero .eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #FA4238;
  box-shadow: 0 0 12px rgba(250,66,56,0.7);
}
.kx-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 2vw + 0.7rem, 2.6rem); line-height: 1.1;
  letter-spacing: -0.03em; color: #fff; margin: 0 0 24px;
  max-width: 22ch;
}
.kx-hero h1 .acc {
  color: transparent; background: linear-gradient(135deg, #FF7E58 0%, #FA4238 100%);
  -webkit-background-clip: text; background-clip: text;
}
.kx-hero .lede {
  font-family: var(--font-body); font-weight: 400; font-size: 19px;
  color: rgba(255,255,255,0.72); max-width: 520px; line-height: 1.55;
  margin: 0 0 36px;
}
.kx-hero .lede b { color: #fff; font-weight: 500; }

.kx-hero .ctas {
  display: flex; gap: 14px; align-items: center; margin-bottom: 28px;
}
.kx-hero .btn-primary {
  -webkit-appearance: none; appearance: none;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 15px 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: #FA4238; color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 150ms cubic-bezier(.2,.7,.2,1);
  line-height: 1; text-decoration: none;
}
.kx-hero .btn-primary:hover { background: #E13129; box-shadow: 0 0 0 6px rgba(250,66,56,0.18); }
.kx-hero .btn-ghost {
  -webkit-appearance: none; appearance: none;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 14px 24px; border-radius: 999px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.18); cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 150ms cubic-bezier(.2,.7,.2,1);
  line-height: 1;
}
.kx-hero .btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.30); }
.kx-hero .btn-ghost .play {
  width: 22px; height: 22px; border-radius: 50%; background: #FA4238;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kx-hero .btn-ghost .play svg { width: 9px; height: 9px; fill: #fff; }

.kx-hero .stats {
  display: grid; grid-template-columns: repeat(3, max-content); gap: 0;
  padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.10);
}
.kx-hero .stat {
  padding: 0 36px; font-family: var(--font-body); position: relative;
}
.kx-hero .stat:first-child { padding-left: 0; }
.kx-hero .stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 1px;
  background: #FA4238;
}
.kx-hero .stat .v {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  color: #fff; letter-spacing: -0.02em; line-height: 1;
}
.kx-hero .stat .v .acc { color: #FA4238; }
.kx-hero .stat .l {
  font-size: 11.5px; color: rgba(255,255,255,0.55); margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ── RIGHT: product showcase ─────────────────────────────────── */
.kx-hero .showcase {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.kx-hero .showcase::before {
  content: ""; position: absolute; inset: 8% 4%;
  background: radial-gradient(circle at 50% 50%, rgba(74, 122, 255, 0.35) 0%, transparent 60%);
  filter: blur(20px); z-index: 0;
}
.kx-hero .hero-mockup-img {
  position: relative; z-index: 3;
  width: 100%; max-width: 320px; height: auto;
  display: block;
  border-radius: 48px;
  filter: drop-shadow(0 32px 56px rgba(0,0,0,0.55)) drop-shadow(0 0 36px rgba(74,122,255,0.22));
}

/* Floating chips around phone */
.kx-hero .hero-chip {
  position: absolute; z-index: 4;
  background: rgba(13, 13, 26, 0.85);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
  font-family: var(--font-body);
}
.kx-hero .hero-chip .ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kx-hero .hero-chip .ico svg { width: 18px; height: 18px; }
.kx-hero .hero-chip .t { font-weight: 700; font-size: 13px; color: #fff; }
.kx-hero .hero-chip .d { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.kx-hero .hero-chip-1 { top: 6%; left: -14%; }
.kx-hero .hero-chip-1 .ico { background: #FA4238; color: #fff; }
.kx-hero .hero-chip-2 { bottom: 14%; right: -14%; }
.kx-hero .hero-chip-2 .ico { background: rgba(74, 122, 255, 0.18); color: #6E9CFF; }
.kx-hero .hero-chip-2 .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #22D3A0;
  box-shadow: 0 0 8px rgba(34, 211, 160, 0.7);
  animation: kx-hero-pulse 2s var(--ease-in-out) infinite;
  margin-left: 4px;
}

/* Logo strip below hero */
.kx-hero .logo-strip {
  margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 48px; flex-wrap: wrap;
}
.kx-hero .logo-strip .lab {
  font-family: var(--font-body); font-size: 11px; color: rgba(255,255,255,0.65);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.kx-hero .logo-strip .marks {
  display: flex; gap: 36px; flex-wrap: wrap; align-items: center;
}
.kx-hero .logo-strip .mark {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: rgba(255,255,255,0.40); letter-spacing: 0.01em;
}

/* Responsive baseline */
@media (max-width: 960px) {
  .kx-hero .row { grid-template-columns: 1fr; gap: 32px; }
  .kx-hero .hero-chip-1 { left: 0; }
  .kx-hero .hero-chip-2 { right: 0; }
}

/* ── Tablet ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .kx-hero {
    padding: 80px 0 28px;
  }

  .kx-hero .container {
    padding: 0 20px;
  }

  .kx-hero .row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .kx-hero h1 {
    max-width: 100%;
  }

  .kx-hero .lede {
    font-size: 16px;
    max-width: 100%;
    margin-bottom: 28px;
  }

  .kx-hero .ctas {
    flex-wrap: wrap;
  }

  .kx-hero .btn-primary,
  .kx-hero .btn-ghost {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }

  /* Phone + chips: contenerizado, sin overflow */
  .kx-hero .showcase {
    width: 100%;
    aspect-ratio: auto;
    min-height: unset;
    max-height: unset;
    padding: 48px 24px 24px;
    overflow: hidden;
  }

  .kx-hero .hero-phone {
    width: 220px;
    height: 440px;
    border-radius: 36px;
  }

  .kx-hero .hero-phone .pcard {
    padding: 9px 10px;
    gap: 8px;
  }

  .kx-hero .hero-phone .pcard .ico {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }

  .kx-hero .hero-phone .pcard .body {
    min-width: 0;
    overflow: hidden;
  }

  .kx-hero .hero-phone .pcard .t,
  .kx-hero .hero-phone .pcard .d {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kx-hero .hero-chip {
    display: none;
  }

  /* Logo strip */
  .kx-hero .logo-strip {
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
  }

  .kx-hero .logo-strip .marks {
    gap: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .kx-hero .logo-strip .marks::-webkit-scrollbar {
    display: none;
  }

  .kx-hero .logo-strip .mark {
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ── Móvil pequeño ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .kx-hero {
    padding: 72px 0 20px;
  }

  .kx-hero .container {
    padding: 0 16px;
  }

  .kx-hero .eyebrow {
    font-size: 10px;
    padding: 6px 12px 6px 8px;
    margin-bottom: 20px;
  }

  .kx-hero h1 {
    font-size: clamp(1.6rem, 8vw, 2rem);
    margin-bottom: 16px;
  }

  .kx-hero .lede {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .kx-hero .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .kx-hero .stat {
    padding: 0 10px;
  }

  .kx-hero .stat .v {
    font-size: 20px;
  }

  .kx-hero .stat .l {
    font-size: 10px;
  }

  .kx-hero .showcase {
    padding: 36px 16px 16px;
  }

  .kx-hero .hero-phone {
    width: 200px;
    height: 410px;
    border-radius: 32px;
    border-width: 6px;
  }

  .kx-hero .hero-phone .screen {
    border-radius: 26px;
    padding: 36px 10px 10px;
    gap: 8px;
  }

  .kx-hero .hero-phone .pcard {
    padding: 8px;
    gap: 7px;
  }

  .kx-hero .hero-phone .pcard .ico {
    width: 24px;
    height: 24px;
  }

  .kx-hero .hero-phone .pcard .ico svg {
    width: 12px;
    height: 12px;
  }

  .kx-hero .hero-phone .pcard .t {
    font-size: 10px;
  }

  .kx-hero .hero-phone .pcard .d {
    font-size: 9px;
  }

  .kx-hero .hero-phone .pcard .pill {
    font-size: 8px;
    padding: 2px 5px;
    flex-shrink: 0;
  }
}
