:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --line: #d6d3d1;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #161514;
  --fg: #f5f5f4;
  --line: #44403c;
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.2s ease;
}

.placeholder {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.placeholder img {
  display: block;
  width: 5cm;
  max-width: 100%;
  height: auto;
}

/* The line art is dark on transparent; invert it so it stays visible on a dark background. */
:root[data-theme="dark"] .placeholder img {
  filter: invert(1);
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

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

.theme-toggle:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun,
:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}
