/* =============================================================
   CEREBRA — tech · negro + blanco + violeta
   ============================================================= */
:root {
  --bg:      #050507;
  --bg-2:    #0b0b10;
  --bg-3:    #121218;   /* card */
  --bg-4:    #1b1b24;
  --ink:     #ffffff;
  --ink-2:   #c6c6d4;
  --ink-3:   #83838f;
  --violet:  #7c5cff;
  --violet-2:#a78bff;
  --accent:  #7c5cff;   /* violeta (marca) */
  --accent-2:#a78bff;
  --accent-deep:#5b3fe0;
  --line:    rgba(255,255,255,.1);
  --line-2:  rgba(255,255,255,.2);

  --disp: "Sora", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-soft: cubic-bezier(0.25,0.46,0.45,0.94);
  --pad: clamp(1.2rem, 5vw, 5.5rem);
  --maxw: 1300px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1,h2,h3,h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; font-weight: 600; font-family: var(--disp); }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: var(--bg); z-index: 9999; border-radius: 6px; font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* Cursor */
.cursor { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.is-ready { opacity: 1; }
.cursor-dot { position: fixed; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translate(-50%,-50%); }
.cursor-ring { position: fixed; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--violet-2); transform: translate(-50%,-50%); transition: width .25s var(--ease-out), height .25s var(--ease-out), border-color .25s, background .25s; }
.cursor.is-hover .cursor-ring { width: 56px; height: 56px; border-color: var(--accent); background: rgba(124,92,255,.08); }
@media (hover: none) { .cursor { display: none; } }

