.yht-top-hero {
    --yht-viewport-width: 100vw;
    --yht-hero-height: 100svh;
    position: relative;
    width: var(--yht-viewport-width);
    max-width: none !important;
    height: var(--yht-hero-height);
    min-height: 0;
    margin: 0;
    margin-left: calc((100% - var(--yht-viewport-width)) / 2);
    padding: 0;
    overflow: hidden;
    isolation: isolate;
    background: #000;
    line-height: 1;
    z-index: 0;
}

.yht-top-hero,
.yht-top-hero * {
    box-sizing: border-box;
}

.yht-top-hero__stage,
.yht-top-hero__media-layer,
.yht-top-hero__text-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.yht-top-hero__stage {
    overflow: hidden;
    background: #000;
}

.yht-top-hero__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--yht-crossfade, 1100ms) ease, visibility 0s linear var(--yht-crossfade, 1100ms);
    z-index: 0;
}

.yht-top-hero__media.is-active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
    z-index: 1;
}

.yht-top-hero__picture,
.yht-top-hero__image {
    display: block;
    width: 100%;
    height: 100%;
}

.yht-top-hero__image {
    object-fit: cover;
    object-position: var(--yht-focus-desktop-x, 50%) var(--yht-focus-desktop-y, 50%);
    transform: scale(var(--yht-zoom-start, 1.02));
    transform-origin: var(--yht-focus-desktop-x, 50%) var(--yht-focus-desktop-y, 50%);
    user-select: none;
    -webkit-user-drag: none;
    backface-visibility: hidden;
    will-change: transform;
}

.yht-top-hero__media.is-active.has-kenburns .yht-top-hero__image {
    animation: yht-top-hero-kenburns var(--yht-kenburns-duration, 8400ms) ease-in-out both;
}

@keyframes yht-top-hero-kenburns {
    from { transform: scale(var(--yht-zoom-start, 1.02)); }
    to   { transform: scale(var(--yht-zoom-end, 1.09)); }
}

.yht-top-hero__overlay {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    background: rgba(0, 0, 0, var(--yht-overlay, 0.35));
}

.yht-top-hero__text-layer {
    z-index: 3;
    pointer-events: none;
}

.yht-top-hero__text-scene {
    position: absolute;
    inset: 0;
    padding:
        calc(var(--yht-safe-top-desktop, 24px) + env(safe-area-inset-top, 0px))
        calc(var(--yht-safe-right-desktop, 32px) + env(safe-area-inset-right, 0px))
        calc(var(--yht-safe-bottom-desktop, 24px) + env(safe-area-inset-bottom, 0px))
        calc(var(--yht-safe-left-desktop, 32px) + env(safe-area-inset-left, 0px));
    opacity: 0;
    visibility: hidden;
    z-index: 0;
}

.yht-top-hero__text-scene.is-active,
.yht-top-hero__text-scene.is-leaving {
    opacity: 1;
    visibility: visible;
}

.yht-top-hero__text-scene.is-active {
    z-index: 1;
}

.yht-top-hero__text-scene.is-leaving {
    z-index: 0;
}

