/* Pigrosoft.com
   A pink desktop, putty-coloured windows, hard one-pixel bevels and no blur anywhere.
   Headings use Pixelify Sans (self-hosted, so no request leaves the site).
   Body text is Verdana, which is what the 90s web was set in. */

@font-face {
  font-family: "Pixelify Sans";
  font-weight: 400;
  font-display: swap;
  src: url("pixelify-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Pixelify Sans";
  font-weight: 700;
  font-display: swap;
  src: url("pixelify-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  --desk: #f3a9c1;        /* trough pink, the desktop */
  --desk-dither: #ec98b4;
  --putty: #ddd6c4;       /* window chrome */
  --putty-light: #ffffff;
  --putty-dark: #8e8776;
  --paper: #fffdf5;       /* inside a window */
  --mulberry: #5a1f3a;    /* title bars, headings */
  --snout: #d9668f;
  --ink: #000000;
  --link: #0000c8;
  --visited: #6b1a8c;

  --pixel: "Pixelify Sans", "Courier New", monospace;
  --body: Verdana, Geneva, Tahoma, sans-serif;

  --raised: inset -2px -2px 0 var(--putty-dark), inset 2px 2px 0 var(--putty-light);
  --sunken: inset 2px 2px 0 var(--putty-dark), inset -2px -2px 0 var(--putty-light);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--desk);
  background-image:
    linear-gradient(45deg, var(--desk-dither) 25%, transparent 25%, transparent 75%, var(--desk-dither) 75%),
    linear-gradient(45deg, var(--desk-dither) 25%, transparent 25%, transparent 75%, var(--desk-dither) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
}

img {
  max-width: 100%;
  image-rendering: pixelated;
}

a {
  color: var(--link);
}
a:visited {
  color: var(--visited);
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px dotted var(--ink);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--pixel);
  font-weight: 700;
  color: var(--mulberry);
  line-height: 1.05;
  margin: 0;
}

p {
  margin: 0 0 1em;
  max-width: 62ch;
}
p:last-child {
  margin-bottom: 0;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  background: var(--paper);
  padding: 6px 10px;
}

/* ---------- menu bar ---------- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 18px;
  padding: 6px 16px;
  background: var(--putty);
  border-bottom: 2px solid var(--ink);
  box-shadow: var(--raised);
  font-family: var(--pixel);
  font-size: 1.0625rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--mulberry);
  text-decoration: none;
}
.brand:visited {
  color: var(--mulberry);
}
.brand img {
  width: 32px;
  height: 32px;
}
.menubar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}
.menubar nav a {
  padding: 4px 8px;
  color: var(--ink);
  text-decoration: none;
}
.menubar nav a::first-letter {
  text-decoration: underline;
}
.menubar nav a:hover {
  background: var(--mulberry);
  color: #fff;
}

/* ---------- windows ---------- */

.desk {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 16px 56px;
  display: grid;
  gap: 32px;
}

.win {
  background: var(--putty);
  border: 2px solid var(--ink);
  box-shadow: var(--raised), 8px 8px 0 var(--snout);
  padding: 4px;
  min-width: 0;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  background: var(--mulberry);
  color: #fff;
  font-family: var(--pixel);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.3;
}
.titlebar::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--putty);
  box-shadow: var(--raised);
  border: 1px solid var(--ink);
}
.pane {
  margin-top: 4px;
  padding: 24px;
  background: var(--paper);
  border: 2px solid;
  border-color: var(--putty-dark) var(--putty-light) var(--putty-light) var(--putty-dark);
}
.pane h2 {
  font-size: 1.75rem;
  margin-bottom: 0.6em;
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
  align-items: start;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 8px 18px;
  font-family: var(--pixel);
  font-size: 1.0625rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  background: var(--putty);
  border: 2px solid var(--ink);
  box-shadow: var(--raised);
  cursor: pointer;
}
.btn:visited {
  color: var(--ink);
}
.btn:hover {
  background: #e9e3d3;
}
.btn:active {
  box-shadow: var(--sunken);
  transform: translate(1px, 1px);
}
.btn.primary {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.btn.primary:focus-visible {
  outline-style: dotted;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 1.4em;
}

/* ---------- welcome ---------- */

.welcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 36px 32px;
}
.welcome h1 {
  font-size: clamp(2rem, 5.4vw, 3.25rem);
  text-wrap: balance;
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-shadow: 3px 3px 0 var(--desk);
  margin-bottom: 0.4em;
}
.welcome .motto {
  font-family: var(--pixel);
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--snout);
  margin-bottom: 0.9em;
}
.welcome p {
  font-size: 1.0625rem;
  max-width: 46ch;
}

