/* ============================================================
   Autobrain Systems — landing
   Estilo: negro profundo, tarjetas de cristal y el cerebro de
   neón de la marca como pieza central. Colores corporativos:
   naranja, rosa y violeta del logo.
   ============================================================ */
/* Tipografía alojada en la propia web: no se envía la IP de los visitantes a Google */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("assets/fuentes/inter-tight-latin.woff2") format("woff2");
}

:root {
  --bg: #0a0b0e;
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --orange: #f7931e;
  --magenta: #e6007e;
  --blue: #4d3dff;
  --grad: linear-gradient(90deg, var(--orange), var(--magenta) 55%, var(--blue));
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --radius: 20px;
  --container: 1240px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--bg); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* Fondo fijo con los colores de la marca (el de la versión anterior).
   Se usa un elemento fixed en vez de background-attachment:fixed
   porque iOS Safari no respeta ese valor. */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 15%, rgba(247, 147, 30, 0.22), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(230, 0, 126, 0.20), transparent 42%),
    radial-gradient(circle at 20% 65%, rgba(77, 61, 255, 0.20), transparent 48%),
    radial-gradient(circle at 90% 85%, rgba(230, 0, 126, 0.17), transparent 48%),
    radial-gradient(circle at 50% 45%, rgba(247, 147, 30, 0.14), transparent 52%),
    var(--bg);
}

/* Texto con el degradado de la marca */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Superficie de cristal */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }

