/*
 * site.css — shared components for the public marketing site
 * (home, landing pages, 404).
 *
 * Design tokens (colours, type, spacing, radii) live in tokens.css, imported below.
 * Page <style> blocks should only use var(--…) values from there, never raw colours,
 * so every public page stays consistent.
 *
 * Plain CSS, no build step, no external fonts or CDN requests.
 * Mobile first: base rules target ~375px phones; min-width queries add layout.
 */
@import url("tokens.css");

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink-2);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--c-ink); line-height: var(--lh-tight); letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
p { margin: 0; }
img, svg { max-width: 100%; }
a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--c-accent-hover); text-decoration-thickness: 2px; }
strong, b { color: var(--c-ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent);
}
.muted { color: var(--c-ink-3); }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--c-accent); color: var(--c-on-accent); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); font-weight: var(--fw-bold); text-decoration: none;
}
.skip-link:focus { top: var(--space-3); color: var(--c-on-accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- buttons ---------- */
.btn, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm); border: 2px solid transparent;
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn-primary:hover { background: var(--c-accent-hover); color: var(--c-on-accent); text-decoration: none; }
.btn-secondary { background: var(--c-surface); color: var(--c-accent); border-color: var(--c-accent); }
.btn-secondary:hover { background: var(--c-bg-tint); color: var(--c-accent-hover); text-decoration: none; }
.btn:disabled, .btn-primary:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- header / nav ----------
 * Below 1366px (phones, tablets, most laptops): row 1 = brand + Early Access button,
 * row 2 = a link strip that scrolls sideways if it ever runs out of room, so the
 * header can never be wider than the screen.
 * >= 1366px: one row, links pushed right, header sticks to the top. Even there the
 * links may shrink and wrap onto a second line (min-width: 0 + flex-wrap), so wider
 * system fonts or a larger text size cannot push the Early Access button off the edge. */
header.nav {
  position: relative; z-index: 20;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--c-line);
}
.nav-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  column-gap: var(--space-5); row-gap: 0; min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap);
  font-weight: var(--fw-heavy); font-size: 1.125rem; letter-spacing: -0.02em;
  color: var(--c-ink); text-decoration: none; white-space: nowrap;
}
a.brand:hover { color: var(--c-ink); text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--c-accent); color: var(--c-on-accent);
}
.brand .mark svg { width: 18px; height: 18px; stroke: currentColor; }
.nav-links {
  order: 3; flex: 1 0 100%; display: flex; gap: var(--space-1);
  overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) var(--space-2);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-sm); color: var(--c-ink-2); font-size: var(--fs-sm); font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.nav-links a:hover { background: var(--c-bg-soft); color: var(--c-ink); }
.nav-links a.active, .nav-links a[aria-current="page"] { color: var(--c-accent); background: var(--c-bg-tint); }
.nav-cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4);
  border-radius: var(--radius-sm); background: var(--c-accent); color: var(--c-on-accent) !important;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-decoration: none; white-space: nowrap;
}
.nav-cta:hover { background: var(--c-accent-hover); text-decoration: none; }
.nav-cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav-actions { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.nav-link-login { font-weight: var(--fw-bold); font-size: var(--fs-sm); white-space: nowrap; }

@media (min-width: 1366px) {
  header.nav { position: sticky; top: 0; }
  .nav-in { flex-wrap: nowrap; min-height: 72px; }
  .brand, .nav-cta { flex: none; }
  .nav-links {
    order: 0; flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; padding: 0; overflow: visible;
    flex-wrap: wrap; justify-content: flex-end;
    -webkit-mask-image: none; mask-image: none;
  }
}

/* ---------- landing / content pages ---------- */
main { display: block; }
.page-main { padding: var(--section-y) 0 var(--space-6); }
.lede-block { max-width: var(--maxw-text); }
h1.page-h { font-size: var(--fs-h1); font-weight: var(--fw-heavy); margin: var(--space-3) 0 0; }
.subtitle { color: var(--c-ink-2); font-size: var(--fs-lg); margin: var(--space-5) 0 0; max-width: 62ch; }
.content { max-width: var(--maxw-text); margin-top: var(--space-4); }
.content h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); font-weight: var(--fw-heavy); margin: var(--space-7) 0 var(--space-1); }
.content h3 { font-size: var(--fs-h3); font-weight: var(--fw-bold); margin: var(--space-5) 0 0; }
.content p { margin: var(--space-4) 0; }
.content ul { margin: var(--space-4) 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.content ul li { position: relative; padding-left: 28px; }
.content ul li::before {
  content: ""; position: absolute; left: 6px; top: .62em;
  width: 9px; height: 9px; border-radius: 2px; background: var(--c-accent); transform: rotate(45deg);
}

/* legal pages (terms, privacy policy) whose content starts with a plain h1 */
.content.legal h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); font-weight: var(--fw-heavy); margin: 0 0 var(--space-3); }
.content .last-updated { color: var(--c-ink-3); font-style: italic; }
.content hr { border: none; border-top: 1px solid var(--c-line); }

