/* Note: the home page also uses landing.css and demo.css */

@media (width <= 500px) {
  /* These titles are really big, and we want a little extra space around them on narrow screens. */
  h1 { margin: 0 .3em 2rem }
  h2 { margin-inline: 1em }
}

/* Used to put a little heading and block of text together, often floating in space */
.unit h4 { font: 800 16px / 1.5 "Overpass" }
.unit p  { font: 500 16px / 1.5 "Overpass" }

/* BACKGROUNDS ************************************************************************************/

.demo-bg {
  position: relative;
  border-bottom: 2px solid var(--fg);
}

.demo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  mask-image: url("autodots-bg.png");
  mask-size: auto 351.5px;
  mask-position: bottom;
  mask-repeat: repeat-x;
  background-color: var(--fg);
  image-rendering: pixelated;
}

.devs-bg {
  --fg: var(--yellow);
  --bg: var(--slate);
  --bg: light-dark(var(--slate), var(--deep));
  color: var(--fg);
  background: var(--bg);
}

.team-bg, footer {
  --fg: var(--white);
  --bg: var(--mid);
  --bg: light-dark(var(--mid), var(--slate));
  color: var(--fg);
  background: var(--bg);
}

footer {
  position: relative;
}

footer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: env(safe-area-inset-bottom);
  background: var(--bg);
  pointer-events: none;
}

/* TAG ********************************************************************************************/

#tag {
  margin-bottom: 3em;
}

/* DEMO *******************************************************************************************/

/* See /content/index/demo.css */

.demo-bg {
  margin-bottom: 4rem;
}

/* ILLUSTRATION ***********************************************************************************/

#illustration {
  position: relative;
  margin-top: 1rem;
  font-size: min(1.388vw, 16px);
  fill: var(--fg);
}

#illustration .full {
  display: block;
  margin: 0 auto;
}

#illustration .chop {
  display: none;
}

#illustration .dashers {
  display: none;
}

#illustration .unit {
  position: absolute;
  max-width: 18em;
  left: 50%;
  margin-left: 16em;
}

@media (width > 1024px) {
  #illustration .unit:nth-of-type(odd) {
    left: auto;
    right: 50%;
    margin-inline: 0 16em;
  }
}

.multiplayer.unit { top: 6rem; }
.offline.unit { top: 24rem; }
.conflict.unit { top: 44rem; }
.versioned.unit { top: calc(50rem + 26em); }
.compact.unit { top: 94rem; }
.fast.unit { top: 108rem; }

.cursor.speedy {
  margin-bottom: 1em;
  margin-left: -1em;
}

.cursor.hello {
  position: absolute;
  top: 100%;
  right: 0;
}

@media (width <= 1024px) {
  #illustration {
    font-size: min(1.5625vw, 12px);
  }
  #illustration .full {
    position: relative;
    margin-left: auto;
    margin-right: 0;
    right: 50%;
    width: 32em;
  }
  #illustration .unit {
    left: 50%;
    margin-left: 5em;
    max-width: 19rem;
  }
  .multiplayer.unit { top: 6em; }
  .offline.unit { top: 30em; }
  .conflict.unit { top: 53em; }
  .versioned.unit { top: 74em; }
  .compact.unit { top: 93em; }
  .fast.unit { top: 109em; }
}

@media (width <= 700px) {
  #illustration {
    margin-top: 3rem;
    font-size: 16px;
  }

  #illustration .full { display: none }

  #illustration .chop {
    display: block;
    margin: 2.5em auto 5em;
  }
  #illustration .unit {
    position: relative;
    left: auto;
    right: auto;
    top: 0;
    margin: 0 auto;
    max-width: 19em;
  }

  #illustration .dashers { display: inline; }

  #illustration .chop.offline { margin-bottom: 8rem; }

  #illustration .cursor {
    position: relative;
    display: block;
    margin-inline: auto;
  }
  #illustration .cursor.speedy {
    margin-right: 3em;
    margin-bottom: -1em;
  }
  #illustration .cursor.hello {
    position: absolute;
    top: 36em;
    left: 11em;
    margin: 0;
  }
}

/* DEVS ******************************************************************************************/

#devs {
  margin-top: 6em;
  padding-block: 6em;
}

#devs h2 {
  margin-bottom: 2em;
}

#devs .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 22em);
  justify-content: center;
  gap: 5em;
}

@media (width <= 700px) {
  #devs {
    padding-bottom: 2em;
  }
  #devs br {
    display: none;
  }
  #devs .grid {
    display: block;
    padding-inline: 0;
  }
  #devs .unit {
    margin: 0 auto 3em;
    max-width: 19em;
  }
}

/* TEAM ******************************************************************************************/

#team {
  display: grid;
  align-items: start;
  gap: 4em 2em;
  padding-block: 6em 1em;
}

#team h2 {
  text-align: left;
  margin: -.5rem 0 .5rem;
}

#team p {
  margin-bottom: 1em;
}

#team .photos {
  display: flex;
  flex-flow: row wrap;
  gap: 1em;
}

#team img {
  width: 100%;
  mix-blend-mode: lighten;
}

@media (width <= 700px) {
  #team .photos { display: none; }
  #team img, #team canvas { margin: 0 0 1rem; }
}

@media (width > 700px) {
  #team { grid-template-columns: auto auto; }
  #team img { max-width: 460px; }
  #team .text div { display: none; }
}

[js-dither] {
  position: relative;
}

[js-dither] canvas {
  position: absolute;
  inset: 0;
  mix-blend-mode: lighten;
}

[js-dither] canvas + img {
  visibility: hidden;
}