/* Fonts and colours for every page on the site.
   Atkinson Hyperlegible was designed for low-vision readers: similar letters (I, l, 1; O, 0) are
   easy to tell apart, which matters on small, cheap phone screens. Both faces are self-hosted so a
   privacy policy never makes the reader's browser contact a third party. SIL OFL 1.1, see fonts/. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --font-text: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --paper: #ffffff;
  --paper-2: #f5f6f9;
  --paper-3: #eaedf2;
  --ink: #151922;
  --ink-2: #4b5263;
  --ink-3: #676e7f;
  --rule: #e0e3ea;
  --rule-strong: #c7ccd6;

  /* Office stamp-pad violet: the one accent. */
  --stamp: #5a3dc8;
  --stamp-strong: #4a2fb0;
  --stamp-tint: #f2effc;
  --stamp-ring: rgba(90, 61, 200, 0.28);
  --on-stamp: #ffffff;

  --danger: #b42318;
  --danger-tint: #fef0ef;
  --caution: #8f4506;
  --caution-tint: #fff4e3;
  --ok: #0f7049;
  --ok-tint: #eaf7f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1016;
    --paper-2: #161922;
    --paper-3: #1f2330;
    --ink: #e8eaf0;
    --ink-2: #b1b7c4;
    --ink-3: #8f96a5;
    --rule: #272b37;
    --rule-strong: #3a4151;

    --stamp: #b6a3ff;
    --stamp-strong: #cdc0ff;
    --stamp-tint: #1c1834;
    --stamp-ring: rgba(182, 163, 255, 0.32);
    --on-stamp: #120d2b;

    --danger: #ff9086;
    --danger-tint: #2b1515;
    --caution: #f3b467;
    --caution-tint: #2a2011;
    --ok: #71d6a8;
    --ok-tint: #10261c;
  }
}

/* ---- Base ---- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }
}

a {
  color: var(--stamp);
  text-decoration-line: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.55rem 0.9rem;
  border-radius: 0.4rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Layout ---- */

:root {
  /* One text column everywhere: about 70 characters a line at the body size. */
  --measure: 41rem;
  --gutter: 1.25rem;
  --rail: 14.5rem;
  --rail-gap: clamp(3rem, 5vw, 5.5rem);
}

::selection {
  background: var(--stamp-ring);
}

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) 4rem;
}

@media (min-width: 72rem) {
  .page--with-contents {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, var(--measure));
    column-gap: var(--rail-gap);
    justify-content: center;
    align-items: start;
    max-width: 74rem;
  }

  .page--with-contents > .masthead,
  .page--with-contents > .policy,
  .page--with-contents > .colophon {
    grid-column: 2;
  }

  .page--with-contents > .contents--rail {
    display: block;
    grid-column: 1;
    grid-row: 2 / span 2;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }

  .page--with-contents > .contents--inline {
    display: none;
  }
}

/* ---- Site bar: added by the server to the top of every page ---- */

.site-bar {
  border-bottom: 1px solid var(--rule);
}

.site-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
}

/* Policies with a contents rail: the name over the rail, the pages over the text. */
@media (min-width: 72rem) {
  .site-bar--wide .site-bar__inner {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, var(--measure));
    column-gap: var(--rail-gap);
    justify-content: center;
    max-width: 74rem;
  }

  .site-bar--wide .site-bar__pages {
    justify-self: end;
  }
}

.site-bar__home {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.site-bar__mark {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.55rem;
  color: var(--stamp);
}

.site-bar__name {
  font-weight: 750;
}

.site-bar__section {
  margin-left: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--rule-strong);
  color: var(--ink-2);
}

.site-bar__home:hover .site-bar__section {
  color: var(--stamp);
}

