.not-found-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.not-found-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
}

.not-found-header {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  padding-inline: .25rem;
}

.not-found-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-title);
  letter-spacing: -.04em;
  line-height: 1.2;
}

.not-found-portrait,
.not-found-portrait img {
  display: block;
  width: 63px;
  height: 57px;
}

.not-found-portrait img {
  object-fit: contain;
}

.not-found-main {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.not-found-intro {
  width: min(100%, 960px);
}

.not-found-intro h1 {
  font-family: var(--font-body);
  font-size: clamp(1.5rem, 2.25vw, 2rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.not-found-intro p {
  margin-top: .75rem;
  font-size: clamp(.875rem, 1.35vw, 1rem);
  line-height: 1.35;
}

.not-found-intro a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.not-found-animation {
  display: block;
  width: clamp(280px, 32vh, 390px);
  height: auto;
  margin-top: .75rem;
  object-fit: contain;
}

.not-found-explanation {
  width: min(100%, 680px);
  margin-top: .5rem;
}

.not-found-explanation h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.not-found-explanation p {
  margin-top: .75rem;
  color: #6b6862;
  font-size: .75rem;
  line-height: 1.35;
}

@media (min-width: 761px) and (max-height: 850px) {
  .not-found-animation {
    width: min(30vh, 300px);
  }

  .not-found-intro p,
  .not-found-explanation p {
    margin-top: .4rem;
  }
}

@media (max-width: 760px) {
  .not-found-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    gap: clamp(.5rem, 1.8vh, 1.25rem);
    padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  }

  .not-found-header {
    min-height: 48px;
    padding-inline: 0;
  }

  .not-found-wordmark {
    font-size: 1.5rem;
  }

  .not-found-portrait,
  .not-found-portrait img {
    width: 44px;
    height: 44px;
  }

  .not-found-main {
    min-height: 0;
    gap: clamp(.25rem, 1vh, .75rem);
    justify-content: flex-start;
    padding-bottom: 20px;
  }

  .not-found-intro h1 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
  }

  .not-found-intro p {
    font-size: 1rem;
  }

  .not-found-intro p br {
    display: none;
  }

  .not-found-animation {
    width: auto;
    max-width: min(100%, 340px);
    height: min(38dvh, 340px);
    margin-top: clamp(.25rem, 1vh, .75rem);
  }

  .not-found-explanation {
    margin-top: 0;
  }

  .not-found-explanation h2 {
    font-size: 1.75rem;
  }

  .not-found-shell > .site-footer {
    margin-top: auto;
    flex: none;
  }
}
