/* Public marketing pages: landing, pricing, checkout.
   Depends on tokens.css, base.css, components.css.

   These pages, not the consoles, are what SAAS_UI_UX_DESIGN_STANDARD.md was
   written for, so its rules apply here without the density trade-offs noted in
   tokens.css. The mechanism is a token override rather than a pile of
   per-element font-size rules: `body.marketing` re-declares the type scale, and
   every shared component — button, card, badge, table — picks up marketing
   sizing automatically because they were all built against the tokens. */

body.marketing {
  /* Standard §3 type scale, desktop column. 16px body is the floor here; the
     console's denser 15px does not apply to a page whose content is prose. */
  --font-size-caption: 13px;
  --font-size-label: 14px;
  --font-size-body: 16px;
  --font-size-lg: 18px;
  --font-size-h3: 28px;
  --font-size-h2: 40px;
  --font-size-h1: 56px;

  font-size: var(--font-size-body);
  min-height: 100vh;
}

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

/* Tablet and mobile steps of the same scale. */
@media (max-width: 1023px) {
  body.marketing { --font-size-h1: 48px; --font-size-h2: 36px; --font-size-h3: 26px; }
}
@media (max-width: 767px) {
  body.marketing { --font-size-h1: 40px; --font-size-h2: 32px; --font-size-h3: 24px; }
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }

/* Marketing buttons are the page's conversion actions: larger text than the
   console's dense toolbar controls, within the standard's 14-16px range. */
body.marketing .btn { font-size: var(--font-size-body); padding: 0 var(--space-6); }
body.marketing .btn.sm { font-size: var(--font-size-label); padding: 0 var(--space-4); }
body.marketing .btn:hover { transform: translateY(-1px); }
body.marketing .btn:active { transform: translateY(0) scale(.985); }

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 17, 32, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--container);
  min-height: 68px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-6);
}
.brand { display: flex; align-items: center; gap: var(--space-2); font-size: var(--font-size-body); font-weight: var(--weight-heading); }
.brand:hover { text-decoration: none; }
.brand .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logomark { flex-shrink: 0; transition: transform var(--motion) var(--ease); }
.brand:hover .logomark { transform: scale(1.08); }

/* The header's "Get started" is the page's main conversion action, so it keeps
   the full 44px target even though it sits in a dense bar. Only its text drops
   to label size — the `.sm` modifier on these two buttons is about type, not
   about shrinking the thing a visitor is meant to click. */
body.marketing .site-nav .nav-cta .btn {
  min-height: 44px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-label);
}

.navlinks { display: flex; gap: var(--space-6); font-size: var(--font-size-label); }
.navlinks a { color: var(--muted); }
.navlinks a:hover { color: var(--text); }

/* Mobile menu button — hidden on desktop. The standard is explicit that a
   hamburger must not appear on desktop just to look minimal. */
.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-24) var(--space-6) var(--space-20);
  text-align: center;
  background: radial-gradient(60% 60% at 50% 0%, #0e2a3f 0%, var(--bg) 70%);
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .32;
  pointer-events: none;
}
.hero::before { width: 280px; height: 280px; background: var(--accent); top: -60px; left: 8%; animation: drift1 14s ease-in-out infinite; }
.hero::after { width: 320px; height: 320px; background: var(--accent2); top: 10px; right: 6%; animation: drift2 16s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,24px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-25px,26px); } }
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  /* Standard: hero copy caps at 700-800px so the line length stays readable. */
  max-width: 800px;
  margin: 0 auto var(--space-4);
  line-height: 1.08;
}
.hero h1 .grad, #heroCycle {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#heroCycle { display: inline-block; transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease); }
#heroCycle.swap { opacity: 0; transform: translateY(6px); }

.hero p {
  max-width: 620px;
  margin: 0 auto var(--space-8);
  color: var(--muted);
  font-size: var(--font-size-lg);
}
.hero .ctas { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

.pill-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 5px var(--space-3);
  background: #0f2018;
  border: 1px solid var(--accent-soft-line);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: var(--font-size-caption);
  /* Uppercase eyebrow gets the standard's extra letter spacing. */
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: var(--weight-label);
}

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding: var(--space-24) var(--space-6); }
.section-head { max-width: 640px; margin: 0 auto var(--space-12); text-align: center; }
.section-head h2 { margin-bottom: var(--space-3); }
.section-head p { color: var(--muted); font-size: var(--font-size-lg); margin: 0 auto; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.show { opacity: 1; transform: translateY(0); }

/* Four cards → two → one, the standard's transformation for a 4-up row. */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); max-width: var(--container); margin: 0 auto; }
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  transition: transform var(--motion) var(--ease), border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
}
.feature:hover { transform: translateY(-2px); border-color: var(--accent2); box-shadow: var(--shadow-2); }
.feature .ico { display: inline-block; font-size: 28px; margin-bottom: var(--space-4); transition: transform var(--motion) var(--ease); }
.feature:hover .ico { transform: scale(1.12) rotate(-4deg); }
.feature h3 { font-size: var(--font-size-lg); margin-bottom: var(--space-2); }
.feature p { color: var(--muted); font-size: var(--font-size-body); line-height: var(--leading-body); }

