/* ============================================================
   NxtAtlas AI — pricing

   Loads last, after css/atlas.css. atlas.css owns the palette, so
   nothing in this file may name a colour: every surface, rule and
   accent below resolves through a token and therefore survives the
   light/dark switch.

   The page has one job — make the three tiers and the numbers that
   separate them legible in a single pass, at 360px as well as at
   1600px. Everything here is layout, rhythm and type; the only
   decoration is a single warm bloom behind the heading.
   ============================================================ */

/* ============================================================
   BASE
   styles.css sets `body { overflow: hidden }` for the chat shell.
   That propagates to the viewport and freezes any document page,
   so it has to be undone before anything else works.
   ============================================================ */
body.ap-body {
  /* atlas.css declares the --atlas-* family only inside its light block
     (`:root:not([data-theme])`, `:root[data-theme="light"]`), so on a page
     that runs dark — the default here, and every named theme too — those
     four resolve to nothing: no Sora, no Manrope, no brass hairline. Each
     use below goes through an alias with a fallback rebuilt from tokens
     that do exist. Drop the fallbacks once the family is hoisted out of
     that block; the aliases can stay either way. */
  --ap-display:    var(--atlas-display, "Sora", system-ui, -apple-system, sans-serif);
  --ap-text:       var(--atlas-body, "Manrope", system-ui, -apple-system, sans-serif);
  --ap-brass-soft: var(--atlas-brass-soft, color-mix(in srgb, var(--accent) 34%, transparent));

  --ap-edge:    clamp(20px, 5vw, 40px);
  --ap-max:     1140px;
  --ap-section: clamp(64px, 10vh, 116px);
  --ap-ease:    cubic-bezier(.22, 1, .36, 1);
  --ap-fast:    .24s;

  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ap-text);
  font-size: 16px;
  line-height: 1.65;
  overflow: visible;
  overflow-x: clip;          /* keeps `position: sticky` alive, unlike hidden */
  overscroll-behavior-y: auto;
  -webkit-font-smoothing: antialiased;
}

/* one soft warm halo, fixed behind everything. no grain, no frame */
.ap-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(84% 60% at 74% -6%, var(--accent-soft), transparent 62%),
    linear-gradient(180deg, var(--bg-sidebar), var(--bg) 44%);
}

.ap-skip, .ap-head, .ap-main, .ap-foot { position: relative; z-index: 1; }
.ap-head { z-index: 20; }

/* Decoration only. A blanket `.ap-body a { color: inherit }` would sit at
   (0,1,1) — above component classes like .btn-primary — and quietly repaint
   the dialog's brass button with body-text colour. Colour is left to each
   link's own rule. */
.ap-body a { text-decoration: none; }

/* one focus ring everywhere — redesign.css would otherwise paint its own */
.ap-body a:focus-visible,
.ap-body button:focus-visible,
.ap-body summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
  border-radius: 8px;
}

.ap-shell {
  width: 100%;
  max-width: var(--ap-max);
  margin-inline: auto;
  padding-inline: var(--ap-edge);
}

/* clipped rather than pushed off to -9999px: an off-canvas element is real
   layout, and at 360px it is the difference between a clean page and a
   phantom horizontal scroll */
.ap-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ap-skip:focus {
  top: 12px;
  left: 12px;
  z-index: 60;
  width: auto;
  height: auto;
  clip-path: none;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
}

/* ============================================================
   TYPE
   ============================================================ */
.ap-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ap-eyebrow::before {
  content: "";
  flex: none;
  width: 24px;
  height: 1px;
  background: var(--ap-brass-soft);
}

