/* ============================================================= n8n Chile
   CSS propio, vanilla. Tema claro, acento azul. Mobile-first.
   ========================================================================= */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-var.woff2?v=2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Lexend";
  src: url("/static/fonts/lexend-var.woff2?v=2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --ink: #0d1220;
  --text: #4a5163;
  --muted: #6b7180;
  --line: #e7eaf2;
  --accent: #2f6bed;
  --accent-ink: #1b4fc7;
  --accent-soft: #e9f0ff;
  --ok: #04ac05;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(13, 18, 32, .08);
  --shadow-sm: 0 4px 14px rgba(13, 18, 32, .06);
  --maxw: 1120px;
  --space: clamp(3.5rem, 8vw, 6.5rem);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Lexend", "Inter", sans-serif;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: var(--space) 0; }
.eyebrow {
  display: inline-block; font-weight: 600; font-size: .75rem;
  letter-spacing: .07em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: .35rem .8rem; border-radius: 999px;
  margin: 0 0 1rem;
}
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-sub { color: var(--text); font-size: 1.05rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .98rem; padding: .8rem 1.4rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(47, 107, 237, .28); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------------ Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { width: 112px; height: auto; }
.main-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a { color: var(--ink); font-weight: 500; font-size: .96rem; }
.nav-menu a:hover { color: var(--accent); }
.nav-cta a { color: #fff; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0;
  padding: 8px; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; transform-origin: center; }
/* Hamburguesa → X cuando el menú está abierto */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------------------------------------------- Hero */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0; background:
  radial-gradient(900px 420px at 85% -10%, var(--accent-soft), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy { max-width: 640px; }
.hero-title { margin-bottom: 1rem; }
.hero-lead { font-size: 1.15rem; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.2rem; }
.hero-note { color: var(--muted); font-size: .95rem; }

/* Tarjeta visual del hero (reconstrucción de la tarjeta de generación del original) */
.hero-visual { display: flex; justify-content: center; }
.gen-card {
  position: relative; width: 100%; max-width: 420px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.2rem 1.4rem 1.5rem; overflow: hidden;
}
.gen-card::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 110% -20%, var(--accent-soft), transparent 70%); }
.gen-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.gen-dots { display: flex; gap: 6px; }
.gen-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.gen-dots i:first-child { background: #ff5f57; } .gen-dots i:nth-child(2) { background: #febc2e; } .gen-dots i:nth-child(3) { background: #28c840; }
.gen-title { font-family: Lexend, sans-serif; font-weight: 600; font-size: .85rem; color: var(--muted); }
.gen-body { position: relative; padding: 1.6rem 0 .5rem; }
.gen-label { color: var(--muted); font-size: .85rem; margin: 0 0 .3rem; }
.gen-line { font-family: Lexend, sans-serif; font-size: 1.3rem; font-weight: 600; color: var(--ink); margin: 0; min-height: 2.2em; }
.rotator { color: var(--accent); }
.rotator::after { content: ""; display: inline-block; width: 2px; height: 1.05em; background: var(--accent); margin-left: 3px; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ----------------------------------------------------------------- Clients */
.clients { padding: 2.5rem 0; border-bottom: 1px solid var(--line); }
.clients-title { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; }
.clients-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(1.5rem, 5vw, 3.5rem); }
.clients-row img { width: clamp(70px, 12vw, 110px); height: auto; filter: grayscale(1); opacity: .6; transition: .2s; }
.clients-row img:hover { filter: grayscale(0); opacity: 1; }

/* --------------------------------------------------------- Cards & grids */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.benefits-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
.benefit-card { padding: 1.8rem; }
.benefit-icon { width: 48px; height: 48px; margin-bottom: 1rem; }
.benefit-card h3 { margin-bottom: .5rem; }
.card-link { display: inline-block; margin-top: .6rem; font-weight: 600; }

/* --------------------------------------------------------- Integrations */
.integrations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.integrations-copy { max-width: 460px; }
.integrations-copy h2 { margin-bottom: .8rem; }
.integrations-copy .section-sub { margin-bottom: 1.4rem; }
.logo-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; width: 100%;
  background: var(--accent-soft); padding: 24px; border-radius: var(--radius-lg);
}
.logo-chip {
  display: grid; place-items: center; aspect-ratio: 1; background: #fff;
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.logo-chip img { width: 40px; height: 40px; object-fit: contain; }

/* ----------------------------------------------------------- Testimonials */
.testimonials { background: var(--bg-soft); }
.testimonials-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
.testimonial { padding: 1.8rem; margin: 0; }
.testimonial blockquote { margin: 0 0 1.2rem; font-size: 1.02rem; color: var(--ink); }
.testimonial blockquote::before { content: "“"; color: var(--accent); font-size: 2rem; font-family: Lexend; line-height: 0; vertical-align: -.4em; margin-right: .15em; }
.testimonial figcaption { display: flex; flex-direction: column; }
.t-name { font-weight: 600; color: var(--ink); }
.t-role { color: var(--muted); font-size: .9rem; }

/* -------------------------------------------------------------- Audience */
.audience-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(4, 1fr); }
.audience-card { overflow: hidden; }
.audience-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.audience-card h3 { margin: 1rem 1.2rem .4rem; }
.audience-card p { margin: 0 1.2rem 1.4rem; font-size: .96rem; }

/* ------------------------------------------------------------------- FAQ */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: .8rem; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 1.2rem; }
.faq-item summary {
  list-style: none; cursor: pointer; font-weight: 600; color: var(--ink);
  padding: 1.1rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 0 1.1rem; color: var(--text); }
