/* ==========================================================================
   Valyon Solutions — Design tokens
   ========================================================================== */
:root {
  --ion: #4B49E0;
  --ion-dark: #3937B8;
  --ion-light: #B9B5F2;
  --ion-tint: #F1F0FE;
  --white: #FFFFFF;
  --ink: #16171A;
  --graphite: #3B3C40;
  --mist: #9A9A94;
  --mist-line: #E4E3DF;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --container: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --ease-out: cubic-bezier(.16,.84,.44,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);

  --nav-h: 84px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); overflow-x: clip; }
body {
  font-family: var(--font-body);
  color: var(--graphite);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; /* clip (no 'hidden') para no crear contenedor de scroll que rompe ScrollTrigger */
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.1; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--ion); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Grain overlay for premium texture */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.section-inner { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ion); margin-bottom: 16px; display: block;
}
.eyebrow--light { color: var(--ion-light); }
.section-title {
  font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.01em; margin-bottom: 20px; max-width: 760px;
}
.section-title--light { color: var(--white); }
.section-lead { font-size: 18px; color: var(--graphite); max-width: 560px; margin-bottom: 48px; }
.text-mist { color: var(--mist); }
.accent-text { color: var(--ion); }

section { position: relative; padding: clamp(72px, 10vw, 140px) 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 14px 24px; border-radius: 100px; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .25s ease, color .25s ease;
}
.btn svg { transition: transform .3s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn-lg { padding: 17px 30px; font-size: 16px; }
.btn-primary { background: var(--ion); color: #fff; box-shadow: 0 1px 2px rgba(75,73,224,.15); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(75,73,224,.55); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--mist-line); }
.btn-ghost:hover { border-color: var(--ion); color: var(--ion); transform: translateY(-2px); }
.btn-white { background: #fff; color: var(--ion); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(0,0,0,.35); }
.btn-nav { padding: 12px 22px; font-size: 14px; }

/* ==========================================================================
   Logo lockup
   ========================================================================== */
.nav-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-symbol { width: 34px; height: 34px; color: var(--ion); flex-shrink: 0; }
.logo-symbol svg { width: 100%; height: 100%; }
.logo-word { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.logo-word-main { font-family: var(--font-display); font-weight: 500; font-size: 20px; color: var(--ion); letter-spacing: -0.01em; }
.logo-word-sub { font-family: var(--font-body); font-weight: 600; font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--graphite); }

.logo-symbol--footer { color: var(--ion-light); }
.footer .logo-word-main { color: var(--white); }
.footer .logo-word-sub { color: var(--mist); }
.logo-symbol--divider { width: 56px; height: 56px; color: var(--ion-light); }
.logo-symbol--chat { width: 26px; height: 26px; color: #fff; }

/* Idle continuous spin */
.ring-idle { transform-box: view-box; transform-origin: center; }
.ring-idle--outer { animation: valyon-spin 26s linear infinite; }
.ring-idle--inner { animation: valyon-spin-rev 19s linear infinite; }
@keyframes valyon-spin { to { transform: rotate(360deg); } }
@keyframes valyon-spin-rev { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ring-idle--outer, .ring-idle--inner { animation: none; }
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 650;
  height: var(--nav-h); display: flex; align-items: center;
  background: rgba(255,255,255,0);
  transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out), height .3s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(22,23,26,.06);
  height: 72px;
}
.nav-inner {
  width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-links { display: flex; align-items: center; gap: 36px; margin-left: auto; margin-right: 36px; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: var(--graphite); position: relative; padding: 6px 0;
  transition: color .25s ease;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--ion);
  transition: width .3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 1.6px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

.nav-mobile {
  position: fixed; top: var(--nav-h); left: 0; right: 0; background: #fff;
  display: flex; flex-direction: column; padding: 12px var(--gutter) 28px; gap: 4px;
  box-shadow: 0 20px 40px -20px rgba(22,23,26,.15);
  transform: translateY(-12px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .35s var(--ease-out), opacity .3s ease, visibility 0s linear .35s;
}
.nav-mobile.is-open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .35s var(--ease-out), opacity .3s ease, visibility 0s; }
.nav-mobile a { padding: 14px 4px; font-size: 17px; font-weight: 500; border-bottom: 1px solid var(--mist-line); }
.nav-mobile .btn { margin-top: 16px; justify-content: center; border-bottom: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-top: calc(var(--nav-h) + 56px); padding-bottom: 80px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(760px 420px at 82% 8%, var(--ion-tint) 0%, rgba(241,240,254,0) 70%);
}
.hero-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-orbit { position: absolute; border-radius: 50%; border: 1.5px solid rgba(75,73,224,.14); }
.hero-orbit--1 { width: 620px; height: 620px; top: -220px; right: -140px; }
.hero-orbit--2 { width: 380px; height: 380px; top: -60px; right: 40px; border-color: rgba(75,73,224,.1); }
.hero-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--ion); opacity: .5; }
.hero-dot--1 { top: 18%; right: 6%; }
.hero-dot--2 { top: 62%; right: 22%; width: 5px; height: 5px; }
.hero-dot--3 { top: 40%; right: 44%; width: 4px; height: 4px; opacity: .3; }

.hero-inner {
  position: relative; z-index: 1; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero-title {
  font-size: clamp(40px, 6vw, 68px); letter-spacing: -0.02em; margin: 18px 0 26px;
}
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: block; }
.hero-subtitle { font-size: clamp(17px, 2vw, 20px); color: var(--graphite); max-width: 480px; margin-bottom: 34px; }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-trust { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--mist); }
.hero-trust-strong { color: var(--ink); font-weight: 600; }

.hero-visual { position: relative; }
.hero-panel {
  position: relative; background: #fff; border: 1px solid var(--mist-line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: 0 40px 80px -40px rgba(22,23,26,.25);
  overflow: hidden;
}
.hero-panel-glow {
  position: absolute; width: 260px; height: 260px; background: radial-gradient(circle, rgba(75,73,224,.16), transparent 70%);
  top: -100px; right: -80px; pointer-events: none;
}
.hero-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.hero-symbol-lg { width: 52px; height: 52px; }
.hero-panel-status {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--graphite);
  background: var(--ion-tint); padding: 7px 14px; border-radius: 100px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2FBA6C; box-shadow: 0 0 0 0 rgba(47,186,108,.5); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%{box-shadow:0 0 0 0 rgba(47,186,108,.45);} 70%{box-shadow:0 0 0 8px rgba(47,186,108,0);} 100%{box-shadow:0 0 0 0 rgba(47,186,108,0);} }

