/* Shared styling for the privacy policy and terms.
 *
 * Standalone files rather than routes inside the app, for one practical
 * reason: Stripe, ad networks, app stores and anyone doing due diligence all
 * want a URL they can open cold. A policy that only renders after a React
 * bundle boots is a policy that half of those checks will report as missing.
 *
 * Palette copied from styles.css rather than imported, so these pages keep
 * working if the app's bundle ever fails to build.
 */

:root {
  --bg: #131211;
  --surface: #1a1817;
  --ink: #e8e3df;
  --muted: #968e89;
  --line: rgba(235, 200, 180, .09);
  --red: #e8442f;
  --font-ui: "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 32px;
}

.mark {
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .22em;
  color: var(--red);
  text-decoration: none;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 18px 0 6px;
  letter-spacing: -.01em;
}

.updated { color: var(--muted); font-size: 13px; margin: 0; }

h2 {
  font-size: 17px;
  margin: 38px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

h3 { font-size: 14px; margin: 22px 0 6px; color: var(--ink); }

p, li { color: #c9c2bc; }
li { margin-bottom: 6px; }
strong { color: var(--ink); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }

code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
}

table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* Who is actually collecting this. The Privacy Act requires the entity to be
   identifiable, and burying it in a footer technically satisfies that while
   defeating the point, so it sits at the top. */
.operator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  border-radius: 3px;
  padding: 12px 15px;
  font-size: 14px;
}

/* Kept for the next time something needs filling in before launch. Loud on
   purpose - a placeholder that blends in is a placeholder that ships. */
.todo {
  background: rgba(232, 68, 47, .1);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer a { color: var(--muted); }

@media (max-width: 560px) {
  .wrap { padding: 32px 18px 64px; }
  h1 { font-size: 25px; }
}

/* Wide tables must scroll inside their own box. Without this the whole page
   scrolls sideways on a phone, which breaks every other line of text on it. */
.scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
}

.scroller table { margin: 0; min-width: 420px; }

/* CC BY 4.0 requires attribution. Quiet, but present and clickable - the
   licence asks for it to be reasonable to the medium, not invisible. */
.attrib { font-size: 12.5px; line-height: 1.6; }
.attrib a { color: var(--muted); }

/* ------------------------------------------------------------- PHONES --- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 28px 18px 72px; }
  h1 { font-size: 27px; }
  h2 { font-size: 19px; margin-top: 34px; }
  h3 { font-size: 15.5px; }

  /* Tables of three columns do not fit a phone at any font size worth
     reading, so they become stacked rows with their header as a label. */
  .scroller table, .scroller thead, .scroller tbody,
  .scroller tr, .scroller th, .scroller td { display: block; }
  .scroller table { min-width: 0; }
  .scroller thead { display: none; }
  .scroller tr {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .scroller td { border: 0; padding: 3px 0; }
  .scroller td:first-child { font-weight: 600; color: var(--ink); }
  .scroller td + td { color: var(--muted); font-size: 13.5px; }

  .operator { padding: 11px 13px; font-size: 13.5px; }
  pre { font-size: 11.5px; }
}

/* --------------------------------------------------------------- LIGHT --- */
/* The app turns white marble below brutality 4. theme.js stamps the same
   attribute on these pages so they follow it, and stamps nothing when there is
   no stored setting - so a cold visitor still gets the dark page above.

   One palette for all three light bands rather than three near-identical ones:
   the requirement is not clashing with what the reader just left, not matching
   parchment against bone. */
:root[data-brutality="1"],
:root[data-brutality="2"],
:root[data-brutality="3"] {
  --bg: #f3f0e8;
  --surface: #fbf8f1;
  --ink: #24211b;
  --muted: #6a6357;
  --line: rgba(90, 78, 55, .14);
  --red: #94691a;
}

:root[data-brutality="1"] p, :root[data-brutality="1"] li,
:root[data-brutality="2"] p, :root[data-brutality="2"] li,
:root[data-brutality="3"] p, :root[data-brutality="3"] li { color: #3c372e; }

/* The placeholder box and the error line are the two places a colour is
   written out rather than taken from a token, because both are meant to be
   loud. Loud on white is a different colour from loud on black. */
:root[data-brutality="1"] .todo,
:root[data-brutality="2"] .todo,
:root[data-brutality="3"] .todo { background: rgba(148, 105, 26, .12); }

:root[data-brutality="1"] .said.bad,
:root[data-brutality="2"] .said.bad,
:root[data-brutality="3"] .said.bad { color: #8c2f1c; }