.related {
  background: var(--c-bg-soft); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: var(--space-5); margin: var(--space-7) 0;
}
.related h2 { font-size: var(--fs-md); font-weight: var(--fw-bold); margin: 0 0 var(--space-3); }
.related .rg { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
.related a {
  display: flex; align-items: center; min-height: var(--tap); padding: var(--space-2) var(--space-4);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  color: var(--c-accent); font-weight: var(--fw-bold); font-size: var(--fs-sm); text-decoration: none;
}
.related a:hover { border-color: var(--c-accent); }
@media (min-width: 640px) { .related .rg { grid-template-columns: 1fr 1fr; } }

.faq { margin-top: var(--space-4); }
.faq details {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  margin-bottom: var(--space-3); overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  min-height: var(--tap); padding: var(--space-3) var(--space-4);
  color: var(--c-ink); font-weight: var(--fw-bold);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--c-accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq summary:focus-visible { outline-offset: -3px; }
.faq details p { margin: 0; padding: 0 var(--space-4) var(--space-4); }

.cta-band {
  margin: var(--space-7) 0 var(--space-3); padding: clamp(28px, 5vw, 48px) var(--space-5);
  background: var(--c-bg-tint); border-radius: var(--radius-lg); text-align: center;
}
.cta-band h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: var(--fw-heavy); margin: 0 auto; max-width: 24ch; }
.cta-band p { max-width: 52ch; margin: var(--space-3) auto var(--space-5); }

/* ---------- footer ---------- */
footer.site-footer, body > footer {
  background: var(--c-dark); color: var(--c-on-dark-2);
  padding: var(--space-7) 0 var(--space-6); margin-top: var(--space-7);
}
footer .brand { color: var(--c-on-dark); margin-bottom: var(--space-3); }
footer .brand .mark { background: var(--c-on-dark); color: var(--c-dark); }
footer p { color: var(--c-on-dark-2); font-size: var(--fs-sm); max-width: 40ch; }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
footer .col h2, footer .col h4 {
  font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase;
  color: var(--c-on-dark); margin: 0 0 var(--space-2);
}
footer .col a {
  display: flex; align-items: center; min-height: 44px;
  color: var(--c-on-dark-2); font-size: var(--fs-sm); text-decoration: none;
}
footer .col a:hover { color: var(--c-on-dark); text-decoration: underline; }
footer a:focus-visible { outline-color: var(--c-on-dark); }
footer .cr {
  border-top: 1px solid rgba(255, 255, 255, .16); margin-top: var(--space-6); padding-top: var(--space-5);
  color: var(--c-on-dark-2); font-size: var(--fs-xs);
}
@media (min-width: 560px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } .foot-grid > :first-child { grid-column: auto; } }
