/*
 * InnLore 3D name loader (v2.0.0). One file for the instant splash in
 * index.html and the React loading screens (ColdStartScreen, DbWakingScreen).
 * Served as a plain file because the portal CSP allows styles from files only.
 * Only transform and opacity animate (GPU friendly). Under
 * prefers-reduced-motion the name stands still.
 */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/outfit-latin-700-normal.woff2') format('woff2');
}

.brand-loader-screen {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 1.5rem 0;
  background:
    radial-gradient(ellipse 70% 60% at 82% 20%, rgba(47, 111, 115, 0.38), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 0%, rgba(30, 58, 95, 0.7), transparent 70%), #071528;
  color: #fbf8f1;
  text-align: center;
  font-family:
    'Outfit',
    'Segoe UI',
    system-ui,
    -apple-system,
    'Helvetica Neue',
    sans-serif;
  overflow: hidden;
}
.brand-loader-screen[data-portal='staff'] {
  background:
    radial-gradient(ellipse 70% 60% at 82% 20%, rgba(47, 111, 115, 0.38), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 0%, rgba(30, 58, 95, 0.7), transparent 70%), #071528;
}

/* The name: full width of the screen, never inside the round logo. */
.brand-loader {
  width: 100%;
  perspective: 900px;
  perspective-origin: 50% 40%;
}
.brand-loader__stage {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  animation: brand-loader-sway 5.5s ease-in-out infinite alternate;
}
.brand-loader__layer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.28em;
  margin: 0;
  width: 100%;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  /* One line on wide screens: the name spans the screen. */
  font-size: 5.5vw;
  line-height: 1.05;
  letter-spacing: 0.01em;
  white-space: normal;
  color: #7d6230;
}
.brand-loader__layer + .brand-loader__layer {
  position: absolute;
  inset: 0;
}
/* Depth: copies pushed back in 3D, darker as they go, make the solid gold. */
.brand-loader__layer:nth-child(1) {
  transform: translateZ(-14px);
  color: #3f3118;
}
.brand-loader__layer:nth-child(2) {
  transform: translateZ(-12px);
  color: #4a3a1c;
}
.brand-loader__layer:nth-child(3) {
  transform: translateZ(-10px);
  color: #554321;
}
.brand-loader__layer:nth-child(4) {
  transform: translateZ(-8px);
  color: #614c26;
}
.brand-loader__layer:nth-child(5) {
  transform: translateZ(-6px);
  color: #6d562a;
}
.brand-loader__layer:nth-child(6) {
  transform: translateZ(-4px);
  color: #7d6230;
}
.brand-loader__layer:nth-child(7) {
  transform: translateZ(-2px);
  color: #a6853e;
}
.brand-loader__layer--front {
  transform: translateZ(0);
  color: #c6a15b;
  background: linear-gradient(
    100deg,
    #c6a15b 0%,
    #c6a15b 40%,
    #f6e7c1 50%,
    #c6a15b 60%,
    #c6a15b 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brand-loader-sheen 3.6s ease-in-out infinite;
}
.brand-loader__part {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  animation: brand-loader-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.brand-loader__part:nth-child(2) {
  animation-delay: 0.15s;
}
.brand-loader__part:nth-child(3) {
  animation-delay: 0.3s;
}
.brand-loader__part:nth-child(4) {
  animation-delay: 0.45s;
}
.brand-loader__part:nth-child(5) {
  animation-delay: 0.6s;
}

.brand-loader__message {
  margin: 0;
  padding: 0 1.25rem;
  max-width: 40rem;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  font-weight: 500;
  color: #fbf8f1;
}
.brand-loader__sub {
  margin: -0.8rem 0 0;
  padding: 0 1.25rem;
  color: rgba(243, 238, 228, 0.78);
}
.brand-loader-screen .btn {
  background: transparent;
  border: 1px solid #c6a15b;
  color: #fbf8f1;
}

/* Phones: two lines, each as wide as the screen allows. */
@media (max-width: 700px) {
  .brand-loader__layer {
    font-size: 14vw;
    row-gap: 0.05em;
  }
  .brand-loader__part--group {
    font-size: 0.72em;
  }
}

@keyframes brand-loader-sway {
  from {
    transform: rotateY(-12deg) rotateX(6deg);
  }
  to {
    transform: rotateY(12deg) rotateX(3deg);
  }
}
@keyframes brand-loader-sheen {
  0% {
    background-position: 120% 0;
  }
  60%,
  100% {
    background-position: -20% 0;
  }
}
@keyframes brand-loader-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-loader__stage {
    animation: none;
    transform: rotateY(-10deg) rotateX(5deg);
  }
  .brand-loader__layer--front {
    animation: none;
  }
  .brand-loader__part {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Instant splash: fades out when the app is ready (see web/src/splash.ts). */
.splash {
  transition: opacity 0.3s ease;
}
.splash--leaving {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .splash {
    transition: none;
  }
}

/* M1: customer splash with the business mark (logo, business name, "Powered by InnLore"). */
.splash-business {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: 1rem;
}
.splash-business__logo {
  max-height: 6rem;
  max-width: 12rem;
  object-fit: contain;
}
.splash-business__name {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
}
.splash-business__powered {
  margin: 0;
  color: #c6a15b;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
