/* Home: wordmark and definitions on the left, the four form factors on the right.
   Loaded after styles.css; background layers and type tokens come from there. */

body.home-forms .stage {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  justify-content: stretch;
  column-gap: clamp(32px, 5vw, 96px);
  padding: max(32px, env(safe-area-inset-top)) clamp(28px, 6.5vw, 120px) max(32px, env(safe-area-inset-bottom));
}

body.home-forms .intro {
  position: relative;
  z-index: 5;
  justify-self: start;
  max-width: 380px;
}

body.home-forms .wordmark {
  text-align: left;
  transform: none;
}

body.home-forms .purl-wordmark {
  width: clamp(72px, 5.6vw, 96px);
}

body.home-forms .wordmark-title {
  font-size: inherit;
  transform-origin: left center;
}

body.home-forms .wordmark-pron {
  margin-top: 9px;
  padding-left: 1px;
  font-size: 11.5px;
}

body.home-forms .definitions {
  margin-top: clamp(28px, 5.5vh, 56px);
  max-width: 350px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.5;
}

body.home-forms .def-entry {
  margin-bottom: 11px;
  padding-left: 19px;
}

body.home-forms .def-num {
  font-size: 12px;
}

body.home-forms .def-pos {
  margin-right: 5px;
}

body.home-forms .def-example {
  font-size: 12.5px;
}

body.home-forms .definitions:hover {
  opacity: 0.88;
}

/* ===== Form factors ===== */

.forms {
  --slot: min(19.5vw, 33vh);
  --gap: calc(var(--slot) * 0.2);
  position: relative;
  z-index: 5;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, var(--slot));
  gap: var(--gap);
}

.form {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  display: block;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.form-art {
  display: block;
  width: var(--slot);
  aspect-ratio: 1;
}

.form:focus-visible {
  outline: 1px dotted var(--ink-faint);
  outline-offset: -8%;
}

#ascii {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 6;
  pointer-events: none;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

body.can-grab {
  cursor: grab;
}

/* ===== Narrow screens: stack, and let the page scroll ===== */

@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  html:has(body.home-forms) {
    overflow: auto;
    height: auto;
  }

  body.home-forms {
    height: auto;
    overflow: visible;
  }

  body.home-forms .stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    row-gap: clamp(36px, 6vh, 64px);
    width: 100%;
    height: auto;
    min-height: 100svh;
    padding: max(48px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
  }

  body.home-forms .stage > .field,
  body.home-forms .stage > .vignette,
  body.home-forms .stage > .grain {
    position: fixed;
  }

  body.home-forms .purl-wordmark {
    width: 74px;
  }

  body.home-forms .definitions {
    margin-top: 24px;
    font-size: 14px;
  }

  body.home-forms .def-example {
    font-size: 12.5px;
  }

  .forms {
    --slot: min(40vw, 30vh, 260px);
  }
}
