/* ===================================================================
   Melin Automations — Premium SaaS theme
   Paleta: Morado #6A0DAD · Naranja #FF7A00 · Negro #080808 · Blanco
=================================================================== */

:root {
  --purple: #6A0DAD;
  --purple-light: #A855F7;
  --orange: #FF7A00;
  --orange-light: #FF9D3D;
  --black: #080808;
  --bg: #080808;
  --bg-alt: #0d0b12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --white: #ffffff;
  --text: #ECEAF1;
  --muted: #A39FB0;
  --muted-2: #7E7A8C;
  --grad: linear-gradient(120deg, var(--purple-light), var(--purple) 45%, var(--orange) 110%);
  --grad-soft: linear-gradient(120deg, #8B2FD6, #FF7A00);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --shadow: 0 30px 80px -30px rgba(106, 13, 173, 0.45);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Sora', var(--font);
}

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

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

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

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Background decoration ===== */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; }
.glow--purple { width: 620px; height: 620px; background: var(--purple); top: -180px; left: -120px; }
.glow--orange { width: 480px; height: 480px; background: var(--orange); top: 380px; right: -160px; opacity: 0.28; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font);
  font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--grad-soft); color: #fff;
  box-shadow: 0 10px 30px -8px rgba(255, 122, 0, .45), 0 6px 20px -10px rgba(106,13,173,.6);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(255,122,0,.6); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); transform: translateY(-2px); border-color: rgba(255,255,255,.28); }
.btn--lg { padding: 16px 30px; font-size: 16px; }
.btn--sm { padding: 10px 18px; font-size: 14px; }

/* ===== Navbar ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 8, 8, .72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { display: grid; place-items: center; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand__accent { color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; margin-left: 2px; }
.nav__links { display: flex; gap: 30px; }
.nav__links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--white); }
.nav__cta { margin-left: 4px; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: .3s; }
.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); }

.nav__mobile {
  display: none; flex-direction: column; gap: 4px; padding: 12px 24px 22px;
  background: rgba(10,9,14,.96); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav__mobile a { padding: 12px 0; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border); }
.nav__mobile .btn { margin-top: 14px; }
.nav__mobile.open { display: flex; }

/* ===== Hero ===== */
.hero { position: relative; padding: 150px 0 90px; }
.hero__inner { max-width: 820px; }
.badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; color: var(--muted); font-weight: 500;
}
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,122,0,.18); }
.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.05; letter-spacing: -.03em;
  margin: 24px 0 0;
}
.gradient-text { color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; display: inline-block; }
.hero__subtitle { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); margin-top: 22px; max-width: 660px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.hero__stats { display: flex; align-items: center; gap: 26px; margin-top: 56px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; }
.stat__label { font-size: 13.5px; color: var(--muted-2); margin-top: 2px; }
.stat__divider { width: 1px; height: 40px; background: var(--border); }

/* Hero chat visual */
.hero__visual { position: absolute; right: max(24px, calc((100vw - var(--maxw)) / 2 + 24px)); top: 150px; width: 340px; display: none; }
.chat {
  background: linear-gradient(180deg, rgba(20,16,28,.92), rgba(12,10,18,.92));
  border: 1px solid var(--border-strong); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
  animation: float 6s ease-in-out infinite;
}
.chat__head { display: flex; align-items: center; gap: 11px; padding: 16px; border-bottom: 1px solid var(--border); }
.chat__avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--grad-soft); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.chat__head strong { display: block; font-size: 14.5px; }
.chat__status { font-size: 12px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.chat__status .dot { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.2); }
.chat__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.bubble--in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble--out { align-self: flex-end; background: var(--grad-soft); color: #fff; border-bottom-right-radius: 5px; }
.bubble--typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble--typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.bubble--typing span:nth-child(2) { animation-delay: .2s; }
.bubble--typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { opacity:.3; transform: translateY(0);} 30% { opacity:1; transform: translateY(-3px);} }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-14px);} }

/* ===== Logos strip ===== */
.logos { padding: 30px 0 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.012); }
.logos__label { text-align: center; font-size: 13px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; }
.logos__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; margin-top: 18px; }
.logos__row span { color: var(--muted); font-weight: 600; font-size: 15px; opacity: .8; transition: opacity .2s, color .2s; }
.logos__row span:hover { opacity: 1; color: var(--white); }

/* ===== Sections ===== */
.section { padding: 100px 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(106,13,173,.05), transparent); }
.section__head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; margin-bottom: 14px;
}
.section__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em; }
.section__lead { color: var(--muted); font-size: 1.08rem; margin-top: 16px; }

