/* ══════════════════════════════════════════════════════════════════════
   plans.css — the Billing / Plans page (/plans), restyled to match the
   marketing home page (home.css). Fully scoped under `.plans-pro` (a body
   class only plans.html sets) and self-contained: it carries its own tokens,
   living background and fx helpers rather than depending on home.css, the
   same way projects.css does. Behaviour (constellation, reveal, spotlight,
   tilt, magnetic, the monthly/yearly toggle) is reused from home.js, which is
   fully null-guarded on pages that lack the hero markup.

   No sidebar here on purpose — Billing is a full-width page under the shared
   base.html navbar.
   ══════════════════════════════════════════════════════════════════════ */

.plans-pro {
  --th-ink: #eef4ff;
  --th-line: rgba(147, 197, 253, .10);
  --th-line-2: rgba(147, 197, 253, .18);
  --th-fill: rgba(96, 165, 250, .05);
  --th-fill-2: rgba(96, 165, 250, .09);
  --th-card: rgba(16, 18, 30, .55);
  --th-card-2: rgba(20, 23, 38, .72);
  --th-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --th-shadow-sm: 0 14px 40px -22px rgba(0, 0, 0, .75);
  --th-glow: rgba(96, 165, 250, .35);
  --th-ease: cubic-bezier(.22, 1, .36, 1);
  --th-ease-out: cubic-bezier(.16, 1, .3, 1);

  min-height: 100vh;
  overflow-x: clip;
}

/* This page carries its own living background — retire base.html's mesh. */
.plans-pro .mesh-bg { display: none !important; }

/* ─────────────────────────────────────────────
   LIVING BACKGROUND (mirrors home.css .th-bg)
   ───────────────────────────────────────────── */
.plans-pro .th-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 72% -8%, rgba(59, 130, 246, .13), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(147, 197, 253, .07), transparent 55%),
    linear-gradient(180deg, #08080e 0%, #070710 45%, #06060c 100%);
}
.plans-pro .th-bg-aurora {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 86vh;
  background:
    conic-gradient(from 120deg at 50% 40%,
      rgba(96, 165, 250, 0) 0deg, rgba(96, 165, 250, .15) 70deg,
      rgba(59, 130, 246, .05) 150deg, rgba(147, 197, 253, .13) 240deg,
      rgba(96, 165, 250, 0) 360deg);
  filter: blur(70px);
  opacity: .52;
  animation: plAurora 26s linear infinite;
}
@keyframes plAurora { from { transform: rotate(0) scale(1.1); } to { transform: rotate(360deg) scale(1.1); } }
.plans-pro .th-bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .8; }
.plans-pro .th-bg-orb-1 { width: 520px; height: 520px; top: -12%; left: -8%;  background: rgba(96, 165, 250, .09); animation: plOrb1 24s ease-in-out infinite; }
.plans-pro .th-bg-orb-2 { width: 460px; height: 460px; top: 26%; right: -10%; background: rgba(59, 130, 246, .07); animation: plOrb2 30s ease-in-out infinite; }
.plans-pro .th-bg-orb-3 { width: 420px; height: 420px; bottom: -14%; left: 38%; background: rgba(147, 197, 253, .05); animation: plOrb3 22s ease-in-out infinite; }
@keyframes plOrb1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(60px,50px)} }
@keyframes plOrb2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-50px,40px)} }
@keyframes plOrb3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,-40px)} }
.plans-pro .th-bg-constellation { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.plans-pro .th-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(147, 197, 253, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
  opacity: .55;
}
.plans-pro .th-bg-noise {
  position: absolute; inset: 0; opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.plans-pro .th-bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(130% 100% at 50% 0%, transparent 55%, rgba(4, 4, 9, .55) 100%);
}

/* ─────────────────────────────────────────────
   FX HELPERS (reveal + spotlight + tilt + buttons) — driven by home.js
   ───────────────────────────────────────────── */
.plans-pro .th-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--th-ease-out), transform .8s var(--th-ease-out);
}
.plans-pro .th-reveal.in-view { opacity: 1; transform: none; }

.plans-pro .th-spot { position: relative; }
.plans-pro .th-spot::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(96, 165, 250, .16), transparent 62%);
  opacity: 0;
  transition: opacity .35s var(--th-ease);
  pointer-events: none;
  z-index: 0;
}
.plans-pro .th-spot:hover::before { opacity: 1; }
.plans-pro .th-spot > * { position: relative; z-index: 1; }