.hero-feed { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.hero-feed-item {
  display: flex; align-items: flex-start; gap: 10px; opacity: 0; transform: translateY(10px);
  font-size: 13.5px;
}
.hero-feed-item strong { display: block; font-size: 12px; color: var(--mist); font-weight: 600; margin-bottom: 2px; }
.hero-feed-item p { background: var(--ion-tint); border-radius: 14px 14px 14px 4px; padding: 10px 14px; color: var(--ink); line-height: 1.4; }
.hero-feed-item--out { flex-direction: row-reverse; text-align: right; }
.hero-feed-item--out p { background: var(--ion); color: #fff; border-radius: 14px 14px 4px 14px; }
.feed-avatar {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--mist-line);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--graphite);
}
.feed-avatar--brand { background: var(--ion); color: #fff; }

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 26px; height: 42px; border: 1.5px solid var(--mist-line); border-radius: 100px;
  display: flex; justify-content: center; padding-top: 8px;
}
.scroll-cue span { width: 4px; height: 4px; border-radius: 50%; background: var(--ion); animation: scroll-cue 1.8s infinite; }
@keyframes scroll-cue { 0%{transform:translateY(0);opacity:1;} 70%{transform:translateY(16px);opacity:0;} 100%{opacity:0;} }

/* ==========================================================================
   Problema
   ========================================================================== */
