/* The original wordmark/backdrop follow the loading storyboard in 125:2540. */
.site-loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    background: #fff;
    transition: background-color 650ms ease, opacity 350ms ease;
}

html[data-intro="loading"],
html[data-intro="revealing"],
html[data-intro="entering"] {
    overflow: hidden;
}

html[data-intro="loading"] .site-loader,
html[data-intro="revealing"] .site-loader,
html[data-intro="entering"] .site-loader {
    display: block;
}

.loader-background {
    position: absolute;
    inset: 0;
    opacity: .3;
    transition: opacity 650ms ease;
}

.loader-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loader-lockup {
    position: absolute;
    top: 35.5%;
    left: 50%;
    width: min(868.159px, calc(100% - 48px));
    transform: translateX(-50%);
}

.loader-wordmark {
    position: relative;
    aspect-ratio: 868.159 / 173.76;
    background: var(--blue);
    mask: url('../images/loading-wordmark.svg') center / 100% 100% no-repeat;
    -webkit-mask: url('../images/loading-wordmark.svg') center / 100% 100% no-repeat;
    transform-origin: center;
    will-change: transform, opacity;
}

.loader-fill {
    position: absolute;
    inset: 0;
    background: var(--yellow);
    clip-path: inset(calc(100% - var(--load-progress, 0%)) 0 0 0);
}

.loader-percentage {
    margin-top: 84px;
    text-align: center;
    color: #9f9f9f;
    font: 700 28px/1 var(--condensed);
    transition: opacity 220ms ease;
}

html[data-intro="revealing"] .site-loader,
html[data-intro="entering"] .site-loader {
    background-color: var(--yellow);
}

html[data-intro="revealing"] .site-loader {
    transition-delay: 450ms, 0ms;
}

html[data-intro="revealing"] .loader-background {
    opacity: 1;
    transition-delay: 450ms;
}

html[data-intro="revealing"] .loader-background img {
    mix-blend-mode: luminosity;
}

.loader-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 32.234%, var(--yellow) 79.243%);
    opacity: 0;
    transition: opacity 650ms ease;
}

html[data-intro="revealing"] .loader-background::after {
    opacity: 1;
    transition-delay: 450ms;
}

html[data-intro="revealing"] .loader-percentage,
html[data-intro="entering"] .loader-percentage {
    opacity: 0;
}

html[data-intro="entering"] .site-loader {
    opacity: 0;
    pointer-events: none;
}

html[data-intro="entering"] .loader-background {
    opacity: 0;
}

/* Animate the independent translate property so the responsive composition's
   existing transforms (centering and mobile scale) stay intact. */
html[data-intro="loading"] .hero-logo,
html[data-intro="loading"] .hero-content > *,
html[data-intro="loading"] .hero-mirai,
html[data-intro="loading"] .hero-name,
html[data-intro="revealing"] .hero-logo,
html[data-intro="revealing"] .hero-content > *,
html[data-intro="revealing"] .hero-mirai,
html[data-intro="revealing"] .hero-name {
    opacity: 0;
    translate: 0 70px;
}

html[data-intro="entering"] .hero-logo {
    animation: hero-logo-arrive 700ms cubic-bezier(.2,.7,.2,1) 100ms both;
}

html[data-intro="entering"] .hero-content > * {
    animation: hero-arrive 800ms cubic-bezier(.2,.7,.2,1) both;
}

html[data-intro="entering"] .hero .event-date { animation-delay: 320ms; }
html[data-intro="entering"] .hero .venue { animation-delay: 440ms; }
html[data-intro="entering"] .hero .ticket-button { animation-delay: 560ms; }

html[data-intro="entering"] .hero-mirai {
    animation: character-arrive 1100ms cubic-bezier(.16,.8,.23,1) 720ms both;
}

html[data-intro="entering"] .hero-name {
    animation: hero-arrive 900ms cubic-bezier(.2,.7,.2,1) 920ms both;
}

@keyframes hero-logo-arrive {
    from { opacity: 0; translate: 0 40px; }
    to { opacity: 1; translate: 0 0; }
}

@keyframes hero-arrive {
    from { opacity: 0; translate: 0 70px; }
    to { opacity: 1; translate: 0 0; }
}

@keyframes character-arrive {
    from { opacity: 0; translate: 0 150px; }
    to { opacity: 1; translate: 0 0; }
}

.hero-character-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-mirai.is-animated > img {
    visibility: hidden;
}

/* Like the live reference: a three-second, gently eased whole-body float.
   The idle loop starts after the entrance so their translations never compete. */