.faq-answer p { margin: 0; }

/* ----------------------------------------------- Secondary / SEO pages */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page-narrow { max-width: 820px; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--muted); } .breadcrumb a:hover { color: var(--accent); }
.page-head { margin-bottom: 2.5rem; }
.page-icon { width: 48px; height: 48px; margin-bottom: 1rem; }
.page-lead { font-size: 1.15rem; color: var(--text); margin-bottom: 1.5rem; }
.page-section { margin-bottom: 2.2rem; }
.page-section h2 { margin-bottom: .8rem; }
.checklist { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.checklist li { position: relative; padding-left: 1.9rem; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent);
  font-weight: 700; background: var(--accent-soft); width: 1.4rem; height: 1.4rem;
  border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
}
.page-cta { padding: 2rem; text-align: center; margin: 2.5rem 0; background: var(--accent-soft); border: 0; }
.page-cta .hero-actions { justify-content: center; }
.related { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.related-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.related-list a { background: #fff; border: 1px solid var(--line); padding: .5rem 1rem; border-radius: 999px; font-weight: 500; }
.related-list a:hover { border-color: var(--accent); }

/* ----------------------------------------------------------------- Footer */
.site-footer { background: var(--ink); color: #c7cbd6; padding: 3.5rem 0 1.5rem; margin-top: var(--space); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2rem; }
.footer-brand img { filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer-brand p { color: #9aa0b0; margin-bottom: 1.2rem; }
.footer-col h3 { color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-col a { color: #c7cbd6; font-size: .94rem; }
.footer-col a:hover { color: #fff; }
.footer-social { display: flex; gap: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2.5rem; padding-top: 1.5rem; }
.footer-bottom p { margin: 0; color: #8a90a2; font-size: .88rem; }

/* ------------------------------------------------------- WhatsApp float */
.whatsapp-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
  transition: transform .2s;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; }

/* ------------------------------------------------------------- Reveals */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { justify-content: flex-start; }
  .integrations-grid { grid-template-columns: 1fr; }
  .integrations-copy { max-width: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .audience-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 1rem 20px 1.5rem;
    transform: translateY(-120%); transition: transform .28s ease; box-shadow: var(--shadow);
    /* visibility saca los enlaces del orden de tabulación y del árbol a11y al cerrar */
    visibility: hidden; max-height: calc(100dvh - 72px); overflow-y: auto;
  }
  .nav-menu.open { transform: translateY(0); visibility: visible; }
  .nav-menu li { width: 100%; }
  .nav-menu a { display: block; padding: .8rem 0; }
  .nav-cta a { display: inline-flex; margin-top: .5rem; }
  .benefits-grid { grid-template-columns: 1fr; }
  .audience-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------- prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rotator::after { animation: none; }
  * { transition: none !important; }
}
