/* ──────────────────────────────────────────────────────────────────
   AnchorWithin — Exit-Intent Popup
   ──────────────────────────────────────────────────────────────────
   Token-driven styling for the Soul exit-intent modal. Pairs with
   /assets/js/exit-popup.js.

   Per-page usage:
     <link rel="stylesheet" href="/assets/css/tokens.css">
     <link rel="stylesheet" href="/assets/css/exit-popup.css">
     <script src="/assets/js/exit-popup.js" defer></script>

   IDs are namespaced (aw-exit-*) so they cannot collide with page
   markup. All visual values flow from --aw-* tokens; the only
   hex-free literal is the modal scrim (rgba black), a structural
   neutral that's intentionally palette-agnostic.
   ────────────────────────────────────────────────────────────────── */

#aw-exit-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--aw-scrim);
  animation: aw-exit-fade var(--dur-2) var(--ease);
}
@keyframes aw-exit-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#aw-exit-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: var(--space-12) var(--space-8);
  text-align: center;
  background: var(--aw-card);
  border: 1px solid var(--aw-border-hi);
  border-radius: var(--r-xl);
  box-shadow: var(--aw-glow-gold);
}

#aw-exit-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  width: var(--tap-min);
  height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--aw-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--r);
  transition: color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}
#aw-exit-close:hover {
  color: var(--aw-text);
  background: var(--aw-gold-glow);
}
#aw-exit-close:focus-visible {
  outline: 2px solid var(--aw-gold-lt);
  outline-offset: 2px;
}

#aw-exit-badge {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: var(--space-1) var(--space-3);
  background: var(--aw-gold-glow);
  border: 1px solid var(--aw-border-hi);
  border-radius: var(--r-pill);
  color: var(--aw-gold-lt);
  font-family: var(--aw-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .15em;
}

#aw-exit-headline {
  margin-bottom: var(--space-2);
  font-family: var(--aw-serif);
  font-size: var(--text-xl);
  color: var(--aw-cream);
  line-height: 1.25;
}

#aw-exit-box p {
  margin-bottom: var(--space-2);
  font-family: var(--aw-sans);
  font-size: var(--text-sm);
  color: var(--aw-muted);
}

#aw-exit-code {
  display: inline-block;
  margin: var(--space-2) 0 var(--space-6);
  padding: var(--space-3) var(--space-6);
  background: var(--aw-bg);
  border: 1px dashed var(--aw-border-hi);
  border-radius: var(--r);
  font-family: var(--aw-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--aw-gold-lt);
  letter-spacing: .1em;
}

#aw-exit-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-8);
  margin-bottom: var(--space-3);
  background: var(--aw-gold);
  color: var(--aw-bg);
  font-family: var(--aw-sans);
  font-weight: 700;
  font-size: var(--text-base);
  text-decoration: none;
  border-radius: var(--r);
  box-shadow: var(--aw-glow-gold);
  transition: background var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}
#aw-exit-cta:hover {
  background: var(--aw-gold-lt);
  transform: translateY(-1px);
  box-shadow: var(--aw-glow-gold-hi);
}
#aw-exit-cta:focus-visible {
  outline: 2px solid var(--aw-cream);
  outline-offset: 2px;
}

#aw-exit-note {
  margin-bottom: 0;
  font-family: var(--aw-mono);
  font-size: var(--text-xs);
  color: var(--aw-muted);
  opacity: .75;
  letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
  #aw-exit-overlay { animation: none; }
  #aw-exit-cta:hover { transform: none; }
}
