/* ============================================================
   switchcard · "Ready to switch?" channel-import card
   Reuses site tokens (.container/.glass/.glass-inner/.btn/.eyebrow/.reveal).
   All local classes are prefixed .switchcard-*.
   ============================================================ */

.switchcard-section {
  position: relative;
}

.switchcard-shell {
  position: relative;
}

/* Soft violet glow behind the card (mirrors the site .glow language) */
.switchcard-glow {
  position: absolute;
  inset: -16% -8% -24%;
  z-index: 0;
  pointer-events: none;
  border-radius: 40px;
  background:
    radial-gradient(58% 60% at 28% 42%, rgba(124, 58, 237, calc(var(--glow-a) * 0.32)), transparent 70%),
    radial-gradient(50% 55% at 86% 62%, rgba(217, 70, 239, calc(var(--glow-a) * 0.2)), transparent 72%);
  filter: blur(6px);
}

/* The card itself uses the shared glass frame recipe */
.switchcard-card {
  position: relative;
  z-index: 1;
}

.switchcard-inner {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(26px, 4vw, 44px);
  padding: clamp(26px, 4vw, 46px);
  background:
    radial-gradient(120% 130% at 8% 0%, rgba(124, 58, 237, 0.08), transparent 60%),
    var(--pane-bg);
}

/* ---------- Copy column ---------- */
.switchcard-copy {
  min-width: 0;
}

.switchcard-copy .eyebrow {
  margin-bottom: 12px;
}

.switchcard-title {
  font-size: clamp(1.7rem, 2.2vw + 1rem, 2.4rem);
  line-height: 1.14;
  margin: 0 0 12px;
}

.switchcard-sub {
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 34em;
  margin: 0 0 24px;
}

.switchcard-cta {
  margin: 0;
}

/* ---------- Visual column: channels -> toggle -> chater ---------- */
.switchcard-visual {
  min-width: 0;
}

.switchcard-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  max-width: 100%;
  padding: 8px 0;
}

.switchcard-sources {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.4vw, 10px);
  flex: 0 0 auto;
}

/* App-icon style badges */
.switchcard-badge {
  flex: 0 0 auto;
  width: clamp(40px, 11vw, 48px);
  height: clamp(40px, 11vw, 48px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.55);
  will-change: transform;
  animation: switchcard-pulse 3.6s ease-in-out infinite;
}

.switchcard-badge svg {
  display: block;
  width: 100%;
  height: 100%;
}

.switchcard-ig { animation-delay: 0.3s; }
.switchcard-ms { animation-delay: 0.6s; }

/* Destination: the chater360 gradient bolt, larger + haloed */
.switchcard-bolt {
  width: clamp(50px, 14vw, 62px);
  height: clamp(50px, 14vw, 62px);
  border-radius: 17px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 34px -10px rgba(124, 58, 237, 0.65);
  animation: switchcard-bob 3.6s ease-in-out infinite, switchcard-halo 3s ease-in-out infinite;
}

/* ---------- Beam + travelling spark ---------- */
.switchcard-beam {
  position: relative;
  flex: 1 1 20px;
  min-width: 16px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--border), var(--border-strong));
}

.switchcard-spark {
  position: absolute;
  top: 50%;
  left: 0;
  width: 15px;
  height: 6px;
  margin-top: -3px;
  border-radius: 6px;
  background: linear-gradient(90deg, transparent, var(--fuchsia));
  box-shadow: 0 0 10px 2px rgba(217, 70, 239, 0.6);
  animation: switchcard-travel 2.6s linear infinite;
}

.switchcard-beam-2 .switchcard-spark {
  animation-delay: 1.3s;
}

/* ---------- The "on" toggle ---------- */
.switchcard-toggle {
  position: relative;
  flex: 0 0 auto;
  width: clamp(50px, 13vw, 58px);
  height: clamp(28px, 7.2vw, 32px);
  border-radius: 999px;
  background: var(--grad-soft);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 8px 22px -8px rgba(124, 58, 237, 0.6);
  animation: switchcard-toggleglow 2.8s ease-in-out infinite;
}

.switchcard-knob {
  position: absolute;
  top: 50%;
  right: 4px;
  width: calc(clamp(28px, 7.2vw, 32px) - 8px);
  height: calc(clamp(28px, 7.2vw, 32px) - 8px);
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.35);
}

/* ---------- Desktop: copy left, visual right ---------- */
@media (min-width: 860px) {
  .switchcard-inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: clamp(40px, 5vw, 64px);
  }

  .switchcard-flow {
    justify-content: flex-start;
  }
}

/* ---------- Motion keyframes ---------- */
@keyframes switchcard-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.035); }
}

@keyframes switchcard-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes switchcard-halo {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.08),
      0 12px 30px -12px rgba(124, 58, 237, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.16),
      0 16px 40px -8px rgba(217, 70, 239, 0.72);
  }
}

@keyframes switchcard-travel {
  0% { left: -12%; opacity: 0; }
  16% { opacity: 1; }
  84% { opacity: 1; }
  100% { left: 104%; opacity: 0; }
}

@keyframes switchcard-toggleglow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.12),
      0 6px 18px -8px rgba(124, 58, 237, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.22),
      0 12px 30px -6px rgba(217, 70, 239, 0.78);
  }
}

/* ---------- Reduced motion: hold a calm, static "on" state ---------- */
@media (prefers-reduced-motion: reduce) {
  .switchcard-badge,
  .switchcard-bolt,
  .switchcard-toggle,
  .switchcard-spark {
    animation: none !important;
  }

  .switchcard-spark {
    left: auto;
    right: 0;
    opacity: 0.85;
  }
}
