:root {
  --radius: 0.75rem;
  --background: oklch(16% .05 270);
  --foreground: oklch(98% .005 250);
  --card: oklch(20% .05 268);
  --muted-foreground: oklch(72% .03 260);
  --primary: oklch(62% .22 260);
  --primary-foreground: oklch(99% .005 250);
  --accent: oklch(55% .28 305);
  --accent-foreground: oklch(99% .005 250);
  --border: oklch(100% 0 0/.1);
  --gradient-brand: linear-gradient(135deg, oklch(62% .22 260), oklch(55% .28 305));
  --gradient-hero: radial-gradient(ellipse at top, oklch(55% .28 305/.35), transparent 60%),
                   radial-gradient(ellipse at bottom left, oklch(62% .22 260/.3), transparent 60%);
  --shadow-glow: 0 20px 60px -20px oklch(55% .28 305/.45);
  --shadow-elegant: 0 30px 80px -30px oklch(62% .22 260/.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; border-color: var(--border); }

#scroll-progress { position: fixed; left: 0; top: 0; z-index: 60; height: 2px; width: 0%; transition: width .15s; background: var(--gradient-brand); }
.code-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.code-bg span { position: absolute; font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; color: oklch(98% .005 250 / .04); white-space: nowrap; }
.code-bg .cb-2xl { font-size: 1.5rem; }
.code-bg .cb-xl { font-size: 1.25rem; }
.code-bg .cb-lg { font-size: 1.125rem; }
.code-bg .cb-base { font-size: 1rem; }
.code-bg .cb-sm { font-size: .875rem; }
.code-bg .cb-xs { font-size: .75rem; }
.code-bg .cb-10 { font-size: .625rem; }
header, #top, .stats, section, footer, .contact-box .inner { position: relative; z-index: 1; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.max-w-4xl { max-width: 56rem; margin-inline: auto; }
.max-w-7xl { max-width: 80rem; margin-inline: auto; }
.max-w-5xl { max-width: 64rem; margin-inline: auto; }
.max-w-2xl { max-width: 42rem; margin-inline: auto; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.section { padding-top: 6rem; padding-bottom: 6rem; }

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-bg { background: var(--gradient-brand); }
.hero-glow { background: var(--gradient-hero); }
.glass-card {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: linear-gradient(oklch(100% 0 0/.05), oklch(100% 0 0/.02));
  border: 1px solid oklch(100% 0 0/.08);
}
.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-elegant { box-shadow: var(--shadow-elegant); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all .2s ease;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--gradient-brand); color: var(--primary-foreground); box-shadow: var(--shadow-elegant); }
.btn-primary:hover { opacity: .9; }
.btn-outline { border: 1px solid var(--border); background: oklch(20% .05 268 / .4); color: var(--foreground); }
.btn-outline:hover { background: var(--card); }
.btn svg { width: 1rem; height: 1rem; }

.tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: oklch(55% .28 305); }

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  width: 100%;
  border-bottom: 1px solid transparent;
  background: oklch(16% .05 270 / .4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all .3s ease;
}
header.scrolled {
  border-bottom-color: var(--border);
  background: oklch(16% .05 270 / .8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-elegant);
}
.nav-wrap {
  margin-inline: auto; max-width: 80rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem; padding-inline: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon {
  height: 3rem; width: 3rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem; background: #fff; box-shadow: 0 10px 25px -5px rgba(0,0,0,.3); flex-shrink: 0;
}
.brand-icon img { height: 2.25rem; width: 2.25rem; object-fit: contain; }
.brand-text { display: none; flex-direction: column; line-height: 1.2; }
.brand-text .name { font-size: 0.875rem; font-weight: 700; }
.brand-text .sub { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted-foreground); }
nav.links { display: none; align-items: center; gap: 2rem; font-size: 0.875rem; color: var(--muted-foreground); }
nav.links a:hover { color: var(--foreground); }

