/* The Lykoh Studio intro (brand-intro.js; spec in design/BRAND_INTRO.md). Same colours, assets and
   timing as the apps (StudioIntro.tsx in Where's the Bomb?):
   - photo: 0 → 1 in 700 ms (ease-out cubic), scaling from 1.06 to 1; the landscape or the portrait
     one depending on the screen;
   - glint: a pale-gold copy of the symbol, up in 380 ms and down in 520 ms;
   - name: from 250 ms, 500 ms, rising 8 px, while symbol and name rise together until the drawn pair is
     centred at 44 % of the height (41 % in portrait), where the photo leaves room for it;
   - at 2150 ms everything fades out in 350 ms. */
html.brand-intro-pending { background: #0c0b0a; }
html.brand-intro-pending body { visibility: hidden; }

.brand-intro {
  position: fixed; inset: 0; z-index: 1000; background: #0c0b0a; cursor: pointer;
  transition: opacity 350ms linear;
}
.brand-intro.is-leaving { opacity: 0; }
/* /assets/ is cached for 30 days: when a photo changes, raise ?v= here and in brand-intro.js. */
.brand-intro-light {
  position: absolute; inset: 0; opacity: 0; transform: scale(1.06);
  background: #0c0b0a url("/assets/brand/lykoh-intro-photo-horizontal.webp?v=2") center / cover no-repeat;
}
@media (orientation: portrait) {
  .brand-intro-light { background-image: url("/assets/brand/lykoh-intro-photo-vertical.webp?v=2"); }
}
/* The symbol sits exactly in the middle; the name hangs below it. Sizes keep the app's proportions
   (symbol 160, name 190 × 63, 6 up into the symbol's margin). */
.brand-intro-center {
  --size: clamp(120px, 20vh, 200px);
  /* Where the drawn pair ends, as a fraction of the screen height (the photo's backdrop is there). */
  --end: 44vh;
  position: absolute; left: 0; right: 0; top: 50%; margin-top: calc(var(--size) / -2);
  display: flex; flex-direction: column; align-items: center;
}
.brand-intro-symbol { position: relative; width: var(--size); height: var(--size); }
.brand-intro-symbol img { width: 100%; height: 100%; }
.brand-intro-glint {
  position: absolute; inset: 0; opacity: 0; background: #f4d9b8;
  -webkit-mask: url("/assets/brand/lykoh-symbol.webp") center / contain no-repeat;
  mask: url("/assets/brand/lykoh-symbol.webp") center / contain no-repeat;
}
.brand-intro-name {
  width: calc(var(--size) * 1.1875); height: auto; margin-top: calc(var(--size) * -0.0375);
  opacity: 0; transform: translateY(8px);
}

.brand-intro.is-playing .brand-intro-light { animation: brand-light 700ms cubic-bezier(0.33, 1, 0.68, 1) forwards; }
.brand-intro.is-playing .brand-intro-glint { animation: brand-glint 900ms linear forwards; }
.brand-intro.is-playing .brand-intro-name { animation: brand-name 500ms cubic-bezier(0.33, 1, 0.68, 1) 250ms forwards; }
.brand-intro.is-playing .brand-intro-center { animation: brand-rise 500ms cubic-bezier(0.33, 1, 0.68, 1) 250ms forwards; }

@keyframes brand-light { to { opacity: 1; transform: scale(1); } }
@keyframes brand-glint {
  0% { opacity: 0; animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); }
  42% { opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  100% { opacity: 0; }
}
@keyframes brand-name { to { opacity: 1; transform: translateY(0); } }
@media (orientation: portrait) { .brand-intro-center { --end: 41vh; } }
/* The symbol starts centred (its box from 50vh - size / 2); the drawn pair (the symbol's drawing starts
   0.125 × size down its box, the name ends 1.3565 × size down) has its centre at 50vh + 0.2408 × size.
   It rises to --end. */
@keyframes brand-rise { to { transform: translateY(calc(var(--end) - 50vh - var(--size) * 0.2408)); } }