.problema-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 56px; }
.problema-card {
  padding: 32px 26px; border-radius: var(--radius-md); background: var(--white);
  border: 1px solid var(--mist-line); transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s ease;
}
.problema-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -30px rgba(22,23,26,.2); border-color: transparent; }
.problema-icon {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 12px; background: var(--ion-tint); color: var(--ion); margin-bottom: 20px;
}
.problema-icon svg { width: 22px; height: 22px; }
.problema-card h3 { font-size: 18px; margin-bottom: 10px; }
.problema-card p { font-size: 14.5px; color: var(--graphite); line-height: 1.55; }

/* ==========================================================================
   Servicios
   ========================================================================== */
.servicios { background: linear-gradient(180deg, var(--white), var(--ion-tint) 130%); }
.servicios-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
.servicio-card {
  position: relative; background: #fff; border: 1px solid var(--mist-line); border-radius: var(--radius-lg);
  padding: 40px; transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.servicio-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(22,23,26,.22); }
.servicio-card--featured {
  grid-column: 1 / -1; background: var(--ink); border-color: var(--ink);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto auto; gap: 4px 28px;
  align-items: start; padding: 44px;
}
.servicio-card--featured .servicio-icon { grid-row: 1 / 3; color: var(--ion-light); background: rgba(255,255,255,.08); }
.servicio-card--featured h3, .servicio-card--featured p, .servicio-card--featured .servicio-link { grid-column: 2; }
.servicio-card--featured h3 { color: #fff; }
.servicio-card--featured p { color: rgba(255,255,255,.7); }
.servicio-badge {
  grid-column: 2; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ion-light); margin-bottom: 6px;
}
.servicio-icon {
  width: 60px; height: 60px; border-radius: 16px; background: var(--ion-tint); color: var(--ion);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.servicio-icon svg { width: 30px; height: 30px; }
.servicio-card h3 { font-size: 21px; margin-bottom: 12px; max-width: 380px; }
.servicio-card p { font-size: 15px; line-height: 1.6; color: var(--graphite); margin-bottom: 20px; max-width: 460px; }
.servicio-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--ion); }
.servicio-card--featured .servicio-link { color: #fff; }
.servicio-link svg { transition: transform .3s var(--ease-out); }
.servicio-card:hover .servicio-link svg { transform: translateX(4px); }

/* ==========================================================================
   Hub de integraciones
   ========================================================================== */
.integraciones { background: var(--ion-tint); }
.hub {
  position: relative; margin-top: 56px; aspect-ratio: 16 / 9;
  background: var(--ink) url('../assets/images/hub-visual.jpg') center / cover no-repeat;
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: 0 40px 90px -40px rgba(22,23,26,.4);
}
/* El logo animado se posa sobre el centro vacío del anillo de la imagen */
.hub-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 19%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.logo-symbol--hub { width: 88%; color: var(--ion-light); }

/* ==========================================================================
   Como funciona
   ========================================================================== */
.pasos { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 64px; }
/* La línea conecta los centros de los círculos 01 y 03 (círculos de 44px, alineados
   a la izquierda de cada columna; gap del grid = 40px → 2 gaps = 80px). */
.pasos-line { position: absolute; top: 22px; left: 22px; right: calc((100% - 80px) / 3 - 22px); height: 2px; background: var(--mist-line); z-index: 0; }
.pasos-line-fill { display: block; height: 100%; width: 0%; background: var(--ion); }
.paso { position: relative; z-index: 1; }
.paso-num {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--white); border: 1.5px solid var(--ion); color: var(--ion);
  font-family: var(--font-display); font-size: 15px; margin-bottom: 22px;
}
.paso h3 { font-size: 20px; margin-bottom: 10px; }
.paso p { font-size: 15px; color: var(--graphite); line-height: 1.6; max-width: 320px; }

/* ==========================================================================
   Comparativo
   ========================================================================== */
