/* Reset, typography, page background and wallpaper layer. */

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

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-deep);
  color: var(--fg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

/* The page is a flat colour by default; the faint grid is opt-in (Settings > Grid overlay),
   toggled on <html> by wallpaper.js. Over a wallpaper the grid is part of the wallpaper layer. */
html.show-grid body {
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

html.has-wallpaper body {
  background-color: transparent;
  background-image: none;
}

html.dlg-open {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

svg.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html [hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--fg-muted);
}

/* Wallpaper: fixed viewport-sized layers behind the content. Layers fade in
   and out, so switching wallpapers cross-fades and `cover` never re-scales. */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.wp-layer {
  position: absolute;
  inset: 0;
  background-image: var(--wp-image, none);
  background-size: var(--wp-size, cover);
  background-repeat: var(--wp-repeat, no-repeat);
  background-position: center;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}

.wp-layer.is-on {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wp-layer {
    transition: none;
  }
}

@media (max-width: 480px) {
  .wp-layer {
    transition: none;
  }
}

noscript .noscript-msg {
  display: block;
  max-width: 32rem;
  margin: 3rem auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface);
}