/* Type helpers */
.kicker { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1.2rem; }
.kicker--accent { color: var(--accent); }
.lead { font-size: clamp(1.05rem,1.5vw,1.28rem); color: var(--ink-2); max-width: 56ch; margin-top: 1.3rem; }
.section-lead { color: var(--ink-2); max-width: 54ch; margin-top: 1.2rem; }
em { font-style: normal; color: var(--accent); }
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; transition: none; }
[data-reveal] { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
[data-reveal].is-in { opacity: 1; transform: none; }
.split-line { display: block; overflow: hidden; }
.split-line > span { display: block; transform: translateY(110%); transition: transform .85s var(--ease-out); }
[data-split].is-in .split-line > span { transform: none; }

h1.hero-title { font-family: var(--disp); font-weight: 700; font-size: clamp(2.5rem, 6.5vw, 5.4rem); line-height: 1; letter-spacing: -0.035em; }
.hero-mega {
  font-family: var(--disp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.2rem, 11vw, 5rem); line-height: .9; letter-spacing: -0.04em;
  white-space: nowrap; width: 100%; margin: .1rem 0 1.3rem;
  background: linear-gradient(177deg, #ffffff 0%, rgba(255,255,255,.9) 45%, rgba(255,255,255,.32) 82%, rgba(255,255,255,.08) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 6px 40px rgba(0,0,0,.35));
}
.hero .hero-inner { max-width: 100%; }
h2 { font-size: clamp(1.9rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .95rem 1.8rem; border-radius: 100px; font-weight: 600; font-size: .92rem; font-family: var(--disp); transition: background .3s var(--ease-out), color .3s, border-color .3s, transform .25s var(--ease-out), box-shadow .3s; border: 1px solid transparent; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 30px -10px rgba(124,92,255,.5); }
.btn-accent:hover { background: var(--accent-2); box-shadow: 0 14px 40px -12px rgba(124,92,255,.6); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-check { width: 20px; height: 20px; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .3s var(--ease-out); }
.btn.is-sent { background: #16351f; color: #7bfcae; box-shadow: none; }
.btn.is-sent .btn-check { opacity: 1; transform: scale(1); }

/* Splash */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg); animation: splashSafety .01s 4.5s forwards; }
.splash-inner { display: grid; gap: 1.2rem; justify-items: center; }
.splash-logo { width: min(200px,55vw); height: auto; }
.splash-bar { width: 200px; height: 2px; background: var(--bg-4); overflow: hidden; border-radius: 2px; }
.splash-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,var(--violet),var(--accent)); animation: splashLoad 1.5s var(--ease-out) forwards; }
.splash.is-out { opacity: 0; pointer-events: none; transition: opacity .6s var(--ease-out); }
@keyframes splashLoad { to { width: 100%; } }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; visibility: hidden; } }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem var(--pad); transition: background .4s var(--ease-out), padding .4s, border-color .4s; border-bottom: 1px solid transparent; }
.nav.is-stuck { background: rgba(5,5,7,.82); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); border-bottom-color: var(--line); padding-block: .8rem; }
.brand img { height: 26px; width: auto; }
.nav-links { display: none; gap: 1.9rem; }
.nav-links a { font-size: .88rem; color: var(--ink-2); position: relative; padding: .2rem 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--accent); transition: width .35s var(--ease-out); }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: none; padding: .6rem 1.3rem; }
.nav-toggle { display: flex; flex-direction: column; gap: 5px; padding: .5rem; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .35s var(--ease-out), opacity .3s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
.nav-drawer { position: fixed; inset: 0; z-index: 890; background: rgba(5,5,7,.98); backdrop-filter: blur(8px); display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: var(--pad); transform: translateY(-100%); transition: transform .5s var(--ease-out); }
.nav-drawer.is-open { transform: translateY(0); }
.nav-drawer a { font-family: var(--disp); font-weight: 600; font-size: clamp(1.8rem,7vw,2.6rem); color: var(--ink); padding: .3rem 0; border-bottom: 1px solid var(--line); }
.nav-drawer a:hover { color: var(--accent); padding-left: .5rem; }

/* Hero — video full screen */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: stretch; padding: 6.4rem var(--pad) 2.4rem; overflow: hidden; background: var(--bg); }
.hero-video { position: absolute; inset: 0; z-index: 0; }
.hero-video video { width: 100%; height: 100%; object-fit: cover; }
.hero-grade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,5,7,.5) 0%, rgba(5,5,7,.15) 35%, rgba(5,5,7,.45) 70%, rgba(5,5,7,.92) 100%), linear-gradient(90deg, rgba(5,5,7,.75) 0%, transparent 60%); }
.hero-inner { position: relative; z-index: 3; width: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.hero-top { width: 100%; }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.hero-title { color: var(--ink); max-width: 18ch; margin-bottom: 1.6rem; text-shadow: 0 4px 50px rgba(0,0,0,.55); }
.hero-sub { color: var(--ink-2); max-width: 42ch; font-size: clamp(1.05rem,1.6vw,1.32rem); margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; flex-shrink: 0; }
.hero-scroll { position: absolute; bottom: 1.6rem; right: var(--pad); z-index: 3; font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }

/* Marquee */
.marquee { overflow: hidden; background: linear-gradient(90deg, #1a1030, #2a1a55); color: #fff; padding-block: .9rem; border-block: 1px solid rgba(255,255,255,.12); }
.marquee-track { display: flex; align-items: center; gap: 1.8rem; width: max-content; animation: marquee 34s linear infinite; }
.marquee-track span { font-family: var(--disp); font-weight: 600; font-size: clamp(1rem,2vw,1.4rem); white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--accent-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
section { padding: clamp(4.5rem,9vw,8rem) var(--pad); }
.section-head { max-width: var(--maxw); margin: 0 auto clamp(2.4rem,5vw,4rem); }

/* Intro */
.intro { background: var(--bg); text-align: center; }
.intro-inner { max-width: 900px; margin: 0 auto; }
.intro h2 { margin: 0 auto; }
.intro .lead { margin-inline: auto; }

/* Algos */
.algos { background: var(--bg-2); }
.algo-grid { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 1.3rem; }
.algo { padding: 2rem 1.8rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg,var(--bg-3),var(--bg-2)); transition: border-color .4s, transform .4s var(--ease-out); transform-style: preserve-3d; }
.algo:hover { border-color: var(--accent); }
.algo-ic { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 14px; background: rgba(123,108,255,.14); border: 1px solid var(--line); margin-bottom: 1.2rem; }
.algo-ic img { width: 32px; height: 32px; }
.algo h3 { margin-bottom: .6rem; }
.algo p { color: var(--ink-2); font-size: .95rem; }

/* Chatbots */
.chatbots { background: var(--bg); }
.chat-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2.6rem; align-items: center; }
.chat-points { list-style: none; display: grid; gap: 1.2rem; margin: 1.8rem 0 2.2rem; }
.chat-points li { display: grid; gap: .2rem; padding-left: 1.5rem; position: relative; }
.chat-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.chat-points strong { font-family: var(--disp); font-weight: 600; }
.chat-points span { color: var(--ink-2); font-size: .95rem; }
.chat-figure { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); transform-style: preserve-3d; }
.chat-figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* Data */
.data { background: var(--bg-2); }
.data-grid { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 1.3rem; }
.dcard { padding: 2rem 1.8rem; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-3); transition: border-color .4s, transform .4s var(--ease-out); transform-style: preserve-3d; }
.dcard:hover { border-color: var(--accent); }
.dcard-ic { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 14px; background: rgba(124,92,255,.1); margin-bottom: 1.2rem; }
.dcard-ic img { width: 34px; height: 34px; }
.dcard h3 { margin-bottom: .6rem; }
.dcard p { color: var(--ink-2); font-size: .95rem; }
.stats-band { max-width: var(--maxw); margin: clamp(2.5rem,5vw,4rem) auto 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sband { background: var(--bg-3); padding: 1.8rem; display: flex; flex-direction: column; gap: .3rem; }
.sband-n { font-family: var(--disp); font-weight: 700; font-size: clamp(2.2rem,5vw,3.2rem); color: var(--ink); line-height: 1; }
.sband-n b { color: var(--accent); font-weight: 700; }
.sband-l { font-size: .85rem; color: var(--ink-3); }

/* About */
.about { background: var(--bg); }
.about-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2.6rem; align-items: center; }
.about-figure { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); transform-style: preserve-3d; }
.about-figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.about-tags { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.about-tags span { font-family: var(--mono); font-size: .78rem; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 100px; padding: .45rem .95rem; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, #1a1440 0%, #0b0a14 60%); text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: -40% 20% auto; height: 400px; background: radial-gradient(50% 50% at 50% 0%, rgba(123,108,255,.35), transparent 70%); filter: blur(40px); pointer-events: none; }
.cta-inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; }
.cta-inner .lead { margin-inline: auto; }
.cta-inner .btn { margin-top: 2rem; }
.cta-office { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 1.8rem; }

/* FAQ */
.faq { background: var(--bg-2); }
.faq-list { max-width: 900px; margin: 0 auto; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; padding: 1.5rem 3rem 1.5rem 0; position: relative; font-family: var(--disp); font-weight: 600; font-size: clamp(1.05rem,2vw,1.3rem); transition: color .3s; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--accent); transition: transform .35s var(--ease-out); }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }
.faq-a { padding: 0 3rem 1.6rem 0; }
.faq-a p { color: var(--ink-2); max-width: 66ch; }

