:root {
  --bg: #070a18;
  --text: #f3f5fb;
  --muted: #8b93ad;
  --accent: #6d72f6;
  --accent-soft: #b0b3ff;
  --line: rgba(255,255,255,.1);
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --spring: cubic-bezier(.22, 1, .36, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --glass: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.03) 45%, rgba(255,255,255,.07));
  --rim: inset 0 1px 1px rgba(255,255,255,.4), inset 0 -1px 1px rgba(255,255,255,.08);
}
* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; background: var(--bg); }
body {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  color: var(--text);
  font-family: var(--body); -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- background the glass refracts ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(900px 420px at 60% -10%, rgba(109,114,246,.16), transparent 70%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: drift 28s ease-in-out infinite alternate; }
.orb.a { width: 420px; height: 420px; left: 2%;  top: 24%; background: #4f46e5; opacity: .42; }
.orb.b { width: 380px; height: 380px; left: 40%; top: 46%; background: #7c3aed; opacity: .34; animation-duration: 34s; animation-delay: -10s; }
.orb.c { width: 400px; height: 400px; right: 0;  top: 26%; background: #0ea5e9; opacity: .28; animation-duration: 40s; animation-delay: -18s; }
@keyframes drift { to { transform: translate3d(60px, -36px, 0) scale(1.12); } }

/* ---------- nav ---------- */
.nav-wrap { position: relative; z-index: 40; padding: 18px 24px 0; }
.nav { position: relative; max-width: 1200px; margin: 0 auto; height: 62px; display: flex; align-items: center; justify-content: flex-end; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu { position: relative; }

.pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
  transition: transform .6s var(--spring), background .5s var(--spring); }
.pill:hover { transform: scale(1.03); background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.07)); }
.pill:active { transform: scale(.96); }
.pill .sym { color: var(--accent-soft); font-weight: 600; min-width: 1ch; }
.pill .code { font-weight: 600; letter-spacing: .02em; }
.pill .chev { opacity: .6; transition: transform .25s; }
.pill[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pill.strong { background: linear-gradient(180deg, rgba(150,156,255,.95), rgba(92,97,240,.9)); border-color: rgba(255,255,255,.28);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), 0 10px 24px -12px rgba(109,114,246,.9); font-weight: 600; }
.pill.strong:hover { background: linear-gradient(180deg, rgba(165,171,255,1), rgba(104,109,245,.95)); }
.pill.user { padding-left: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--display);
  background: linear-gradient(135deg, #a5a9ff, #5b5ff0); color: #fff; }

/* ---------- popovers ---------- */
.popover { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; width: 340px; padding: 10px; border-radius: 24px;
  background: linear-gradient(150deg, rgba(52,60,124,.93), rgba(13,17,40,.96));
  border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(36px) saturate(170%); backdrop-filter: blur(36px) saturate(170%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), 0 30px 70px -24px rgba(0,0,0,.9);
  transform-origin: top right; animation: pop .5s var(--spring); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.acct-pop { width: 220px; padding: 14px; }
.who { font-size: 13px; color: var(--muted); padding: 2px 6px 10px; word-break: break-word; }
.menu-item { width: 100%; text-align: left; padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 0; font-size: 14px; font-weight: 500; }
.menu-item:hover { background: rgba(255,255,255,.12); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border-radius: 999px; color: var(--muted);
  background: rgba(4,6,16,.4); border: 1px solid rgba(255,255,255,.1); }
.search:focus-within { border-color: rgba(176,179,255,.55); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14.5px; color: var(--text); }
#cur-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
#cur-list li { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 14px; cursor: pointer; }
#cur-list li .c { font-weight: 600; letter-spacing: .02em; }
#cur-list li .n { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cur-list li .s { color: var(--accent-soft); font-weight: 600; }
#cur-list li.active, #cur-list li:hover { background: rgba(255,255,255,.1); }
#cur-list li[aria-selected="true"] { background: rgba(109,114,246,.3); }
#cur-list .none { color: var(--muted); cursor: default; display: block; text-align: center; }
.rates-note { margin: 8px 6px 2px; font-size: 12px; color: var(--muted); }

/* ---------- hero ---------- */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: clamp(12px, 3vh, 36px) 24px 24px;
  display: flex; flex-direction: column; justify-content: flex-start; }
.hero { text-align: center; margin-bottom: clamp(48px, 8vh, 88px); }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(42px, 6.2vw, 72px); letter-spacing: -.045em; line-height: 1; }
.hero p { margin-top: 16px; color: var(--muted); font-size: clamp(15px, 1.6vw, 17px); }

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; margin: auto 0; }
.plans .error { grid-column: 1 / -1; text-align: center; color: var(--muted); }

.plan { position: relative; isolation: isolate; display: flex; flex-direction: column;
  padding: 30px 26px 26px; border-radius: 28px; border: 1px solid rgba(255,255,255,.07);
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(190%) brightness(1.1); backdrop-filter: blur(28px) saturate(190%) brightness(1.1);
  box-shadow: var(--rim), inset 0 0 28px rgba(255,255,255,.05), 0 34px 60px -32px rgba(0,0,0,.8);
  animation: rise .9s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: calc(var(--i) * 100ms + 80ms);
  transition: transform .9s var(--spring); }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.96); } }