html[data-intro="ready"] .hero-mirai.is-floating {
    animation: character-float 3s ease-in-out infinite;
}

@keyframes character-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -16px; }
}

/* The CodePen coffee badge's idle shine: an eased three-second sweep.
   Use the original 328 x 81 SVG as the mask, matching the button artwork even
   where the responsive layout scales its wrapper. Keep the label above it. */
.ticket-button span { z-index: 2; }

.ticket-shine {
    position: absolute;
    left: 0;
    top: 0;
    width: 328px;
    height: 81px;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    mask: url('../images/button-ticket.svg') 0 0 / 328px 81px no-repeat;
    -webkit-mask: url('../images/button-ticket.svg') 0 0 / 328px 81px no-repeat;
}

.ticket-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgb(255 255 255 / .2) 50%, transparent 70%);
    animation: ticket-shine 3s ease infinite;
}

@keyframes ticket-shine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.about-piko-canvas {
    position: absolute;
    inset: 0;
    width: 103.75%;
    height: 100%;
    pointer-events: none;
}

.about .about-piko { overflow: visible; }

/* Keep the rightward entrance on the outer mirrored slot. Move the entire
   clipped composition inside it, using the same float as the hero character. */
.about-piko-float {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.about-piko.is-revealed .about-piko-float {
    animation: piko-float 3s ease-in-out infinite;
}

@keyframes piko-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 var(--piko-float-distance, -12px); }
}

.about-piko.is-offscreen .about-piko-float,
.about.is-paused .about-piko-float { animation-play-state: paused; }

.about-piko.is-blinking .about-piko-float > img { visibility: hidden; }

@media (max-width: 600px) {
    .loader-lockup { width: calc(100% - 62px); top: 36%; }
    .loader-percentage { margin-top: 40px; font-size: 24px; }
    .about .about-piko { --about-from-x: -36px; --piko-float-distance: -6px; }
    .about-piko-canvas { width: 100%; height: 100%; object-fit: contain; }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-shine { display: none; }
    .site-loader { display: none !important; }
    html[data-intro] { overflow-y: auto; overflow-x: clip; }
    html[data-intro] .hero-logo,
    html[data-intro] .hero-content > *,
    html[data-intro] .hero-mirai,
    html[data-intro] .hero-name { opacity: 1; translate: none; }
    .hero-mirai.is-animated > img { visibility: visible; }
    .hero-character-canvas { display: none; }
    .about-piko.is-blinking .about-piko-float > img { visibility: visible; }
    .about-piko-float { translate: none; }
    .about-piko-canvas { display: none; }
}

/* Activities: heading right, first row left, second row right. */
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .features.has-feature-motion [data-feature-reveal] {
        transition: opacity 1200ms ease var(--feature-delay, 0ms), translate 1600ms cubic-bezier(.28,.45,.35,1) var(--feature-delay, 0ms);
    }
    .features.has-feature-motion [data-feature-reveal]:not(.is-revealed) { opacity: 0; }
    .features.has-feature-motion [data-feature-reveal="right"]:not(.is-revealed) { translate: -56px 0; }
    .features.has-feature-motion [data-feature-reveal="left"]:not(.is-revealed) { translate: 56px 0; }
}

/* Music, GUEST, PROGRAMME, LIVE, partners, and archive: gently rise on entry. */
.programme-character-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.programme-mirai.programme-rig-ready > img { visibility: hidden; }
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .has-artist-motion [data-artist-reveal] {
        transition: opacity 1200ms ease var(--artist-delay, 0ms), translate 1600ms cubic-bezier(.28,.45,.35,1) var(--artist-delay, 0ms);
    }
    .has-artist-motion [data-artist-reveal]:not(.is-revealed) { opacity: 0; translate: 0 40px; }
    .has-artist-motion h2[data-artist-reveal]:not(.is-revealed) { translate: 0 32px; }
    .has-artist-motion [data-artist-reveal].is-focus-revealed { transition: none; }
    .programme.has-artist-motion .programme-mirai {
        --artist-delay: 400ms;
        transition-duration: 800ms, 1000ms;
    }
    .programme.has-artist-motion .programme-mirai:not(.is-revealed) { translate: 64px 0; }
}

