@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-latin.woff2') format('woff2');
}

:root {
  --paper-0: #131312;
  --paper-1: #1a1a18;
  --paper-2: #222220;
  --hair: #2e2e2b;
  --control: #4a4946;
  --ink-1: #dad7ce;
  --ink-2: #a8a59c;
  --ink-3: #8e8b83;
  --text: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;
  /* The intro's drawn width. The front page places its tools from the same number. */
  --intro-w: calc(min(72vw, 150vh) * 0.73);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper-0); color: var(--ink-1); }
body {
  font: 15px/24px var(--text);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; font-weight: inherit; font-size: inherit; }
button { font: inherit; color: inherit; }
a { color: var(--ink-2); text-underline-offset: 4px; }
a:hover { color: var(--ink-1); }
:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 4px; }

/* Less above than at the sides: the top bar's logo loop already gives the top its room. */
main { position: relative; min-height: 100vh; padding: 2px 32px 32px; }
.name {
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}

/* A tool's top bar: its name on the left, the logo loop in the middle, the line under both.
   The two outer columns are equal, so the loop sits in the middle of the page. The loop is
   drawn on black and screen-blended, like the intro, so its black is the page showing through. */
.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hair);
}
/* The name sits on the line, where it is on a page without the loop; the loop is centred on the bar. */
.bar .name { padding-bottom: 0; border-bottom: 0; align-self: end; }
/* The loop is also the way home. */
.mark { display: block; width: 140px; }
.mark video { display: block; width: 100%; height: auto; mix-blend-mode: screen; }
@media (max-width: 480px) {
  .mark { width: 96px; }
}

/* The front page. The tools sit where the logo was: 0.173 and 0.67 are the logo's
   left edge and width inside the intro frame, measured from the file. */
.front .tools {
  position: absolute;
  top: 50%;
  left: calc(50vw - var(--intro-w) * 0.327);
  width: calc(var(--intro-w) * 0.67);
  transform: translateY(-50%);
}
.tool {
  display: grid;
  grid-template-columns: 120px 1fr;
  column-gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
}
/* A tool is a link, and the whole row is the link. */
a.tool { color: inherit; text-decoration: none; }
a.tool:hover .tool-says { color: var(--ink-1); }
.tool-name { font-size: 20px; line-height: 28px; font-weight: 500; }
.tool-says { color: var(--ink-2); }
.front .foot { position: absolute; left: 32px; bottom: 32px; font-size: 13px; line-height: 20px; }

/* The intro: black over the page, the logo animation over the black.
   The video is screen-blended, so its own black shows whatever is under it. */
html.intro-on, html.intro-on body { overflow: hidden; }
.intro-bg, .intro-video { position: fixed; inset: 0; }
.intro-bg {
  z-index: 10;
  background: #000;
  opacity: 1;
  transition: opacity var(--intro-fade, 200ms) linear;
}
.intro-bg.gone { opacity: 0; }
.intro-video {
  z-index: 11;
  margin: auto;
  width: var(--intro-w);
  aspect-ratio: 3 / 2;
  mix-blend-mode: screen;
  pointer-events: none;
}

@media (max-width: 640px) {
  :root { --intro-w: calc(min(92vw, 150vh) * 0.73); }
  main { padding: 2px 16px 24px; }
  .front .tools { left: 16px; right: 16px; width: auto; }
  .front .foot { left: 16px; bottom: 24px; }
  .tool { grid-template-columns: 1fr; }
}