.comparativo { background: var(--ink); }
.comparativo-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 40px; align-items: center; margin-top: 56px;
}
.comparativo-col h3 { color: var(--white); font-size: 15px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 24px; font-weight: 600; font-family: var(--font-body); }
.comparativo-col--before h3 { color: var(--mist); }
.comparativo-col ul { display: flex; flex-direction: column; gap: 18px; }
.comparativo-col li { display: flex; align-items: flex-start; gap: 14px; font-size: 15.5px; line-height: 1.5; color: rgba(255,255,255,.86); }
.comparativo-col--before li { color: rgba(255,255,255,.5); }
.ico { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-top: 1px; }
.ico--minus { background: rgba(255,255,255,.08); color: rgba(255,255,255,.4); }
.ico--check { background: var(--ion); color: #fff; }
.comparativo-divider { display: flex; align-items: center; justify-content: center; }

/* ==========================================================================
   Nosotros
   ========================================================================== */
.nosotros-inner { display: grid; grid-template-columns: 1fr .85fr; gap: 64px; align-items: center; }
.nosotros-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 56px; }
.nosotros-head-left .section-title { margin-bottom: 0; }
.nosotros-text { font-size: 16.5px; line-height: 1.7; color: var(--graphite); margin-bottom: 18px; }
.nosotros-head-right .nosotros-text:last-child { margin-bottom: 0; }

/* Mockup ERP (HTML/CSS, logo real, nítido) */
.erp-showcase { margin: 0; }
.erp {
  display: grid; grid-template-columns: 210px 1fr; overflow: hidden;
  background: #fff; border: 1px solid var(--mist-line); border-radius: var(--radius-lg);
  box-shadow: 0 50px 100px -50px rgba(22,23,26,.4); font-size: 13px;
}
.erp-side { border-right: 1px solid var(--mist-line); padding: 24px 18px; }
.erp-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 30px; padding-left: 4px; }
.erp-brand .logo-symbol { width: 26px; height: 26px; }
.erp-brand-word { font-family: var(--font-display); font-weight: 500; font-size: 18px; color: var(--ion); }
.erp-nav { display: flex; flex-direction: column; gap: 4px; }
.erp-nav span { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--graphite); font-weight: 500; }
.erp-nav span.is-active { background: var(--ion-tint); color: var(--ion); }
.erp-nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.erp-main { padding: 24px 26px; min-width: 0; }
.erp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.erp-title { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--ink); }
.erp-search { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--mist-line); border-radius: 100px; padding: 8px 16px; color: var(--mist); font-size: 12.5px; }
.erp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.erp-kpi { border: 1px solid var(--mist-line); border-radius: 14px; padding: 16px 18px; }
.erp-kpi span { display: block; font-size: 12px; color: var(--mist); margin-bottom: 8px; }
.erp-kpi strong { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--ink); }
.erp-kpi--accent strong { color: var(--ion); }
.erp-card { border: 1px solid var(--mist-line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.erp-card:last-child { margin-bottom: 0; }
.erp-card h4 { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.erp-chart { width: 100%; height: 120px; display: block; }
.erp-table { width: 100%; border-collapse: collapse; }
.erp-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mist); font-weight: 600; padding: 0 0 10px; border-bottom: 1px solid var(--mist-line); }
.erp-table td { padding: 11px 0; border-bottom: 1px solid var(--mist-line); color: var(--ink); font-size: 13px; }
.erp-table tbody tr:last-child td { border-bottom: none; }
.erp-caption { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--mist); }

@media (max-width: 720px) {
  .erp { grid-template-columns: 1fr; font-size: 12px; }
  .erp-side { border-right: none; border-bottom: 1px solid var(--mist-line); padding: 16px 18px; }
  .erp-brand { margin-bottom: 0; }
  .erp-nav { display: none; }
  .erp-main { padding: 18px; }
  .erp-kpis { grid-template-columns: 1fr; }
  .erp-title { font-size: 19px; }
}

/* ==========================================================================
   Por que Valyon
   ========================================================================== */