.plan:hover { transform: translateY(-5px); }
.plan::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from 200deg at 50% 50%, rgba(255,255,255,.7), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 52%, rgba(255,255,255,.4) 70%, rgba(255,255,255,0) 86%, rgba(255,255,255,.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude; }
.plan::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.2), transparent 62%); }
.plan:hover::after { opacity: 1; }
.plan.featured { translate: 0 -10px;
  background: linear-gradient(135deg, rgba(139,146,255,.34), rgba(109,114,246,.08) 50%, rgba(139,146,255,.2));
  border-color: rgba(165,169,255,.25);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 1px rgba(255,255,255,.14), inset 0 0 36px rgba(139,146,255,.12), 0 40px 80px -30px rgba(109,114,246,.7); }

.badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  padding: 8px 15px; border-radius: 999px; font: 600 12px/1 var(--body); color: #fff;
  background: linear-gradient(180deg, rgba(139,146,255,.95), rgba(95,100,240,.9)); border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 8px 24px -8px rgba(109,114,246,.8); }

.plan h2 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.015em; }
.access { margin-top: 16px; padding: 11px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; white-space: nowrap; color: var(--accent-soft);
  background: linear-gradient(180deg, rgba(165,169,255,.2), rgba(165,169,255,.08)); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 1px rgba(255,255,255,.28); }
.dots { display: flex; gap: 6px; margin: 14px 0 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(176,179,255,.25); }
.dots i.on { background: var(--accent-soft); box-shadow: 0 0 8px rgba(176,179,255,.55); }

.price { margin-top: 28px; display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.price strong { font-family: var(--display); font-weight: 700; font-size: 46px; letter-spacing: -.04em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.note { margin: 10px 0 30px; color: var(--muted); font-size: 13.5px; }

.btn.primary { background: linear-gradient(180deg, rgba(150,156,255,.98), rgba(92,97,240,.92)); border-color: rgba(255,255,255,.3);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -8px 14px rgba(60,64,200,.35), 0 14px 30px -12px rgba(109,114,246,.95); color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, rgba(165,171,255,1), rgba(104,109,245,.96)); }


/* ---------- Get started: glass button with slow, relaxed motion ---------- */
@property --rim { syntax: "<angle>"; inherits: false; initial-value: -60deg; }

.cta { position: relative; isolation: isolate; margin-top: auto; width: 100%; height: 54px; padding: 0; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; color: var(--text); cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(135deg, rgba(255,255,255,.15), rgba(255,255,255,.04) 55%, rgba(255,255,255,.1));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -10px 18px -6px rgba(255,255,255,.07), 0 12px 28px -16px rgba(0,0,0,.85);
  transition: transform 1s var(--ease), box-shadow 1s var(--ease), filter 1s var(--ease), --rim 1.8s var(--ease); }
.cta > span { position: relative; z-index: 3; display: block; transition: transform 1s var(--ease); }
/* glass edge: a bright rim that slowly travels around the button on hover */
.cta::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1.2px; pointer-events: none;
  background: conic-gradient(from var(--rim) at 50% 50%, rgba(255,255,255,.8), rgba(255,255,255,.1) 22%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.6) 72%, rgba(255,255,255,.1) 88%, rgba(255,255,255,.8));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
/* light inside the glass that follows the cursor (position set in app.js) */
.cta::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0;
  transition: opacity 1.2s var(--ease);
  background: radial-gradient(140px circle at var(--bx, 50%) var(--by, 20%), rgba(255,255,255,.4), rgba(255,255,255,.1) 46%, transparent 72%); }

.featured .cta {
  background:
    linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(135deg, rgba(139,146,255,.88), rgba(95,100,240,.72) 55%, rgba(139,146,255,.82));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -10px 18px -6px rgba(255,255,255,.1), 0 16px 34px -14px rgba(109,114,246,.95); }

