/* ════════════════════════════════════════════════
   CORTEX EXIT BANNER — full-screen Cortex Intellect banner
   (markup: templates/includes/cortex_exit_banner.html,
   triggers, focus, scroll lock and the core animation: assets/js/cortex-exit-banner.js).
   A separate file with ?v= in the headers: /static/ is cached by
   browsers for 7 days and the name has no hash.
   [hidden]  — closed (display: none)
   .is-open  — shown, the fade-in / fade-out runs on this class
   html.cortex-exit-lock — page scroll is blocked while the banner is open
   Colors come from the site palette (:root in basic/header.html), as on the small card
   (cortex-card.css): --thirty_bg panel, --main_bg, the --gradient_* of .main-btn.
   ════════════════════════════════════════════════ */

@keyframes cortex-exit-border-spin {
  to {
    transform: rotate(360deg);
  }
}

html.cortex-exit-lock {
  overflow: hidden;
}

/* above the header (100), the card (105) and the modals (230–260); the banner never opens over the consent popups,
   and if the language popup (9999) shows up while it is open, it stays on top and clickable */
.cortex-exit {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.02em;
  opacity: 0;
  transition: opacity .35s ease;
  box-sizing: border-box;
}

.cortex-exit *,
.cortex-exit *::before,
.cortex-exit *::after {
  box-sizing: border-box;
}

.cortex-exit[hidden] {
  display: none;
}

.cortex-exit.is-open {
  opacity: 1;
}

.cortex-exit__overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 29, .8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.cortex-exit__panel {
  position: relative;
  width: min(1170px, 100%);
  max-height: 100%;
  padding: 4px;
  border-radius: 48px;
  background: #2C2F40;
  box-shadow: 0 40px 120px rgba(12, 11, 14, .6), 0 0 100px rgba(109, 93, 211, .25);
  overflow: hidden;
  isolation: isolate;
  transform: scale(.96);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

/* Animated border: a big rotating conic gradient with a bright "comet",
   visible only through the 4px padding around the content */
.cortex-exit__panel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 2000px;
  height: 2000px;
  margin: -1000px 0 0 -1000px;
  background: conic-gradient(
    transparent 0deg 190deg,
    rgba(109, 93, 211, .6) 230deg,
    var(--gradient_start, #6D5DD3) 270deg,
    var(--gradient_center, #985DD3) 305deg,
    var(--gradient-hover_end, #e26dff) 335deg,
    #fff 350deg,
    transparent 360deg
  );
  animation: cortex-exit-border-spin 6s linear infinite;
}

.cortex-exit.is-open .cortex-exit__panel {
  transform: none;
}

.cortex-exit__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 48px;
  max-height: calc(100vh - 56px);
  padding: 60px 60px 60px 66px;
  border-radius: 44px;
  color: var(--text_color, #fff);
  text-decoration: none;
  background:
    radial-gradient(120% 140% at 100% 50%, rgba(109, 93, 211, .28) 0, transparent 55%),
    var(--thirty_bg, #252733);
  overflow: auto;
}

.cortex-exit__link:hover {
  color: var(--text_color, #fff);
}

.cortex-exit__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.cortex-exit__eyebrow {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #CAB1FF;
}

.cortex-exit__title {
  margin-top: 16px;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

.cortex-exit__text {
  max-width: 34em;
  margin-top: 22px;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 500;
  line-height: 1.45;
  color: #8884A1;
}

/* CTA in the colors of .main-btn: the site gradient, the hover gradient fades in over it */
.cortex-exit__cta {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  padding: 20px 38px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text_color, #fff);
  background: linear-gradient(79.58deg, var(--gradient_start, #6D5DD3) 41.08%, var(--gradient_center, #985DD3) 74.67%, var(--gradient_end, #AD5DD3) 93.79%);
  transition: box-shadow .2s ease;
}

.cortex-exit__cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(79.58deg, var(--gradient-hover_start, #624bf3) 41.08%, var(--gradient-hover_center, #ac5efa) 74.67%, var(--gradient-hover_end, #e26dff) 93.79%);
  opacity: 0;
  transition: opacity .6s;
}

.cortex-exit__arrow {
  display: inline-block;
  transition: transform .2s ease;
}

.cortex-exit__link:hover .cortex-exit__cta {
  box-shadow: 0 0 0 8px rgba(152, 93, 211, .2);
}

.cortex-exit__link:hover .cortex-exit__cta::after {
  opacity: 1;
}

.cortex-exit__link:hover .cortex-exit__arrow {
  transform: translateX(5px);
}

/* Core: node network on a sphere drawn by cortex-exit-banner.js,
   a gradient ball until the script runs */
.cortex-exit__core {
  position: relative;
  flex: none;
  width: 264px;
  aspect-ratio: 1;
  margin: 24px 24px 24px 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #CAB1FF, #985DD3 55%, #3b2f7a 100%);
  box-shadow: 0 0 0 30px rgba(109, 93, 211, .12), 0 0 90px rgba(152, 93, 211, .65);
}

/* the plexus took over: the ball fades into a soft glow under it */
.cortex-exit__core.is-live {
  background: radial-gradient(circle, rgba(109, 93, 211, .4), rgba(109, 93, 211, 0) 70%);
  box-shadow: 0 0 120px rgba(109, 93, 211, .3);
}

/* a bit wider than the core so the near-side nodes are not clipped */
.cortex-exit__plexus {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cortex-exit__plexus canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cortex-exit__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: var(--text_color, #fff);
  background: rgba(32, 32, 40, .7);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.cortex-exit__close:hover {
  background: #2C2F40;
  border-color: var(--accent_color, #6D5DD3);
}

/* ── adaptive ── */
@media (max-width: 1023px) {
  .cortex-exit__link {
    gap: 32px;
    padding: 44px;
  }

  .cortex-exit__core {
    width: 200px;
    margin: 12px 12px 12px 0;
  }
}

@media (max-width: 767px) {
  .cortex-exit {
    padding: 12px;
  }

  .cortex-exit__panel {
    padding: 3px;
    border-radius: 28px;
  }

  .cortex-exit__link {
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 30px);
    padding: 36px 22px 24px;
    border-radius: 25px;
    text-align: center;
    background:
      radial-gradient(140% 70% at 50% 0, rgba(109, 93, 211, .3) 0, transparent 60%),
      var(--thirty_bg, #252733);
  }

  .cortex-exit__body {
    align-items: stretch;
    width: 100%;
  }

  .cortex-exit__eyebrow {
    font-size: 13px;
  }

  .cortex-exit__title {
    margin-top: 10px;
    font-size: 25px;
  }

  .cortex-exit__text {
    margin-top: 14px;
    font-size: 16px;
  }

  .cortex-exit__cta {
    margin-top: 24px;
    padding: 16px 20px;
    font-size: 16px;
  }

  .cortex-exit__core {
    order: -1;
    width: 160px;
    margin: 0;
  }

  .cortex-exit__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cortex-exit,
  .cortex-exit__panel {
    transition: none;
  }

  .cortex-exit__panel::before {
    animation: none;
  }
}
