@font-face {
  font-family: "Departure Mono";
  src: url("DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
}

/* --u is one palette swatch; the sheet is 16 wide and the canvas 16 by 12 (4:3). */
:root {
  --u: 18px;
  --desk: #b2aea8;
  --paper: #ffffff;
  --ink: #000000;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #585552;
    --paper: #000000;
    --ink: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--desk);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 14px;
  /* Departure Mono is drawn for sizes that are multiples of 11px. */
  font: 22px/22px "Departure Mono", ui-monospace, Consolas, Menlo, monospace;
  color: var(--ink);
}

.sheet {
  width: calc(16 * var(--u) + 4px);
  border: 2px solid var(--ink);
}

.canvas {
  height: calc(12 * var(--u));
  margin: 0;
  padding: var(--u);
  background: var(--paper);
  font-size: 33px;
  line-height: 33px;
  font-weight: normal;
}

.palette {
  display: flex;
  flex-wrap: wrap;
}

.palette span {
  width: var(--u);
  height: var(--u);
}

.palette span:nth-child(1) { background: #000000; }
.palette span:nth-child(2) { background: #701c2a; }
.palette span:nth-child(3) { background: #74461f; }
.palette span:nth-child(4) { background: #6b6618; }
.palette span:nth-child(5) { background: #2b5a2a; }
.palette span:nth-child(6) { background: #1b5955; }
.palette span:nth-child(7) { background: #1f3487; }
.palette span:nth-child(8) { background: #4a2a6c; }
.palette span:nth-child(9) { background: #585552; }
.palette span:nth-child(10) { background: #d8362d; }
.palette span:nth-child(11) { background: #ec8a2b; }
.palette span:nth-child(12) { background: #f3d03e; }
.palette span:nth-child(13) { background: #5aa845; }
.palette span:nth-child(14) { background: #25a59e; }
.palette span:nth-child(15) { background: #3f8fe0; }
.palette span:nth-child(16) { background: #7b4ab8; }
.palette span:nth-child(17) { background: #b2aea8; }
.palette span:nth-child(18) { background: #ef8f98; }
.palette span:nth-child(19) { background: #e2b47c; }
.palette span:nth-child(20) { background: #f5ea8c; }
.palette span:nth-child(21) { background: #a2d972; }
.palette span:nth-child(22) { background: #7fd8ce; }
.palette span:nth-child(23) { background: #8fc4f2; }
.palette span:nth-child(24) { background: #b89ce0; }
.palette span:nth-child(25) { background: #ffffff; }
.palette span:nth-child(26) { background: #f7c3cc; }
.palette span:nth-child(27) { background: #f7dbba; }
.palette span:nth-child(28) { background: #fbf6d2; }
.palette span:nth-child(29) { background: #d6f0bd; }
.palette span:nth-child(30) { background: #c8efe8; }
.palette span:nth-child(31) { background: #d2e5f8; }
.palette span:nth-child(32) { background: #e3d6f3; }

/* The address is 23 letters, each 7/11 of the font size wide: 22px is 322 wide, 44px is 644. */
.link {
  display: block;
  min-height: 44px;
  padding: 11px 0;
  font-size: 19px;
  text-align: center;
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.link:hover,
.link:focus {
  background: #f3d03e;
  color: #000000;
}

.link:focus {
  outline: 4px solid var(--ink);
  outline-offset: 4px;
}

.link:focus:not(:focus-visible) {
  outline: 0;
}

@media (min-width: 360px) {
  :root {
    --u: 21px;
  }

  body {
    padding: 10px;
  }

  .link {
    font-size: 22px;
  }
}

@media (min-width: 760px) and (min-height: 700px) {
  :root {
    --u: 41px;
  }

  body {
    padding: 20px;
    font-size: 33px;
    line-height: 33px;
  }

  .canvas {
    font-size: 66px;
    line-height: 66px;
  }

  .link {
    padding: 22px 0;
    font-size: 44px;
    line-height: 44px;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
  }
}