/* hololive Meet: follow the annotated upward and alternating horizontal arrows. */
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .hololive.has-holo-motion :is(.holo-logo, [data-holo-reveal]) {
        transition: opacity 1200ms ease var(--holo-delay, 0ms), translate 1600ms cubic-bezier(.28,.45,.35,1) var(--holo-delay, 0ms);
    }
    .hololive.has-holo-motion .holo-pair figure:nth-child(2) { --holo-delay: 140ms; }
    .hololive.has-holo-motion :is(.holo-logo, [data-holo-reveal]):not(.is-revealed) { opacity: 0; }
    .hololive.has-holo-motion :is(.holo-logo, [data-holo-reveal="up"]):not(.is-revealed) { translate: 0 40px; }
    .hololive.has-holo-motion [data-holo-reveal="right"]:not(.is-revealed) { translate: -56px 0; }
    .hololive.has-holo-motion [data-holo-reveal="left"]:not(.is-revealed) { translate: 56px 0; }
    .hololive.has-holo-motion .is-focus-revealed { transition: none; }
}

/* Ticket storyboard 144:2595 -> 144:2577: panels retract, content grows/fades. */
.ticket-corner-right-motion { display: contents; }
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .tickets.has-ticket-motion .ticket-corner-right-motion {
        display: block;
        position: relative;
        width: 100%;
        height: 100%;
    }
    .tickets.has-ticket-motion :is(.ticket-corner-left, .ticket-corner-right-motion) {
        transform-origin: 0 0;
        transition: transform 1200ms cubic-bezier(.22,.61,.36,1);
    }
    .tickets.has-ticket-motion:not(.ticket-entered) .ticket-corner-left {
        transform: scale(var(--ticket-left-start-x), var(--ticket-left-start-y));
    }
    .tickets.has-ticket-motion:not(.ticket-entered) .ticket-corner-right-motion {
        transform: scale(var(--ticket-right-start-x), var(--ticket-right-start-y));
    }
    .tickets.has-ticket-motion .ticket-layout {
        transform-origin: 46% 50%;
        transition: opacity 1200ms ease 250ms, transform 1400ms cubic-bezier(.22,.61,.36,1) 250ms;
    }
    .tickets.has-ticket-motion:not(.ticket-entered) .ticket-layout {
        opacity: 0;
        transform: scale(.472103);
    }
    .tickets.has-ticket-motion.ticket-motion-instant :is(.ticket-layout, .ticket-corner-left, .ticket-corner-right-motion) { transition: none; }
}

/* News: separate the entrance from the hero-style idle float and artwork rig. */
.news-mirai-float, .news-piko-float { position: absolute; inset: 0; }
.news-character-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.news-mirai-float.news-rig-ready > img { visibility: hidden; }
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .news.has-news-motion :is(.news-heading, .news-item, .news-mirai, .news-piko) {
        transition: opacity 1000ms ease var(--news-delay, 0ms), translate 1400ms cubic-bezier(.28,.45,.35,1) var(--news-delay, 0ms);
    }
    .news.has-news-motion :is(.news-heading, .news-item, .news-mirai, .news-piko):not(.is-revealed) { opacity: 0; }
    .news.has-news-motion .news-heading:not(.is-revealed) { translate: -40px 0; }
    .news.has-news-motion .news-item:not(.is-revealed) { translate: -36px 16px; }
    .news.has-news-motion :is(.news-mirai, .news-piko):not(.is-revealed) { translate: 56px 0; }
    .news.has-news-motion .news-mirai { --news-delay: 350ms; }
    .news.has-news-motion .news-piko { --news-delay: 490ms; }
    .news.has-news-motion .is-focus-revealed { transition: none; }
    .news.has-news-motion .news-mirai.is-revealed .news-mirai-float {
        animation: character-float 3s ease-in-out 1750ms infinite;
        animation-play-state: var(--news-play-state, paused);
    }
    .news.has-news-motion .news-piko.is-revealed .news-piko-float {
        animation: news-piko-float 3s ease-in-out 1890ms infinite;
        animation-play-state: var(--news-play-state, paused);
    }
}
@keyframes news-piko-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

.archive-piko-float { position: absolute; inset: 0; }
.archive-character-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.archive-piko-float.archive-rig-ready > img { visibility: hidden; }
.archive-highlight > video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.archive-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 80px; height: 80px; border-radius: 50%; color: #fff; background: #0f3ec1cc; font-size: 64px; line-height: 1; }
.archive-play:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }
.archive-video-status:not(.visually-hidden) { position: absolute; inset: 20px 20px auto; padding: 12px; background: #fff; color: var(--blue); }
@media (min-width:1200px) and (prefers-reduced-motion:no-preference) {
    .archive-piko.is-revealed .archive-piko-float { animation: archive-float 3s ease-in-out 1600ms infinite; animation-play-state: var(--archive-play-state, paused); }
}
@keyframes archive-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}
