/*
 * Nocturne, as much of it as a legal page needs.
 *
 * The values are lifted from src/theme/nocturne.ts in the app repo, but this
 * file deliberately does not import or generate from it. The app's design
 * system is React Native objects compiled into a bundle; reaching for it here
 * would couple a document that must be publishable in an afternoon to the
 * release cycle of an iOS app. Six colours and a font stack is the entire
 * overlap, and if they ever drift, the reader sees a slightly different shade
 * of purple rather than an unpublishable page.
 *
 * No web font. The app uses Inter, but loading it from a font CDN would send
 * every reader's IP address to a third party — on the page whose job is to
 * list the third parties. The system stack is close enough and costs nothing.
 */

:root {
  color-scheme: dark light;

  --bg: #161826;
  --surface: #232532;
  --chrome: #1a1c29;
  --ink: #e9e9ed;
  --ink-dim: rgba(233, 233, 237, 0.6);
  --ink-faint: rgba(233, 233, 237, 0.4);
  --line: rgba(233, 233, 237, 0.12);
  --accent: #9184d9;
  --accent-text: #d2cefd;
}

/*
 * The app is dark-only; these pages are not. They are read on desktops, by
 * lawyers, by App Store reviewers and by anyone following a link out of an
 * email, and forcing a dark page on a light-mode reader makes a long document
 * harder to read for no gain. Same accent, inverted ground.
 */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfd;
    --surface: #ffffff;
    --chrome: #f2f2f6;
    --ink: #1b1c26;
    --ink-dim: rgba(27, 28, 38, 0.68);
    --ink-faint: rgba(27, 28, 38, 0.5);
    --line: rgba(27, 28, 38, 0.14);
    --accent: #5a4bb0;
    --accent-text: #4a3d9c;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  /* 17px is the iOS body size. Most readers arrive from a link inside the
     app, so the step between the two should be invisible. */
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: 8px;
}

.bar {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.by {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

main {
  /* 34rem is roughly 70 characters at this size — the width long prose stops
     being tiring to read. */
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.4rem;
}

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

p {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.4rem;
}

strong {
  color: var(--ink);
  font-weight: 620;
}

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

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

/* The version stamp under the title. The single most load-bearing fact on
   the page, because it is the string recorded against an acceptance. */
.stamp {
  margin: 0 0 1.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.stamp strong {
  font-variant-numeric: tabular-nums;
}

/* The draft banner. Only a --draft build emits it, and it is deliberately the
   loudest thing on the page: the one failure mode of allowing a draft build at
   all is somebody reading an unfinished legal document and believing it. It
   does not use a theme colour, because it has to look wrong in both themes. */
.draft {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 2px solid #d9534f;
  border-radius: 8px;
  background: rgba(217, 83, 79, 0.12);
  color: var(--ink);
}

.draft strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

/* The tax caveat on the index page. The disclaimer proper lives in the terms,
   which is the document people read least; this is the one line everybody who
   lands on the site actually sees, so it gets the accent rule rather than
   being left to blend into the body copy. */
.caveat {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  color: var(--ink-dim);
}

.caveat strong {
  color: var(--ink);
}

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

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/* Tables are how a privacy notice says "what we hold, why, and for how long".
   On a phone they have to scroll rather than squeeze. */
.table-scroll,
main > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}

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

th {
  color: var(--ink);
  font-weight: 620;
  white-space: nowrap;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.cards li {
  margin-bottom: 0.75rem;
}

.cards a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}

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

.card-title {
  color: var(--ink);
  font-weight: 620;
}

.card-meta {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.foot {
  border-bottom: none;
  border-top: 1px solid var(--line);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}
