/* Header logo intro (driven by brand-intro.js), modelled on the video intro:
   1) .brand-intro        – the real mark is hidden while JS draws dot → spinning O → capsule;
                            the wordmark folds away right-to-left.
   2) .brand-intro-eject  – the real mark returns with the square back in the stem; the square is
                            pushed out (T appears inside the C → "CT") and the wordmark slides out.
   Transforms/opacity/clip only: no layout shift, no effect on LCP. Final frame = the static logo. */

:root { --bm-ready: 1; }  /* lets brand-intro.js know this (non-blocking) stylesheet has loaded */
.brand-mark { display: block; width: 100%; height: 100%; overflow: visible; }
.marketing-brand__text,
.x-app-brand-text { transition: clip-path .25s ease, opacity .25s ease, transform .25s ease; }

.brand-intro:not(.brand-intro-eject) .brand-mark .bm-body,
.brand-intro:not(.brand-intro-eject) .brand-mark .bm-square { opacity: 0; }
.brand-intro .marketing-brand__text,
.brand-intro .x-app-brand-text { clip-path: inset(0 100% 0 0); opacity: 0; transform: translateX(-14px); }

/* Square travel along the mark's 35° long axis, in SVG user units of the brand file:
   START_OFFSET = R - SLOT_W/2 = 696.5 - 237 = 459.5 → (-459.5·cos35°, -459.5·sin35°). */
.brand-intro-eject .brand-mark .bm-square { animation: bm-eject .9s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes bm-eject {
    0%   { transform: translate(-376.4px, -263.6px); fill: #111B24; }
    15%  { transform: translate(-376.4px, -263.6px); fill: #111B24; }
    52%  { transform: translate(18.8px, 13.2px); fill: #EA6429; }
    66%  { transform: translate(0, 0); fill: #EA6429; }
    85%  { transform: translate(0, 0); fill: #EA6429; }
    100% { transform: translate(0, 0); fill: #111B24; }
}

.brand-intro-eject .marketing-brand__text,
.brand-intro-eject .x-app-brand-text { animation: bm-word .9s cubic-bezier(.3, 0, .2, 1) both; transition: none; }
@keyframes bm-word {
    0%, 40% { clip-path: inset(0 100% 0 0); transform: translateX(-14px); opacity: 0; }
    48%     { opacity: 1; }
    95%, 100% { clip-path: inset(0 0 0 0); transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-intro .brand-mark .bm-body,
    .brand-intro .brand-mark .bm-square { opacity: 1 !important; animation: none !important; }
    .brand-intro .marketing-brand__text,
    .brand-intro .x-app-brand-text { clip-path: none !important; opacity: 1 !important; transform: none !important; animation: none !important; }
}