.pig {
  position: relative;
  width: 240px;
  height: 240px;
  margin: -24px -16px 0 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pig img {
  display: block;
  width: 240px;
  height: 240px;
}
.pig .awake,
.pig.is-awake .asleep {
  display: none;
}
.pig.is-awake .awake {
  display: block;
}
.oink {
  display: none;
  position: absolute;
  right: 4px;
  top: 22px;
  padding: 2px 8px;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--mulberry);
  background: var(--paper);
  border: 2px solid var(--ink);
  pointer-events: none;
}
.pig.is-awake .oink {
  display: block;
}

/* ---------- tools ---------- */

.tools {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tools li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px 20px;
  align-items: center;
  padding: 18px 0;
  border-top: 2px dotted var(--putty-dark);
}
.tools li:first-child {
  border-top: 0;
  padding-top: 0;
}
.tools li:last-child {
  padding-bottom: 0;
}
.tools img,
.tools .slot {
  width: 64px;
  height: 64px;
}
.tools .slot {
  display: grid;
  place-items: center;
  border: 2px dashed var(--putty-dark);
  font-family: var(--pixel);
  font-size: 2rem;
  color: var(--putty-dark);
}
.tools h3 {
  font-size: 1.375rem;
  margin-bottom: 0.25em;
}
.tools p {
  margin: 0;
}
.status {
  font-family: var(--pixel);
  font-size: 1.0625rem;
  color: var(--mulberry);
  white-space: nowrap;
}

/* ---------- lists inside windows ---------- */

.rules,
.specs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rules li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.45em;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 10px;
  height: 10px;
  background: var(--snout);
  border: 2px solid var(--ink);
}
.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
}
.specs dt {
  font-family: var(--pixel);
  color: var(--mulberry);
  font-size: 1.0625rem;
}
.specs dd {
  margin: 0;
}

/* ---------- help ---------- */

details {
  border-top: 2px dotted var(--putty-dark);
}
details:first-of-type {
  border-top: 0;
}
summary {
  padding: 12px 0;
  font-family: var(--pixel);
  font-size: 1.1875rem;
  color: var(--mulberry);
  cursor: pointer;
}
details p {
  padding: 0 0 14px 20px;
}

/* ---------- status bar ---------- */

.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  align-items: center;
  padding: 8px 16px;
  background: var(--putty);
  border-top: 2px solid var(--ink);
  box-shadow: var(--raised);
  font-size: 0.8125rem;
}
.statusbar span:first-child {
  margin-right: auto;
}
.statusbar a,
.statusbar a:visited {
  color: var(--ink);
}

/* ---------- plain pages (legal, 404) ---------- */

.doc h1 {
  font-size: 2.25rem;
  margin-bottom: 0.6em;
}
.doc h2 {
  font-size: 1.375rem;
  margin: 1.6em 0 0.4em;
}
.doc address {
  font-style: normal;
  margin-bottom: 1em;
}
.doc hr {
  border: 0;
  border-top: 2px dotted var(--putty-dark);
  margin: 2.2em 0;
}
.lost {
  text-align: center;
}
.lost img {
  width: 160px;
  height: 160px;
}
.lost p {
  margin-left: auto;
  margin-right: auto;
}
.lost .actions {
  justify-content: center;
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .welcome {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 20px;
    gap: 20px;
  }
  .pig,
  .pig img {
    width: 160px;
    height: 160px;
  }
  .pig {
    margin: -16px 0 0;
  }
  .oink {
    right: -8px;
    top: 8px;
  }
  .pane {
    padding: 18px;
  }
  .tools li {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .tools img,
  .tools .slot {
    width: 48px;
    height: 48px;
  }
  .tools .status,
  .tools .btn {
    grid-column: 2;
    justify-self: start;
  }
  .win {
    box-shadow: var(--raised), 5px 5px 0 var(--snout);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
