/* ==========================================================================
   Page transition overlay (pixel-grid dissolve)
   Works together with /js/page-transition.js.

   - The grid covers the whole viewport: 24 columns x 20 rows = 480 cells.
     The cells are created by a tiny inline script right after
     <div class="load_grid"> on each page. If you change the column/row
     count here, change the cell count in that snippet too.
   - Cell colour = --transition-color (defined in styles.css :root, white #fff).
   ========================================================================== */

/* The page canvas is the transition colour, so the moment between leaving a
   fully covered page and the next page painting matches the cells. Both are
   white now; .page_wrapper (which holds every section) is white too and is
   always at least one screen tall. */
html,
body,
.body {
  background-color: var(--transition-color);
}

.page_wrapper {
  background-color: var(--background-color);
  min-height: 100vh;
}

/* Until the inline script has added the cells, the empty grid is a solid
   sheet of the transition colour, so the page is covered from its first paint. */
.load_grid:empty {
  background-color: var(--transition-color);
}

.load_grid {
  z-index: 100;
  box-sizing: border-box;
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  grid-template-rows: repeat(20, auto);
  grid-template-columns: repeat(24, 1fr);
  grid-auto-columns: 1fr;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  margin-left: auto;
  margin-right: auto;
  display: grid; /* on at first paint; page-transition.js hides it after the intro */
  position: fixed;
  inset: 0%;
}

.load_grid-item {
  background-color: var(--transition-color);
  width: 100%;
  height: 100%;
}
