/* /welcome: one-screen, cursor-reactive landing. Pointer position arrives as --px/--py (-1..1) and --gx/--gy (%), set by js/welcome.js. */
.bl-welcome {
    --px: 0; --py: 0; --gx: 62%; --gy: 38%;
    position: fixed; inset: 0; z-index: 5; overflow: hidden;
    background: var(--surface-dark, #081833); color: #F8F4EB; font-family: var(--font-body);
    display: grid; align-items: center;
}
.bl-welcome-bg, .bl-welcome-bg > * { position: absolute; inset: 0; }
.bl-welcome-fallback {
    background:
        radial-gradient(60% 55% at 78% 22%, rgba(40, 100, 255, .45), transparent 70%),
        radial-gradient(50% 50% at 18% 85%, rgba(248, 216, 66, .16), transparent 70%),
        #081833;
    animation: bl-welcome-drift 18s ease-in-out infinite alternate;
}
.bl-welcome-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.bl-welcome-video.is-ready { opacity: 1; }
.bl-welcome-glow {
    background: radial-gradient(420px circle at var(--gx) var(--gy), rgba(248, 216, 66, .22), transparent 65%);
    mix-blend-mode: screen; transition: opacity .4s ease;
}

.bl-welcome-brand {
    position: absolute; top: clamp(18px, 3.5vh, 36px); left: clamp(20px, 4vw, 56px); z-index: 3;
    display: inline-flex; align-items: center; gap: 9px; color: #F8F4EB; text-decoration: none;
    font-family: var(--font-display); font-size: 1.375rem;
}

.bl-welcome-copy {
    position: relative; z-index: 2; width: min(100% - 40px, 560px); margin-left: clamp(20px, 7vw, 120px);
    transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -8px), 0);
}
.bl-welcome-eyebrow { margin: 0 0 14px; font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(248, 244, 235, .78); }
.bl-welcome h1 {
    margin: 0; color: #F8F4EB; font-family: var(--font-display); font-weight: 700; line-height: 1.02;
    font-size: clamp(2rem, 4.2vw, 3.5rem); letter-spacing: -.01em;
}
.bl-welcome h1 em { font-style: italic; color: var(--accent-yellow, #F8D842); }
.bl-welcome-lead { max-width: 30em; margin: 20px 0 0; font-size: clamp(.9375rem, 1.2vw, 1.0625rem); line-height: 1.55; color: rgba(248, 244, 235, .86); }
.bl-welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.bl-welcome-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px;
    border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.bl-welcome-btn svg { width: 18px; height: 18px; transition: transform .18s ease; }
.bl-welcome-btn.is-primary { background: var(--accent-yellow, #F8D842); color: #0B1830; }
.bl-welcome-btn.is-primary:hover svg { transform: translateX(4px); }
.bl-welcome-btn.is-ghost { border-color: rgba(248, 244, 235, .6); color: #F8F4EB; }
.bl-welcome-btn.is-ghost:hover { background: #F8F4EB; color: #0B1830; }
.bl-welcome-btn:hover { transform: translateY(-2px); }
.bl-welcome-btn:focus-visible, .bl-welcome-signin a:focus-visible, .bl-welcome-brand:focus-visible { outline: 3px solid #F8F4EB; outline-offset: 3px; }
.bl-welcome-signin { margin: 18px 0 0; font-size: .875rem; color: rgba(248, 244, 235, .78); }
.bl-welcome-signin a { color: #F8F4EB; text-underline-offset: 3px; }


@keyframes bl-welcome-drift { to { transform: scale(1.08) translate3d(-2%, 2%, 0); } }
@keyframes bl-welcome-float { to { margin-top: -10px; } }

@media (max-width: 700px) {
    .bl-welcome { align-items: end; padding-bottom: clamp(28px, 7vh, 64px); }
    .bl-welcome-copy { margin-left: 20px; }
    .bl-welcome-actions .bl-welcome-btn { flex: 1 1 100%; }
    }
@media (max-height: 520px) and (min-width: 701px) {
    .bl-welcome h1 { font-size: clamp(2.25rem, 9vh, 3.5rem); }
    .bl-welcome-lead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bl-welcome-fallback { animation: none; }
    .bl-welcome-copy { transform: none; }
    .bl-welcome-btn, .bl-welcome-btn svg { transition: none; }
}

/* intro: the video plays alone; hero and brand appear once .is-revealed is set by js/welcome.js */
/* Not visibility:hidden: that would drop the h1 and the links from the accessibility tree (and from crawlers) for the whole film.
   Transparent and click-through is enough; a Tab press skips the film (js/welcome.js), so focus never lands on something unseen. */
.bl-welcome-copy { opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.bl-welcome.is-revealed .bl-welcome-copy { opacity: 1; pointer-events: auto; transition: opacity .9s ease; }
/* the wordmark sits top-left from the first frame; it steps aside only for the centred logo end card */
.bl-welcome-brand { transition: opacity .5s ease, visibility 0s; }
.bl-welcome.is-outro .bl-welcome-brand { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.bl-welcome:not(.is-revealed) { cursor: pointer; }
.bl-welcome-skip {
    position: absolute; z-index: 3; left: 50%; bottom: clamp(20px, 4vh, 40px); transform: translateX(-50%); margin: 0;
    padding: 8px 16px; min-height: 44px; border: 0; border-radius: 999px; background: rgba(8, 24, 51, .72); color: #F8F4EB; font: inherit; font-size: .8125rem; letter-spacing: .06em; cursor: pointer;
    transition: opacity .4s ease, visibility 0s;
}
.bl-welcome-skip:focus-visible { outline: 3px solid var(--accent-yellow, #F8D842); outline-offset: 2px; }
/* hidden once the film is over, and out of the tab order with it */
.bl-welcome.is-revealed .bl-welcome-skip, .bl-welcome.is-outro .bl-welcome-skip { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
@media (prefers-reduced-motion: reduce) {
    .bl-welcome-copy, .bl-welcome-brand { transition: none; }
}

/* text tone follows the video behind it: data-tone="dark" means a bright background, so use ink instead of porcelain */
.bl-welcome[data-tone="dark"] .bl-welcome-copy, .bl-welcome[data-tone="dark"] .bl-welcome-brand, .bl-welcome[data-tone="dark"] h1 { color: #0B1830; }
.bl-welcome[data-tone="dark"] .bl-welcome-eyebrow, .bl-welcome[data-tone="dark"] .bl-welcome-lead, .bl-welcome[data-tone="dark"] .bl-welcome-signin { color: rgba(11, 24, 48, .86); }
.bl-welcome[data-tone="dark"] h1 em { color: #163B97; }
.bl-welcome[data-tone="dark"] .bl-welcome-signin a { color: #0B1830; }
.bl-welcome[data-tone="dark"] .bl-welcome-btn.is-ghost { border-color: rgba(11, 24, 48, .6); color: #0B1830; }
.bl-welcome[data-tone="dark"] .bl-welcome-btn.is-ghost:hover { background: #0B1830; color: #F8F4EB; }
.bl-welcome[data-tone="dark"] .bl-welcome-btn:focus-visible, .bl-welcome[data-tone="dark"] .bl-welcome-signin a:focus-visible, .bl-welcome[data-tone="dark"] .bl-welcome-brand:focus-visible { outline-color: #0B1830; }
.bl-welcome[data-tone="light"] .bl-welcome-copy, .bl-welcome[data-tone="light"] .bl-welcome-brand { text-shadow: 0 1px 14px rgba(8, 24, 51, .45); }
.bl-welcome[data-tone="dark"] .bl-welcome-copy, .bl-welcome[data-tone="dark"] .bl-welcome-brand { text-shadow: 0 1px 14px rgba(248, 244, 235, .55); }

/* outro: video fades to navy, then the logo with a True Focus wordmark */
.bl-welcome-video { transition: opacity 1.2s ease; }
.bl-welcome.is-faded .bl-welcome-video { opacity: 0; }
.bl-welcome-outro {
    position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 24px);
    opacity: 0; visibility: hidden; transition: opacity .47s ease, visibility 0s linear .47s; pointer-events: none;
}
.bl-welcome.is-outro .bl-welcome-outro { opacity: 1; visibility: visible; transition: opacity .47s ease .33s; }
.bl-welcome-outro-mark { flex: 0 0 auto; width: clamp(52px, 6.4vw, 92px); height: auto; transform: scale(.9); transition: transform .93s cubic-bezier(.34, 1.56, .64, 1) .33s; }
.bl-welcome.is-outro .bl-welcome-outro-mark { transform: scale(1); }
.bl-tf { --fx: 0px; --fy: 0px; --fw: 0px; --fh: 0px; --gap: 10px; --cs: 16px; position: relative; display: flex; gap: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.1; }
.bl-tf-word { filter: blur(5px); transition: filter .33s ease; }
.bl-tf-word.is-blue { color: #8FB0FF; }
.bl-tf-word.is-lemon { color: var(--accent-yellow, #F8D842); }
.bl-tf-word.is-focus, .bl-tf.is-done .bl-tf-word { filter: blur(0); }
.bl-tf-corner {
    position: absolute; top: 0; left: 0; width: var(--cs); height: var(--cs); border: 3px solid #F8F4EB; border-radius: 3px;
    filter: drop-shadow(0 0 4px rgba(248, 216, 66, .6)); opacity: 0;
    transition: transform .33s cubic-bezier(.65, 0, .35, 1), opacity .27s ease;
}
.bl-tf.is-live .bl-tf-corner { opacity: 1; }
.bl-tf.is-done .bl-tf-corner { opacity: 0; }
.bl-tf-corner.is-tl { border-right: 0; border-bottom: 0; transform: translate(calc(var(--fx) - var(--gap)), calc(var(--fy) - var(--gap))); }
.bl-tf-corner.is-tr { border-left: 0; border-bottom: 0; transform: translate(calc(var(--fx) + var(--fw) + var(--gap) - var(--cs)), calc(var(--fy) - var(--gap))); }
.bl-tf-corner.is-bl { border-right: 0; border-top: 0; transform: translate(calc(var(--fx) - var(--gap)), calc(var(--fy) + var(--fh) + var(--gap) - var(--cs))); }
.bl-tf-corner.is-br { border-left: 0; border-top: 0; transform: translate(calc(var(--fx) + var(--fw) + var(--gap) - var(--cs)), calc(var(--fy) + var(--fh) + var(--gap) - var(--cs))); }

/* clip with its own white end card: after the hold, the stage becomes plain white under the fading video */
.bl-welcome.is-white .bl-welcome-bg { background: #FAF9F5; }
.bl-welcome.is-white .bl-welcome-fallback, .bl-welcome.is-white .bl-welcome-glow { opacity: 0; transition: opacity .4s ease; }
.bl-welcome.is-white .bl-welcome-video { transition: opacity .67s ease; }

/* White veil that carries /welcome into the Explore page, then lifts. */
.bl-welcome-veil { position: fixed; inset: 0; z-index: 9999; background: #FAF9F5; opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.bl-welcome-veil.is-in { opacity: 1; }
.bl-welcome-veil:not(.is-in) { transition-duration: .9s; }

/* Logo end card sits on white: plain black wordmark and black focus frame (no blue / lemon colour) */
.bl-welcome.is-white .bl-tf-word.is-blue, .bl-welcome.is-white .bl-tf-word.is-lemon { color: #111827; }
.bl-welcome.is-white .bl-tf-corner { border-color: #111827; }

/* ---- Landing hero v2 (Figma: "Landing Hero + Region Map / DRAFT FOR REVIEW"): centred copy, region map lines on the right, log in / sign up in the header ---- */
.bl-welcome { justify-items: center; }
.bl-welcome-copy { margin-inline: auto; width: min(100% - 40px, 760px); text-align: center; }
.bl-welcome-lead { margin-inline: auto; }
.bl-welcome-actions { justify-content: center; }
.bl-welcome h1 { font-size: clamp(2.25rem, 4.7vw, 4.25rem); }

.bl-welcome-map {
    position: absolute; z-index: 1; right: 0; top: 2vh; width: min(50vw, calc(96vh * 945 / 1023)); aspect-ratio: 945 / 1023; pointer-events: none;
    color: #8FB0FF; opacity: 0; transition: opacity 1.2s ease;
    transform: translate3d(calc(var(--px) * 12px), calc(var(--py) * 10px), 0);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.35) 18%, #000 36%), linear-gradient(180deg, transparent 0, #000 8%, #000 90%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.35) 18%, #000 36%), linear-gradient(180deg, transparent 0, #000 8%, #000 90%, transparent 100%);
    mask-composite: intersect;
}
.bl-welcome.is-revealed .bl-welcome-map { opacity: 1; }
.bl-welcome-map svg { display: block; width: 100%; height: 100%; }
.bl-welcome-map text { text-transform: uppercase; }
.bl-welcome-map text.is-minor { opacity: .88; font-size: 11px; }
.bl-welcome-map .bl-map-dot { opacity: .85; }
.bl-welcome[data-tone="dark"] .bl-welcome-map { color: #163B97; }

@media (prefers-reduced-motion: no-preference) {
    .bl-welcome.is-revealed .bl-map-land path { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: bl-map-draw 2.6s cubic-bezier(.5, 0, .2, 1) .3s forwards; }
    .bl-welcome.is-revealed .bl-map-land path:nth-child(2) { animation-delay: .6s; }
    .bl-welcome.is-revealed .bl-map-land path:nth-child(3) { animation-delay: .9s; }
    .bl-welcome.is-revealed .bl-map-pin .halo { transform-box: fill-box; transform-origin: center; animation: bl-map-pulse 3.2s ease-in-out infinite; }
    .bl-welcome.is-revealed .bl-map-pin:nth-child(2n) .halo { animation-delay: .8s; }
    .bl-welcome.is-revealed .bl-map-pin:nth-child(3n) .halo { animation-delay: 1.6s; }
}
@keyframes bl-map-draw { to { stroke-dashoffset: 0; } }
@keyframes bl-map-flow { to { stroke-dashoffset: -160; } }
@keyframes bl-map-pulse { 0%, 100% { transform: scale(1); opacity: .18; } 50% { transform: scale(1.7); opacity: .06; } }
@media (prefers-reduced-motion: reduce) { .bl-welcome-map { transform: none; transition: none; } }

@media (max-width: 700px) {
    .bl-welcome-copy { margin-inline: auto; }
    .bl-welcome h1 { font-size: clamp(2.25rem, 11vw, 3rem); }
    .bl-welcome-map { right: 4vw; left: auto; top: 7vh; height: auto; width: min(100vw, 35vh); aspect-ratio: 945 / 1023; opacity: 0; }
    .bl-welcome.is-revealed .bl-welcome-map { opacity: .9; }
    .bl-welcome-map text { font-size: 30px; }
    .bl-welcome-map .bl-map-pin circle { r: 12px; }
    .bl-welcome-map .bl-map-pin .halo { r: 28px; }
    .bl-welcome-map text.is-minor, .bl-welcome-map text.is-sub, .bl-welcome-map .bl-map-dot { display: none; }
}

/* Sound button: only offered when the browser starts the film muted */
.bl-welcome-sound {
    position: absolute; z-index: 6; top: clamp(14px, 3vh, 30px); right: clamp(20px, 4vw, 56px);
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
    border: 1.5px solid rgba(248, 244, 235, .6); background: rgba(8, 24, 51, .62); color: #F8F4EB;
    font: 600 .875rem var(--font-body); cursor: pointer; transition: background-color .18s ease, color .18s ease, opacity .4s ease;
}
.bl-welcome-sound[hidden] { display: none; }
.bl-welcome-sound svg { width: 18px; height: 18px; }
.bl-welcome-sound:hover { background: #F8F4EB; color: #0B1830; }
.bl-welcome-sound:focus-visible { outline: 3px solid #F8F4EB; outline-offset: 3px; }
.bl-welcome.is-outro .bl-welcome-sound, .bl-welcome.is-revealed .bl-welcome-sound { display: none; }
