/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Theme tokens ---------- */
:root {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --fg: #1a1f2c;
  --fg-muted: #586174;
  --accent: #5b6cff;
  --accent-fg: #ffffff;
  --border: #e3e6ee;
  --code-bg: #eef0f7;
  --code-fg: #2a3142;
  --row-alt: #fafbfd;
  --shadow: 0 4px 24px rgba(20, 28, 60, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b132b;
    --bg-elev: #121a36;
    --fg: #e8ecf7;
    --fg-muted: #98a0b8;
    --accent: #8b97ff;
    --accent-fg: #0b132b;
    --border: #1f284a;
    --code-bg: #1a234a;
    --code-fg: #d6dcf2;
    --row-alt: #0f1730;
    --shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 56px;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(91,108,255,0.18), transparent 60%),
    radial-gradient(900px 420px at -10% 10%, rgba(91,108,255,0.10), transparent 55%);
}
.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.lede {
  margin: 0 0 28px;
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 60ch;
}

/* ---------- Buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  color: var(--fg);
  border-color: var(--border);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */
main { padding: 24px 0 64px; }
section { margin: 56px 0; }
h2 {
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.prose p, .prose li { color: var(--fg); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0.4em 0; }
.muted { color: var(--fg-muted); }

/* ---------- Code chips ---------- */
code {
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ---------- Table ---------- */
.table-wrap {
  margin-top: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.terms {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}
.terms thead th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--row-alt);
}
.terms td, .terms tbody th {
  padding: 16px 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 500;
}
.terms tbody tr:last-child td,
.terms tbody tr:last-child th { border-bottom: none; }
.terms tbody tr:nth-child(even) { background: var(--row-alt); }
.terms tbody th { white-space: normal; }
.terms td:last-child { color: var(--fg-muted); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 60px;
  font-size: 0.92rem;
  color: var(--fg-muted);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- Links default ---------- */
a { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  section { margin: 40px 0; }
  .terms thead { display: none; }
  .terms tbody th,
  .terms tbody td {
    display: block;
    padding: 6px 16px;
    border-bottom: none;
  }
  .terms tbody th {
    padding-top: 18px;
    font-size: 1rem;
    color: var(--fg);
  }
  .terms tbody td:nth-of-type(1)::before { content: "→ "; color: var(--accent); font-weight: 700; }
  .terms tbody td:last-of-type {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
  }
  .terms tbody tr:last-child td:last-of-type { border-bottom: none; }
  .terms tbody tr:nth-child(even) { background: transparent; }
}
