/* ==========================================================================
   dxq-lab — Design System
   Bold Contrast · Deep Black · Indigo Accent · Sharp Forms
   ========================================================================== */

:root {
  /* Colors */
  --bg-deep: #0a0a0f;
  --bg-slate: #0e0e14;
  --bg-card: #141419;
  --border-subtle: #27272a;
  --border-strong: #3f3f46;
  --text-primary: #ffffff;
  --text-muted: #a1a1aa;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-cyan: var(--accent);
  --accent-sky: var(--accent-light);
  --accent-indigo: var(--accent);
  --accent-purple: var(--accent-light);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.14) 0%, rgba(129, 140, 248, 0.08) 100%);
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.16), transparent),
                   radial-gradient(ellipse 50% 40% at 85% 55%, rgba(99, 102, 241, 0.08), transparent);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 8vw, 7rem);
  --container-max: 1200px;
  --gap: clamp(1rem, 3vw, 2rem);

  /* Effects */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 48px rgba(99, 102, 241, 0.22);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 3px;
  --radius-lg: 4px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  background-image: var(--gradient-hero);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

.text-accent {
  color: var(--accent);
}

.brand-name {
  white-space: nowrap;
  letter-spacing: inherit;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.section {
  padding-block: var(--section-padding);
}

.section__header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section__label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section__title {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section__subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-inline: auto;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 1rem;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header--scrolled {
  border-bottom-color: var(--border-subtle);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo__mark {
  width: 8px;
  height: 8px;
  border-radius: var(--radius);
  background: var(--accent);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__cta {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 32px rgba(99, 102, 241, 0.55);
  color: #ffffff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.08);
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(63, 63, 70, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 63, 70, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black, transparent);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease both;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius);
  background: var(--accent);
  animation: pulse 2s ease infinite;
}

.hero__title {
  font-size: clamp(3.5rem, 11vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  animation: fadeInUp 0.6s 0.1s ease both;
}

.hero__subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s 0.2s ease both;
}

.hero__uvp {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-primary);
  line-height: 1.7;
  padding: 1.25rem 1.5rem;
  background: var(--gradient-glow);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s 0.3s ease both;
}

.hero__uvp strong {
  color: var(--accent-light);
  font-weight: 700;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: fadeInUp 0.6s 0.4s ease both;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeInUp 0.6s 0.5s ease both;
}

.hero__stat-value {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero__stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Services Grid
   ========================================================================== */

.services {
  background: var(--bg-slate);
  position: relative;
}

.services::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap);
}

/* Row 1: three equal cards */
.services__grid .service-card:nth-child(1),
.services__grid .service-card:nth-child(2),
.services__grid .service-card:nth-child(3) {
  grid-column: span 2;
}

/* Row 2: two centered cards */
.services__grid .service-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.services__grid .service-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.service-card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: var(--shadow-glow);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card__icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: background var(--transition), border-color var(--transition);
}

.service-card:hover .service-card__icon {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
}

.service-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent-light);
}

.service-card__title {
  position: relative;
  z-index: 1;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.service-card__desc {
  position: relative;
  z-index: 1;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.service-card__badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.875rem;
}

.service-card__badge--b2c {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.45);
}

/* ==========================================================================
   Workflow Timeline
   ========================================================================== */

.workflow__timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  position: relative;
}

.workflow__timeline::before {
  content: "";
  position: absolute;
  top: 28px;
  left: calc(12.5% + 1rem);
  right: calc(12.5% + 1rem);
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0.45;
}

.workflow-step {
  text-align: center;
  position: relative;
}

.workflow-step__number {
  width: 56px;
  height: 56px;
  margin-inline: auto;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--accent-light);
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.workflow-step:hover .workflow-step__number {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
}

.workflow-step__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.workflow-step__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 220px;
  margin-inline: auto;
}

/* ==========================================================================
   CTA Banner
   ========================================================================== */

.cta-banner {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.cta-banner__inner {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.cta-banner__inner::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 180deg at 50% 50%, transparent, rgba(99, 102, 241, 0.07), transparent, rgba(129, 140, 248, 0.06), transparent);
  animation: rotate 20s linear infinite;
}

.cta-banner__content {
  position: relative;
  z-index: 1;
}

.cta-banner__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cta-banner__text {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 520px;
  margin-inline: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--bg-slate);
  border-top: 1px solid var(--border-subtle);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.footer__brand {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 360px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  text-align: right;
}

.footer__link {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer__link:hover {
  color: var(--accent-light);
}

/* Reset button-styled nav links — match plain text links */
.contact-nav-btn,
.inline-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.footer__link.contact-nav-btn {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: right;
}

.footer__link.contact-nav-btn:hover {
  color: var(--accent-light);
}

.footer__legal .contact-nav-btn {
  font-size: inherit;
  color: var(--accent-light);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__legal .contact-nav-btn:hover {
  color: var(--accent);
}

.inline-link-btn {
  display: inline;
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link-btn:hover {
  color: var(--accent);
}

.contact-details {
  margin-top: 1.5rem;
}

.contact-list {
  display: grid;
  gap: 1.25rem;
}

.contact-list__item dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.contact-list__item dd {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.contact-list__item dd a {
  color: var(--accent-light);
}

.contact-note {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.contact-loading {
  color: var(--text-muted);
}

.footer__legal {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer__legal-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ==========================================================================
   Legal Pages (privacy.html, oferta.html)
   ========================================================================== */

.legal-page {
  padding-top: 6rem;
  padding-bottom: 4rem;
  min-height: 100vh;
}

.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.legal-page__updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent-light);
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.legal-page ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.legal-page a.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  color: var(--accent-light);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services__grid .service-card:nth-child(n) {
    grid-column: auto;
  }

  .services__grid .service-card:nth-child(5) {
    grid-column: 1 / -1;
    max-width: calc(50% - var(--gap) / 2);
    justify-self: center;
  }

  .workflow__timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .workflow__timeline::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--border-subtle);
    transform: translateX(100%);
    transition: transform var(--transition);
    gap: 1.5rem;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav__cta {
    display: inline-flex;
    margin-top: 0.5rem;
  }

  .menu-toggle {
    display: flex;
  }

  .header__cta-desktop {
    display: none;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .services__grid .service-card:nth-child(n) {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__links {
    text-align: left;
  }

  .hero__stats {
    gap: 1.5rem;
  }

  .hero__stat {
    flex: 1 1 calc(50% - 0.75rem);
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .workflow__timeline {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .nav-overlay {
    display: none;
  }
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
