/* Sweepcheck: legal and support pages. One stylesheet, nothing loaded from elsewhere.
   The colours are the app's Palette (App/Sources/DesignSystem/Theme.swift), light and dark;
   the faces are the system's own (no web fonts). Amber is the app's colour for a confirmed
   tracker only, so it is not used here. */

:root {
  color-scheme: light dark;
  --paper: #f4f2ee;        /* Palette.paper: the page */
  --surface: #ffffff;      /* Palette.surface: cards */
  --sunken: #eae7e1;       /* Palette.sunken: table heads */
  --ink: #14181f;          /* Palette.ink: text */
  --ink-dim: #565b65;      /* Palette.inkDim: secondary text */
  --line: #d6d3cc;         /* Palette.line: hairlines */
  --signal: #2457d6;       /* Palette.signal: links */
  --on-signal: #ffffff;    /* Palette.onSignal */
  --signal-wash: #e4ebfb;  /* Palette.signalWash: notices */
  --measure: 42rem;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1116;
    --surface: #181c23;
    --sunken: #12151b;
    --ink: #eceef2;
    --ink-dim: #a2a8b3;
    --line: #2b313b;
    --signal: #7fa6ff;
    --on-signal: #0e1116;
    --signal-wash: #1b2742;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--signal);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

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

header.site,
nav.langs,
main,
footer.site {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}

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

nav.site ul,
nav.langs ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav.site li + li,
nav.langs li + li {
  margin-top: 0;
}

nav.site ul {
  gap: 0.25rem 1.125rem;
  font-size: 0.9375rem;
}

nav.site a,
nav.langs a {
  display: inline-block;
  padding: 0.375rem 0;
}

nav.site a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

/* Language switcher: on every page, under the header. */

nav.langs {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

nav.langs ul {
  gap: 0 1rem;
  font-size: 0.875rem;
}

nav.langs a {
  color: var(--ink-dim);
  text-decoration: none;
}

nav.langs a:hover {
  color: var(--signal);
  text-decoration: underline;
}

nav.langs a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
}

/* Text */

main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: 2.125rem;
  margin: 0 0 0.375rem;
}

h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.25rem;
  scroll-margin-top: 1rem;
}

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

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

li + li {
  margin-top: 0.3rem;
}

li > ul {
  margin: 0.3rem 0 0;
}

.meta {
  color: var(--ink-dim);
  font-size: 0.9375rem;
}

.ui {
  font-weight: 600;
}

/* Blocks */

.card {
  margin: 1.5rem 0;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2 {
  font-size: 1.1875rem;
}

.notice {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--signal-wash);
  border-radius: 14px;
  font-size: 0.9375rem;
}

.toc {
  padding-left: 1.5rem;
  font-size: 0.9375rem;
  columns: 2 15rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
}

/* Tables */

.table-wrap {
  margin: 0 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
}

th,
td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  background: var(--sunken);
}

tbody th {
  background: var(--surface);
}

/* Footer */

footer.site {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.875rem;
}

footer.site p {
  margin: 0 0 0.375rem;
}

/* The home page: one screen. */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

body.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  text-align: center;
}

body.home nav.langs {
  width: 100%;
  padding-top: 1rem;
  border-bottom: 0;
}

body.home nav.langs ul {
  justify-content: center;
}

body.home footer.site {
  width: 100%;
  text-align: center;
}

.app-icon {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 1rem;
  border-radius: 28px;
}

body.home h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.lede {
  max-width: 30rem;
  margin: 0 auto 0.75rem;
  font-size: 1.125rem;
}

.promise {
  max-width: 30rem;
  margin: 0 auto 1.5rem;
  color: var(--ink-dim);
}

.links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  max-width: 34rem;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.links li + li {
  margin-top: 0;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
}

.links a:hover {
  border-color: var(--signal);
}

/* Phones */

@media (max-width: 34rem) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  body.home h1 {
    font-size: 2.25rem;
  }

  .app-icon {
    width: 104px;
    height: 104px;
    border-radius: 23px;
  }

  .links {
    grid-template-columns: 1fr;
  }

  /* Each table row becomes a small card with labelled cells. */
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack {
    background: none;
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table.stack tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  table.stack th,
  table.stack td {
    padding: 0.25rem 0;
    border: 0;
    background: none;
  }

  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-dim);
  }

  table.stack td:first-child {
    font-weight: 600;
  }

  table.stack td:first-child::before {
    display: none;
  }
}

@media print {
  nav,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
  }
}
