/* CommercePilot — marketing site
   Brand tokens mirror app/lib/brand.js so the site and the app agree. */

:root {
  --brand: #6d4ae6;
  --brand-dark: #5335c4;
  --brand-soft: #efeafc;
  --brand-grad-end: #8b3fe8;
  --accent: #ffb020;

  --ink: #14121f;
  --ink-2: #3a3552;
  --muted: #6b6880;
  --line: #e7e4f0;
  --surface: #ffffff;
  --surface-2: #f7f6fb;
  --surface-3: #f0eef8;

  --ok: #0f9d76;
  --ok-soft: #e3f6ef;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 31, .06), 0 1px 3px rgba(20, 18, 31, .04);
  --shadow-md: 0 4px 12px rgba(20, 18, 31, .07), 0 12px 32px rgba(20, 18, 31, .06);
  --shadow-lg: 0 12px 28px rgba(83, 53, 196, .13), 0 32px 64px rgba(20, 18, 31, .12);

  --maxw: 1140px;
  --pad: clamp(20px, 5vw, 40px);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f2fb;
    --ink-2: #cfcae3;
    --muted: #a09ab8;
    --line: #2b2740;
    --surface: #141221;
    --surface-2: #1a1730;
    --surface-3: #221e3c;
    --brand-soft: #241d47;
    --ok-soft: #12332a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .45), 0 32px 64px rgba(0, 0, 0, .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.022em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); letter-spacing: -.028em; }
h3 { font-size: 1.16rem; }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: clamp(64px, 9vw, 116px); }
.center { text-align: center; }

.lede {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  color: var(--muted);
  line-height: 1.62;
  max-width: 60ch;
}
.center .lede { margin-inline: auto; }

/* ---------- chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .82rem; font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 11px;
  font-weight: 600; font-size: .97rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-grad-end));
  color: #fff;
  box-shadow: 0 1px 2px rgba(83, 53, 196, .3), 0 8px 22px rgba(109, 74, 230, .28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(83,53,196,.34), 0 16px 34px rgba(109,74,230,.34); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .btn-row { justify-content: center; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-head.is-stuck { border-bottom-color: var(--line); }
.head-in {
  max-width: var(--maxw); margin: 0 auto; padding: 14px var(--pad);
  display: flex; align-items: center; gap: 28px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -.02em; font-size: 1.06rem;
  color: var(--ink); text-decoration: none !important;
}
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo .sub { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); font-size: .94rem; font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--brand); }
@media (max-width: 860px) { .nav .hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(56px, 8vw, 104px) clamp(40px, 6vw, 72px);
  background:
    radial-gradient(1100px 520px at 50% -12%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 68%),
    radial-gradient(700px 380px at 88% 8%, color-mix(in srgb, var(--brand-grad-end) 15%, transparent), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(760px 400px at 50% 0%, #000, transparent 78%);
}
.hero-in { position: relative; display: grid; gap: 26px; justify-items: center; text-align: center; }
.hero h1 { max-width: 17ch; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-grad-end) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-note { font-size: .87rem; color: var(--muted); }

/* ---------- browser frame ---------- */
.frame {
  margin-top: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.frame-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 15px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
}
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.frame-url {
  margin-left: 10px; font-size: .74rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  padding: 3px 12px; border-radius: 999px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.frame img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- trust strip ---------- */
.strip {
  border-block: 1px solid var(--line);
  background: var(--surface-2);
  padding-block: 22px;
}
.strip-in {
  display: flex; flex-wrap: wrap; gap: 12px 34px;
  align-items: center; justify-content: center;
  font-size: .89rem; color: var(--muted); font-weight: 500;
}
.strip-in span { display: inline-flex; align-items: center; gap: 9px; }
.tick { color: var(--ok); flex: none; }

/* ---------- section head ---------- */
.sec-head { display: grid; gap: 14px; margin-bottom: 46px; justify-items: center; text-align: center; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 26%, var(--line));
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }
.ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  margin-bottom: 16px;
}

