/* ── Pricing (config.js planTable) ───────────────────────────────────────
   One segmented picker, a row of plan cards whose rows are measured (a value
   and a bar each), the speciality tier (Roblox) as a wide banner under them,
   the compare table behind a button, and a strip of ways to pay.

   Colours come from the tokens plan-cards.css sets on .pt-host (the holder),
   so light and obsidian both follow. Figures are in the mono face. Loaded
   after plan-cards.css. */

@property --pc-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ── The picker: one segmented control ── */
.pc-pick {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 30px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.pc-pick::-webkit-scrollbar {
  display: none;
}

.pc-pick-opt {
  flex: none;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: 600 13.5px/1 var(--font-body);
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pc-pick-opt:hover {
  color: var(--ink);
}

.pc-pick-opt:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.pc-pick-opt[aria-pressed="true"] {
  background: linear-gradient(180deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(234, 88, 12, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* A little wider than the compare table's reading width: four cards with
   mono figures need the room. */
.pt-host {
  max-width: 1200px;
  /* A grid item: without this the picker's one long line sets its width. */
  min-width: 0;
}

/* ── The cards ── */
.pc-wrap {
  display: grid;
  /* minmax(0, ...): the one-line labels must not widen the column past the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.pc-row {
  display: grid;
  grid-template-columns: repeat(var(--pc-count, 4), minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pc {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--pt-line-strong);
  border-radius: 20px;
  background: var(--pt-surface);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 22px 44px -32px rgba(24, 24, 27, 0.4);
  text-align: left;
  transition:
    translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    opacity 0.3s ease,
    filter 0.3s ease,
    scale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The light under the pointer (config.js wakePricing sets --mx / --my). */
.pc::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(249, 115, 22, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .pc-wrap:hover .pc::before {
    opacity: 1;
  }

  .pc:hover {
    translate: 0 -4px;
    border-color: rgba(234, 88, 12, 0.4);
  }
}

/* The popular plan: a slowly turning lit border, a warm wash, a lift. */
.pc.is-featured {
  border: 1.5px solid transparent;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(249, 115, 22, 0.16), transparent 65%) padding-box,
    linear-gradient(var(--pt-surface), var(--pt-surface)) padding-box,
    conic-gradient(from var(--pc-angle), #fb923c, #fde68a, #ea580c, #9a3412, #fb923c) border-box;
  box-shadow: 0 30px 64px -30px rgba(234, 88, 12, 0.65);
  animation: pc-spin 6s linear infinite;
}

.pc.is-featured:hover {
  border-color: transparent;
}

@media (min-width: 1180px) {
  .pc.is-featured {
    margin-block: -8px;
    padding-block: 30px;
  }
}

@keyframes pc-spin {
  to { --pc-angle: 360deg; }
}

/* Head: the name, and in the corner a tag, the badge or the size switch. */
.pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.pc-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.pc-name.is-mark svg {
  display: block;
  height: 26px;
  width: auto;
}

.pc-tag {
  padding: 5px 9px;
  border: 1px solid var(--pt-line-strong);
  border-radius: 7px;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.pc-tag.is-red {
  align-self: flex-start;
  border-color: rgba(226, 35, 26, 0.4);
  background: rgba(226, 35, 26, 0.08);
  color: #e2231a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

html[data-theme="dark"] .pc-tag.is-red {
  color: #ff6b5e;
}

.pc-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #ea580c);
  box-shadow: 0 6px 16px -6px rgba(234, 88, 12, 0.8);
  font: 700 11px/1 var(--font-body);
  color: #fff;
  white-space: nowrap;
}

.pc-flag-star svg {
  display: block;
  width: 11px;
  height: 11px;
}

.pc-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
}

.pc-switch .plan-switch-opt {
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: none;
  font: 600 11.5px/1 var(--font-mono);
  cursor: pointer;
}

.pc-switch .plan-switch-opt.is-on {
  background: linear-gradient(180deg, #f97316, #ea580c);
  color: #fff;
}

.pc-for {
  margin: 6px 0 0;
  font: 500 13px/1.45 var(--font-body);
  color: var(--ink-faint);
}

/* Price, in the mono face. */
.pc-price {
  margin: 16px 0 0;
}

.pc-was-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font: 500 12.5px/1 var(--font-mono);
  color: var(--ink-faint);
}

.pc-save {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--pt-yes-bg);
  color: var(--pt-yes-ink);
  font-weight: 700;
}

.pc-now {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
}

.pc-now strong {
  font-family: var(--font-mono);
  font-size: clamp(28px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pc-now small {
  font: 500 12px/1 var(--font-mono);
  color: var(--ink-faint);
}

/* Buttons: outlined; the popular plan solid orange; Max solid ink. */
.pc-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 16px 0 0;
  border: 1px solid var(--pt-btn-edge);
  border-radius: 12px;
  background: var(--pt-surface);
  box-shadow: none;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}

.pc .pc-btn:hover {
  border-color: rgba(234, 88, 12, 0.55);
  background: var(--pt-surface);
  color: var(--accent-deep);
}

.pc.is-featured .pc-btn,
.pc.is-roblox .pc-btn {
  border-color: transparent;
  background: linear-gradient(180deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(234, 88, 12, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pc.is-featured .pc-btn:hover {
  background: linear-gradient(180deg, #ea580c, #c2410c);
  color: #fff;
}

.pc.is-group .pc-btn,
.pc.is-group .pc-btn:hover {
  border-color: transparent;
  background: var(--ink);
  color: var(--page);
}

.pc.is-roblox .pc-btn,
.pc.is-roblox .pc-btn:hover {
  background: linear-gradient(180deg, #f9603a, #e2231a);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(226, 35, 26, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* A sheen crossing the solid orange button now and then. */
.pc.is-featured .pc-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.38) 50%, transparent 60%);
  translate: -100% 0;
  animation: pc-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pc-sheen {
  0%, 60% { translate: -100% 0; }
  100% { translate: 100% 0; }
}

/* ── Measured rows: label and value, a note, a bar ── */
.pc-metrics {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--pt-line);
}

.pc-metric-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pc-metric-label {
  font: 500 12.5px/1.3 var(--font-body);
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.pc-metric-value {
  font: 700 12.5px/1.3 var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pc-metric-value small {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
}

.is-lead .pc-metric-value,
.is-lead .pc-metric-value small {
  color: var(--accent);
}

.pc-metric-note {
  margin: 2px 0 7px;
  font: 400 11px/1.35 var(--font-body);
  color: var(--ink-faint);
}

.pc-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--pt-track);
  overflow: hidden;
}

.pc-bar i {
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fb923c, #ea580c);
  transform-origin: left;
  animation: pc-fill 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

@keyframes pc-fill {
  from { scale: 0 1; }
}

/* ── The yes/no extras, as chips at the card's foot ── */
.pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}

.pc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--pt-line-strong);
  border-radius: 8px;
  font: 500 11px/1 var(--font-mono);
  color: var(--ink-soft);
  white-space: nowrap;
}

.pc-chip b {
  font-weight: 700;
  color: var(--pt-yes-ink);
}

.pc-chip.is-hot {
  border-color: var(--pt-pill-edge);
  background: var(--pt-pill-bg);
  color: var(--pt-pill-ink);
}

.pc-chip.is-hot b {
  color: inherit;
}

/* ── The speciality tier: a wide banner under the cards ── */
.pc-wide {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 28px;
  padding: 26px;
  border-color: rgba(226, 35, 26, 0.32);
  background:
    radial-gradient(60% 140% at 0% 50%, rgba(226, 35, 26, 0.1), transparent 70%),
    var(--pt-surface);
}

.pc-wide:hover {
  border-color: rgba(226, 35, 26, 0.55);
}

.pc-wide-lead {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.pc-wide-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.pc-wide .pc-price,
.pc-wide .pc-for,
.pc-wide .pc-btn {
  margin: 0;
}

.pc-wide .pc-now strong {
  background: linear-gradient(90deg, #f97316, #e2231a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pc-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pc-tile {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--pt-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--pt-band) 60%, transparent);
}

.pc-tile .pc-metric-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.pc-tile .pc-metric-label {
  white-space: normal;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pc-tile .pc-metric-value,
.pc-tile.is-lead .pc-metric-value {
  color: var(--ink);
  text-align: left;
  white-space: normal;
}

.pc-tile.is-lead .pc-metric-value small {
  color: var(--ink-faint);
}

.pc-tile .pc-metric-note {
  display: none;
}

.pc-tile .pc-bar {
  margin-top: 9px;
}

.pc-tile .pc-bar i {
  background: linear-gradient(90deg, #f97316, #e2231a);
}

.pc-tile.is-yes .pc-metric-value {
  color: var(--pt-yes-ink);
}

.pc-tile.is-yes .pc-metric-note {
  display: block;
  margin: 6px 0 0;
}

.pc-wide-side .pc-btn {
  min-width: 170px;
  padding: 0 22px;
}

/* ── "Help me choose": the match lifts, the rest step back ── */
.pc-wrap.has-pick .pc:not(.is-pick) {
  opacity: 0.4;
  filter: saturate(0.5);
  scale: 0.985;
}

.pc-wrap.has-pick .pc.is-pick {
  z-index: 1;
  scale: 1.02;
  box-shadow: 0 0 0 2px var(--accent), 0 34px 70px -30px rgba(234, 88, 12, 0.7);
}

.pc.is-pick::after {
  content: "Best match";
  position: absolute;
  top: -12px;
  left: 50%;
  translate: -50% 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  font: 700 11.5px/1 var(--font-body);
  color: #fff;
  white-space: nowrap;
  animation: pc-match 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pc-match {
  from { opacity: 0; translate: -50% 6px; }
}

/* ── First sight: each card rises in as it is seen (wakePricing adds
   .is-in), and their rows tick in. Off screen the loops rest (.is-away). ── */
.pc:not(.is-in) {
  opacity: 0;
}

.pc:not(.is-in) .pc-bar i {
  animation: none;
  scale: 0 1;
}

.pc.is-in {
  animation: pc-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.pc.is-in.is-featured {
  animation:
    pc-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both,
    pc-spin 6s linear infinite;
  animation-delay: calc(var(--i, 0) * 90ms), 0s;
}

@keyframes pc-rise {
  from { opacity: 0; translate: 0 28px; scale: 0.97; }
}

.pc-metric {
  animation: pc-line 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pc-metric:nth-child(1) { animation-delay: 0.08s; }
.pc-metric:nth-child(2) { animation-delay: 0.13s; }
.pc-metric:nth-child(3) { animation-delay: 0.18s; }
.pc-metric:nth-child(4) { animation-delay: 0.23s; }
.pc-metric:nth-child(5) { animation-delay: 0.28s; }

@keyframes pc-line {
  from { opacity: 0; translate: -8px 0; }
}

.pc-wrap.is-away .pc,
.pc-wrap.is-away .pc-btn::after {
  animation-play-state: paused;
}

/* ── The compare button and the table it opens ── */
.pt-compare {
  display: grid;
  justify-items: center;
  margin-top: 30px;
}

.pt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  font: 600 14.5px/1 var(--font-body);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.pt-toggle:hover {
  border-color: rgba(234, 88, 12, 0.5);
}

.pt-toggle:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.pt-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate 0.25s ease;
}

.pt-toggle[aria-expanded="true"] svg {
  rotate: 180deg;
}

.pt-drawer {
  width: 100%;
  margin-top: 26px;
  animation: pt-open 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pt-drawer[hidden] {
  display: none;
}

@keyframes pt-open {
  from { opacity: 0; translate: 0 -10px; }
}

/* ── Ways to pay: a line of trust on the left, the logos on the right ── */
.pay-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 30px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--pt-line-strong);
  border-radius: 16px;
  background: var(--pt-surface);
}

.pay-words {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font: 500 13.5px/1.4 var(--font-body);
  color: var(--ink-soft);
  text-align: left;
}

.pay-words svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--pt-yes-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* White in both themes: the brand marks are drawn for a white ground. */
.pay-chip {
  display: inline-grid;
  place-items: center;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.pay-chip img {
  display: block;
  height: 18px;
  width: auto;
}

.pay-chip.is-paypal img {
  height: 20px;
}

.pay-chip.is-bank svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #52525b;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Narrower screens ── */
@media (max-width: 1179px) {
  .pc-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pc-wide {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pc-wide-side .pc-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .pc-row {
    grid-template-columns: 1fr;
  }

  .pc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pc-pick {
    width: auto;
    margin-inline: -4px;
  }

  .pay-strip {
    justify-content: center;
  }

  .pay-words {
    text-align: center;
  }

  .pay-row {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pc,
  .pc.is-in,
  .pc.is-in.is-featured,
  .pc-metric,
  .pc-bar i,
  .pc.is-featured .pc-btn::after,
  .pc.is-pick::after,
  .pt-drawer {
    animation: none;
    transition: none;
  }
}