/* ============ Botones ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 30px -10px rgba(230, 0, 126, 0.7); }
.btn-grad:hover { box-shadow: 0 10px 38px -8px rgba(230, 0, 126, 0.9); transform: translateY(-1px); }
.btn-glass { background: var(--glass-2); border-color: var(--border); backdrop-filter: blur(12px); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.12); }
.btn-small { padding: 0.55rem 1.05rem; font-size: 0.92rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ============ Cabecera ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(rgba(10, 11, 14, 0.85), rgba(10, 11, 14, 0.55));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; position: relative; }
.brand img { width: 136px; }

.nav-pill {
  display: flex;
  gap: 0.2rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
}
.nav-pill a { text-decoration: none; font-size: 0.92rem; color: var(--text-2); padding: 0.45rem 1rem; border-radius: 999px; transition: color 0.15s, background 0.15s; }
.nav-pill a:hover { color: var(--text); background: var(--glass-2); }
.nav-pill a.activo { color: #fff; background: var(--grad); }
.nav-cta-movil { display: none; }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--glass); cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--text); transition: transform 0.2s, top 0.2s; }
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21.5px; transform: rotate(-45deg); }

/* ============ Portada ============ */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem); min-height: min(calc(100svh - 72px), 900px); display: flex; align-items: center; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 2rem; align-items: end; width: min(100% - 2.5rem, var(--container)); }
.hero-copy { max-width: 600px; }
.hero h1 {
  font-size: clamp(2.9rem, 6.4vw, 5.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-top: 1.4rem;
}
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 44ch; margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.9rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 2.6rem; max-width: 560px; }
.stats li { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.4rem; border-radius: 16px; }
.stat-label { font-size: 0.8rem; color: var(--text-2); }
.stat-num { font-size: 2.1rem; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.stat-num small { font-size: 0.95rem; letter-spacing: 0; color: var(--text-2); }

.hero-side { display: grid; gap: 0.8rem; }
.side-card { padding: 1.2rem 1.25rem; }
.side-kicker { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.9rem; }
.side-big { font-size: 1.55rem; font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.side-text { font-size: 0.9rem; color: var(--text-2); margin: 0.5rem 0 0; }
.side-card .btn { margin-top: 1rem; }

/* ============ Declaración ============ */
.statement { padding: clamp(3rem, 8vw, 6.5rem) 0; }
.statement p {
  font-size: clamp(1.7rem, 3.6vw, 3.1rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 24ch;
  margin-left: auto;
}

/* ============ Bento ============ */
.bento { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 1rem; }
.bento > * { min-width: 0; }
.bento-remote {
  grid-row: span 2;
  position: relative;
  overflow: hidden;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  min-height: 380px;
}
.bento-remote-glow {
  position: absolute;
  inset: auto -20% -45% -20%;
  height: 80%;
  background: radial-gradient(50% 60% at 50% 50%, rgba(230, 0, 126, 0.45), rgba(77, 61, 255, 0.18) 55%, transparent 75%);
  filter: blur(10px);
  pointer-events: none;
}
.bento-remote > :not(.bento-remote-glow) { position: relative; }
.bento-title { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; max-width: 15ch; }
.bento-num { padding: 1.6rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; }
.bento-small { color: var(--text-2); font-size: 0.95rem; max-width: 36ch; }
.bento-huge { font-size: clamp(4.5rem, 9vw, 7.5rem); font-weight: 300; letter-spacing: -0.06em; line-height: 0.85; text-align: right; }
.bento-huge span { font-size: 1.1rem; letter-spacing: 0; color: var(--text-2); }
.bento-quote { margin: 0; padding: 1.6rem; display: grid; grid-template-columns: 64px 1fr; gap: 0.6rem 1.1rem; align-items: start; }
.bento-quote img { width: 64px; height: 64px; border-radius: 14px; grid-row: span 2; }
.bento-quote blockquote { font-size: 1.08rem; line-height: 1.4; }
.bento-quote figcaption { font-size: 0.88rem; color: var(--text-2); }
.bento-quote figcaption strong { display: block; color: var(--text); font-weight: 500; }

/* ============ Cinta de procesos ============ */
.marquee { padding: clamp(3rem, 6vw, 4.5rem) 0; display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 1.5rem; width: min(100% - 2.5rem, var(--container)); margin-inline: auto; border-bottom: 1px solid var(--border); }
.marquee-label { font-size: 0.88rem; color: var(--text-3); }
.marquee-track {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track ul { display: flex; flex-shrink: 0; gap: 2.4rem; padding-right: 2.4rem; }
.marquee-track li { white-space: nowrap; font-size: 1.15rem; color: var(--text-2); display: flex; align-items: center; gap: 2.4rem; }
.marquee-track li::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track ul { animation: cinta 38s linear infinite; }
}
@keyframes cinta { to { transform: translateX(-100%); } }

/* ============ Secciones ============ */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; }
.section-head { margin-bottom: 2.4rem; }

.panel { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.panel-head h2 { margin-top: 1.2rem; }
.panel-head > p:not(.tag) { color: var(--text-2); margin-top: 1rem; max-width: 36ch; }
@media (min-width: 900px) { .panel-head { position: sticky; top: 7rem; } }

.phases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.phases-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.phases li { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.phase-num { font-size: 0.9rem; font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phases h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.phases p { color: var(--text-2); font-size: 0.97rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; }
.pills li { font-size: 0.8rem; color: var(--text-2); padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--glass); }

.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.area { padding: 1.5rem; position: relative; overflow: hidden; }
.area::before { content: ""; display: block; width: 36px; height: 3px; border-radius: 3px; background: var(--grad); margin-bottom: 1.4rem; }
.area h3 { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; }
.area p { color: var(--text-2); font-size: 0.97rem; margin-top: 0.6rem; }

.decide { position: relative; overflow: hidden; text-align: center; padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 5vw, 4rem); }
.decide-glow { position: absolute; inset: -40% 10% auto; height: 90%; background: radial-gradient(50% 50% at 50% 50%, rgba(247, 147, 30, 0.22), rgba(230, 0, 126, 0.18) 45%, transparent 72%); pointer-events: none; }
.decide > :not(.decide-glow) { position: relative; }
.decide p { color: var(--text-2); max-width: 58ch; margin: 1.2rem auto 0; font-size: 1.1rem; }

/* Preguntas */
.faq { display: grid; gap: 0.7rem; }
.faq details { padding: 0 1.4rem; border-radius: 16px; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.15rem 0; font-size: 1.08rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); font-size: 1.2rem; color: var(--text-2); transition: transform 0.2s, background 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); background: var(--grad); color: #fff; border-color: transparent; }
.faq details p { color: var(--text-2); padding-bottom: 1.3rem; max-width: 62ch; }

/* ============ Contacto ============ */
.lead-form { padding: clamp(1.4rem, 4vw, 2.2rem); display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-field { display: grid; gap: 0.45rem; }
.form-field label { font-size: 0.92rem; font-weight: 500; }
.optional { color: var(--text-3); font-weight: 400; margin-left: 0.3rem; }
.lead-form input[type="text"], .lead-form input[type="email"], .lead-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  width: 100%;
}
.lead-form textarea { resize: vertical; }
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: rgba(230, 0, 126, 0.7); box-shadow: 0 0 0 3px rgba(230, 0, 126, 0.18); }
.lead-form .invalid { border-color: #ff5a8a; }
.field-error { color: #ff7aa2; font-size: 0.86rem; }
.field-error:empty { display: none; }
.consent label { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.92rem; color: var(--text-2); cursor: pointer; }
.consent input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; accent-color: var(--magenta); flex-shrink: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#form-status:empty { display: none; }
#form-status.ok { color: #4ade80; }
#form-status.error { color: #ff7aa2; }

/* ============ Pie ============ */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0 3rem; font-size: 0.92rem; color: var(--text-2); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer-logo { width: 120px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-nav a, .footer-contact a { text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--text); }
.footer-copy { margin-left: auto; color: var(--text-3); }

/* Botón fijo (solo móvil) */
.sticky-cta { display: none; }

/* ============ Página legal (privacidad) ============ */
.legal { padding: 3rem 0 5rem; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 400; letter-spacing: -0.04em; margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.35rem; font-weight: 500; margin: 2.2rem 0 0.7rem; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { list-style: disc; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.legal a { color: var(--text); }
.legal-fecha { font-size: 0.92rem; color: var(--text-3) !important; margin-bottom: 1rem; }
.legal p + p { margin-top: 0.8rem; }
.legal p + ul { margin-top: 0.7rem; }
.legal ul + p, .legal .tabla-scroll + p { margin-top: 0.8rem; }
.legal-volver { margin-top: 2.5rem !important; }
.tabla-scroll { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--border); border-radius: 14px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 520px; }
.tabla th, .tabla td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.tabla th { color: var(--text); font-weight: 500; background: var(--glass); }
.tabla td { color: var(--text-2); }
.tabla tr:last-child td { border-bottom: none; }
.todo { background: rgba(230, 0, 126, 0.16); color: #ff7aa2; font-weight: 600; padding: 0 0.3rem; border-radius: 4px; }

/* ============ Tablet ============ */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; max-width: 640px; }
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ Móvil ============ */
@media (max-width: 860px) {
  .header-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-pill {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem;
    border-radius: 22px;
    background: #111115;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  }
  .nav-pill.open { display: flex; }
  .nav-pill a { font-size: 1.05rem; padding: 0.85rem 1rem; border-radius: 14px; }
  .nav-pill a.activo { background: var(--glass-2); color: var(--text); }
  .nav-pill .nav-cta-movil { display: block; background: var(--grad); color: #fff; text-align: center; margin-top: 0.3rem; }

  .panel { grid-template-columns: 1fr; }
  .phases, .phases-3 { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento-remote { grid-row: auto; min-height: 320px; }
  .marquee { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; padding-bottom: 5.5rem; }
  .container, .hero-grid, .marquee { width: calc(100% - 2rem); }
  .brand img { width: 118px; }

  .hero { min-height: 0; padding-top: 1.5rem; align-items: flex-start; }
  .hero h1 { font-size: clamp(2.6rem, 12.5vw, 3.4rem); margin-top: 1.1rem; }
  .lead { font-size: 1.02rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; padding: 0.95rem 1.2rem; }
  .hero-actions .btn-grad { order: -1; }

  /* Cifras y tarjetas: carrusel horizontal con imán */
  .stats, .hero-side {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.7rem;
    margin-inline: -1rem;
    padding: 0 1rem 0.4rem;
    scrollbar-width: none;
  }
  .stats::-webkit-scrollbar, .hero-side::-webkit-scrollbar { display: none; }
  .stats li { flex: 0 0 42%; scroll-snap-align: start; }
  .hero-side { max-width: none; }
  .hero-side .side-card { flex: 0 0 82%; scroll-snap-align: start; }
  .stat-num { font-size: 1.9rem; }

  .statement p { margin-left: 0; }
  .areas { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .faq details { padding: 0 1.1rem; }
  .bento-quote { grid-template-columns: 52px 1fr; }
  .bento-quote img { width: 52px; height: 52px; }
  .footer-copy { margin-left: 0; }

  .sticky-cta {
    display: flex;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(0.9rem + env(safe-area-inset-bottom));
    z-index: 40;
    padding: 1rem;
    transition: transform 0.25s, opacity 0.25s;
  }
  .sticky-cta.oculto { transform: translateY(150%); opacity: 0; pointer-events: none; }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
}