.ap-h1 {
  margin: 18px 0 0;
  font-family: var(--ap-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  color: var(--text);
}
/* the word-split animation clips each word to its own line box; a little
   breathing room under it stops descenders being shaved off */
.ap-h1 .a-word-outer { padding-bottom: .14em; }

.ap-h2 {
  margin: 14px 0 0;
  font-family: var(--ap-display);
  font-weight: 500;
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  color: var(--text);
}

.ap-lede {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.7;
}
.ap-note {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.ap-mono { font-variant-numeric: tabular-nums; letter-spacing: .05em; color: var(--text); }

/* ============================================================
   BUTTONS
   transform is deliberately outside the transition — the magnetic
   hook writes it on every pointer move and easing it feels laggy.
   ============================================================ */
.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--ap-text);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ap-fast) ease,
              border-color var(--ap-fast) ease,
              color var(--ap-fast) ease;
}
.ap-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.ap-btn-brass {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.ap-btn-brass:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.ap-btn-block { width: 100%; }
.ap-btn svg { flex: none; }

/* ============================================================
   HEADER — full bleed, sticky, hairline
   ============================================================ */
.ap-head {
  position: sticky;
  top: 0;
  padding-block: 13px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.ap-head-in {
  max-width: none;
  padding-inline: clamp(16px, 3.4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
/* atlas.css sets the wordmark's face from --atlas-display, which is one of
   the four that go missing outside the light theme — restate it locally */
.ap-body .atlas-wm { font-family: var(--ap-display); }

.ap-mark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ap-mark-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
  transition: transform .5s var(--ap-ease);
}
.ap-mark:hover .ap-mark-logo { transform: rotate(-8deg) scale(1.06); }
.ap-mark .atlas-wm { font-size: 13px; letter-spacing: .2em; }
.ap-mark-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ap-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.ap-nav-link {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--ap-fast) ease;
}
.ap-nav-link:hover { color: var(--accent); }
.ap-nav-link.is-active { color: var(--text); }
.ap-head-cta { padding: 10px 20px; font-size: 13.5px; }
.ap-head-cta .t-narrow { display: none; }

@media (max-width: 700px) {
  .ap-nav-link { display: none; }
  .ap-mark .atlas-wm { font-size: 12px; }
}
@media (max-width: 460px) {
  /* the full label eats half the bar on a small phone */
  .ap-head-cta .t-wide { display: none; }
  .ap-head-cta .t-narrow { display: inline; }
  .ap-head-cta { padding: 10px 16px; }
}

/* ============================================================
   HERO
   ============================================================ */
.ap-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vh, 104px) clamp(40px, 6vh, 72px);
}
.ap-bloom {
  position: absolute;
  left: 50%;
  top: -22%;
  translate: -50% 0;
  z-index: 0;
  width: min(1080px, 130vw);
  aspect-ratio: 1.2;
  pointer-events: none;
  /* softness lives in the gradient stops, not in a blur filter — an
     animated blur this large re-rasterises on every scrolled frame */
  background: radial-gradient(circle,
    var(--ap-brass-soft) 0%, var(--accent-soft) 30%, transparent 66%);
}
.ap-hero-in { position: relative; z-index: 1; }
.ap-hero-cta {
  margin-top: clamp(26px, 3.4vw, 36px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 430px) {
  .ap-hero-cta { flex-direction: column; align-items: stretch; }
  .ap-hero-cta .ap-btn { width: 100%; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.ap-sec { padding-block: 0 var(--ap-section); scroll-margin-top: 84px; }
.ap-sec-head { max-width: 64ch; }

/* ============================================================
   TIER CARDS
   One column until there is honest room for three; a 2 + 1 wrap
   would imply a ranking the tiers do not have.
   ============================================================ */
.ap-grid {
  margin: clamp(26px, 3.6vw, 42px) auto 0;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 460px;
}
@media (min-width: 860px) {
  .ap-grid { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.ap-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bg-elev), transparent 74%);
  transition: border-color var(--ap-fast) ease;
}
.ap-card > * { position: relative; }
.ap-card:hover { border-color: var(--ap-brass-soft); }
/* the spotlight — atlas-motion.js feeds --mx / --my */
.ap-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
                              var(--accent-soft), transparent 68%);
  transition: opacity .32s ease;
}
.ap-card:hover::after { opacity: 1; }

.ap-card.is-featured { border-color: var(--ap-brass-soft); }
.ap-card.is-featured::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* The tier name is the anchor, not the price: two of the three prices are
   the word "Custom", so leading with the figure would make the cards look
   interchangeable. The figures that do differ live in .ap-quick below. */
