@charset "UTF-8";

.loading-screen {
    display: none;
}

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
    :root {
        --intro-cover-delay: 2400ms;
        --intro-enter-duration: 1250ms;
        --intro-wipe-in-duration: 650ms;
        --intro-black-hold: 550ms;
        --intro-wipe-duration: 750ms;
        --intro-covered: calc(var(--intro-cover-delay) + var(--intro-wipe-in-duration));
        --intro-exit-start: calc(var(--intro-covered) + var(--intro-black-hold));
        --intro-end: calc(var(--intro-exit-start) + var(--intro-wipe-duration));
        --intro-enter-ease: cubic-bezier(.32, .12, .02, 1);
        --intro-wipe-in-ease: cubic-bezier(.22, .62, .38, 1);
        --intro-wipe-out-ease: cubic-bezier(.66, .02, .86, .55);
        --motion-ease: cubic-bezier(.22, .61, .36, 1);
    }

    /* index.html 冒頭の .loading-screen。白画面、中央ロゴ、黒い幕。 */
    .loading-screen {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10;
        overflow: hidden;
        animation: intro-hide var(--intro-end) step-end forwards;
    }

    .loading-screen-white {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        background: var(--color-light);
        animation: intro-hide var(--intro-covered) step-end forwards;
    }

    .loading-screen-logo {
        width: min(85vw, 750px);
        overflow: hidden;
    }

    .loading-screen-logo img {
        /* ヘッダーロゴのうち、カンプにある HIACE × NTP の範囲を表示する。 */
        width: calc(var(--design-unit) * 911);
        animation: intro-logo var(--intro-enter-duration) var(--intro-enter-ease) 1s both;
    }

    /* 幕が全面を覆った位置で静止し、静止時間の後に上へ抜ける。 */
    .loading-screen::after {
        position: absolute;
        inset: 0;
        background: var(--color-base);
        content: "";
        animation:
            intro-wipe-in var(--intro-wipe-in-duration) var(--intro-wipe-in-ease) var(--intro-cover-delay) both,
            intro-wipe-out var(--intro-wipe-duration) var(--intro-wipe-out-ease) var(--intro-exit-start) forwards;
    }

    /* .main-img-top 内のメイン写真。黒い幕が上へ抜ける間に下から表示する。 */
    .main-img-top {
        background: var(--color-base);
        overflow: clip;
    }

    .image-main {
        animation: intro-image var(--intro-wipe-duration) var(--intro-wipe-out-ease) var(--intro-exit-start) both;
    }

    /* .main-img-top 内の左上ロゴとキャッチコピー。幕が抜けた直後に左から表示する。 */
    .main-img-top .box-brand,
    .main-img-top .box-main-copy {
        animation: reveal-slide 1150ms var(--motion-ease) var(--intro-end) both;
        --reveal-x: calc(-1 * clamp(14px, 3vw, 72px));
    }

    /* 画面外から移動する写真で横スクロール領域を広げない。 */
    .layout-showcase,
    .layout-lifestyle,
    .contents-performance {
        overflow: clip;
    }

    /* スクロール演出の共通設定。index.html の data-reveal が付いた要素に適用する。 */
    .reveal-ready {
        --reveal-distance: clamp(14px, 3vw, 72px);
    }

    .reveal-ready:not(.is-revealed),
    .reveal-ready:not(.is-revealed) .showcase-letter {
        opacity: 0;
    }

    /* 右から。EXTERIORの側面写真、荷室のHIACE VANロゴ、ユーティリティの3枚写真。 */
    [data-reveal="right"] {
        --reveal-x: var(--reveal-distance);
    }

    @media screen and (min-width: 768px) {
        [data-reveal="photo-row"] {
            --reveal-x: var(--reveal-distance);
        }
    }

    /* 左から。走行性能のメイン写真。diagonal は下方向のずれも加える。 */
    [data-reveal="left"],
    [data-reveal="diagonal"] {
        --reveal-x: calc(-1 * var(--reveal-distance));
    }

    /* 下から。EXTERIORの正面写真、INTERIORの座席、荷室・ユーティリティの見出しや写真。
       左下から。EXTERIORの夕景と斜めロゴ、INTERIORのコックピットと道路写真。 */
    [data-reveal="up"],
    [data-reveal="diagonal"] {
        --reveal-y: var(--reveal-distance);
    }

    /* 上から表示する要素に data-reveal="top" を指定した場合の動き。 */
    [data-reveal="top"] {
        --reveal-y: calc(-1 * var(--reveal-distance));
    }

    /* EXTERIORの正面写真とINTERIORの座席は、表示条件を満たしてから240ms待つ。 */
    .image-front,
    .layout-interior-seats {
        --reveal-delay: 240ms;
    }

    .is-revealed:not([data-reveal="letters"]) {
        animation: reveal-slide var(--reveal-duration, 1280ms) var(--motion-ease) var(--reveal-delay, 0ms) both;
    }

    @media screen and (min-width: 768px) {

        .is-revealed:not([data-reveal="photo-row"]),
        .is-revealed[data-reveal="photo-row"] .box {
            animation: reveal-slide var(--reveal-duration, 1280ms) var(--motion-ease) var(--reveal-delay, 0ms) both;
        }
    }

    /* 走行性能のメイン写真は、左からゆっくり表示する。 */
    .image-performance {
        --reveal-duration: 1800ms;
    }

    /* .layout-lifestyle の3枚は右端、中央、左端の順で表示する。 */
    .layout-lifestyle .box:first-child {
        --reveal-delay: 220ms;
    }

    .layout-lifestyle .box:nth-child(2) {
        --reveal-delay: 110ms;
    }

    /* EXTERIOR・INTERIORの h2。base.js が分けた文字を末尾から順に表示する。 */
    .showcase-letter {
        /* 見出しは90度回転済みなので、縦方向の移動が画面上では水平になる。 */
        position: relative;
        --letter-offset: calc(-1 * var(--reveal-distance));
    }

    .contents-interior .showcase-letter {
        --letter-offset: var(--reveal-distance);
    }

    .is-revealed .showcase-letter {
        animation: reveal-letter 1020ms var(--motion-ease) calc(var(--letter-index) * 95ms) both;
    }

    /* .contents-welcab。画面下中央から、スクロール量に合わせてピンクの円を広げる。 */
    .contents-welcab.is-circle-ready {
        position: relative;
        z-index: 1;
        isolation: isolate;
        background: var(--color-base);
    }

    .contents-welcab.is-circle-ready::before {
        position: absolute;
        /* 拡大中は円の描画領域を上へ広げ、直前の .contents-custom に重ねる。 */
        inset: calc(-1 * var(--welcab-circle-overlap)) 0 0;
        z-index: -1;
        background: var(--color-welcab-background);
        clip-path: var(--welcab-circle);
        pointer-events: none;
        content: "";
    }

    /* 円の拡大完了を境に、ロゴと本文を上下に動かしながらフェードする。 */
    .contents-welcab.is-circle-ready > :is(.box-welcab-brand, .layout-welcab) {
        opacity: 1;
        translate: 0 0;
        transition: opacity 1000ms ease-in-out, translate 1000ms ease-in-out;
    }

    .contents-welcab.is-circle-ready:not(.is-circle-expanded, :focus-within) > :is(.box-welcab-brand, .layout-welcab) {
        opacity: 0;
        translate: 0 20px;
    }

    .contents-welcab.is-circle-ready:focus-within {
        background: var(--color-welcab-background);
    }
}