.plans-pro .th-btn {
  --th-btn-shift: 0px, 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform .3s var(--th-ease), box-shadow .3s var(--th-ease),
              background .25s var(--th-ease), border-color .25s var(--th-ease), color .25s;
  transform: translate(var(--th-btn-shift));
}
.plans-pro .th-btn-primary {
  color: #061021;
  background: radial-gradient(120% 160% at 30% 0%, #cfe4ff 0%, #93c5fd 34%, #60a5fa 72%, #3b82f6 100%);
  box-shadow: 0 10px 30px -10px var(--th-glow), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.plans-pro .th-btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 44px -12px var(--th-glow), inset 0 1px 0 rgba(255, 255, 255, .6);
  filter: saturate(1.05);
}
.plans-pro .th-btn-glass {
  color: var(--th-ink);
  background: var(--th-fill-2);
  border-color: var(--th-line-2);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.plans-pro .th-btn-glass:hover:not(:disabled) {
  background: rgba(96, 165, 250, .14);
  border-color: rgba(96, 165, 250, .45);
  color: #fff;
}
.plans-pro .th-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ─────────────────────────────────────────────
   PAGE SHELL
   ───────────────────────────────────────────── */
.plans-pro .plans-wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 24px 110px;
}

/* Hero */
.plans-pro .plans-hero { max-width: 680px; margin: 0 auto 60px; text-align: center; }
.plans-pro .th-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
}
.plans-pro .plans-hero h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.08;
  color: var(--th-ink);
  margin: 14px 0;
}
.plans-pro .plans-hero p { font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.plans-pro .plans-hero p strong { color: var(--th-ink); font-weight: 600; }

/* Monthly / yearly toggle (mirrors home.css .th-bill-toggle) */
.plans-pro .th-bill-toggle {
  position: relative;
  display: inline-flex;
  margin-top: 28px;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--th-fill);
  border: 1px solid var(--th-line-2);
}
.plans-pro .th-bill-toggle button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .3s var(--th-ease);
}
.plans-pro .th-bill-toggle button.is-active { color: #061021; }
.plans-pro .th-bill-toggle button em {
  position: absolute;
  top: -10px; right: -10px;
  z-index: 2;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #061021;
  background: var(--success);
  padding: 4px 7px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .35);
}
.plans-pro .th-bill-pill {
  position: absolute;
  top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  border-radius: var(--radius-pill);
  background: var(--gradient-1);
  box-shadow: 0 6px 18px -6px var(--th-glow);
  transition: transform .35s var(--th-ease);
}
.plans-pro .th-bill-toggle[data-period="yearly"] .th-bill-pill { transform: translateX(100%); }

.plans-pro .plans-current-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--th-fill);
  border: 1px solid var(--th-line);
  font-size: 13px;
  color: var(--text-muted);
}
.plans-pro .plans-renew { opacity: .7; }

.plans-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 36px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--warning-tint);
  border: 1px solid rgba(253, 230, 138, .28);
  color: var(--warning);
  font-size: 13.5px;
}
.plans-notice svg { width: 18px; height: 18px; flex-shrink: 0; }
.plans-notice code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, .25);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}

/* ─────────────────────────────────────────────
   PLAN CARDS (mirrors home.css .th-price)
   ───────────────────────────────────────────── */
.plans-pro .plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
.plans-pro .plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .5));
  border: 1px solid var(--th-line);
  backdrop-filter: blur(12px);
  transition: transform .4s var(--th-ease), border-color .4s var(--th-ease), box-shadow .4s var(--th-ease);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.plans-pro .plan-card:hover { border-color: var(--th-line-2); box-shadow: var(--th-shadow); }
.plans-pro .plan-card.is-featured {
  border-color: rgba(96, 165, 250, .4);
  background: linear-gradient(180deg, rgba(20, 26, 44, .7), rgba(12, 14, 26, .6));
  box-shadow: 0 24px 70px -30px var(--th-glow);
}
.plans-pro .plan-card.is-current { border-color: rgba(110, 231, 183, .4); }
.plans-pro .plan-glow {
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(80% 60% at 50% 0%, rgba(96, 165, 250, .18), transparent 70%);
  pointer-events: none;
}
.plans-pro .plan-flag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #061021; background: var(--gradient-1);
  box-shadow: 0 8px 24px -8px var(--th-glow);
  white-space: nowrap;
}
.plans-pro .plan-flag-current {
  background: linear-gradient(120deg, #6ee7b7, #34d399);
  box-shadow: 0 8px 24px -8px rgba(110, 231, 183, .5);
}

.plans-pro .plan-card-head { margin-bottom: 18px; }
.plans-pro .plan-card-head h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--th-ink);
  margin-bottom: 5px;
  text-transform: none;
  letter-spacing: -.01em;
}
.plans-pro .plan-card-head p { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

.plans-pro .plan-price { display: flex; align-items: baseline; gap: 3px; margin-bottom: 22px; flex-wrap: wrap; }
.plans-pro .plan-price-cur {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 22px; font-weight: 600;
  color: var(--text-muted);
  align-self: flex-start;
  margin-top: 6px;
}
.plans-pro .plan-price-amt {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--th-ink);
  line-height: 1;
}
.plans-pro .plan-price-per { font-size: 13px; color: var(--text-muted); margin-left: 2px; }

