@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono:vf@latest/latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --woops-width: 200px;
  --background: #eaffea;
  --pattern-color: #f9fff9;
  --text: #000000;
  --comment-color: #8a8a8a;
  --comment-hover-color: #6f6f6f;
  --string-color: #4a8f52;
  --number-color: #d98a3d;
}

html[data-theme="light"] {
  --background: #eaffea;
  --pattern-color: #f9fff9;
  --text: #000000;
  --comment-color: #8a8a8a;
  --comment-hover-color: #6f6f6f;
  --string-color: #4a8f52;
}

html[data-theme="dark"] {
  --background: #0f1511;
  --pattern-color: #151d17;
  --text: #f4f8f4;
  --comment-color: #8f978f;
  --comment-hover-color: #b0b8b0;
  --string-color: #6dbb75;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --background: #0f1511;
    --pattern-color: #151d17;
    --text: #f4f8f4;
    --comment-color: #8f978f;
    --comment-hover-color: #b0b8b0;
    --string-color: #6dbb75;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  font-family: "JetBrains Mono Variable", monospace;
  font-size: 150%;
  color: var(--text);
  background-color: var(--background);
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--pattern-color) 25%,
      transparent 25%,
      transparent 75%,
      var(--pattern-color) 75%,
      var(--pattern-color)
    ),
    repeating-linear-gradient(
      45deg,
      var(--pattern-color) 25%,
      transparent 25%,
      transparent 75%,
      var(--pattern-color) 75%,
      var(--pattern-color)
    );
  background-position: 0 0, 80px 80px;
  background-size: 160px 160px;
  animation: body-bg-move 10s linear infinite;
}

@keyframes body-bg-move {
  from {
    background-position: 0 0, 80px 80px;
  }

  to {
    background-position: 160px 160px, 240px 240px;
  }
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.theme-toggle__icon {
  position: absolute;
  font-size: 24px;
  line-height: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: scale(0.7) rotate(-12deg);
}

.theme-toggle--dark .theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle--dark .theme-toggle__icon--moon {
  opacity: 0;
  transform: scale(0.7) rotate(12deg);
}

.theme-toggle--light .theme-toggle__icon--moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.stage {
  width: 100%;
  padding: 40px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
  max-width: 34rem;
}

.woops {
  display: block;
  width: var(--woops-width);
  height: auto;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.message {
  margin: 0;
  text-align: center;
  font-size: 0.8125em;
  line-height: 1.7;
  text-wrap: balance;
}

.value-link {
  color: var(--string-color);
  text-decoration: underline;
  text-underline-offset: 0.08em;
}

.value-link:hover,
.value-link:focus-visible {
  color: var(--string-color);
}

@media (max-width: 700px) {
  .theme-toggle {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
  }

  .theme-toggle__icon {
    font-size: 22px;
  }

  .card {
    gap: 28px;
  }
}

@media (max-height: 760px) {
  :root {
    --woops-width: 168px;
  }
}

@media (max-height: 520px) {
  :root {
    --woops-width: 120px;
  }
}
