/* ============================================================
   AthletIQX — marketing site design system
   Dark athletic-tech: deep black field, iOS-blue primary,
   signal-green accent, glass cards, cinematic grain.
   ============================================================ */

:root {
  --bg: #060709;
  --bg-elevated: #0c0e12;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --fg: #f2f4f8;
  --muted: #9aa3b2;
  --subtle: #5b6472;
  --primary: #007aff;
  --primary-soft: rgba(0, 122, 255, 0.14);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --blue-light: #73aefa;
  --warning: #ff9f0a;
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Space Grotesk", -apple-system, "SF Pro Display", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis { height: auto; scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}

::selection { background: rgba(0, 122, 255, 0.35); }

/* ---------- cinematic overlays ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 90; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 89;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(6, 7, 9, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand img { width: 30px; height: 30px; }
.nav-brand span {
  font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--fg);
  letter-spacing: -0.01em;
}
.nav-brand span em { font-style: normal; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  background: var(--primary); color: #fff !important; padding: 8px 18px;
  border-radius: 99px; font-weight: 600 !important;
  box-shadow: 0 0 24px rgba(0, 122, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 0 34px rgba(0, 122, 255, 0.5); }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- shared layout ---------- */
.section { position: relative; padding: 120px 24px; max-width: 1180px; margin: 0 auto; }
.section-tight { padding: 80px 24px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 18px;
}
.kicker::before {
  content: ""; width: 22px; height: 2px; background: var(--primary); border-radius: 2px;
}
.kicker.green { color: var(--green); }
.kicker.green::before { background: var(--green); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; margin-bottom: 18px; }
.lede { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 620px; }

/* ---------- glass card ---------- */
.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- buttons ---------- */
.btn-appstore {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #000; text-decoration: none;
  padding: 13px 26px; border-radius: 14px;
  font-family: var(--body); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4), box-shadow 0.25s;
  box-shadow: 0 10px 40px rgba(255, 255, 255, 0.12);
}
.btn-appstore:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 50px rgba(255, 255, 255, 0.2); }
.btn-appstore svg { width: 26px; height: 26px; }
.btn-appstore .lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-appstore .lines small { font-size: 11px; font-weight: 500; opacity: 0.7; }
.btn-appstore .lines strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.04); }

/* ---------- scroll reveal primitives (driven by motion.js) ---------- */
.reveal { opacity: 0; transform: translateY(36px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal-scale { opacity: 0; transform: scale(0.92) translateY(24px); }
.reveal-scale.in { opacity: 1; transform: none; transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.16, 0.9, 0.25, 1.2); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 48px 28px; margin-top: 40px;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.footer-inner p { color: var(--subtle); font-size: 13px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--fg); }

/* ---------- legal / support pages ---------- */
.doc {
  max-width: 760px; margin: 0 auto; padding: 140px 24px 80px;
}
.doc h1 { font-size: clamp(34px, 5vw, 46px); font-weight: 700; margin-bottom: 8px; }
.doc .updated { color: var(--subtle); font-size: 14px; margin-bottom: 40px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; }
.doc h3 { font-size: 17px; margin: 26px 0 8px; font-weight: 600; }
.doc p, .doc li { color: var(--muted); font-size: 15.5px; }
.doc ul { padding-left: 22px; margin: 10px 0; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--fg); font-weight: 600; }
.doc a { color: var(--primary); }
.doc .callout {
  background: var(--primary-soft); border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: var(--radius-sm); padding: 16px 20px; margin: 20px 0;
}
.doc .callout p { color: var(--fg); margin: 0; }