/* ---------- split ---------- */
.split { display: grid; gap: 40px; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.split + .split { margin-top: clamp(56px, 7vw, 92px); }
.split .body { display: grid; gap: 16px; }
.ticks { display: grid; gap: 11px; padding: 0; margin: 6px 0 0; list-style: none; }
.ticks li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; color: var(--ink-2); }

/* ---------- pricing ---------- */
.tiers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
.tier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  display: grid; gap: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.tier.hot {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  box-shadow: var(--shadow-lg);
}
.tier-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand), var(--brand-grad-end));
  color: #fff; font-size: .73rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  white-space: nowrap;
}
.tier .name { font-weight: 700; font-size: 1.06rem; }
.price { display: flex; align-items: baseline; gap: 4px; }
.price .amt { font-size: 2.7rem; font-weight: 700; letter-spacing: -.04em; }
.price .per { color: var(--muted); font-size: .92rem; }
.tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tier li { display: flex; gap: 10px; font-size: .93rem; color: var(--ink-2); align-items: flex-start; }
.tier .btn { width: 100%; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; margin-inline: auto; }
details.qa {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
details.qa summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after {
  content: "+"; color: var(--brand); font-size: 1.4rem; font-weight: 400;
  line-height: 1; flex: none; transition: transform .2s ease;
}
details.qa[open] summary::after { transform: rotate(45deg); }
details.qa p { margin-top: 12px; color: var(--muted); font-size: .95rem; }

/* ---------- CTA band ---------- */
.cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-grad-end));
  border-radius: var(--radius-lg);
  padding: clamp(38px, 6vw, 62px);
  text-align: center;
  display: grid; gap: 18px; justify-items: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .88); max-width: 52ch; }
.cta .btn-ghost { background: #fff; color: var(--brand-dark); border-color: transparent; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding-block: 52px 34px;
  margin-top: 8px;
}
/* Explicit tracks: `1.6fr repeat(auto-fit, …)` is invalid CSS — auto-fit can't
   follow a flexible track — so the whole declaration was dropped and the
   footer collapsed to a single column. */
.foot-grid { display: grid; gap: 34px; grid-template-columns: 1.8fr 1fr 1fr 1fr; }
@media (max-width: 880px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { color: var(--ink-2); font-size: .93rem; text-decoration: none; }
.foot-grid a:hover { color: var(--brand); }
.foot-note { color: var(--muted); font-size: .9rem; max-width: 34ch; margin-top: 12px; }
.foot-bottom {
  margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
  color: var(--muted); font-size: .87rem;
}

/* ---------- legal / prose pages ---------- */
.prose-head {
  padding-block: clamp(48px, 7vw, 78px) 34px;
  background:
    radial-gradient(760px 300px at 20% -30%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.prose { max-width: 760px; margin-inline: auto; padding-block: clamp(40px, 6vw, 64px); }
.prose h2 { font-size: 1.42rem; margin-top: 44px; margin-bottom: 12px; }
.prose h3 { font-size: 1.06rem; margin-top: 26px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 1rem; line-height: 1.72; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 22px; display: grid; gap: 9px; margin: 14px 0 0; }
.prose a { text-decoration: underline; }
.prose .meta { color: var(--muted); font-size: .92rem; }
.prose table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.tablewrap { overflow-x: auto; }

.callout {
  margin-top: 22px; padding: 18px 20px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: var(--radius);
  font-size: .95rem;
}
.callout strong { color: var(--ink); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- small screens ---------- */
/* Long words and un-wrappable buttons were pushing the page 3px wide at 390px. */
h1, h2, h3, h4, p, li, summary { overflow-wrap: break-word; }

@media (max-width: 520px) {
  /* "CheckoutOS by CommercePilot" + nav overflowed the header on the legal pages */
  .logo .sub { display: none; }
  .head-in { gap: 14px; }
  .nav { gap: 16px; }
  .btn { white-space: normal; max-width: 100%; }
  .btn-lg { padding: 14px 20px; font-size: .96rem; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1 1 auto; }
  .cta { padding: 34px 20px; }
  .card, .tier { padding: 22px 20px; }
  .frame-url { display: none; }
}
