/* The whole font loads only for a character the core lacks; the core is Latin and Cyrillic, the page's first paint. */
@font-face {
  font-family: "TikTok Sans";
  src: url("fonts/TikTokSans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "TikTok Sans";
  src: url("fonts/TikTokSans-core.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-017F, U+0400-045F, U+0490-0491, U+2010-2027, U+2030-203A, U+20AC, U+20BD, U+2116, U+2122, U+2190-2193, U+2212, U+2215, U+25CF;
}

body.boot-document {
  margin: 0;
  min-height: 100vh;
  background: #000;
}

.boot-shell,
.boot-shell * {
  box-sizing: border-box;
}

/* USER DECISION (Max, 02.12): the loading screen is the identity's light behind fluted glass rising from the bottom
   edge under the wordmark. It has three states: entering (nothing yet), holding (waiting) and exiting (opened).
   Every motion is a transition to a state, not a clip: «ready» may come at any moment, mid-entrance too, and each
   part carries on from where it was. The pending line shows only after a second and a half of waiting, so a quick
   load never shows it. At the end the wordmark lands on the page's own one, the light sinks, and the page shows
   through. The tokens come from /identity.css, the light from /light.js. */
.boot-shell {
  --boot-logo: clamp(96px, 14vw, 150px);
  --boot-at: 36;
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  background: #000;
  color: var(--cream);
  font: var(--w-text) 15px / var(--lh-ui) var(--sans);
  letter-spacing: var(--t-ui);
  transition: background-color var(--d-3) var(--ease);
}

.boot-light {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(0deg, #000 40%, transparent);
  mask-image: linear-gradient(0deg, #000 40%, transparent);
  transition: translate calc(var(--d-3) * 2) var(--ease), opacity var(--d-3) var(--ease);
}

.boot-light canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.boot-logo {
  position: absolute;
  left: 50%;
  top: calc(var(--boot-at) * 1%);
  width: var(--boot-logo);
  height: auto;
  translate: -50% -50%;
  transform-origin: 0 0;
  transition:
    translate var(--d-3) var(--ease),
    scale var(--d-3) var(--ease),
    opacity var(--d-3) var(--ease) var(--d-1),
    filter var(--d-3) var(--ease) var(--d-1);
}

/* What the screen says stands right under the wordmark, whose height is 0.229 of its width. */
.boot-main {
  position: absolute;
  left: 50%;
  top: calc(var(--boot-at) * 1% + var(--boot-logo) * 0.115 + 16px);
  width: min(100% - 32px, 520px);
  display: grid;
  justify-items: center;
  text-align: center;
  translate: -50% 0;
  transition: opacity var(--d-3) var(--ease) var(--d-1);
}

.boot-eyebrow {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: var(--cream-3);
}

.boot-title {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-wrap: balance;
}

.boot-title--pending {
  transition: opacity calc(var(--d-3) * 2) ease 1500ms;
}

.boot-body {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 44ch;
  margin-top: 12px;
  color: var(--cream-2);
  line-height: var(--lh-text);
}

.boot-body > * {
  margin: 0;
}

.boot-shell.is-holding,
.boot-shell.is-entering {
  pointer-events: none;
}

.boot-shell.is-entering .boot-light {
  translate: 0 100%;
  opacity: 0;
}

.boot-shell.is-entering .boot-logo {
  translate: -50% calc(10px - 50%);
  opacity: 0;
  filter: blur(8px);
}

.boot-shell.is-entering .boot-main {
  opacity: 0;
}

.boot-shell:is(.is-entering, .is-exiting, .is-hidden) .boot-title--pending {
  opacity: 0;
  transition-duration: var(--d-1);
  transition-delay: 0s;
}

.boot-shell.is-exiting,
.boot-shell.is-hidden {
  background-color: transparent;
  pointer-events: none;
}

.boot-shell:is(.is-exiting, .is-hidden) .boot-light {
  translate: 0 60%;
  opacity: 0;
  transition-duration: var(--d-3);
}

.boot-shell:is(.is-exiting, .is-hidden) .boot-main {
  opacity: 0;
  transition-duration: var(--d-1);
  transition-delay: 0s;
}

/* With a wordmark on the page to land on, the screen's own one travels to it; otherwise it goes out with the rest. */
.boot-shell:is(.is-exiting, .is-hidden) .boot-logo {
  opacity: 0;
  filter: none;
  transition-delay: 0s;
}

.boot-shell.is-exiting.is-landing .boot-logo {
  translate: var(--boot-to);
  scale: var(--boot-scale);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .boot-shell,
  .boot-shell * {
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
  }
}
