/* Privacy + Terms (P28.4): the same look as the app - Geist, the app's theme
 * (boot.js sets data-theme from the saved prefs), dot grid + spectrum edge. */
:root {
  --paper: #fafafa;
  --card: #ffffff;
  --hairline: #ebebeb;
  --ash: #c9c9c9;
  --smoke: #a8a8a8;
  --stone: #666666;
  --charcoal: #4d4d4d;
  --obsidian: #171717;
  --on-obsidian: #ffffff;
  --hover: #f2f2f2;
  --ring: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--paper);
  --spectrum: linear-gradient(90deg, rgb(0, 255, 149) 0%, rgb(255, 208, 0) 25%, rgb(255, 23, 68) 50%, rgb(149, 0, 255) 75%, rgb(0, 229, 255) 100%);
  --radius: 6px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #0a0a0a;
  --card: #111111;
  --hairline: #262626;
  --ash: #454545;
  --smoke: #6e6e6e;
  --stone: #a1a1a1;
  --charcoal: #c7c7c7;
  --obsidian: #ededed;
  --on-obsidian: #0a0a0a;
  --hover: #1a1a1a;
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 2px var(--paper);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--obsidian);
  font: 16px/1.6 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-color: var(--smoke);
}

a:hover {
  text-decoration-color: var(--obsidian);
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- header ---- */

.legal-hero {
  position: relative;
  border-bottom: 1px solid var(--hairline);
  background-color: var(--card);
  background-image: radial-gradient(var(--ash) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -12px -12px;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--card) 85%);
}

.legal-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--spectrum);
}

.legal-hero .wrap {
  position: relative;
  padding-top: 20px;
  padding-bottom: 48px;
}

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  text-decoration: none;
}

.mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

:root[data-theme='dark'] .mark {
  filter: drop-shadow(0 0 0.6px #fff) drop-shadow(0 0 0.6px #fff) drop-shadow(0 0 0.6px #fff);
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.legal-links a {
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--charcoal);
}

.legal-links a:hover {
  background: var(--hover);
  color: var(--obsidian);
}

.legal-links a[aria-current='page'] {
  color: var(--obsidian);
  font-weight: 500;
  box-shadow: var(--ring);
  background: var(--card);
}

.legal-links a.app-btn {
  margin-left: 6px;
  background: var(--obsidian);
  color: var(--on-obsidian);
}

.legal-links a.app-btn:hover {
  opacity: 0.88;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 450;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.lead {
  margin: 14px 0 0;
  max-width: 560px;
  font-size: 1.125rem;
  color: var(--stone);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--card);
  box-shadow: var(--ring);
  font-size: 0.8125rem;
  color: var(--charcoal);
  text-decoration: none;
}

a.chip:hover {
  color: var(--obsidian);
}

/* ---- body: contents on the left, the sections on the right ---- */

.legal-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 64px;
}

.toc {
  position: sticky;
  top: 24px;
  align-self: start;
}

.toc p {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--hairline);
}

.toc li {
  margin: 0;
  padding: 0;
}

.toc li::before {
  display: none;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 14px;
  border-left: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--stone);
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--obsidian);
  color: var(--obsidian);
}

.toc .toc-lang {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

section {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--ring);
}

section + section {
  margin-top: 24px;
}

section > p:first-child {
  margin-top: 0;
  font-size: 1.0625rem;
  color: var(--obsidian);
}

h2 {
  margin: 36px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

section > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.5rem;
  font-weight: 450;
}

p,
li {
  color: var(--charcoal);
}

strong {
  color: var(--obsidian);
  font-weight: 500;
}

section ul {
  padding-left: 0;
  list-style: none;
}

section li {
  position: relative;
  padding-left: 20px;
  margin: 6px 0;
}

section li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--obsidian);
}

footer {
  border-top: 1px solid var(--hairline);
}

footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 24px;
  padding-bottom: 40px;
}

footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--stone);
}

@media (max-width: 820px) {
  .legal-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .toc {
    position: static;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--ring);
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 16px;
  }

  .legal-nav {
    margin-bottom: 36px;
  }

  .legal-links a.app-btn {
    margin-left: 0;
  }

  section {
    padding: 22px 18px;
  }
}