/* ===== Grid ===== */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Cards (servicios) ===== */
.card {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s, border-color .3s, background .3s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .3s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover { transform: translateY(-5px); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px; color: #fff; }
.icon--purple { background: linear-gradient(135deg, var(--purple-light), var(--purple)); box-shadow: 0 10px 24px -10px rgba(106,13,173,.7); }
.icon--orange { background: linear-gradient(135deg, var(--orange-light), var(--orange)); box-shadow: 0 10px 24px -10px rgba(255,122,0,.7); }
.card h3 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
.card p { color: var(--muted); margin-top: 10px; font-size: .98rem; }

/* ===== Beneficios ===== */
.benefit { display: flex; gap: 15px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .3s, border-color .3s; }
.benefit:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.benefit__check { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: rgba(255,122,0,.14); color: var(--orange-light); border: 1px solid rgba(255,122,0,.3); }
.benefit h3 { font-size: 1.06rem; font-weight: 700; font-family: var(--font-display); }
.benefit p { color: var(--muted); font-size: .94rem; margin-top: 5px; }

/* ===== Timeline (proceso) ===== */
.timeline { max-width: 760px; margin: 0 auto; list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--purple), var(--orange)); opacity: .4; }
.timeline__item { display: flex; gap: 24px; padding: 18px 0; position: relative; }
.timeline__num { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; background: var(--bg-alt); border: 1px solid var(--border-strong); color: var(--white); position: relative; z-index: 1; }
.timeline__item:hover .timeline__num { background: var(--grad-soft); border-color: transparent; }
.timeline__content { padding-top: 6px; }
.timeline__content h3 { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; }
.timeline__content p { color: var(--muted); margin-top: 5px; }

/* ===== Métricas (casos) ===== */
.metric { padding: 30px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-align: left; transition: transform .3s, border-color .3s; }
.metric:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.metric__num { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; letter-spacing: -.03em; line-height: 1; }
.metric h3 { font-size: 1.05rem; font-weight: 700; margin-top: 14px; }
.metric p { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.casos__disclaimer { text-align: center; color: var(--muted-2); font-size: 13px; margin-top: 28px; }

/* ===== Final CTA ===== */
.finalcta { padding: 90px 0; }
.finalcta__box {
  position: relative; text-align: center; padding: 64px 32px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(ellipse 80% 120% at 50% 0%, rgba(106,13,173,.35), transparent 70%), var(--bg-alt);
  border: 1px solid var(--border-strong);
}
.finalcta__box::after { content: ""; position: absolute; bottom: -120px; right: -60px; width: 380px; height: 380px; background: var(--orange); filter: blur(130px); opacity: .22; border-radius: 50%; }
.finalcta__title { position: relative; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em; max-width: 720px; margin: 0 auto; }
.finalcta__sub { position: relative; color: var(--muted); font-size: 1.1rem; margin: 18px auto 32px; max-width: 600px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: rgba(255,255,255,.012); }
.footer__inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer__brand p { color: var(--muted); margin: 14px 0 16px; max-width: 320px; font-size: .96rem; }
.footer__mail { color: var(--orange-light); font-weight: 600; transition: color .2s; }
.footer__mail:hover { color: var(--orange); }
.footer__col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin-bottom: 16px; }
.footer__col a { display: block; color: var(--muted); padding: 6px 0; transition: color .2s; }
.footer__col a:hover { color: var(--white); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 13.5px; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Legal pages ===== */
.legal { padding: 140px 0 80px; }
.legal__inner { max-width: 800px; margin: 0 auto; }
.legal h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.025em; }
.legal__updated { color: var(--muted-2); margin-top: 10px; font-size: 14px; }
.legal h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 40px 0 12px; }
.legal p { color: var(--muted); margin-bottom: 14px; }
.legal ul { color: var(--muted); margin: 0 0 16px 22px; }
.legal li { margin-bottom: 8px; }
.legal__note { margin-top: 40px; padding: 22px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.legal__note a { color: var(--orange-light); font-weight: 600; }
.legal__back { display: inline-flex; align-items: center; gap: 8px; margin-top: 36px; color: var(--muted); font-weight: 500; }
.legal__back:hover { color: var(--white); }

/* ===== Responsive ===== */
@media (min-width: 1080px) {
  .hero__visual { display: block; }
  .hero__inner { max-width: 660px; }
}
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .grid--3 { grid-template-columns: 1fr; }
  .section { padding: 76px 0; }
  .hero { padding: 130px 0 60px; }
  .footer__inner { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
  .hero__stats { gap: 16px; }
  .stat__divider { display: none; }
  .btn--lg { width: 100%; }
  .hero__actions { flex-direction: column; }
  .finalcta__box { padding: 44px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
