*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-dim: #888888;
  --error: #d42020;
  --pixel: 4px;
}

html {
  font-size: 16px;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Press Start 2P", monospace;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  image-rendering: pixelated;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  animation: boot 1.2s steps(6) both;
}

@keyframes boot {
  0% { opacity: 0; }
  20% { opacity: 1; }
  40% { opacity: 0.4; }
  60% { opacity: 1; }
  100% { opacity: 1; }
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  max-width: 80vw;
}

.title {
  font-size: clamp(1.2rem, 5.8vw, 1.9rem);
  line-height: 1.8;
  color: var(--text);
  text-align: center;
  width: 100%;
  margin-bottom: 1.25rem;
}

.title .exp {
  font-size: 0.55em;
  vertical-align: super;
  position: relative;
  top: -0.65em;
  color: var(--text-dim);
  margin-left: 0.1em;
}

.loadbar {
  width: 100%;
  margin-top: 0;
  padding: var(--pixel);
  border: var(--pixel) solid var(--text-dim);
  background-color: var(--bg);
  overflow: hidden;
}

.loadbar-fill {
  display: block;
  height: calc(var(--pixel) * 2);
  width: 0;
  background-color: var(--text);
  animation: loading 5s steps(16) infinite;
}

@keyframes loading {
  0% { width: 0%; }
  40% { width: 74%; }
  70% { width: 74%; }
  71% { width: 0%; }
  100% { width: 0%; }
}

.error {
  margin-top: 1.25rem;
  text-align: center;
  opacity: 0;
  animation: error-appear 5s steps(1) infinite;
}

.error-label {
  display: block;
  font-size: 0.7rem;
  line-height: 1.8;
  color: var(--error);
  margin-bottom: 0.6rem;
}

.error-caption {
  display: block;
  font-size: 0.5rem;
  line-height: 2;
  color: var(--error);
  max-width: 280px;
  opacity: 0.9;
}

@keyframes error-appear {
  0%, 39% { opacity: 0; }
  40%, 70% { opacity: 1; }
  71%, 100% { opacity: 0; }
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 2rem;
  text-align: center;
  animation: boot 1.2s steps(6) 0.3s both;
}

.footer p {
  font-size: 0.4rem;
  line-height: 2;
  color: var(--text-dim);
}

@media (max-width: 480px) {
  .title {
    font-size: clamp(0.9rem, 4.8vw, 1.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content,
  .footer {
    animation: none;
    opacity: 1;
  }

  .loadbar-fill {
    animation: none;
    width: 74%;
  }

  .error {
    animation: none;
    opacity: 1;
  }
}