/* Contact */
.contact { background: var(--bg); }
.contact-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2.8rem; }
.contact-data { list-style: none; margin-top: 2.2rem; display: grid; gap: 1.1rem; }
.contact-data li { display: grid; gap: .15rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.contact-data span { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.contact-data a { font-size: 1.05rem; color: var(--ink); }
.contact-data a[href]:hover { color: var(--accent); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; padding: 1.8rem; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); align-content: start; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--full { grid-column: 1/-1; }
.field label { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.field input, .field select, .field textarea { font: inherit; font-size: .95rem; color: var(--ink); background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; transition: border-color .3s, box-shadow .3s; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.15); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c5cff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.4rem; }
.contact-legal { grid-column: 1/-1; font-size: .76rem; color: var(--ink-3); text-align: center; margin-top: .2rem; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Footer */
.footer { background: var(--bg-2); color: var(--ink-2); padding: clamp(3rem,6vw,4.5rem) var(--pad) 2rem; border-top: 1px solid var(--line); }
.footer-top { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2.2rem; }
.footer-brand img { height: 30px; width: auto; }
.footer-tag { margin-top: 1rem; color: var(--ink-3); max-width: 42ch; font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; }
.footer-nav a { font-size: .9rem; color: var(--ink-2); }
.footer-nav a:hover { color: var(--accent); }
.footer-contact { display: grid; gap: .5rem; }
.footer-contact a { font-size: .9rem; }
.footer-contact a:hover { color: var(--accent); }
.footer-bottom { max-width: var(--maxw); margin: 2.6rem auto 0; padding-top: 1.6rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; color: var(--ink-3); font-size: .82rem; font-family: var(--mono); }

/* WhatsApp */
.wa-bubble { position: fixed; z-index: 950; right: clamp(1rem,3vw,2rem); bottom: clamp(1rem,3vw,2rem); display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 10px 30px -6px rgba(37,211,102,.5), 0 4px 12px rgba(0,0,0,.3); transition: transform .35s var(--ease-out); }
.wa-bubble svg { width: 28px; height: 28px; }
.wa-bubble:hover { transform: translateY(-3px) scale(1.05); }
.wa-bubble::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(37,211,102,.5); animation: waPulse 2.6s var(--ease-out) infinite; }
@keyframes waPulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

/* Responsive */
@media (min-width: 720px) {
  .algo-grid { grid-template-columns: repeat(2,1fr); }
  .data-grid { grid-template-columns: repeat(3,1fr); }
  .contact-form { grid-template-columns: 1fr 1fr; }
  .stats-band { grid-template-columns: repeat(4,1fr); }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .algo-grid { grid-template-columns: repeat(4,1fr); }
  .chat-inner { grid-template-columns: 1.05fr .95fr; gap: 4rem; }
  .about-inner { grid-template-columns: .95fr 1.05fr; gap: 4rem; }
  .contact-inner { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: 90s; }
  .wa-bubble::after { animation: none; }
  .splash-bar i { animation-duration: .01s; }
}

/* Selector de idioma */
.lang-switch { display: none; align-items: center; gap: .4rem; font-family: var(--mono); font-size: .78rem; }
.lang-switch a { color: var(--ink-3); transition: color .3s; }
.lang-switch a.is-active { color: var(--ink); }
.lang-switch a:hover { color: var(--accent); }
.lang-switch span { color: var(--ink-3); }
@media (min-width: 960px) { .lang-switch { display: inline-flex; } }

/* Ajustes hero en mobile: botones apilados y espacio para la burbuja */
@media (max-width: 640px) {
  .hero { padding-bottom: 5.5rem; }
  .hero-bottom { gap: 1.2rem; }
  .hero-sub { max-width: 100%; }
  .hero-actions { width: 100%; gap: .8rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-scroll { display: none; }
}

/* Movimiento/flow en las imágenes de secciones (chatbots y nosotros) */
.chat-figure, .about-figure { overflow: hidden; }
.chat-figure img, .about-figure img { filter: saturate(1.05) brightness(.95); animation: cereFlow 20s ease-in-out infinite alternate; will-change: transform; transform-origin: 55% 45%; }
@keyframes cereFlow { 0% { transform: scale(1.03) translate3d(0,0,0); } 100% { transform: scale(1.13) translate3d(-2%,-1.5%,0); } }
@media (prefers-reduced-motion: reduce) { .chat-figure img, .about-figure img { animation: none; transform: scale(1.03); } }
