/* The look shared by every page (the app, privacy, 404, 500): colors, type, buttons.
   Design "fun", accent #d9e70d, mobile first.
   Sizes in rem, so the visitor's text size setting is respected. No inline styles anywhere:
   the CSP allows only files from this site. */

:root {
  color-scheme: light dark;
  --accent: #d9e70d;
  /* The accent is a light yellow-green: dark text on it, and a deep olive for links and focus
     rings on the light paper (7:1), where the accent itself would be unreadable. */
  --on-accent: #1f1d36;
  --accent-ink: #4d5300;
  --pop: #ff5fa2;
  --sky: #7cc8ff;
  --paper: #fffbeb;
  --surface: #fff3c4;
  --ink: #1f1d36;
  --muted: #514d6b;
  --line: #f0d98a;
  --radius: 1.25rem;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --font-head: var(--font);
  --head-weight: 800;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: color-mix(in oklab, #d9e70d 70%, white);
    --on-accent: #0b0d12;
    --accent-ink: var(--accent);
    --pop: #ff7ab4;
    --sky: #5aa9e6;
    --paper: #17152b;
    --surface: #221f3d;
    --ink: #fdf7e3;
    --muted: #c7c2e0;
    --line: #3a3660;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* The text size chosen in the footer (public/text-size.js sets it before the first paint),
   on top of the browser's own setting. Phones get bigger steps. */
html[data-text-size="2"] {
  font-size: 115%;
}
html[data-text-size="3"] {
  font-size: 130%;
}
@media (max-width: 40rem) {
  html[data-text-size="2"] {
    font-size: 125%;
  }
  html[data-text-size="3"] {
    font-size: 150%;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font);
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  line-height: 1.2;
}

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

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -10rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 100;
}
.skip:focus {
  top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.noscript {
  max-width: 36rem;
  margin: 3rem auto;
  padding: 0 1.25rem;
}

/* Static pages (privacy, 404, 500) */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}
.page-header {
  padding: 1rem 0;
  font-weight: 800;
}
.page-header a {
  color: var(--ink);
  text-decoration: none;
}
.page .updated {
  color: var(--muted);
  margin-top: 0;
}
.center {
  min-height: 80dvh;
  display: grid;
  place-content: center;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Paper: black on white, no controls, and each link's address after its text. */
@media print {
  :root {
    color-scheme: light;
    --paper: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --muted: #333333;
    --line: #999999;
  }
  body {
    background: #fff;
    color: #000;
  }
  .skip,
  button,
  .btn,
  .link,
  nav,
  [role="dialog"],
  [role="status"],
  [role="alert"] {
    display: none !important;
  }
  a {
    color: #000;
  }
  main a[href^="http"]::after,
  main a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
  h1,
  h2,
  h3 {
    break-after: avoid;
  }
}
