/*
 * One stylesheet for the three legal pages.
 *
 * Dark first, because the app is dark first, with a light variant behind
 * prefers-color-scheme. The palette is lifted from src/shared/config/theme.ts
 * so a person who opens Terms from inside the app does not feel handed off to
 * somebody else's website. No web fonts: these are documents people read once
 * under time pressure (an App Review, a refund question, a GDPR request), and
 * a font that has to arrive first is a page that is blank first.
 */

:root {
  --bg: #101112;
  --surface: #18181a;
  --border: #2a2a2c;
  --text: #f2f5f9;
  --muted: #8b95a7;
  --faint: #5b6577;
  --accent: #e8581b;
  --accent-soft: #3a2115;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #efeeee;
    --surface: #ffffff;
    --border: #ddd9d1;
    --text: #121315;
    --muted: #62656b;
    --faint: #92949a;
    --accent: #e8581b;
    --accent-soft: #ffe1d1;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem 6rem;
}

/* Header */

header.top {
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  background: var(--surface);
}

header.top .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}

nav.top-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

nav.top-nav a {
  color: var(--muted);
  text-decoration: none;
}

nav.top-nav a:hover,
nav.top-nav a[aria-current='page'] {
  color: var(--text);
}

nav.top-nav a[aria-current='page'] {
  font-weight: 600;
}

/* Typography */

h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 3rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.5rem;
}

li > ul,
li > ol {
  margin-top: 0.5rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

strong {
  font-weight: 650;
}

.updated {
  color: var(--faint);
  font-size: 0.9rem;
  margin: 0 0 2.5rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Callout, used for the claims that matter most */

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.note p:last-child {
  margin-bottom: 0;
}

/* Table of contents */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem 1.1rem 2.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  margin: 0 0 0.75rem -1.25rem;
  font-weight: 650;
}

.toc ol {
  margin: 0;
  padding-left: 0;
  font-size: 0.95rem;
}

.toc li {
  margin-bottom: 0.3rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

/* Tables */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  min-width: 34rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 650;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Footer */

footer.bottom {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  color: var(--faint);
  font-size: 0.9rem;
}

footer.bottom .wrap {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

footer.bottom a {
  color: var(--muted);
  text-decoration: none;
}

footer.bottom a:hover {
  color: var(--accent);
}

footer.bottom p {
  margin-bottom: 0.4rem;
}

/* Landing page cards */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 2rem 0;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: var(--accent);
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