.yht-top-hero__textbox {
    --yht-fit-scale: 1;
    position: absolute;
    color: var(--yht-text-color, #fff);
    font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-weight: 300;
    text-shadow: 0 0 18px rgba(0, 0, 0, var(--yht-shadow-opacity, 0.48));
}

.yht-top-hero__line {
    display: block;
    margin: 0;
    color: inherit;
    opacity: 1;
    white-space: nowrap;
    transition: opacity var(--yht-text-fade, 1200ms) ease-in-out;
}

.yht-top-hero.is-enhanced .yht-top-hero__line {
    opacity: 0;
}

.yht-top-hero.is-enhanced .yht-top-hero__line.is-visible {
    opacity: 1;
}

/* 日本語：縦書きの列を右から左へ並べる */
.yht-top-hero--jp .yht-top-hero__textbox {
    top: var(--yht-jp-desktop-y, 18%);
    left: var(--yht-jp-desktop-x, 50%);
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: var(--yht-jp-gap-desktop, 24px);
    transform: translateX(-50%) scale(var(--yht-fit-scale));
    transform-origin: top center;
}

.yht-top-hero--jp .yht-top-hero__line {
    writing-mode: vertical-rl;
    text-orientation: upright;
    direction: ltr;
    font-size: var(--yht-jp-font-desktop, 36px);
    line-height: 1.55;
    letter-spacing: 0.04em;
}

/* 英語：各行を横書きで上下に並べる */
.yht-top-hero--en .yht-top-hero__textbox {
    top: var(--yht-en-desktop-y, 34%);
    left: var(--yht-en-desktop-x, 8%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--yht-en-gap-desktop, 10px);
    text-align: left;
    transform: scale(var(--yht-fit-scale));
    transform-origin: top left;
}

.yht-top-hero--en .yht-top-hero__line {
    font-size: var(--yht-en-font-desktop, 34px);
    line-height: 1.25;
    letter-spacing: 0.035em;
}

.yht-top-hero.is-mobile .yht-top-hero__image {
    object-position: var(--yht-focus-mobile-x, 50%) var(--yht-focus-mobile-y, 50%);
    transform-origin: var(--yht-focus-mobile-x, 50%) var(--yht-focus-mobile-y, 50%);
}

.yht-top-hero.is-mobile .yht-top-hero__text-scene {
    padding:
        calc(var(--yht-safe-top-mobile, 18px) + env(safe-area-inset-top, 0px))
        calc(var(--yht-safe-right-mobile, 18px) + env(safe-area-inset-right, 0px))
        calc(var(--yht-safe-bottom-mobile, 88px) + env(safe-area-inset-bottom, 0px))
        calc(var(--yht-safe-left-mobile, 18px) + env(safe-area-inset-left, 0px));
}

.yht-top-hero--jp.is-mobile .yht-top-hero__textbox {
    top: var(--yht-jp-mobile-y, 16%);
    left: var(--yht-jp-mobile-x, 50%);
    gap: var(--yht-jp-gap-mobile, 16px);
}

.yht-top-hero--jp.is-mobile .yht-top-hero__line {
    font-size: var(--yht-jp-font-mobile, 28px);
}

.yht-top-hero--en.is-mobile .yht-top-hero__textbox {
    top: var(--yht-en-mobile-y, 28%);
    left: var(--yht-en-mobile-x, 8%);
    gap: var(--yht-en-gap-mobile, 8px);
}

.yht-top-hero--en.is-mobile .yht-top-hero__line {
    font-size: var(--yht-en-font-mobile, 28px);
}

.yht-top-hero__pause {
    position: absolute;
    right: calc(18px + env(safe-area-inset-right, 0px));
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 8;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.yht-top-hero__pause:hover,
.yht-top-hero__pause:focus-visible {
    background: rgba(0, 0, 0, 0.5);
}

.yht-top-hero__pause-icon,
.yht-top-hero__pause-icon::before,
.yht-top-hero__pause-icon::after {
    display: block;
}

.yht-top-hero__pause-icon {
    position: relative;
    width: 14px;
    height: 16px;
}

.yht-top-hero__pause-icon::before,
.yht-top-hero__pause-icon::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 1px;
    background: currentColor;
}

.yht-top-hero__pause-icon::before { left: 1px; }
.yht-top-hero__pause-icon::after  { right: 1px; }

.yht-top-hero.is-paused .yht-top-hero__pause-icon::before {
    top: 1px;
    left: 2px;
    bottom: auto;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 12px solid currentColor;
    border-radius: 0;
    background: transparent;
}

.yht-top-hero.is-paused .yht-top-hero__pause-icon::after {
    display: none;
}

.yht-top-hero.is-paused .yht-top-hero__media.is-active.has-kenburns .yht-top-hero__image {
    animation-play-state: paused;
}

.yht-top-hero.is-reduced-motion .yht-top-hero__media.is-active.has-kenburns .yht-top-hero__image {
    animation: none;
    transform: scale(1.02);
}

.yht-top-hero.is-reduced-motion .yht-top-hero__media,
.yht-top-hero.is-reduced-motion .yht-top-hero__line {
    transition-duration: 220ms !important;
}

.yht-top-hero-empty {
    padding: 18px;
    border: 1px solid #d63638;
    background: #fff;
    color: #1d2327;
}

@media (max-width: 767px) {
    /* JavaScriptが無効でも標準のモバイル設定を適用 */
    .yht-top-hero:not(.is-enhanced) .yht-top-hero__image {
        object-position: var(--yht-focus-mobile-x, 50%) var(--yht-focus-mobile-y, 50%);
    }

    .yht-top-hero--jp:not(.is-enhanced) .yht-top-hero__textbox {
        top: var(--yht-jp-mobile-y, 16%);
        left: var(--yht-jp-mobile-x, 50%);
        gap: var(--yht-jp-gap-mobile, 16px);
    }

    .yht-top-hero--jp:not(.is-enhanced) .yht-top-hero__line {
        font-size: var(--yht-jp-font-mobile, 28px);
    }

    .yht-top-hero--en:not(.is-enhanced) .yht-top-hero__textbox {
        top: var(--yht-en-mobile-y, 28%);
        left: var(--yht-en-mobile-x, 8%);
        gap: var(--yht-en-gap-mobile, 8px);
    }

    .yht-top-hero--en:not(.is-enhanced) .yht-top-hero__line {
        font-size: var(--yht-en-font-mobile, 28px);
    }
}