@media (hover: hover) {
  .cta:hover, .cta:focus-visible { transform: translateY(-3px); --rim: 150deg; filter: brightness(1.08);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -12px 22px -6px rgba(255,255,255,.12), inset 0 0 22px rgba(255,255,255,.08),
      0 24px 42px -18px rgba(120,126,255,.6), 0 0 0 5px rgba(176,179,255,.06); }
  .featured .cta:hover, .featured .cta:focus-visible {
    box-shadow: inset 0 1px 1px rgba(255,255,255,.8), inset 0 -12px 22px -6px rgba(255,255,255,.14), inset 0 0 22px rgba(255,255,255,.1),
      0 26px 46px -16px rgba(120,126,255,1), 0 0 0 5px rgba(176,179,255,.08); }
  .cta:hover::after, .cta:focus-visible::after { opacity: 1; }
}
.cta:focus-visible { outline: none; }
.cta:active { transform: translateY(0) scale(.982); transition-duration: .4s; filter: brightness(.98);
  box-shadow: inset 0 3px 9px rgba(0,0,0,.28), inset 0 1px 1px rgba(255,255,255,.3), 0 6px 14px -10px rgba(0,0,0,.8); }

/* ---------- footer ---------- */
.foot { display: flex; justify-content: center; padding: 8px 24px calc(28px + env(safe-area-inset-bottom, 0px)); }
.support { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 20px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: transform .6s var(--spring), color .4s var(--spring); }
.support:hover { color: var(--text); transform: translateY(-2px); }

/* ---------- dialogs ---------- */
dialog { margin: auto; padding: 0; width: min(440px, calc(100% - 32px)); color: var(--text); border-radius: 32px; border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(150deg, rgba(56,64,124,.6), rgba(16,20,44,.78));
  -webkit-backdrop-filter: blur(34px) saturate(170%); backdrop-filter: blur(34px) saturate(170%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), inset 0 0 40px rgba(255,255,255,.04), 0 50px 110px -30px rgba(0,0,0,.9); }
dialog[open] { animation: dpop .7s var(--spring); }
@keyframes dpop { from { opacity: 0; transform: translateY(14px) scale(.92); } }
dialog::backdrop { background: rgba(4,6,14,.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.dlg-body { padding: 30px; }
dialog h3 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.015em; }
dialog .sub { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.summary { margin: 20px 0 14px; padding: 15px 18px; border-radius: 20px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.12); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary b { font-family: var(--display); font-size: 24px; letter-spacing: -.025em; white-space: nowrap; }
.summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 13.5px; }
.charge-note { margin: 0 4px 16px; color: var(--accent-soft); font-size: 13px; line-height: 1.45; }
form label { display: block; margin: 18px 0 9px; color: var(--muted); font-size: 13.5px; }
#co-form label { margin-top: 6px; }
input[type=email], input[type=text]#full-name { width: 100%; height: 50px; padding: 0 18px; border-radius: 999px; font-size: 15px;
  background: rgba(4,6,16,.42); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
input[type=email]:focus, input#full-name:focus { outline: none; border-color: rgba(176,179,255,.65); }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { flex: 1; height: 50px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45); transition: transform .5s var(--spring), background .4s var(--spring); }
.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(.96); }
.btn.ghost { flex: 0 0 auto; color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.status { min-height: 20px; margin-top: 14px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.status.error { color: #ff9f9f; }
.check { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; color: #fff;
  background: linear-gradient(180deg, rgba(150,156,255,.98), rgba(92,97,240,.92)); box-shadow: inset 0 1px 1px rgba(255,255,255,.6), 0 14px 30px -10px rgba(109,114,246,.9); }
.noscript { text-align: center; color: var(--muted); padding: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
  .plan.featured { translate: none; }
}
@media (max-width: 620px) {
  .nav-wrap { padding: 12px 16px 0; }
  .nav { height: 58px; }
  .pill { padding: 0 13px; }
  main { padding: 12px 16px 16px; }
  .plans { grid-template-columns: 1fr; gap: 28px; }
  .popover, .acct-pop { position: fixed; left: 16px; right: 16px; top: 82px; width: auto; transform-origin: top center; }
  .acct-pop { left: auto; width: 240px; }
  .dlg-body { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .plan, .popover, dialog[open], dialog::backdrop { animation: none; }
  .plan, .pill, .btn, .support, .cta, .cta > span, .cta::after { transition: none; }
  .plan:hover { transform: none; }
}