/* .loading-screen と .loading-screen-white を指定時刻に非表示にする。 */
@keyframes intro-hide {
    to {
        visibility: hidden;
    }
}

/* .loading-screen-logo img。ほぼ見えた位置から、残りをゆっくり進んで定位置に収まる。 */
@keyframes intro-logo {
    0% {
        opacity: 0;
        translate: 0 100%;
    }

    100% {
        opacity: 1;
        translate: 0 0;
    }
}

/* .loading-screen::after。幕が勢いよく入り、画面を覆う位置で止まる。 */
@keyframes intro-wipe-in {
    from {
        translate: 0 100%;
    }

    to {
        translate: 0 0;
    }
}

/* .loading-screen::after。画面を覆った幕が上へ抜ける。 */
@keyframes intro-wipe-out {
    from {
        translate: 0 0;
    }

    to {
        translate: 0 -100%;
    }
}

/* .main-img-top の .image-main。写真の表示範囲を下端から上へ広げる。 */
@keyframes intro-image {
    from {
        clip-path: inset(100% 0 0);
    }

    to {
        clip-path: inset(0);
    }
}

/* ファーストビューのロゴ・コピーと、スクロールで表示する写真・文章の共通の動き。 */
@keyframes reveal-slide {
    from {
        opacity: 0;
        translate: var(--reveal-x, 0) var(--reveal-y, 0);
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* EXTERIOR・INTERIORの .showcase-letter を1文字ずつ表示する。 */
@keyframes reveal-letter {
    from {
        opacity: 0;
        top: var(--letter-offset);
    }

    to {
        opacity: 1;
        top: 0;
    }
}

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {

    /* インタビューの導入文、写真風の組写真、車内とProfileの写真を順番に表示する。 */
    .contents-interview :is(.box-interview-lead, .layout-interview-photos, .layout-interview-pair).is-revealed {
        animation: none;
    }

    .contents-interview :is(.box-interview-lead, .layout-interview-photos, .layout-interview-pair).is-revealed > * {
        animation: reveal-slide 1280ms var(--motion-ease) var(--interview-delay, 0ms) both;
    }

    .contents-interview .is-revealed > :nth-child(2) {
        --interview-delay: 180ms;
    }

    .contents-interview .is-revealed > :nth-child(3) {
        --interview-delay: 360ms;
    }

    .contents-interview .is-revealed > :nth-child(4) {
        --interview-delay: 540ms;
    }

    /* img29.png は定位置でゆっくりフェードインする。 */
    .image-interview-person {
        --reveal-duration: 1700ms;
    }

    /* 写真風の組写真は、少し間を空けて1枚ずつ表示する。 */
    .contents-interview .layout-interview-photos.is-revealed > img {
        --reveal-distance: clamp(18px, 4vw, 88px);
        animation-duration: 1550ms;
    }

    .contents-interview .layout-interview-photos.is-revealed > img:nth-child(1) {
        --interview-delay: 120ms;
    }

    .contents-interview .layout-interview-photos.is-revealed > img:nth-child(2) {
        --interview-delay: 380ms;
    }

    .contents-interview .layout-interview-photos.is-revealed > img:nth-child(3) {
        --interview-delay: 640ms;
    }

    /* img-photo01 は左から、img-photo02 は右から、img-photo03 は下から。 */
    .interview-music .layout-interview-photos > img:nth-child(-n+2) {
        --reveal-y: 0px;
    }

    .interview-music .layout-interview-photos > img:first-child {
        --reveal-x: calc(-1 * var(--reveal-distance));
    }

    .interview-music .layout-interview-photos > img:nth-child(2) {
        --reveal-x: var(--reveal-distance);
    }

    /* img-photo04 は右から、img-photo05 は左から、間を空けて表示する。 */
    .contents-interview .interview-drive .layout-interview-photos.is-revealed > img {
        --reveal-y: 0px;
        animation-duration: 1550ms;
    }

    .contents-interview .interview-drive .layout-interview-photos.is-revealed > img:first-child {
        --reveal-x: var(--reveal-distance);
        --interview-delay: 120ms;
    }

    .contents-interview .interview-drive .layout-interview-photos.is-revealed > img:nth-child(2) {
        --reveal-x: calc(-1 * var(--reveal-distance));
        --interview-delay: 380ms;
    }
}