/* ---------- Hero ---------- */
#top { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-carousel { position: absolute; inset: 0; }
.hero-carousel img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.hero-carousel img.active { opacity: 1; }
.hero-carousel img.contain { object-fit: contain; }
.hero-overlay { position: absolute; inset: 0; background: oklch(16% .05 270 / .8); }
.hero-glow-layer { position: absolute; inset: 0; pointer-events: none; }
.hero-content { position: relative; z-index: 10; margin-inline: auto; max-width: 56rem; padding: 8rem 1.5rem; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 999px;
  border: 1px solid var(--border); background: oklch(20% .05 268 / .6); padding: 0.25rem 0.75rem;
  font-size: 0.75rem; color: var(--muted-foreground);
}
.hero-badge svg { width: 0.875rem; height: 0.875rem; color: oklch(55% .28 305); }
.hero-content h1 { margin-top: 1.5rem; font-size: 3rem; font-weight: 700; line-height: 1.05; }
.hero-content p { margin: 1.5rem auto 0; max-width: 36rem; font-size: 1.125rem; color: var(--muted-foreground); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 2rem; display: flex; justify-content: center; gap: 0.5rem; z-index: 20; }
.carousel-dots button { height: 0.375rem; border-radius: 999px; background: rgba(255,255,255,.4); width: 0.5rem; border: none; cursor: pointer; transition: all .3s; padding: 0; }
.carousel-dots button.active { width: 2rem; background: #fff; }

/* ---------- Stats ---------- */
.stats { border-top: 1px solid oklch(100% 0 0/.06); border-bottom: 1px solid oklch(100% 0 0/.06); background: oklch(20% .05 268 / .3); }
.stats-grid { margin-inline: auto; max-width: 64rem; display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1.5rem; text-align: center; }
.stat .value { font-size: 2.25rem; font-weight: 700; }
.stat .label { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Section heading ---------- */
.section-head { margin-inline: auto; max-width: 42rem; text-align: center; }
.section-head h2 { margin-top: 0.75rem; font-size: 2.5rem; font-weight: 700; }
.section-head p { margin-top: 1rem; color: var(--muted-foreground); }

/* ---------- Nosotros ---------- */
.mv-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
.mv-card { border-radius: 1rem; padding: 2rem; }
.mv-card h3 { font-size: 1.25rem; font-weight: 600; }
.mv-card p { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
.values-title { margin-top: 4rem; text-align: center; font-size: 1.5rem; font-weight: 700; }
.values-grid { margin-top: 2rem; display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.value-card { border-radius: 1rem; padding: 1.5rem; }
.value-icon { display: inline-flex; height: 2.5rem; width: 2.5rem; align-items: center; justify-content: center; border-radius: 0.75rem; }
.value-icon svg { height: 1.25rem; width: 1.25rem; color: var(--primary-foreground); }
.value-card h4 { margin-top: 1rem; font-size: 1rem; font-weight: 600; }
.value-card p { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
.purpose-box { margin-top: 4rem; border-radius: 1.5rem; border: 1px solid var(--border); background: oklch(20% .05 268 / .4); padding: 2.5rem; text-align: center; }
.purpose-icon { display: inline-flex; height: 3rem; width: 3rem; align-items: center; justify-content: center; border-radius: 999px; margin-inline: auto; }
.purpose-icon svg { height: 1.5rem; width: 1.5rem; color: var(--primary-foreground); }
.purpose-box h3 { margin-top: 1.25rem; font-size: 1.25rem; font-weight: 600; }
.purpose-box p { margin: 0.75rem auto 0; max-width: 42rem; color: var(--muted-foreground); }
.slogan { margin-top: 2.5rem; text-align: center; }
.slogan p { margin: 0.75rem auto 0; max-width: 48rem; font-size: 1.5rem; font-weight: 700; line-height: 1.4; }

/* ---------- Servicios ---------- */
.service-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.services-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
.service-card { position: relative; border-radius: 1rem; padding: 2rem; transition: transform .2s ease, box-shadow .2s ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.service-card.featured { box-shadow: var(--shadow-glow); outline: 2px solid oklch(55% .28 305 / .6); outline-offset: 0; }
.service-badge {
  position: absolute; top: -0.75rem; left: 1.5rem; display: inline-flex; align-items: center; gap: 0.25rem;
  border-radius: 999px; background: var(--gradient-brand); padding: 0.25rem 0.75rem; font-size: 0.625rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary-foreground); box-shadow: var(--shadow-glow);
}
.service-badge svg { width: 0.65rem; height: 0.65rem; fill: currentColor; }
.service-icon { display: inline-flex; height: 3rem; width: 3rem; align-items: center; justify-content: center; border-radius: 0.75rem; box-shadow: var(--shadow-glow); background: var(--gradient-brand); }
.service-card.featured .service-icon { background: oklch(55% .28 305); }
.service-icon svg { height: 1.5rem; width: 1.5rem; color: var(--primary-foreground); }
.service-card h3 { margin-top: 1.25rem; font-size: 1.125rem; font-weight: 600; }
.service-card p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- ControlaPro ---------- */
#controlapro { position: relative; overflow: hidden; padding-top: 6rem; padding-bottom: 6rem; }
.cp-grid { position: relative; margin-inline: auto; max-width: 80rem; display: grid; gap: 3rem; padding-inline: 1.5rem; align-items: center; }
.cp-image { display: flex; align-items: center; justify-content: center; }
.cp-image img { height: auto; max-height: 480px; width: auto; max-width: 100%; cursor: zoom-in; border-radius: 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow-elegant); transition: transform .2s ease; }
.cp-image img:hover { transform: scale(1.02); }
.cp-text { text-align: center; }
.cp-badge { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 999px; border: 1px solid oklch(55% .28 305 / .4); background: oklch(55% .28 305 / .1); padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: oklch(55% .28 305); }
.cp-logo { margin: 1rem auto; height: 4rem; }
.cp-text h2 { font-size: 2rem; font-weight: 700; }
.cp-text > p { margin-top: 1rem; color: var(--muted-foreground); }
.cp-features { margin-top: 2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.cp-feature { display: flex; align-items: center; gap: 0.75rem; border-radius: 0.75rem; border: 1px solid var(--border); background: oklch(20% .05 268 / .4); padding: 0.75rem; font-size: 0.875rem; }
.cp-feature svg { width: 1.25rem; height: 1.25rem; color: oklch(55% .28 305); flex-shrink: 0; }
.cp-demo-btn { margin-top: 2rem; }

/* ---------- Proceso ---------- */
.process-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
.process-card { border-radius: 1rem; padding: 2rem; }
.process-card .n { font-size: 2.25rem; font-weight: 700; }
.process-card h3 { margin-top: 0.75rem; font-size: 1.125rem; font-weight: 600; }
.process-card p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Tecnologias ---------- */
.tech-cloud { margin-top: 3rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.tech-pill { border-radius: 999px; border: 1px solid var(--border); background: oklch(20% .05 268 / .4); padding: 0.5rem 1.25rem; font-size: 0.875rem; color: var(--muted-foreground); transition: all .2s; }
.tech-pill:hover { color: var(--foreground); border-color: oklch(55% .28 305 / .6); }

/* ---------- Sectores ---------- */
.sectors-grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.sector-card { border-radius: 0.75rem; padding: 1.5rem; text-align: center; font-size: 0.875rem; font-weight: 500; transition: transform .2s, box-shadow .2s; }
.sector-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }

/* ---------- Testimonios ---------- */
.testimonials-grid { margin-top: 3.5rem; display: grid; gap: 1.5rem; }
.testimonial { border-radius: 1rem; padding: 2rem; }
.testimonial blockquote { font-size: 0.875rem; line-height: 1.6; color: oklch(98% .005 250 / .9); }
.testimonial figcaption { margin-top: 1.5rem; border-top: 1px solid oklch(100% 0 0/.06); padding-top: 1rem; }
.testimonial .name { font-weight: 600; }
.testimonial .role { font-size: 0.75rem; color: var(--muted-foreground); }

/* ---------- Contacto ---------- */
#contacto { margin-inline: auto; max-width: 80rem; padding: 6rem 1.5rem; }
.contact-box { position: relative; overflow: hidden; border-radius: 1.5rem; border: 1px solid var(--border); padding: 3rem 1.5rem; text-align: center; }
.contact-box .inner { position: relative; }
.contact-box h2 { font-size: 2.5rem; font-weight: 700; }
.contact-box p { margin: 1rem auto 0; max-width: 36rem; color: var(--muted-foreground); }
.contact-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid oklch(100% 0 0/.06); background: oklch(20% .05 268 / .3); }
.footer-grid { margin-inline: auto; max-width: 80rem; display: grid; gap: 2.5rem; padding: 3.5rem 1.5rem; }
.footer-brand img { height: 2.5rem; width: auto; }
.footer-brand p { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.footer-brand .email { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.footer-brand .email:hover { color: var(--foreground); }
.footer-col h4 { font-size: 0.875rem; font-weight: 600; }
.footer-col ul { margin-top: 1rem; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.footer-col ul a:hover { color: var(--foreground); }
.footer-bottom { border-top: 1px solid oklch(100% 0 0/.06); }
.footer-bottom-inner { margin-inline: auto; max-width: 80rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.social-links { display: flex; align-items: center; gap: 1rem; }
.social-links a:hover { color: var(--foreground); }
.social-links svg { width: 1rem; height: 1rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; will-change: opacity, transform; transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1); transform: translateY(28px); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: oklch(0% 0 0 / .85); padding: 2rem; cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-height: 85vh; max-width: 90vw; width: auto; height: auto; border-radius: 1.5rem; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-content h1 { font-size: 3.75rem; }
  .sectors-grid { grid-template-columns: repeat(3, 1fr); }
  .brand-text { display: flex; }
  .service-card.featured { grid-column: span 2 / span 2; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .mv-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-bottom-inner { flex-direction: row; }
  nav.links { display: flex; }
}
@media (min-width: 1024px) {
  #controlapro .cp-grid { grid-template-columns: repeat(2, 1fr); }
  .cp-text { text-align: left; }
  .cp-logo { margin-left: 0; }
}
@media (min-width: 1024px) {
  .hero-content h1 { font-size: 4.5rem; }
  .values-grid { grid-template-columns: repeat(4, 1fr); }
  .sectors-grid { grid-template-columns: repeat(4, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .service-card.featured { grid-column: span 1 / span 1; }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
}
