/* COMEXT-WEB-UX-01: shared visual/interaction engine for the Solutions, Platform, Pricing and
   About pages — blueprint background, reactive border glow, 3D tilt, staggered scroll reveal,
   and a generic accessible modal shell. Built once here instead of once per page so none of the
   four pages duplicates the same ~150 lines, and so a fix applies everywhere at once. Reuses the
   site's own existing tokens (--c-bg, --c-cyan, --c-gold, --c-surface, --c-border, --c-title,
   --c-text from theme.css) instead of inventing a second palette — the mockups' own accent
   colors (#38BDF8 cyan, #F59E0B amber) already match these exactly. */

.comext-tech-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 20%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 20%, #000 35%, transparent 100%);
  pointer-events: none;
  z-index: -2;
}

.comext-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
  animation: comext-orb-float 17s ease-in-out infinite alternate;
}

.comext-orb-cyan {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
  top: -150px;
  left: 8%;
}

.comext-orb-amber {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent 70%);
  bottom: -100px;
  right: 5%;
  animation-delay: -8s;
}

@keyframes comext-orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(36px, 26px) scale(1.08); }
}

/* Badge pill used in every section header ("Ecosistema Digital COMEXT", etc.) */
.comext-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.comext-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--c-cyan);
  box-shadow: 0 0 10px var(--c-cyan);
  animation: comext-pulse-dot 2s infinite;
}

@keyframes comext-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.55; }
}

.comext-eyebrow-text {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-cyan);
}

/* Card shell with a 1px padding trick: the border itself is the glow gradient. */
.comext-glow-card {
  position: relative;
  border-radius: 18px;
  padding: 1px;
  background: var(--c-border);
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  will-change: transform;
}

.comext-glow-card.is-filtered-out {
  display: none;
}

.comext-card-border-glow {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(
    550px circle at var(--x, -500px) var(--y, -500px),
    rgba(56, 189, 248, 0.65),
    rgba(56, 189, 248, 0.2) 40%,
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}

.comext-glow-card--amber .comext-card-border-glow {
  background: radial-gradient(
    600px circle at var(--x, -500px) var(--y, -500px),
    rgba(245, 158, 11, 0.7),
    transparent 65%
  );
}

.comext-card-inner {
  position: relative;
  height: 100%;
  background: var(--c-surface);
  border-radius: 17px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  z-index: 1;
}

.comext-card-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    450px circle at var(--x, -500px) var(--y, -500px),
    rgba(56, 189, 248, 0.08),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

.comext-glow-card--amber .comext-card-spotlight {
  background: radial-gradient(
    450px circle at var(--x, -500px) var(--y, -500px),
    rgba(245, 158, 11, 0.08),
    transparent 65%
  );
}

/* Staggered scroll reveal, driven by IntersectionObserver in comext-interactive-cards.js. */
.comext-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Generic accessible modal shell, reused for any non-form informational modal. */
.comext-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 11, 26, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.comext-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.comext-modal-container {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--c-bg-2);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.12);
  transform: scale(0.94) translateY(15px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.comext-modal-backdrop.active .comext-modal-container {
  transform: scale(1) translateY(0);
}

.comext-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.comext-modal-close:hover,
.comext-modal-close:focus-visible {
  background: rgba(56, 189, 248, 0.15);
  color: var(--c-title);
  border-color: var(--c-cyan);
}

.comext-modal-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-cyan);
  margin-bottom: 0.75rem;
}

.comext-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-title);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.comext-modal-desc {
  font-size: 0.98rem;
  color: var(--c-text);
  margin-bottom: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .comext-orb,
  .comext-eyebrow-dot,
  .comext-glow-card,
  .comext-reveal,
  .comext-modal-backdrop,
  .comext-modal-container {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .comext-card-inner {
    padding: 1.75rem;
  }
  .comext-modal-container {
    padding: 1.75rem;
  }
}