.porque-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 56px; background: var(--mist-line); border: 1px solid var(--mist-line); border-radius: var(--radius-md); overflow: hidden; }
.porque-card { background: #fff; padding: 36px 28px; transition: background .3s ease; }
.porque-card:hover { background: var(--ion-tint); }
.porque-num { font-family: var(--font-display); color: var(--ion-light); font-size: 26px; display: block; margin-bottom: 18px; }
.porque-card h3 { font-size: 17px; margin-bottom: 10px; }
.porque-card p { font-size: 14px; color: var(--graphite); line-height: 1.55; }

/* ==========================================================================
   CTA final
   ========================================================================== */
.cta-final { background: var(--ion); overflow: hidden; text-align: center; }
.cta-final-field { position: absolute; inset: 0; pointer-events: none; }
.cta-orbit { position: absolute; width: 900px; height: 900px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); top: 50%; left: 50%; transform: translate(-50%,-50%); }
.cta-final-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.cta-final-title { font-size: clamp(30px, 5vw, 50px); color: #fff; letter-spacing: -0.01em; max-width: 720px; margin-bottom: 18px; }
.cta-final-sub { font-size: 18px; color: rgba(255,255,255,.82); max-width: 520px; margin-bottom: 36px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--ink); padding-top: 80px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 56px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand p { color: var(--mist); font-size: 14.5px; margin-top: 18px; max-width: 280px; line-height: 1.6; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 14px; }
.footer-links h4, .footer-contact h4 { color: var(--white); font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.footer-links a, .footer-contact a { color: var(--mist); font-size: 14.5px; transition: color .25s ease; }
.footer-links a:hover, .footer-contact a:hover { color: var(--ion-light); }
.footer-bottom { display: flex; justify-content: space-between; padding: 26px var(--gutter); color: var(--mist); font-size: 13px; }

/* ==========================================================================
   Páginas legales
   ========================================================================== */
.legal { padding: calc(var(--nav-h) + 48px) 0 96px; }
.legal-inner { max-width: 780px; }
.legal-title { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.01em; margin: 10px 0 8px; }
.legal-updated { color: var(--mist); font-size: 14px; margin-bottom: 40px; }
.legal p { font-size: 16px; line-height: 1.75; color: var(--graphite); margin-bottom: 18px; }
.legal h2 { font-size: 21px; margin: 40px 0 14px; color: var(--ink); }
.legal ul { margin: 0 0 18px 4px; display: flex; flex-direction: column; gap: 9px; }
.legal li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.65; color: var(--graphite); }
.legal li::before { content: ''; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--ion); }
.legal a { color: var(--ion); font-weight: 500; }
.legal a:hover { text-decoration: underline; }
.legal strong { color: var(--ink); }
.legal-note { font-size: 13.5px !important; color: var(--mist) !important; border-top: 1px solid var(--mist-line); padding-top: 24px; margin-top: 40px; }
.legal-back { margin-top: 28px; }
.footer-bottom a { color: var(--mist); }
.footer-bottom a:hover { color: var(--ion-light); }

/* ==========================================================================
   Chatbot flotante
   ========================================================================== */
/* pointer-events:none en el contenedor para que su área vacía (la ventana cerrada
   sigue ocupando layout) no intercepte taps sobre el menú móvil u otros elementos.
   El botón y la ventana reactivan los eventos por su cuenta. */
.chatbot { position: fixed; right: 20px; bottom: 20px; z-index: 600; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; pointer-events: none; }
.chatbot-toggle {
  pointer-events: auto;
  width: 60px; height: 60px; border-radius: 50%; background: var(--ion); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 16px 32px -12px rgba(75,73,224,.55);
  transition: transform .3s var(--ease-out);
  position: relative;
}
.chatbot-toggle:hover { transform: scale(1.06); }
.chatbot-icon { position: absolute; transition: opacity .2s ease, transform .3s var(--ease-out); }
.chatbot-icon--close { opacity: 0; transform: scale(.5) rotate(-45deg); }
.chatbot.is-open .chatbot-icon--open { opacity: 0; transform: scale(.5) rotate(45deg); }
.chatbot.is-open .chatbot-icon--close { opacity: 1; transform: scale(1) rotate(0); }

