@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; }

main { position: relative; min-height: 100vh; padding: 32px; }
.name {
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}

/* The logo loop, in the middle of the top line of a tool's page. Like the intro it is drawn on
   black and screen-blended, so its black is the page showing through. 0.6 is its height over
   its width. Narrower screens keep it clear of the name on the left. */
.mark {
  position: absolute;
  top: calc(var(--mark-top) + 14px - var(--mark-w) * 0.3);
  left: 50%;
  width: var(--mark-w);
  transform: translateX(-50%);
  mix-blend-mode: screen;
  pointer-events: none;
  --mark-w: 100px;
  --mark-top: 32px;
}
@media (max-width: 480px) {
  .mark { --mark-w: 64px; }
}

/* 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: 24px 16px; }
  .mark { --mark-top: 24px; }
  .front .tools { left: 16px; right: 16px; width: auto; }
  .front .foot { left: 16px; bottom: 24px; }
  .tool { grid-template-columns: 1fr; }
}