.site-bar__pages {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-bar__page {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.site-bar__page:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.site-bar__page[aria-current='page'] {
  background: var(--stamp-tint);
  box-shadow: inset 0 0 0 1.5px var(--stamp-ring);
  color: var(--stamp);
}

/* Phones: keep the name and an app's pages on one row by dropping "Privacy policies". */
@media (max-width: 30rem) {
  .site-bar__inner {
    column-gap: 0.75rem;
  }

  .site-bar__inner:has(.site-bar__pages) .site-bar__section {
    display: none;
  }

  .site-bar__page {
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
  }
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.25rem);
  border-bottom: 1px solid var(--rule);
}

.masthead__text {
  flex: 1 1 19rem;
  min-width: 0;
}

.masthead__title {
  margin: 0;
  font-size: clamp(2.15rem, 1.35rem + 3.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.022em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.masthead__kind {
  display: block;
  margin-bottom: 0.95rem;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead__app {
  display: block;
}

.masthead__operator {
  max-width: 36rem;
  margin: 1.1rem 0 0;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.45;
}

.masthead__details {
  margin: 0.2rem 0 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* The effective date, set like an office date stamp: the one thing a reviewer checks first. */
.stamp {
  flex: none;
  display: inline-grid;
  justify-items: center;
  gap: 0.15rem;
  margin: 0.4rem 0.4rem 0 0;
  padding: 0.55rem 1rem 0.6rem;
  border: 2px solid currentColor;
  border-radius: 0.6rem;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px currentColor;
  color: var(--stamp);
  font-family: var(--font-mono);
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.stamp__label {
  margin-right: -0.26em;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.stamp__date {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---- Contents ---- */

.contents {
  font-size: 0.9375rem;
  line-height: 1.35;
}

.contents--rail {
  display: none;
}

.contents__title {
  margin: 0 0 0.8rem;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contents__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents__list a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.9rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-2);
  text-decoration: none;
}

.contents__list a:hover {
  border-left-color: var(--stamp);
  color: var(--stamp);
}

.contents--inline {
  margin: 0 0 2.25rem;
  border: 1px solid var(--rule);
  border-radius: 0.65rem;
  background: var(--paper-2);
}

.contents--inline > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.contents--inline > summary::-webkit-details-marker {
  display: none;
}

.contents--inline > summary::after {
  content: '+';
  margin-left: auto;
  color: var(--ink-2);
  font-size: 1.15rem;
  letter-spacing: 0;
}

.contents--inline[open] > summary::after {
  content: '\2212';
}

.contents__count {
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.contents--inline .contents__list {
  padding: 0 1rem 1rem;
}

/* ---- Policy text ---- */

.policy {
  outline: none;
}

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

.policy p,
.policy ul,
.policy ol,
.policy dl,
.policy blockquote,
.policy pre,
.policy address,
.policy .callout,
.policy .table-scroll {
  margin: 0 0 1.1em;
}

.policy p,
.policy li {
  text-wrap: pretty;
}

.policy h2 {
  margin: 2.6em 0 0.7em;
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.012em;
  scroll-margin-top: 1.5rem;
  text-wrap: balance;
}

.policy h3 {
  margin: 1.9em 0 0.45em;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  scroll-margin-top: 1.5rem;
}

.policy h2 + h3 {
  margin-top: 1.1em;
}

.policy h4 {
  margin: 1.6em 0 0.4em;
  font-size: 1rem;
  font-weight: 700;
}

.policy ul,
.policy ol {
  padding-left: 1.35em;
}

.policy li {
  margin: 0.4em 0;
  padding-left: 0.2em;
}

.policy li::marker {
  color: var(--stamp);
}

.policy li > p {
  margin: 0.4em 0;
}

.policy strong {
  font-weight: 700;
}

.policy a {
  overflow-wrap: anywhere;
}

.policy code,
.policy kbd {
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.policy pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.5rem;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.policy blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-2);
}

.policy hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.policy img {
  max-width: 100%;
  height: auto;
}

.policy .callout {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--stamp);
  border-radius: 0 0.55rem 0.55rem 0;
  background: var(--stamp-tint);
}

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

/* "Need help now? Not here": the support page's emergency notice. */
.policy .callout--urgent {
  border-left-color: var(--danger);
  background: var(--danger-tint);
}

.policy .callout--urgent strong {
  color: var(--danger);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 0.65rem;
}

.policy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.policy th,
.policy td {
  min-width: 8.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.policy thead th {
  background: var(--paper-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.policy tbody tr:last-child > * {
  border-bottom: 0;
}

.policy caption {
  padding: 0.75rem 0.9rem;
  color: var(--ink-2);
  text-align: left;
}

/* Phones: one card per row, each cell labelled with its column (the cells' data-label). */
@media (max-width: 40rem) {
  .table-scroll--stack {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .table-scroll--stack table,
  .table-scroll--stack tbody,
  .table-scroll--stack tr,
  .table-scroll--stack th,
  .table-scroll--stack td {
    display: block;
    width: 100%;
  }

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

  .table-scroll--stack tbody tr {
    margin-bottom: 0.75rem;
    padding: 0.8rem 1rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: 0.65rem;
  }

  .policy .table-scroll--stack td,
  .policy .table-scroll--stack th {
    min-width: 0;
    padding: 0.3rem 0;
    border: 0;
  }

  .table-scroll--stack [data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.1rem;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  /* The first cell names the row, so it reads as the card's title. */
  .table-scroll--stack tr > :first-child {
    font-size: 1.0625rem;
  }

  .table-scroll--stack tr > :first-child::before {
    display: none;
  }
}

/* ---- Footer ---- */

.colophon {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.colophon p {
  margin: 0 0 0.45rem;
}

.colophon__address {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* ---- Home page ("/"): a register of apps, one panel per store ---- */

.masthead--home {
  display: block;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding-bottom: 0;
  border-bottom: 0;
}

.home-lede {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: var(--ink-2);
  font-size: 1.125rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.stores {
  display: grid;
  gap: 2.75rem;
}

.store__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.7rem;
  margin: 0 0 0.85rem;
  font-size: 1.3rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.store__platform {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.register {
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--rule-strong);
  border-radius: 0.85rem;
  list-style: none;
}

/* One app: who it is on the left, its pages on the right (stacked on phones). */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
  gap: 0.9rem 1.75rem;
  padding: 1.15rem 1.25rem;
}

.entry + .entry {
  border-top: 1px solid var(--rule);
}

@media (max-width: 38rem) {
  .entry {
    grid-template-columns: minmax(0, 1fr);
  }
}

.entry__name {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.entry__operator {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.entry__docs {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc {
  display: grid;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
}

.doc:hover {
  border-color: var(--stamp);
  background: var(--stamp-tint);
}

.doc__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.doc__label::after {
  content: '\2192';
  color: var(--stamp);
  font-weight: 400;
}

.doc__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  line-height: 1.2;
}

.doc__path {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* The effective date, as a small stamp: the same mark as the one on the policy itself. */
.doc__date {
  padding: 0.12rem 0.4rem 0.1rem;
  border: 1.5px solid currentColor;
  border-radius: 0.3rem;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-empty {
  color: var(--ink-2);
}

/* ---- 404 page ---- */

.message {
  padding-top: clamp(0.5rem, 6vh, 4rem);
}

.message__code {
  margin: 0 0 0.9rem;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.16em;
}

.message__title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.message__text {
  max-width: 34rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

.message__subtitle {
  margin: 2.5rem 0 0.75rem;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.message__list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.message__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

.message__app {
  flex: 1 1 12rem;
  font-weight: 700;
}

/* ---- Print ---- */

@media print {
  :root {
    --paper: #fff;
    --paper-2: #fff;
    --ink: #000;
    --ink-2: #333;
    --ink-3: #555;
    --rule: #bbb;
    --stamp: #4a2fb0;
    --stamp-tint: #fff;
  }

  body {
    font-size: 11pt;
  }

  .skip-link,
  .site-bar,
  .contents {
    display: none !important;
  }

  .page,
  .page--with-contents {
    display: block;
    max-width: none;
    padding: 0;
  }

  .policy h2,
  .policy h3 {
    break-after: avoid;
  }

  .policy table,
  .policy .callout,
  .policy li {
    break-inside: avoid;
  }

  .policy a {
    color: inherit;
  }

  .policy a[href^='http']::after {
    content: ' (' attr(href) ')';
    color: #555;
    font-size: 0.85em;
  }

  .table-scroll {
    overflow: visible;
  }
}