.chatbot-window {
  width: min(370px, calc(100vw - 40px)); height: min(560px, 74vh); background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -20px rgba(22,23,26,.35); overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(16px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease-out), opacity .3s ease;
  transform-origin: bottom right;
}
.chatbot.is-open .chatbot-window { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.chatbot-header { flex-shrink: 0; display: flex; align-items: center; gap: 12px; background: var(--ion); color: #fff; padding: 18px 20px; }
.chatbot-header strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 14.5px; }
.chatbot-header span { display: block; font-size: 12px; color: rgba(255,255,255,.75); }
.chatbot-header > div { flex: 1; }
.chatbot-close { color: #fff; opacity: .8; }
.chatbot-close:hover { opacity: 1; }

.chatbot-whatsapp-pin {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ion-tint); color: var(--ion); padding: 10px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--mist-line); transition: background .25s ease;
}
.chatbot-whatsapp-pin:hover { background: #e7e5fc; }

.chatbot-messages {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px;
  background: #fff;
}
.chatbot-msg {
  max-width: 88%; padding: 11px 15px; border-radius: 14px 14px 14px 4px; font-size: 13.8px; line-height: 1.5;
  background: var(--ion-tint); color: var(--ink);
}
.chatbot-msg--user {
  align-self: flex-end; background: var(--ion); color: #fff; border-radius: 14px 14px 4px 14px;
}

.chatbot-typing { flex-shrink: 0; display: flex; gap: 4px; padding: 0 16px 10px; }
.chatbot-typing[hidden] { display: none; }
.chatbot-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mist); animation: chatbot-bounce 1.2s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chatbot-input-row {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--mist-line); background: #fff;
}
.chatbot-input-row input {
  flex: 1; border: 1px solid var(--mist-line); border-radius: 100px; padding: 10px 16px; font-size: 13.8px;
  font-family: var(--font-body); color: var(--ink); background: var(--white); transition: border-color .2s ease;
}
.chatbot-input-row input:focus { outline: none; border-color: var(--ion); }
.chatbot-input-row input:disabled { opacity: .6; }
.chatbot-send {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--ion); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: transform .25s var(--ease-out), opacity .2s ease;
}
.chatbot-send:hover { transform: scale(1.06); }
.chatbot-send:disabled { opacity: .5; }

/* ==========================================================================
   Scroll reveal base states (JS toggles .is-visible)
   ========================================================================== */
.reveal-up { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-up.is-visible { opacity: 1; transform: translateY(0); }
.reveal-scale { opacity: 0; transform: translateY(20px) scale(.96); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal-scale.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; }
  .problema-grid { grid-template-columns: repeat(2, 1fr); }
  .porque-grid { grid-template-columns: repeat(2, 1fr); }
  .nosotros-inner { grid-template-columns: 1fr; }
  .nosotros-visual { max-width: 380px; margin: 0 auto; }
  .nosotros-head { grid-template-columns: 1fr; gap: 24px; align-items: start; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .nav-toggle { display: flex; }
  .servicios-grid { grid-template-columns: 1fr; }
  .servicio-card--featured { grid-template-columns: 1fr; }
  .servicio-card--featured .servicio-icon { grid-row: auto; }
  .servicio-card--featured h3, .servicio-card--featured p, .servicio-card--featured .servicio-link, .servicio-badge { grid-column: 1; }
  .pasos { grid-template-columns: 1fr; gap: 44px; }
  .pasos-line { display: none; }
  .comparativo-grid { grid-template-columns: 1fr; gap: 32px; text-align: left; }
  .comparativo-divider { transform: rotate(90deg); margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 640px) {
  :root { --nav-h: 72px; }
  .problema-grid { grid-template-columns: 1fr; }
  .porque-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 22px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .chatbot { right: 14px; bottom: 14px; }
  .chatbot-window { width: calc(100vw - 28px); height: min(500px, 72vh); }
  .logo-word-main { font-size: 18px; }
}