.plans-pro .plan-headline {
  padding: 14px;
  border-radius: 14px;
  background: var(--th-fill);
  border: 1px solid var(--th-line);
  text-align: center;
  margin-bottom: 22px;
}
.plans-pro .plan-headline-num {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.plans-pro .plan-headline-lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.plans-pro .plan-cta { margin-bottom: 22px; }
.plans-pro .plan-btn { width: 100%; }
.plans-pro .plan-btn-current {
  background: var(--success-tint);
  border-color: rgba(110, 231, 183, .35);
  color: var(--success);
  cursor: default;
  opacity: 1;
}
.plans-pro .plan-btn.is-loading { opacity: .7; cursor: wait; }

.plans-pro .plan-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}
.plans-pro .plan-feats li {
  position: relative;
  padding-left: 26px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.plans-pro .plan-feats li::before {
  content: '';
  position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: rgba(110, 231, 183, .12);
  border: 1px solid rgba(110, 231, 183, .3);
}
.plans-pro .plan-feats li::after {
  content: '';
  position: absolute; left: 5px; top: 6px;
  width: 7px; height: 4px;
  border-left: 1.8px solid var(--success);
  border-bottom: 1.8px solid var(--success);
  transform: rotate(-45deg);
}

.plans-pro .plans-fine { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 26px; }

/* ─────────────────────────────────────────────
   COMPARISON TABLE
   ───────────────────────────────────────────── */
.plans-pro .plans-compare { margin-top: 96px; }
.plans-pro .plans-compare-title {
  text-align: center;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--th-ink);
  margin-bottom: 32px;
}
.plans-pro .compare-scroll {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--th-line);
  background: linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .5));
  backdrop-filter: blur(12px);
  box-shadow: var(--th-shadow-sm);
}
.plans-pro .compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.plans-pro .compare-table th,
.plans-pro .compare-table td {
  padding: 15px 20px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid var(--th-line);
}
.plans-pro .compare-table thead th {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--th-ink);
  background: rgba(12, 14, 26, .9);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.plans-pro .compare-table th.ct-featured,
.plans-pro .compare-table td.ct-featured { color: var(--accent2); }
.plans-pro .compare-table thead th.ct-featured { background: rgba(30, 41, 70, .92); }
.plans-pro .compare-table tbody tr:last-child td { border-bottom: none; }
.plans-pro .compare-table tbody tr:hover td { background: var(--th-fill); }
.plans-pro .compare-table .ct-highlight td { background: rgba(96, 165, 250, .07); }
.plans-pro .compare-table .ct-highlight:hover td { background: rgba(96, 165, 250, .12); }

.plans-pro .ct-feature {
  text-align: left !important;
  color: var(--text) !important;
  font-weight: 500;
}
.plans-pro .ct-note {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: .7;
}
.plans-pro .compare-table td strong { color: var(--th-ink); font-weight: 700; }
.plans-pro .ct-check { color: var(--success); font-weight: 700; font-size: 16px; }
.plans-pro .ct-cross { color: var(--text-muted); opacity: .5; font-size: 14px; }
.plans-pro .ct-soft { color: var(--text-muted); font-size: 13px; }

.plans-pro .plans-fineprint {
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 980px) {
  .plans-pro .plans-grid { grid-template-columns: 1fr; max-width: 440px; margin-left: auto; margin-right: auto; }
  .plans-pro .plan-card.is-featured { order: -1; }
  .plans-pro .plans-wrap { padding-top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .plans-pro .th-bg-aurora, .plans-pro .th-bg-orb { animation: none !important; }
  .plans-pro .th-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .plans-pro .plan-card, .plans-pro .th-btn { transition: none !important; }
}
