/* ══════════════════════════════════════════════════════════════════
   Klarivox — shared site stylesheet
   Design tokens, reset, typography, buttons, nav (incl. mobile),
   skip link, focus states, and footer. Every page links this file
   and layers its own page-specific <style> block on top for anything
   unique to that page (hero sections, cards, mocks, forms, etc).

   A page MAY override a token (e.g. redeclare a CSS custom property
   inside its own <style> block, after this stylesheet loads) if it
   needs a deliberate visual variation — the cascade lets later rules
   of equal specificity win. Do that sparingly; most pages should
   need zero overrides.
   ══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1A1426;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

:root {
  --violet:       #3A0DA3;
  --violet-700:   #2A0870;
  --violet-100:   #D4CAEF;
  --violet-50:    #EDE9FA;
  --ink-900:      #1A1426;
  --ink-700:      #23104A;
  --ink-500:      #6E6B85;   /* darkened from #9490AB (~3.06:1) to clear WCAG AA's 4.5:1 for normal text; ~5.1:1 on white */
  --ink-300:      #C9C3D9;
  --ink-200:      #E2DFF0;
  --ink-100:      #F1EEF7;
  --bg-subtle:    #FBFAFD;
  --bg:           #ffffff;
  --success:      #1F8A5B;
  --success-50:   #E6F5EE;
  --danger:       #D8385C;
  --danger-50:    #FDEEF2;

  --r-chip:   6px;
  --r-btn:    10px;
  --r-card:   14px;
  --r-hero:   18px;
  --r-pill:   999px;

  --ease:     cubic-bezier(.2, .8, .2, 1);
  --t-micro:  120ms;
  --t-ui:     200ms;
  --t-page:   320ms;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-family: 'Inter Tight', 'Inter', sans-serif; }
h1 { font-size: clamp(40px, 5.5vw, 56px); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 600; line-height: 1.10; letter-spacing: -0.025em; text-wrap: balance; }
h3 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
h4 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
p  { font-size: 16px; font-weight: 400; line-height: 1.55; }
.lede { font-size: 19px; font-weight: 400; line-height: 1.5; color: var(--ink-500); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.mono { font-family: 'JetBrains Mono', Consolas, monospace; }

/* Default styling for a plain inline text link (prose, footer, etc.).
   Any component with its own link treatment (nav, buttons, cards) uses
   a class selector, which already wins over this on specificity. */
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Focus (WCAG 2.4.7) — one visible, on-brand ring for every
   interactive element, so keyboard focus is never ambiguous. ── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: var(--r-chip);
}
.section-dark a:focus-visible,
.section-dark button:focus-visible,
footer a:focus-visible,
.cta-band a:focus-visible {
  outline-color: #fff;
}

/* ── Layout ── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 64px;
}
@media (max-width: 1024px) { .container { padding: 0 40px; } }
@media (max-width: 640px)  { .container { padding: 0 24px; } }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.005em;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--t-micro) var(--ease),
    border-color     var(--t-micro) var(--ease),
    color            var(--t-micro) var(--ease);
  white-space: nowrap;
}
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-700); }
.btn-secondary { background: #fff; color: var(--ink-900); border-color: var(--ink-200); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--violet-100); }
.btn-on-dark.btn-primary { background: #fff; color: var(--ink-900); }
.btn-on-dark.btn-primary:hover { background: var(--violet-50); }

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ink-200);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 64px;
  gap: 24px;
}
.nav-logo { flex-shrink: 0; display: inline-flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--ink-900); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-chip);
  transition: background var(--t-micro) var(--ease), color var(--t-micro) var(--ease);
}
.nav-links a:hover { color: var(--violet); }
.nav-links a.active { color: var(--violet); }

.nav-ctas { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-signin {
  text-decoration: none; color: var(--ink-900); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-chip);
  transition: background var(--t-micro) var(--ease);
}
.nav-signin:hover { background: var(--violet-50); color: var(--violet); }

/* ── SKIP LINK (WCAG 2.4.1 Bypass Blocks) ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: var(--violet);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--r-btn);
  text-decoration: none;
  transition: top var(--t-ui) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ── MOBILE NAV ──
   Below 900px the inline nav-links/nav-ctas row runs out of room and
   wraps unpredictably. Swap to a hamburger + full-width panel instead. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  background: transparent;
  border: none;
  border-radius: var(--r-chip);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--violet-50); }
.nav-toggle-bars {
  position: relative;
  width: 20px;
  height: 14px;
  display: block;
}
.nav-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-900);
  transition: transform var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease), top var(--t-ui) var(--ease);
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 6px; }
.nav-toggle-bars span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.nav-mobile-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0 20px;
  border-top: 1px solid var(--ink-200);
}
.nav-mobile-panel a {
  display: block;
  text-decoration: none;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 4px;
  border-radius: var(--r-chip);
}
.nav-mobile-panel a:hover { background: var(--violet-50); color: var(--violet); }
.nav-mobile-ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-200);
}
.nav-mobile-ctas .btn { width: 100%; }
.nav-mobile-ctas .nav-signin { text-align: center; }

@media (max-width: 900px) {
  .nav-links, .nav-ctas { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav-mobile-panel { display: flex; }
}

/* ── FOOTER ── */
footer {
  background: var(--ink-900);
  color: rgba(255,255,255,0.5);
  padding: 64px 0 36px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.6); /* was 0.4 — measured ~3.8:1 on --ink-900, failing AA; 0.6 clears ~5.7:1 */
  line-height: 1.6;
}
.footer-copy a {
  color: inherit;
  text-decoration: none;
}
.footer-copy a:hover { color: #fff; }

/* Richer footer (brand + link columns), used by every page except the
   trial/thank-you flow, which keeps a single-row footer on purpose so
   there's nowhere else to click while converting. */
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 280px;
}
.footer-tagline {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.5);
}
.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  transition: background var(--t-micro) var(--ease), color var(--t-micro) var(--ease);
}
.footer-social:hover { background: var(--violet); color: #fff; }
.footer-social svg { width: 16px; height: 16px; }
.footer-links {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color var(--t-micro) var(--ease);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
}
