/* ---- Home intro (see intro.js) ------------------------------------------
   Kept apart from styles.css on purpose: the intro disables styles.css and
   retypes it live, so these rules must survive that.                        */
html.intro-pending {
  visibility: hidden;
}

body.intro-active {
  padding-bottom: 45vh;
}

#intro {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  height: 42vh;
  display: flex;
  flex-direction: column;
  background: #16150f;
  border-top: 2px solid #f08a4b;
  box-shadow: 0 -8px 30px rgb(0 0 0 / 0.35);
  color: #efe9da;
  font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  transition: transform 0.6s ease;
}

#intro.intro-done {
  transform: translateY(105%);
}

#intro pre {
  flex: 1;
  margin: 0;
  padding: 0.75rem 1rem;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  color: inherit;
}

#intro .intro-comment {
  color: #8f8a76;
}

#intro button {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid #f08a4b;
  border-radius: 999px;
  background: #16150f;
  color: #f08a4b;
  font: inherit;
  cursor: pointer;
}

/* The photo stays out until its circle has been styled, then fades in. */
body.intro-active:not(.intro-avatar-ready) .hero picture,
body.intro-active:not(.intro-avatar-ready) .hero .avatar {
  display: none;
}

body.intro-avatar-ready .hero .avatar {
  animation: intro-avatar-in 0.8s ease both;
}

@keyframes intro-avatar-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

/* Page parts that have not been "written" yet. */
.intro-hidden {
  display: none !important;
}

/* Wide screens: the code panel docks to the right so page and code are both fully visible. */
@media (min-width: 75rem) {
  body.intro-active {
    padding-right: 38vw;
    padding-bottom: 0;
  }

  #intro {
    top: 0;
    left: auto;
    width: 38vw;
    height: auto;
    border-top: 0;
    border-left: 2px solid #f08a4b;
    box-shadow: -8px 0 30px rgb(0 0 0 / 0.35);
    font-size: 14px;
  }

  #intro.intro-done {
    transform: translateX(105%);
  }
}