.ap-tier {
  margin: 0;
  font-family: var(--ap-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
}
.ap-price {
  margin: 9px 0 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 9px;
}
.ap-price-n {
  font-family: var(--ap-display);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--accent);
}
.ap-price-per { font-size: 12.5px; color: var(--text-muted); }
.ap-tier-line {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* the four numbers that matter, on the card itself, so a phone reader
   never has to hold a table in their head */
.ap-quick {
  margin: 20px 0 0;
  padding: 16px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 12px;
  border-block: 1px solid var(--border);
}
.ap-quick > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-quick dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ap-quick dd {
  margin: 0;
  font-family: var(--ap-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ap-quick dd .ap-u {
  margin-left: 3px;
  font-family: var(--ap-text);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted);
}
.ap-quick dd.ap-none { color: var(--text-muted); }

.ap-inc {
  margin: 20px 0 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ap-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ap-list li {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}
.ap-list b { color: var(--text); font-weight: 600; }
.ap-tick { margin-top: 4px; color: var(--accent); }
.ap-list li.ap-off { color: var(--text-muted); }
.ap-list li.ap-off .ap-tick { color: var(--text-muted); opacity: .65; }

.ap-card-cta { margin-top: auto; padding-top: 24px; }

/* ============================================================
   THE COMPARISON TABLE
   A real table: row headers, column headers, no scroll at 360px.
   ============================================================ */
.ap-table-wrap {
  margin-top: clamp(24px, 3.4vw, 38px);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bg-elev), transparent 84%);
}
.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.ap-table col.ap-col-row { width: 38%; }

.ap-table thead th {
  padding: 15px 8px;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--ap-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}
.ap-table thead th:first-child {
  text-align: left;
  padding-left: clamp(14px, 2.2vw, 24px);
}
.ap-table thead th.is-lead { color: var(--accent); }

.ap-table tbody th {
  padding: 14px clamp(8px, 1.4vw, 16px) 14px clamp(14px, 2.2vw, 24px);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}
.ap-table tbody th small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
}
.ap-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 15px;
  color: var(--text);
}
.ap-table td.ap-none { color: var(--text-muted); }
.ap-table tbody tr:last-child th,
.ap-table tbody tr:last-child td { border-bottom: 0; }
.ap-table tbody tr:hover th,
.ap-table tbody tr:hover td { background: var(--bg-hover); }

.ap-foot-note {
  margin: 16px 0 0;
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

@media (max-width: 400px) {
  .ap-table tbody th { font-size: 12.5px; }
  .ap-table td { font-size: 13.5px; }
  .ap-table thead th { letter-spacing: .1em; }
}

/* ============================================================
   FAQ
   ============================================================ */
/* the list is capped, not the shell — narrowing the shell would indent the
   heading and break the left edge every other section shares */
.ap-faq-list {
  margin-top: clamp(20px, 3vw, 32px);
  max-width: 860px;
  border-top: 1px solid var(--border);
}
.ap-faq-item { border-bottom: 1px solid var(--border); }
.ap-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 2px;
  list-style: none;
  cursor: pointer;
  font-family: var(--ap-display);
  font-size: clamp(15px, 1.6vw, 17px);
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text);
  transition: color var(--ap-fast) ease;
}
.ap-faq-item summary::-webkit-details-marker { display: none; }
.ap-faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: .5;
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--ap-fast) var(--ap-ease);
}
.ap-faq-item[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.ap-faq-item summary:hover { color: var(--accent); }
.ap-faq-a {
  padding: 0 2px 22px;
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.ap-foot { padding-block: 0 46px; }
.ap-foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.ap-foot-brand { display: inline-flex; align-items: center; gap: 9px; }
.ap-foot-brand img { border-radius: 6px; display: block; }
.ap-foot-brand .atlas-wm { font-size: 11.5px; letter-spacing: .2em; color: var(--text-muted); }
.ap-foot-c { font-size: 12px; letter-spacing: .04em; color: var(--text-muted); }
.ap-foot-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.ap-foot-nav a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--ap-fast) ease;
}
.ap-foot-nav a:hover { color: var(--accent); }

/* ============================================================
   THE TELEGRAM DIALOG
   Markup and ids are inherited from the old page — app CSS already
   styles it through the tokens, so only the leftovers that hard-code
   the previous brand's colours need correcting.
   ============================================================ */
.ap-body .lock {
  z-index: 120;
  padding: 20px;
  background: var(--backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ap-body .lock-card {
  max-width: 400px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-modal);
}
.ap-body .upgrade-card::before { display: none; }   /* retire the old glow */
.ap-body .upgrade-icon {
  border: 1px solid var(--ap-brass-soft);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.ap-body .lock-title {
  font-family: var(--ap-display);
  font-weight: 500;
  letter-spacing: -.02em;
}
.ap-body .tg-card { background: var(--bg-hover); border-color: var(--border); }
.ap-body .tg-card-value.mono { font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.ap-body .lock .btn { border-radius: 10px; padding: 12px 18px; }

/* ============================================================
   MOTION FALLBACKS
   atlas.css hides .a-reveal only while the motion module is alive;
   these two rules cover the pointer-driven decoration instead.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ap-card::after { display: none; }
  .ap-mark:hover .ap-mark-logo { transform: none; }
}
@media (hover: none) {
  .ap-card::after { display: none; }
}