/* ============================================================
   DEMO + SIGNUP
   ============================================================ */
.demo-wrap { max-width: 660px; margin: 0 auto; }
.signup-wrap { max-width: 440px; margin: 0 auto; }
.demo-input { display: flex; gap: var(--space-2); }
.demo-input input { flex: 1; }
body.marketing .chatlog { height: 300px; max-height: none; margin-bottom: var(--space-3); }
body.marketing .msg { animation: msgIn .25s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.typing { display: flex; gap: 4px; padding: 2px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.challenge-box { padding: var(--space-1) 0; text-align: center; }
.challenge-box p { color: var(--muted); font-size: var(--font-size-label); margin: 0 auto var(--space-3); }
.challenge-box .row { display: flex; gap: var(--space-2); grid-template-columns: none; }

.badge-live { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: var(--space-2); color: var(--accent); font-size: var(--font-size-caption); }
.badge-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 rgba(56,224,165,0); } 50% { box-shadow: 0 0 14px rgba(56,224,165,.3); } }

.hint { margin-top: var(--space-3); color: var(--muted); font-size: var(--font-size-label); text-align: center; }
.divider { margin: var(--space-4) 0; color: var(--muted); font-size: var(--font-size-label); text-align: center; }

/* Dropdown arrow drawn in CSS so the control matches the other fields. */
body.marketing select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%3E%3Cpath%20d%3D%22M1%201l5%205%205-5%22%20stroke%3D%22%2393a4c0%22%20stroke-width%3D%221.6%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
}
body.marketing select option { background: var(--field); color: var(--text); }

/* ============================================================
   CAPABILITY MARQUEE
   Decorative only (aria-hidden) — the standard's ban on auto-rotating carousels
   applies to essential information, and nothing here appears only in the
   marquee. It stops entirely under prefers-reduced-motion.
   ============================================================ */
.marquee { overflow: hidden; padding: var(--space-3) 0; background: var(--panel2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; gap: var(--space-10); animation: marqueeScroll 32s linear infinite; }
.marquee-item { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--font-size-label); white-space: nowrap; }
.marquee-item b { color: var(--text); font-weight: var(--weight-strong); }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   VERTICALS CAROUSEL
   Scroll-snap with arrows and dots. Not auto-rotating, and it is a scrollable
   list rather than a swipe-only widget, so keyboard and touch both work.
   ============================================================ */
.vcarousel { position: relative; max-width: var(--container); margin: 0 auto; }
.vtrack {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: var(--space-1) var(--space-1) var(--space-4);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.vtrack::-webkit-scrollbar { display: none; }
.vcard {
  flex: 0 0 240px;
  scroll-snap-align: start;
  padding: var(--space-6);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.vcard:hover { border-color: var(--accent2); transform: translateY(-2px); }
.vcard .ico { display: inline-block; font-size: 26px; margin-bottom: var(--space-3); }
.vcard h3 { font-size: var(--font-size-body); margin-bottom: var(--space-2); }
.vcard p { color: var(--muted); font-size: var(--font-size-label); line-height: var(--leading-body); }

.vnav { display: flex; justify-content: center; align-items: center; gap: var(--space-4); margin-top: var(--space-2); }
.varrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease);
}
.varrow:hover { border-color: var(--accent2); }
.vdots { display: flex; gap: var(--space-2); }
/* The dot itself is 6px, but its hit area is a full 24px — the standard's
   minimum target size, with the visual mark kept small deliberately. */
.vdot {
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vdot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease); }
.vdot.active::before { background: var(--accent); transform: scale(1.4); }

/* ============================================================
   PRICING
   Three plans, one highlighted. Note the plan feature list is `.plan-features`,
   not `.features` — that name is the landing page's 4-up card grid, and once
   both pages shared a stylesheet the two collided.
   ============================================================ */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); max-width: var(--container); margin: 0 auto; }
