:root {
  color-scheme: dark;
  background: #111110;
  color: #e2e0d5;
  font-family: "Courier New", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
}

main {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 56px 24px;
}

pre {
  margin: 0;
  font-family: "Courier New", monospace;
  --columns: 180;
  --rows: 113;
  --max-width: 672px;
  font-size: min(calc(var(--max-width) / (var(--columns) * 0.6)), calc((100vw - 48px) / (var(--columns) * 0.6)), calc((100svh - 112px) / var(--rows)));
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
}

main.full-width {
  position: fixed;
  inset: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

main.full-width pre {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  font-size: max(calc((100vw + 2px) / (var(--columns) * 0.6)), calc((100dvh + 2px) / var(--rows)));
}

pre.source-colors {
  font-weight: 700;
  background-image: var(--source-image);
  background-repeat: no-repeat;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: brightness(var(--color-brightness));
}

footer {
  position: fixed;
  z-index: 1;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f0ede2;
  text-shadow: 0 2px 8px #000, 0 0 20px #000;
}
