/* Overrides the legacy global splash rules, including the mobile display:none. */
html body #splash-screen[hidden] { display:none !important; }
html body #splash-screen:not([hidden]) {
    position:fixed; inset:0; width:100%; height:100%; display:flex;
    align-items:center; justify-content:center; background:#313131; z-index:10000; overflow:hidden;
}
html.home-intro-active, html.home-intro-active body { overflow:hidden; }
/* Same font stack as the home hero (brand-theme.css), instead of the legacy global oswald-only rule. */
#splash-screen, #splash-screen * { font-family:var(--af-font) !important; }
#video-loader { position:absolute; z-index:1; color:#fff; font-size:16px; line-height:1.5; }
#video-loader[hidden] { display:none; }
#splash-stage[hidden] { display:none !important; }
#splash-screen #splash-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }

/* Layers in place of the old video: photo, SVG band, then text. Nothing shows until the photo is ready (.is-playing). */
#splash-stage { position:absolute; inset:0; color:#fff; isolation:isolate; }
#splash-stage > *, #splash-stage .intro-copy > * { opacity:0; }
#splash-stage .intro-photo { position:absolute; inset:0; z-index:0; width:100%; height:100%; object-fit:cover; object-position:30% 50%; }
/* Match the photo's tone independently of the white band, logo and copy; no blur/resampling. */
#splash-stage::before {
    content:""; position:absolute; inset:0; z-index:1; pointer-events:none; opacity:0;
    background:rgb(59 59 59 / var(--intro-photo-overlay-opacity, 0));
}
#splash-stage .intro-band { position:absolute; inset:0; z-index:2; width:100%; height:100%; fill:rgba(255,255,255,.44); }
#splash-stage .intro-band-tall { display:none; }
#splash-stage .intro-copy {
    position:absolute; z-index:3; left:5.6vw; top:0; bottom:0; width:min(58vw,1100px); opacity:1;
    display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:min(2.6vw,4.6vh);
    text-shadow:0 1px 3px rgba(0,0,0,.25);
}
#splash-stage .intro-logo { display:block; width:min(37vw,66vh); height:auto; }
#splash-stage .intro-tag {
    display:inline-flex; align-items:center; gap:.9em; padding:.9em 1.6em; background:rgba(255,255,255,.3);
    font-size:clamp(12px,1.25vw,20px); line-height:1.3; letter-spacing:.02em; text-transform:uppercase;
}
#splash-stage .intro-tag svg { width:1.2em; height:1.2em; fill:none; stroke:currentColor; stroke-width:2.4; }
#splash-stage .intro-title {
    margin:0; font-size:min(5vw,8.9vh) !important; font-weight:400; line-height:1.15; letter-spacing:.06em; text-transform:uppercase;
    text-wrap:balance;
}
/* Chinese has no spaces: keep words whole so the headline only breaks at its punctuation. */
html:lang(zh-TW) #splash-stage .intro-title { word-break:keep-all; overflow-wrap:anywhere; }
#splash-stage .intro-sub { margin:0; font-size:clamp(13px,1.4vw,24px) !important; line-height:1.5; letter-spacing:.06em; }

/* Config sets timing variables; the hold duration includes the layer entrances. */
#splash-stage.is-playing { animation:intro-hold var(--intro-duration, 5s) linear both; }
#splash-stage.is-playing .intro-photo { animation:intro-fade var(--intro-photo-duration, .4s) ease-out var(--intro-photo-delay, 0s) both; }
#splash-stage.is-playing::before { animation:intro-fade var(--intro-photo-duration, .4s) ease-out var(--intro-photo-delay, 0s) both; }
#splash-stage.is-playing .intro-band { animation:intro-band var(--intro-band-duration, .8s) ease-out var(--intro-band-delay, .1s) both; }
#splash-stage.is-playing .intro-logo { animation:intro-logo var(--intro-logo-duration, .7s) ease-out var(--intro-logo-delay, .4s) both; }
#splash-stage.is-playing .intro-tag { animation:intro-rise var(--intro-tag-duration, .6s) ease-out var(--intro-tag-delay, .9s) both; }
#splash-stage.is-playing .intro-title { animation:intro-wipe var(--intro-title-duration, 1.1s) ease-in-out var(--intro-title-delay, 1.5s) both; }
#splash-stage.is-playing .intro-sub { animation:intro-fade var(--intro-sub-duration, .8s) ease-out var(--intro-sub-delay, 1.8s) both; }
@keyframes intro-hold { from { opacity:1; } to { opacity:1; } }
@keyframes intro-fade { from { opacity:0; } to { opacity:1; } }
@keyframes intro-band { from { opacity:0; transform:translateX(-12%); } to { opacity:1; transform:none; } }
@keyframes intro-logo { from { opacity:0; transform:scale(1.06); } to { opacity:1; transform:none; } }
@keyframes intro-rise { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes intro-wipe { from { opacity:1; clip-path:inset(0 100% 0 0); } to { opacity:1; clip-path:inset(0 0 0 0); } }

/* Portrait screens: a wider band and larger type so the text stays inside it.
   The legacy mobile rules shrink paragraph text with !important, hence the !important on the two sizes here and above. */
@media (max-aspect-ratio:4/5) {
    #splash-stage .intro-band-wide { display:none; }
    #splash-stage .intro-band-tall { display:inline; }
    #splash-stage .intro-copy { left:6vw; width:86vw; justify-content:flex-start; padding-top:18vh; gap:4.5vw; }
    #splash-stage .intro-logo { width:64vw; }
    #splash-stage .intro-tag { font-size:3.4vw; }
    #splash-stage .intro-title { font-size:8.4vw !important; }
    #splash-stage .intro-sub { font-size:3.8vw !important; }
}

/* Same look as the square primary CTA (home hero, cta-buttons.css). */
#skip-intro {
    position:absolute; z-index:2; right:24px; bottom:max(24px,env(safe-area-inset-bottom));
    display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:12px 24px;
    border:1px solid var(--af-blue); border-radius:0; background:var(--af-blue); color:#fff; cursor:pointer;
    font:600 var(--af-button-size)/1.5 var(--af-font); text-transform:uppercase;
}
#skip-intro:is(:hover,:focus-visible) { background:var(--af-blue-hover); border-color:var(--af-blue-hover); }
#skip-intro:focus-visible { outline:3px solid var(--af-blue); outline-offset:4px; }

#skip-intro[hidden] { display:none !important; }
