/* DataSense AI — marketing site prototype
   Base tokens, body canvas and secondary-page (legal/404) chrome.
   The homepage's own nav/hero/section/footer/button chrome lives in
   marketing.css, ported verbatim from the production app; this file
   covers what that port doesn't (page background, font loading, and
   the simpler nav/sections used only on the non-audited secondary
   pages). Loaded on every page so the shared `.btn`/`.ds-mkt-nav-mark`
   styles from marketing.css are available everywhere. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #050816;
  --surface: rgba(13, 19, 42, .78);
  --surface-strong: #0e1530;
  --surface-soft: rgba(18, 27, 57, .62);
  --line: rgba(158, 174, 255, .13);
  --line-strong: rgba(124, 92, 255, .42);
  --text: #f5f7ff;
  --muted: #9aa6c3;
  --purple: #7c5cff;
  --purple-light: #a78bfa;
  --cyan: #22d3ee;
  --green: #34d399;
  --shadow: 0 22px 65px rgba(0, 0, 0, .34);
  --heading-font: "Space Grotesk", "Inter", -apple-system, "Segoe UI", sans-serif;
  --body-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-heading-font: "Space Grotesk", "Inter", -apple-system, "Segoe UI", sans-serif;
  /* .ds-mkt-nav's own real rendered height (2.5rem content + .85rem
     top/bottom padding + 1px border) - the actual measured value, not
     an arbitrary guess, used wherever the layout needs to know exactly
     how much room the fixed nav occupies (hero min-height, nav
     clearance). */
  --nav-h: calc(4.2rem + 1px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Exact body background from production's styles.css (.stApp rule). */
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 78% 8%, rgba(89, 58, 229, .19), transparent 28rem),
    radial-gradient(circle at 22% 72%, rgba(34, 211, 238, .07), transparent 30rem),
    linear-gradient(145deg, #050816 0%, #070b19 52%, #050713 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--purple);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 0 0 8px 0;
  z-index: 999;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Secondary-page nav (privacy / terms / 404) ----------
   These pages are not the audited landing page, so they keep a simple
   nav of their own (including a mobile hamburger) rather than the
   production ds-mkt-nav, which deliberately has none. Buttons reuse
   the shared .btn / .btn-primary from marketing.css for visual
   consistency with the homepage. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 22, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: .7rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Sections (used by supplementary SEO sections not present
   in the production app — "Who it's for", "Capabilities", "Why try
   it" — kept from the previous round; see PR description) ---------- */
section { padding: 3.4rem 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
.kicker {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: .6rem;
  text-align: center;
}
h2 {
  font-family: var(--heading-font);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  margin: 0 auto 2.4rem;
  max-width: 680px;
  letter-spacing: -.01em;
}
h3 { font-family: var(--heading-font); margin: 0 0 .5rem; font-size: 1.15rem; }

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card .tag {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--purple-light);
  font-weight: 700;
  margin-bottom: .6rem;
}
.card p { color: var(--muted); font-size: .92rem; margin: 0; }

/* Four capability cards in a balanced 2x2 grid - reuses the existing
   .card styling/palette (same as the "Who it's for" cards above) so
   this section doesn't introduce a new visual language. Grid items
   stretch to equal height by default, so all four cards share one
   row height per row without extra height rules. */
.cap-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, 1fr); }
.cap-grid .card { display: flex; flex-direction: column; }
.cap-grid .card h3 { color: var(--text); }
.cap-grid .card p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Footer (secondary pages) ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-family: var(--heading-font); }
.footer-brand img { width: 22px; height: 22px; border-radius: 6px; }
.footer-links { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; color: var(--muted); font-size: .88rem; }
.footer-links a:hover { color: var(--text); }
.footer-note { width: 100%; color: var(--muted); font-size: .78rem; margin-top: .6rem; }

/* ---------- Simple legal / content pages ---------- */
.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.back-home {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.6rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 6px;
}
.back-home .arrow { font-size: 1rem; line-height: 1; transition: transform .15s ease; }
.back-home:hover, .back-home:focus-visible { color: var(--cyan); }
.back-home:hover .arrow, .back-home:focus-visible .arrow { transform: translateX(-3px); }
.back-home:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.doc h1 { text-align: left; margin-bottom: .3rem; }
.doc .eff-date { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.doc h2 { text-align: left; margin: 2rem 0 .8rem; font-size: 1.3rem; }
.doc p, .doc li { color: var(--muted); font-size: .96rem; }
.doc a { color: var(--cyan); }

/* ---------- 404 ---------- */
.state-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}
.state-page .code {
  font-family: var(--heading-font);
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--purple-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.state-page p { color: var(--muted); max-width: 440px; }

/* ---------- Responsive (secondary-page nav only) ---------- */
@media (max-width: 860px) {
  .cap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-mobile-login { display: none; }
  .brand span { white-space: nowrap; font-size: .95rem; }
  .brand { flex-shrink: 0; }
  .site-nav .container { gap: .6rem; }
  body.nav-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface-strong);
    border-bottom: 1px solid var(--line);
    padding: 1.2rem 1.5rem;
    gap: 1rem;
  }
  body.nav-open .nav-mobile-login { display: block; }
}

/* ---------- Reduced motion (global fallback for secondary pages'
   small transitions; the homepage's own tour/story reduced-motion
   handling lives in tour.css/story.css, matching production) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-nav *, .nav-links a, .footer-links a, .card {
    transition-duration: 0.001ms !important;
  }
}
