/* ── Tokens (mirrors DESIGN.md) ───────────────────────────────── */
:root {
  --primary: #5B5BD6;
  --primary-light: rgba(91, 91, 214, 0.12);
  --primary-dark: #4747B8;
  --accent: #8B8FE8;
  --blue: #3B82F6;
  --green: #10B981;
  --amber: #F59E0B;
  --violet: #8B5CF6;

  --bg: #F2F2F7;
  --bg-2: #E5E5EA;
  --card: #FFFFFF;
  --text1: #1C1C1E;
  --text2: #3C3C43;
  --text3: #8E8E93;
  --separator: rgba(60, 60, 67, 0.12);
  --glass: rgba(255, 255, 255, 0.72);

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 100px;

  --wordmark-filter: none;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8B8FE8;
    --primary-light: rgba(139, 143, 232, 0.16);
    --primary-dark: #6E72D8;
    --bg: #0F0F1A;
    --bg-2: #16162A;
    --card: #1A1A2E;
    --text1: #F5F5F7;
    --text2: #C7C7CC;
    --text3: #8E8E93;
    --separator: rgba(255, 255, 255, 0.12);
    --glass: rgba(22, 22, 42, 0.72);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
    /* logo-main.png ships as solid black artwork; invert it for dark surfaces */
    --wordmark-filter: invert(1);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Staging ribbon ───────────────────────────────────────────── */
.staging {
  background: var(--amber);
  color: #3a2600;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
}

/* ── Nav ──────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand { display: flex; align-items: center; }
.brand:hover { text-decoration: none; }

.brand img.wordmark {
  height: 28px;
  width: auto;
  filter: var(--wordmark-filter);
}

/* Nav tabs — active state mirrors the app's tab bar: indigo on a 12% tint.
   Sits at the right, immediately before the "Coming soon" pill. */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.tabs a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  padding: 7px 13px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.tabs a:hover {
  color: var(--text1);
  background: var(--bg-2);
  text-decoration: none;
}

.tabs a.is-active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Store badge ──────────────────────────────────────────────── */
/* Not a link: the listing doesn't exist yet. See web/README.md. */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  border-radius: var(--r-md);
  padding: 11px 20px 11px 18px;
  cursor: default;
}
.btn-store svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.btn-store .lines { display: flex; flex-direction: column; line-height: 1.15; }
.btn-store .small {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.btn-store .big { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }

@media (prefers-color-scheme: dark) {
  .btn-store { background: #fff; color: #000; }
}

/* Nav pill — text only, no Apple mark, since there's nothing to link to */
.badge-soon {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding: 72px 0 88px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  width: 780px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side,
              rgba(139, 92, 246, 0.30),
              rgba(91, 91, 214, 0.10) 55%,
              transparent 75%);
  pointer-events: none;
}

.hero > * { position: relative; }

.hero .icon {
  width: 132px;
  height: 132px;
  margin: 0 auto 28px;
  border-radius: 30px;
  box-shadow: var(--shadow-lg), 0 18px 50px rgba(91, 91, 214, 0.28);
}

h1 {
  font-size: clamp(34px, 6.2vw, 56px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0 auto 18px;
  max-width: 15ch;
}

h1 .accent {
  background: linear-gradient(135deg, #5B5BD6 0%, #8B5CF6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (prefers-color-scheme: dark) {
  h1 .accent {
    background: linear-gradient(135deg, #8B8FE8 0%, #B79DFB 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

.lede {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text2);
  max-width: 54ch;
  margin: 0 auto 32px;
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.req { font-size: 13px; color: var(--text3); }

/* ── Features ─────────────────────────────────────────────────── */
section.features { padding: 8px 0 72px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: center;
  margin: 0 0 10px;
}

h2 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  margin: 0 0 40px;
}

/* Flex rather than grid so the trailing row of an odd count stays centered */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.card {
  flex: 1 1 260px;
  max-width: 336px;
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.card .ico {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.card .ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Category tints, matching the in-app activity icon system */
.ico--indigo { background: rgba(91, 91, 214, 0.12); }
.ico--indigo svg { stroke: #5B5BD6; }
.ico--green  { background: rgba(16, 185, 129, 0.12); }
.ico--green svg  { stroke: #10B981; }
.ico--violet { background: rgba(139, 92, 246, 0.12); }
.ico--violet svg { stroke: #8B5CF6; }
.ico--blue   { background: rgba(59, 130, 246, 0.12); }
.ico--blue svg   { stroke: #3B82F6; }
.ico--amber  { background: rgba(245, 158, 11, 0.12); }
.ico--amber svg  { stroke: #F59E0B; }

.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.card p { margin: 0; font-size: 15px; color: var(--text2); }

/* ── Closing CTA ──────────────────────────────────────────────── */
.closing {
  background: linear-gradient(135deg, #5B5BD6 0%, #8B8FE8 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 48px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.closing::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  top: -70px;
  right: -50px;
}

.closing > * { position: relative; }

.closing h2 { color: #fff; margin-bottom: 10px; }
.closing p { margin: 0 auto 26px; max-width: 48ch; opacity: 0.92; }
.closing .btn-store { background: #fff; color: #000; }

/* ── Legal pages ──────────────────────────────────────────────── */
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 16px;
}

.legal h1 {
  font-size: clamp(30px, 5vw, 42px);
  text-align: left;
  margin: 0 0 12px;
  max-width: none;
}

.legal .updated {
  color: var(--text3);
  font-size: 14px;
  margin: 0 0 32px;
}

.legal .intro {
  font-size: 17px;
  color: var(--text2);
  margin: 0 0 32px;
}

.legal h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-align: left;
  margin: 40px 0 12px;
  padding-top: 8px;
  scroll-margin-top: 80px;
}

.legal h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.legal p,
.legal li {
  color: var(--text2);
  font-size: 16px;
}

.legal p { margin: 0 0 14px; }
.legal ul, .legal ol { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin-bottom: 7px; }
.legal strong { color: var(--text1); }

.legal .toc {
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.legal .toc p {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 0 0 10px;
}
.legal .toc ol { margin: 0; padding-left: 20px; }
.legal .toc li { margin-bottom: 4px; font-size: 15px; }

/* Highlights a point users are likely to be surprised by */
.legal .callout {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  margin: 0 0 20px;
}
.legal .callout p:last-child { margin-bottom: 0; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--separator);
  border-radius: var(--r-md);
}

.legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 15px;
}
.legal th, .legal td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--separator);
  vertical-align: top;
  color: var(--text2);
}
.legal th {
  color: var(--text1);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bg-2);
}
.legal tr:last-child td { border-bottom: none; }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  padding: 44px 0 56px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}
footer .flogo {
  height: 24px;
  width: auto;
  margin: 0 auto 14px;
  opacity: 0.55;
  filter: var(--wordmark-filter);
}
footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
footer nav a { color: var(--text2); }
footer nav a:hover { color: var(--primary); }
/* Trading disclosure sits above the copyright line; keep both readable */
footer .company {
  margin: 0 auto;
  max-width: 64ch;
  font-size: 12.5px;
  line-height: 1.5;
}
footer .company + .company { margin-top: 8px; }

.section-pad { padding: 64px 0; }

@media (max-width: 560px) {
  .brand img.wordmark { height: 23px; }
  .badge-soon { font-size: 12px; padding: 6px 13px; }
  .tabs a { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 52px 0 64px; }
  .hero .icon { width: 108px; height: 108px; border-radius: 25px; }
  .legal { padding-top: 36px; }
}

@media (max-width: 359px) {
  /* Wordmark, Home, and the pill stop fitting; the hero badge already says this */
  .badge-soon { display: none; }
}

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