.app-launch {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 32px 24px 88px;
  padding-bottom: max(88px, calc(env(safe-area-inset-bottom) + 64px));
  box-sizing: border-box;
  overflow: auto;
  background: #f4f7f5;
  color: #222d2b;
  font-family: "DM Sans", system-ui, sans-serif;
  text-align: center;
  letter-spacing: 0;
  transition:
    opacity 160ms ease-out,
    background-color 180ms ease-out;
}
.app-launch[data-phase="company"] {
  background: #f3f3ef;
}
.app-launch[data-phase="app"] {
  background: #10221e;
  color: #f6f8f5;
}
.app-launch.launch-leaving {
  opacity: 0;
}
.launch-panel {
  width: 100%;
  flex-shrink: 0;
}
#launch-company {
  transition: opacity 240ms ease-out;
  mix-blend-mode: darken;
}
#launch-company.company-leaving {
  opacity: 0;
}
.launch-company-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 660px, 80svh);
  margin: 0 auto;
  aspect-ratio: 1195 / 896;
}
.launch-company-mark img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  opacity: 0;
  grid-area: 1 / 1;
  /* Feather only the empty paper margins; keep the supplied artwork intact. */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to bottom, transparent, #000 24%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to bottom, transparent, #000 24%, #000 78%, transparent);
  mask-composite: intersect;
}
.launch-company-mark h1 {
  grid-area: 1 / 1;
  font-size: 24px;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}
.launch-company-mark.logo-ready img {
  opacity: 1;
  /* The entrance starts when the logo loads, not when the empty panel mounts. */
  animation: launch-company-enter 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.launch-company-mark.logo-ready h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.app-launch [hidden] {
  display: none;
}
.app-launch:has(noscript p) .launch-progress {
  display: none;
}
.launch-app-mark {
  position: relative;
  width: min(216px, 100%);
  aspect-ratio: 88 / 92;
  margin: 0 auto 16px;
}
.launch-app-mark img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
}
.launch-app-mark.fallback-ready .launch-mark-fallback {
  opacity: 1;
}
.launch-app-mark.art-ready .launch-mark-fallback {
  display: none;
}
.launch-app-mark.art-ready .launch-frame-rear {
  animation: launch-rear-enter 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.launch-app-mark.art-ready .launch-frame-front {
  animation: launch-front-enter 860ms cubic-bezier(0.22, 1, 0.36, 1) 70ms both;
}
.launch-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("/icons/brand-symbol.svg") center / contain no-repeat;
  mask: url("/icons/brand-symbol.svg") center / contain no-repeat;
}
.launch-shine::after {
  content: "";
  position: absolute;
  inset: -25%;
  background: linear-gradient(
    110deg,
    transparent 38%,
    #ffffffb3 49%,
    transparent 60%
  );
  opacity: 0;
}
.art-ready .launch-shine::after {
  animation: launch-shine 700ms cubic-bezier(0.4, 0, 0.6, 1) 800ms both;
}
.launch-identity h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  font-family: "Nunito", "DM Sans", system-ui, sans-serif;
  animation: launch-reveal 500ms cubic-bezier(0.22, 1, 0.36, 1) 450ms both;
}
.launch-identity p {
  margin: 10px 0 0;
  font-size: 15px;
  color: #b8c9c2;
  animation: launch-reveal 500ms cubic-bezier(0.22, 1, 0.36, 1) 550ms both;
}
.launch-progress {
  width: 96px;
  height: 3px;
  overflow: hidden;
  background: #324c43;
  margin: 28px auto 0;
}
.launch-progress::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: #f57861;
  animation: launch-progress 1.2s ease-in-out infinite alternate;
}
.launch-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.launch-recovery,
.app-launch noscript {
  max-width: 340px;
  font-size: 14px;
  line-height: 1.6;
}
.launch-recovery h2 {
  font-size: 17px;
  margin: 0;
}
.launch-recovery button {
  padding: 12px 24px;
  min-height: 44px;
  font: inherit;
  border: 0;
  border-radius: 6px;
  background: #176b5b;
  color: white;
  cursor: pointer;
}
.launch-recovery button:focus-visible {
  outline: 3px solid #176b5b;
  outline-offset: 4px;
}
.launch-skip {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  min-height: 44px;
  min-width: 64px;
  padding: 10px 16px;
  border: 1px solid #b5c4bb;
  border-radius: 6px;
  background: #ffffff;
  color: #222d2b;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.launch-skip:hover {
  background: #e9f3ee;
}
.launch-skip:focus-visible {
  outline: 3px solid #176b5b;
  outline-offset: 3px;
}
.app-launch[data-phase="app"] .launch-skip {
  background: #1b332b;
  border-color: #5e7b6f;
  color: #f6f8f5;
}
.app-launch[data-phase="app"] .launch-skip:hover {
  background: #29493d;
}
.app-launch[data-phase="app"] :focus-visible {
  outline-color: #f57861;
}
.app-launch[data-phase="app"] .launch-recovery button {
  background: #f57861;
  color: #10221e;
}
@keyframes launch-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes launch-company-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes launch-rear-enter {
  from {
    opacity: 0;
    transform: translate(24px, -22px) rotate(8deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
}
@keyframes launch-front-enter {
  from {
    opacity: 0;
    transform: translate(-28px, 22px) rotate(-6deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
}
@keyframes launch-shine {
  0% {
    opacity: 0;
    transform: translateX(-90%);
  }
  25%,
  65% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translateX(90%);
  }
}
@keyframes launch-progress {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(150%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-launch,
  #launch-company {
    transition: none;
  }
  .launch-company-mark.logo-ready img,
  .launch-app-mark.art-ready .launch-frame,
  .launch-identity h1,
  .launch-identity p {
    animation: none;
  }
  .launch-app-mark.art-ready .launch-frame {
    opacity: 1;
  }
  .art-ready .launch-shine::after {
    animation: none;
  }
  .launch-progress::after {
    animation: none;
    width: 100%;
  }
}
@media (max-height: 480px) {
  .app-launch {
    padding-top: 24px;
    padding-bottom: 76px;
    gap: 12px;
  }
  .launch-company-mark {
    width: min(100%, 660px, calc((100svh - 110px) * 1195 / 896));
  }
  .app-launch:has(.launch-recovery:not([hidden])) {
    justify-content: flex-start;
  }
  .launch-progress {
    margin-top: 24px;
  }
  .launch-app-mark {
    width: 108px;
    margin-bottom: 10px;
  }
  .launch-identity h1 {
    font-size: 26px;
  }
  .launch-identity p {
    margin-top: 6px;
  }
}