.plan {
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
/* The recommended plan is marked with a badge and a stronger border, not by
   being made dramatically larger than its neighbours. */
.plan.featured { position: relative; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.plan.featured::before {
  content: 'Most popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px var(--space-3);
  background: var(--accent);
  border-radius: var(--radius-pill);
  color: var(--on-accent);
  font-size: var(--font-size-caption);
  font-weight: var(--weight-heading);
  white-space: nowrap;
}
.plan h3 { font-size: var(--font-size-h3); margin-bottom: var(--space-1); }
.plan .audience { color: var(--muted); font-size: var(--font-size-label); }
.price { margin: var(--space-3) 0 2px; font-size: var(--font-size-h2); font-weight: var(--weight-heading); }
.price span { color: var(--muted); font-size: var(--font-size-body); font-weight: var(--weight-body); }
.included { margin-bottom: var(--space-4); color: var(--muted); font-size: var(--font-size-label); }
.plan-features { flex: 1; list-style: none; margin-bottom: var(--space-6); }
.plan-features li { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: var(--font-size-body); }
.plan-features li::before { content: '✓ '; color: var(--accent); font-weight: var(--weight-heading); }
.plan .btn { width: 100%; }
/* Billing conditions stay visible on the card — never hidden in a tooltip. */
.overage { margin-top: var(--space-3); color: var(--muted); font-size: var(--font-size-label); text-align: center; }

@media (max-width: 1023px) {
  /* Two per row before three become too narrow; the highlighted plan stays
     early in the sequence so it is seen first. */
  .plans { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .plans { grid-template-columns: 1fr; }
}

/* ============================================================
   FAQ
   Real <details>/<summary>, so expanded/collapsed state and keyboard operation
   are correct without any JS.
   ============================================================ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-4) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--weight-strong);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '⌄';
  margin-left: auto;
  color: var(--muted);
  font-size: var(--font-size-h3);
  line-height: 0.5;
  transition: transform var(--motion) var(--ease);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .answer { padding: 0 0 var(--space-6); color: var(--muted); max-width: var(--measure); }

/* ============================================================
   CENTRED SINGLE-TASK PAGE (checkout, checkout success)
   One job per screen, so the page is a single centred card with no nav to
   wander off into mid-purchase.
   ============================================================ */
body.center-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
}
body.center-page .card { width: 440px; max-width: 100%; margin-bottom: 0; }
body.center-page .brand { margin-bottom: var(--space-4); }
body.center-page h1 { font-size: var(--font-size-h3); margin-bottom: var(--space-1); }
body.center-page .card > p { color: var(--muted); font-size: var(--font-size-label); margin-bottom: var(--space-4); }
.note { margin-top: var(--space-4); color: var(--muted); font-size: var(--font-size-label); line-height: var(--leading-body); }

/* Vertically stacked actions — used where two CTAs must not sit side by side. */
.stack { display: flex; flex-direction: column; gap: var(--space-2); }

/* Success tick on the post-checkout page. Decorative: the heading already says
   "You're all set", so this is not the only signal that it worked. */
.check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  border-radius: 50%;
  color: var(--accent);
  font-size: var(--font-size-h3);
  font-weight: var(--weight-heading);
}

/* ============================================================
   FOOTER
   Grouped links with distinct headings; legal always visible.
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: var(--space-16) var(--space-6) var(--space-10); }
.footer-inner { max-width: var(--container); margin: 0 auto; }
.footer-cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: var(--space-10); }
.footer-cols h2 {
  margin-bottom: var(--space-4);
  color: var(--text);
  font-size: var(--font-size-label);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.footer-cols a { color: var(--muted); font-size: var(--font-size-body); }
.footer-cols a:hover { color: var(--text); }
.footer-blurb { color: var(--muted); font-size: var(--font-size-label); max-width: 30ch; margin-top: var(--space-3); }
.footer-fine {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--font-size-label);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
  .features { grid-template-columns: 1fr 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  section { padding: var(--space-20) var(--space-6); }
}

@media (max-width: 767px) {
  section { padding: var(--space-16) var(--space-4); }
  .wrap { padding: 0 var(--space-4); }
  .hero { padding: var(--space-16) var(--space-4) var(--space-12); }
  .features { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .site-footer { padding: var(--space-12) var(--space-4) var(--space-8); }

  /* Stack the hero CTAs full width rather than letting them shrink. */
  .hero .ctas { flex-direction: column; align-items: stretch; }
  .hero .ctas .btn { width: 100%; }

  /* Desktop links collapse into a menu panel. They are NOT removed — the
     standard requires mobile content to be reorganised, not deleted, and the
     previous rule simply hid navigation entirely below 520px. */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    color: var(--text);
    font-size: var(--font-size-lg);
    cursor: pointer;
  }
  .site-nav .row { min-height: 60px; }
  .site-nav .navlinks,
  .site-nav .nav-cta { display: none; }

  .site-nav.open .navlinks,
  .site-nav.open .nav-cta {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--space-2);
  }
  .site-nav.open .row { flex-wrap: wrap; padding-bottom: var(--space-4); }
  .site-nav.open .navlinks { margin-top: var(--space-2); }
  /* Menu rows at the standard's 48-56px height. */
  .site-nav.open .navlinks a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--space-2);
    border-bottom: 1px solid var(--line);
    color: var(--text);
  }
  .site-nav.open .nav-cta .btn { width: 100%; }
}
