/* First Time User Promo — a golden ticket on the pricing box, beside the tier
   slider. Tap it and every price on the page gets cut; the ticket tears away
   and leaves a stub holding the code.
   Mobile is the primary target: full-width ticket, 44px+ tap areas, and slashed
   bar labels stack so both numbers stay readable at 9px in a 50px column. */

:root {
  --promo-gold: #f5a742;
  --promo-gold-hot: #ffd79a;
  --promo-ink: #150d02;
  --promo-cut: #ff4d6d;
}

/* ---------- placement on the pricing box ---------- */

.promo-ticket-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

/* ---------- the ticket ---------- */

.promo-ticket {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  min-height: 50px;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--promo-ink);
  background: linear-gradient(135deg, var(--promo-gold-hot) 0%, var(--promo-gold) 46%, #e2902f 100%);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(245, 167, 66, .34), 0 0 0 1px rgba(255, 226, 178, .6) inset;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;

  /* punch the ticket notches out of both ends */
  --notch: radial-gradient(circle at 0 50%, transparent 0 8px, #000 8px),
           radial-gradient(circle at 100% 50%, transparent 0 8px, #000 8px);
  -webkit-mask-image: var(--notch);
  mask-image: var(--notch);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.promo-ticket:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245, 167, 66, .48), 0 0 0 1px rgba(255, 226, 178, .7) inset; }
.promo-ticket:active { transform: translateY(0) scale(.985); }
.promo-ticket:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.promo-ticket__perf {
  width: 0;
  align-self: stretch;
  border-left: 2px dashed rgba(21, 13, 2, .34);
  margin: 2px 0;
}

.promo-ticket__icon { flex: none; display: block; }
.promo-ticket__copy { display: flex; flex-direction: column; line-height: 1.2; }

.promo-ticket__label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .82;
}

.promo-ticket__amount { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

/* a slow shine so it reads as interactive without nagging */
.promo-ticket::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 34%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: rotate(18deg);
  animation: promo-shine 4.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes promo-shine {
  0%, 62% { left: -30%; }
  92%, 100% { left: 118%; }
}

.promo-ticket.is-claimed {
  animation: promo-tear .5s cubic-bezier(.3, .1, .2, 1) forwards;
  pointer-events: none;
}

@keyframes promo-tear {
  0%   { transform: rotate(0) scale(1); opacity: 1; }
  35%  { transform: rotate(-3deg) scale(1.05); opacity: 1; }
  100% { transform: rotate(-9deg) scale(.86) translateY(14px); opacity: 0; }
}

/* ---------- the stub left behind, which carries the code ---------- */

.promo-stub {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px dashed rgba(245, 167, 66, .6);
  background: rgba(245, 167, 66, .08);
  color: var(--promo-gold);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}

.promo-stub[hidden] { display: none; }
.promo-stub:hover { background: rgba(245, 167, 66, .16); }
.promo-stub:focus-visible { outline: 2px solid var(--promo-gold); outline-offset: 2px; }
.promo-stub__label { opacity: .75; }
.promo-stub__code { font-size: 14px; letter-spacing: .16em; color: var(--promo-gold-hot); }

.promo-stub.is-copied {
  border-color: var(--green, #9dfbc1);
  color: var(--green, #9dfbc1);
  background: rgba(157, 251, 193, .1);
}
.promo-stub.is-copied .promo-stub__label::after { content: " · copied"; }

/* ---------- slashed prices ---------- */

[data-promo-price] { position: relative; }

.promo-was {
  opacity: .4;
  text-decoration: line-through;
  text-decoration-color: var(--promo-cut);
  text-decoration-thickness: 2px;
}

.promo-now {
  color: var(--green, #9dfbc1);
  text-shadow: 0 0 14px rgba(157, 251, 193, .45);
}

.promo-inline .promo-now { margin-left: .3em; }

/* Only the live claim pops. A restore on a later visit renders the cut price
   flat — .promo-anim is set by JS on the animated pass only. */
.promo-anim .promo-now { animation: promo-pop .4s cubic-bezier(.2, .9, .25, 1.4); }

@keyframes promo-pop {
  0%   { opacity: 0; transform: scale(1.45) rotate(-3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* stacked for the slider bar labels — 9px in a 50px column on phones */
.promo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.promo-stack .promo-was { font-size: .82em; }
.promo-stack .promo-now { font-weight: 700; }

.promo-slice {
  position: absolute;
  left: -8%;
  top: 50%;
  width: 116%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--promo-cut), #fff, var(--promo-cut), transparent);
  transform-origin: left center;
  transform: rotate(-10deg) scaleX(0);
  animation: promo-slice .36s cubic-bezier(.3, 0, .2, 1) forwards;
  pointer-events: none;
  border-radius: 2px;
}

@keyframes promo-slice {
  0%   { transform: rotate(-10deg) scaleX(0); opacity: 1; }
  58%  { transform: rotate(-10deg) scaleX(1); opacity: 1; }
  100% { transform: rotate(-10deg) scaleX(1); opacity: 0; }
}

.promo-spark {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--promo-gold-hot);
  pointer-events: none;
  z-index: 95;
}

/* badge stamped on the checkout button once the promo is on */
.promo-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--promo-gold);
  color: var(--promo-ink);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  vertical-align: middle;
}

/* ---------- mobile ---------- */

@media (max-width: 960px) {
  .promo-ticket-row { justify-content: stretch; margin-bottom: 14px; }
  .promo-ticket { width: 100%; justify-content: center; gap: 14px; min-height: 56px; padding: 12px 16px; }
  .promo-stub { width: 100%; justify-content: center; }
  .promo-stack .promo-was { font-size: .8em; opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
  .promo-ticket::after { animation: none; }
  .promo-ticket.is-claimed { animation-duration: .01ms; }
  .promo-slice { animation-duration: .01ms; }
  .promo-anim .promo-now { animation-duration: .01ms; }
}
