/* Public styles.
 *
 * Deliberately free of scaffold tokens. A title is free text, and one that
 * happened to close a CSS comment would leave the rest of this file as
 * broken CSS on a live site.
 *
 * Flask serves this directory at /static, so anything you drop in here is
 * reachable at /static/<name>. Stylesheets, images, fonts and downloads all
 * belong here rather than in templates/.
 *
 * The theme variables and the pre-paint script stay inline in
 * templates/index.html on purpose: both have to apply before the browser
 * paints, and a stylesheet is a round trip that arrives too late. Everything
 * that can wait lives here.
 *
 * No third-party fonts, analytics or CDNs. Self-host whatever you need.
 */

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

main {
  max-width: 34rem;
  padding: 2rem;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

p {
  color: var(--muted);
}

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

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Labelled with the mode it switches TO, which is what is being chosen.
   Naming the current mode reads as a status display and gets clicked by
   mistake. */
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  body { transition: background 0.15s ease, color 0.15s ease; }
}
