:root {
  --pmx-color-bg: light-dark(#b9b9b9, #282828);
  --pmx-color-fg: light-dark(#111, #f3f3f3);
  --pmx-color-muted: light-dark(#555, #b8b8b8);
  --pmx-color-link: light-dark(#111, #f3f3f3);
  --pmx-color-surface: light-dark(#fff, #151515);
  --pmx-color-border: light-dark(#111, #d8d8d8);
  --pmx-color-accent: light-dark(#111, #f3f3f3);
  --pmx-font-body: "Courier New", Courier, monospace;
  --pmx-font-heading: Chicago, Charcoal, Geneva, sans-serif;
  --pmx-radius: 0;
}

html {
  background-color: var(--pmx-color-bg);
}

body {
  min-height: 100dvh;
  padding: clamp(1rem, 5vw, 4rem);
}

.site-window {
  width: min(100%, 46rem);
  margin-inline: auto;
  overflow: hidden;
  color: var(--pmx-color-fg);
  background: var(--pmx-color-surface);
  border: 2px solid var(--pmx-color-border);
  box-shadow: 4px 4px 0 light-dark(#555, #000);
}

.site-titlebar {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 1.75rem;
  padding-inline: 2.5rem;
  color: light-dark(#111, #f3f3f3);
  background-color: light-dark(#fff, #151515);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    currentColor 2px,
    currentColor 3px
  );
  border-bottom: 2px solid currentColor;
  font-family: var(--pmx-font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.site-window-title {
  padding: 0.2rem 0.5rem;
  background: light-dark(#fff, #151515);
}

.site-close-box {
  position: absolute;
  left: 0.4rem;
  width: 1rem;
  height: 1rem;
  background: light-dark(#fff, #151515);
  border: 2px solid currentColor;
}

.site-workspace {
  display: flex;
  align-items: flex-start;
  min-height: min(34rem, calc(100dvh - 8rem));
}

.site-workspace > main {
  flex: 1;
  min-width: 0;
}

.site-workspace .pmx-document {
  padding: clamp(1.5rem, 5vw, 3rem);
}

.site-workspace .pmx-document a {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.site-workspace .pmx-document a:hover {
  color: var(--pmx-color-surface);
  background: var(--pmx-color-fg);
}

.site-workspace .pmx-document a:focus-visible {
  outline: 2px dashed var(--pmx-color-fg);
  outline-offset: 3px;
}

.site-workspace .pmx-document a[href="/guides/automate-the-boring-stuff"] {
  color: #111;
  background: #fff176;
  box-shadow: 0.15em 0 0 #fff176, -0.15em 0 0 #fff176;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.site-workspace main .pmx-document[data-source="/index"] {
  max-width: 36rem;
}

.site-workspace main .pmx-document[data-source="/index"] h1,
.site-workspace main .pmx-document[data-source="/index"] h2 {
  letter-spacing: -0.02em;
}

.site-workspace main .pmx-document[data-source="/index"] h1 {
  margin-block: 0 0.75rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
}

.middle-initial {
  display: inline-block;
  transform-origin: 50% 80%;
  animation: middle-initial-wobble 650ms ease-in-out 300ms both;
}

@keyframes middle-initial-wobble {
  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(4deg);
  }

  50% {
    transform: rotate(-3deg);
  }

  75% {
    transform: rotate(1.5deg);
  }
}

.site-workspace main .pmx-document[data-source="/index"] h1 + p {
  margin-block: 0 2.5rem;
  color: var(--pmx-color-muted);
}

.site-workspace main .pmx-document[data-source="/index"] h2 {
  margin-block: 2.75rem 1rem;
  font-size: 1rem;
  text-transform: uppercase;
}

.site-workspace main .pmx-document[data-source="/index"] ul {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-left: 0;
  list-style: none;
}

@media (max-width: 40rem) {
  body {
    padding: 0.75rem;
  }

  .site-workspace {
    min-height: calc(100dvh - 3.5rem);
  }

  .site-window {
    box-shadow: 3px 3px 0 light-dark(#555, #000);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
