/*
 * The start screen (M-57, D123): the yellow MAIM sign of the header, large, and a thin bar that runs
 * ahead once and waits. It is plain HTML in index.html, so it stands before the app's script has
 * loaded — with a weak connection that is several seconds. src/boot/boot.ts takes it away once the
 * app knows who is signed in. A file of its own rather than inline styles, like theme.js, so a
 * strict Content-Security-Policy can stay (D046). Colours as in src/styles/tokens.css.
 */
@font-face {
  font-family: 'MAIM Sign';
  font-weight: 700;
  font-display: block;
  src: url('/fonts/maim-sign.woff2') format('woff2');
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  background: #ffffff;
  transition: opacity 0.25s ease-out;
}

:root[data-theme='dark'] #boot {
  background: #111316;
}

#boot.boot-gone {
  opacity: 0;
  pointer-events: none;
}

.boot-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 50px;
  border-bottom: 3px solid #1d2128;
  border-radius: 4px 4px 1px 1px;
  background: #ffc20e;
  color: #1d2128;
  font:
    700 34px/1 'MAIM Sign',
    'Fira Sans Condensed',
    system-ui,
    sans-serif;
}

.boot-track {
  width: 120px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #e3e6ea;
}

:root[data-theme='dark'] .boot-track {
  background: #2a2e34;
}

/* Runs ahead to 85 % once and waits there; nothing loops (D118). */
.boot-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: #ffc20e;
  animation: boot-ahead 2.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

#boot.boot-done .boot-fill {
  width: 100%;
  animation: none;
  transition: width 0.2s ease-out;
}

@keyframes boot-ahead {
  to {
    width: 85%;
  }
}

/* The words for a screen reader; the sign says it for everybody else. */
.boot-words {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .boot-fill {
    width: 85%;
    animation: none;
  }

  #boot,
  #boot.boot-done .boot-fill {
    transition: none;
  }
}
