:root {
  --premarchives-screen-protection-background: #000;
  --premarchives-screen-protection-foreground: #f7f7f8;
  --premarchives-screen-protection-muted: #a7a7ad;
}

.premarchives-screen-protection {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  min-height: 100dvh;
  padding: 32px;
  overflow: hidden;
  color: var(--premarchives-screen-protection-foreground);
  background: var(--premarchives-screen-protection-background);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.premarchives-screen-protection__content {
  width: min(620px, 100%);
}

.premarchives-screen-protection__title {
  margin: 0 0 18px;
  color: inherit;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.premarchives-screen-protection__message {
  margin: 0;
  color: var(--premarchives-screen-protection-muted);
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 400;
  line-height: 1.6;
}

.premarchives-screen-protection__instruction {
  margin: 22px 0 0;
  color: var(--premarchives-screen-protection-foreground);
  font-size: clamp(13px, 1.7vw, 16px);
  font-weight: 500;
  line-height: 1.5;
}

html.premarchives-screen-protected,
html.premarchives-screen-protected body {
  background: var(--premarchives-screen-protection-background) !important;
}

html.premarchives-screen-protected body > :not(.premarchives-screen-protection) {
  visibility: hidden !important;
}

html.premarchives-screen-protected .premarchives-screen-protection {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
}

@media (max-width: 480px) {
  .premarchives-screen-protection {
    padding: max(24px, env(safe-area-inset-top)) 24px
      max(24px, env(safe-area-inset-bottom));
  }

  .premarchives-screen-protection__title {
    margin-bottom: 14px;
  }

  .premarchives-screen-protection__message {
    font-size: 15px;
    line-height: 1.55;
  }

  .premarchives-screen-protection__instruction {
    margin-top: 18px;
    font-size: 14px;
  }
}

@media print {
  html:not(.premarchives-screen-protection-exempt),
  html:not(.premarchives-screen-protection-exempt) body {
    background: #000 !important;
  }

  html:not(.premarchives-screen-protection-exempt) body > :not(.premarchives-screen-protection) {
    display: none !important;
  }

  html:not(.premarchives-screen-protection-exempt) .premarchives-screen-protection {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
    background: #000 !important;
  }
}
