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

@keyframes cortex-card-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes cortex-tab-pulse {
  0%, 70%, 100% {
    box-shadow: 0 6px 20px rgba(36, 56, 234, 0.35), 0 0 0 0 rgba(63, 208, 255, 0.45);
  }
  85% {
    box-shadow: 0 6px 20px rgba(36, 56, 234, 0.35), 0 0 0 8px rgba(63, 208, 255, 0);
  }
}

.cortex-card {
  font-family: "Montserrat", sans-serif;
}

.cortex-card__panel {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 450;
  width: 390px;
  padding: 2px;
  border-radius: 20px;
  background: rgba(63, 120, 255, 0.28);
  box-shadow: 0 18px 48px rgba(3, 8, 30, 0.55), 0 0 36px rgba(36, 120, 234, 0.22);
  overflow: hidden;
  isolation: isolate;
  box-sizing: border-box;
}

.cortex-card__panel::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  background: conic-gradient(transparent 0deg 190deg, rgba(36, 56, 234, 0.6) 230deg, #8a5cff 280deg, #3fd0ff 330deg, #fff 350deg, transparent 360deg);
  animation: cortex-border-spin 4s linear infinite;
}

@media (max-width: 767px) {
  .cortex-card__panel {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    border-radius: 18px;
  }
}

.cortex-card__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 20px 22px;
  border-radius: 18.5px;
  color: #fff !important;
  text-decoration: none;
  background: radial-gradient(120% 140% at 100% 50%, rgba(47, 107, 255, 0.28) 0, transparent 55%), #0d1333;
  overflow: hidden;
}

.cortex-card__link:hover {
  color: #fff;
}

@media (max-width: 767px) {
  .cortex-card__link {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas: "core eyebrow" "core title" "text text" "cta cta";
    column-gap: 14px;
    align-items: center;
    padding: 18px 16px 16px;
    border-radius: 16px;
  }
}

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

@media (max-width: 767px) {
  .cortex-card__body {
    display: contents;
  }
}

.cortex-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #3fd0ff;
}

@media (max-width: 767px) {
  .cortex-card__eyebrow {
    grid-area: eyebrow;
    align-self: end;
    font-size: 10px;
  }
}

.cortex-card__title {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

@media (max-width: 767px) {
  .cortex-card__title {
    grid-area: title;
    align-self: start;
    margin-top: 4px;
    padding-right: 28px;
    font-size: 18px;
  }
}

.cortex-card__text {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #aebbdf;
}

@media (max-width: 767px) {
  .cortex-card__text {
    grid-area: text;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.45;
  }
}

.cortex-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #07122e;
  background: linear-gradient(90deg, #3fd0ff, #7fdcff);
  transition: background-color .2s ease, box-shadow .2s ease;
}

@media (max-width: 767px) {
  .cortex-card__cta {
    grid-area: cta;
    justify-content: center;
    margin-top: 16px;
    padding: 13px 16px;
    font-size: 14px;
  }
}

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

.cortex-card__link:hover .cortex-card__cta {
  box-shadow: 0 0 0 4px rgba(63, 208, 255, 0.18);
}

.cortex-card__link:hover .cortex-card__arrow {
  transform: translateX(3px);
}

.cortex-card__core {
  position: relative;
  flex: none;
  width: 88px;
  aspect-ratio: 1;
  margin: 8px 8px 8px 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #8fc4ff, #2473ea 62%, #14349c 100%);
  box-shadow: 0 0 0 10px rgba(36, 115, 234, 0.12), 0 0 30px rgba(84, 160, 255, 0.75);
}

.cortex-card__core.is-live {
  background: radial-gradient(circle, rgba(36, 115, 234, 0.4), rgba(36, 115, 234, 0) 70%);
  box-shadow: 0 0 40px rgba(36, 115, 234, 0.3);
}

@media (max-width: 767px) {
  .cortex-card__core {
    grid-area: core;
    width: 56px;
    margin: 0;
  }
}

.cortex-card__plexus {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

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

.cortex-card__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  background: rgba(13, 19, 51, 0.7);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.cortex-card__close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.cortex-card__close::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.cortex-card__tab {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 36px;
  padding: 12px 0 16px;
  border: 0;
  border-radius: 0 14px 14px 0;
  color: #fff !important;
  text-decoration: none;
  background: linear-gradient(180deg, #2438EA 0%, #2497EA 100%);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate(-100%, -50%);
  animation: cortex-tab-pulse 4s ease-in-out infinite;
}

.cortex-card__tab:hover {
  width: 40px;
  color: #fff;
}

@media (max-width: 767px) {
  .cortex-card__tab {
    width: 30px;
    padding: 10px 0 12px;
    gap: 8px;
  }
}

.cortex-card__tab-orb {
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85) 0, rgba(190, 240, 255, 0.45) 10%, transparent 30%), radial-gradient(circle at 50% 50%, #58c8ff 0, #2f6bff 38%, #5a3de0 66%, #1a1c52 100%);
  width: 16px;
  height: 16px;
  flex: none;
  box-shadow: 0 0 8px rgba(160, 230, 255, 0.8);
}

@media (max-width: 767px) {
  .cortex-card__tab-orb {
    width: 14px;
    height: 14px;
  }
}

.cortex-card__tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .cortex-card__tab-text {
    font-size: 10px;
  }
}

.cortex-card.is-collapsed .cortex-card__panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(-100% - 40px));
}

@media (max-width: 767px) {
  .cortex-card.is-collapsed .cortex-card__panel {
    transform: translateY(calc(100% + 24px));
  }
}

.cortex-card.is-collapsed .cortex-card__tab {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.cortex-card.is-animated .cortex-card__panel {
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.5s;
}

.cortex-card.is-animated .cortex-card__tab {
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.4s, width 0.2s ease;
}

.cortex-card.is-entering:not(.is-collapsed) .cortex-card__panel {
  animation: cortex-card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.cortex-card.is-waiting .cortex-card__panel, .cortex-card.is-waiting .cortex-card__tab {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .cortex-card__panel, .cortex-card__panel::before, .cortex-card__tab, .cortex-card.is-entering:not(.is-collapsed) .cortex-card__panel {
    animation: none;
  }
  .cortex-card.is-animated .cortex-card__panel, .cortex-card.is-animated .cortex-card__tab {
    transition: opacity .3s ease, visibility .3s;
  }
}
