/* =============================
    Hero Section (Final Stable)
   ============================= */

.hero {
    position: relative;
    background: #0f0f10 url('/images/bg_noise.webp') center/600px repeat;
    overflow: hidden;
}

/* Layout */
.hero-wrap {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    min-height: clamp(520px, 70vh, 860px);
}

/* 左右画像 */
.hero-left,
.hero-right {
    position: relative;
    z-index: 1;
}

.hero-media,
.hero-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 3 / 4;
}

/* Overlay グラデーション */
.hero-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15,15,16,.55) 0%, rgba(15,15,16,0) 26%, rgba(15,15,16,0) 74%, rgba(15,15,16,.55) 100%),
        radial-gradient(40% 100% at 50% 50%, rgba(0,0,0,.35), transparent 70%);
    pointer-events: none;
    z-index: 2;
}

.hero-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-.5px);
    background: linear-gradient(to bottom, rgba(255,255,255,.24), rgba(255,255,255,0));
    filter: blur(10px);
    opacity: .28;
    z-index: 3;
    pointer-events: none;
}

/* =============================
    Text Layer (中央やや上)
   ============================= */

/* 全デバイスで微調整可能なリフト量 */
:root {
    --liftY: -14vh;
}

@media (min-width: 1600px) { :root { --liftY: -18vh; } }
@media (max-width: 1280px) { :root { --liftY: -8vh; } }
@media (max-width: 1024px) and (min-width: 768px) { :root { --liftY: -7vh; } }
@media (max-width: 768px) { :root { --liftY: -6vh; } }
@media (max-width: 420px) { :root { --liftY: -5vh; } }

.hero-content {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transform: translateY(var(--liftY));
    text-align: center;
    z-index: 5;
    pointer-events: none;
    row-gap: clamp(6px, 1.2vw, 12px);
    color: #f5ecf5ff;
    font-family: "Inter", "Noto Serif JP", sans-serif;
    padding-inline: clamp(16px, 3vw, 40px);
}

/* 大画面 */
@media (min-width: 1600px) { .hero-content { row-gap: 1.8vw; } }
/* ノートPC */
@media (max-width: 1599px) and (min-width: 1025px) { .hero-content { row-gap: 1.4vw; } }
/* タブレット */
@media (max-width: 1024px) and (min-width: 769px) { .hero-content { row-gap: 1.1vw; } }
/* スマホ */
@media (max-width: 768px) { .hero-content { row-gap: 0.8vw; } }
/* 小画面 */
@media (max-width: 420px) { .hero-content { row-gap: 0.6vw; } }

/* 英語サブの位置補正 */
@media (min-width: 1600px) { .hero-sub { top: -0.7em; } }
@media (max-width: 1024px) { .hero-sub { top: -0.5em; } }
@media (max-width: 600px)  { .hero-sub { top: -0.4em; } }

/* 日本語タイトル */
.hero-title {
    font-family: "Noto Serif JP", "Yu Mincho", serif;
    font-size: clamp(30px, 5.6vw, 84px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.5;
    text-shadow:
        0 0 18px rgba(86, 47, 159, 0.79),
        0 0 18px rgba(147, 115, 41, 0.71);
    animation: fade-up 1.8s ease-out both;
    animation-delay: 0.3s;
}

@media (min-width: 1600px) {
    .hero-title .jp { margin-bottom: 1.8vw; }
}
@media (max-width: 768px) {
    .hero-title .jp { margin-bottom: 0.8vw; }
}

/* hero-sub を上方向に寄せる */
.hero-sub {
    display: block;
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(20px, 3vw, 34px);
    font-weight: 400;
    letter-spacing: .045em;
    opacity: .95;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(86, 47, 159, 0.79);
    animation: fade-up-soft 2.2s ease-out both;
    animation-delay: 0.7s;
    position: relative;
    top: 0.8em;
}

/* =============================
    Orbs (発光エフェクト)
   ============================= */
.orbs {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: orb-fade 2.2s ease-out both;
    animation-delay: 1.1s;
}

.orbs::before {
    content: "";
    position: absolute;
    inset: -12%;
    background:
        radial-gradient(60% 50% at 30% 40%, rgba(255,211,160,.30), transparent 75%),
        radial-gradient(55% 45% at 70% 55%, rgba(160,160,255,.30), transparent 68%);
    filter: blur(14px);
    opacity: .8;
}

.orb {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    width: var(--sz);
    height: var(--sz);
    margin-left: calc(var(--sz) * -0.5);
    margin-top: calc(var(--sz) * -0.5);
    border-radius: 50%;
    opacity: calc(var(--a));
    background: radial-gradient(
        circle at 35% 35%,
        hsla(var(--h), 85%, 80%, .92) 0%,
        hsla(var(--h), 85%, 60%, .34) 46%,
        rgba(0,0,0,0) 70%
    );
    filter: blur(8px);
    animation:
        orb-float var(--d1,14s) ease-in-out infinite alternate,
        orb-pulse var(--d2,20s) ease-in-out infinite;
}

/* =============================
    Animation Keyframes
   ============================= */
@keyframes fade-up {
    0% { opacity: 0; transform: translateY(28px); }
    60% { opacity: 0.8; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up-soft {
    0% { opacity: 0; transform: translateY(18px); }
    70% { opacity: 0.7; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes orb-fade {
    0% { opacity: 0; transform: scale(0.92); }
    70% { opacity: 0.6; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes orb-float {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(calc(var(--k,1) * 22px), -16px, 0) scale(1.05); }
}

@keyframes orb-pulse {
    0% { opacity: calc(var(--a) * .92); }
    50% { opacity: calc(var(--a) * 1.06); }
    100% { opacity: calc(var(--a) * .95); }
}

/* =============================
    Hero image bottom fade overlay
   ============================= */
.hero-left,
.hero-right {
    position: relative;
    overflow: hidden;
}

.hero-left::after,
.hero-right::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(180px, 20vw, 320px);
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(15,15,16,0) 0%,
        rgba(15,15,16,0.58) 62%,
        rgba(10,10,11,1) 100%
    );
    opacity: 0.93;
    z-index: 1;
}

/* =============================
    Mobile — Risa only (stable height)
   ============================= */
@media (max-width: 960px) {
    .hero {
        padding: 0;
        margin: 0;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
    }

    .hero-right { display: none; }

    .hero-wrap {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: center;
        width: 100%;
        margin: 0;
        position: relative;
        /* ← 高さが変わらない“安定版” */
        min-height: 100svh;
        height: 100svh;
    }

    /* iOS 古めのSafari向けフォールバック */
    @supports (-webkit-touch-callout: none) {
        .hero-wrap {
            min-height: -webkit-fill-available;
            height: -webkit-fill-available;
        }
    }

    .hero-left {
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    .hero-left .hero-media {
        width: 100vw;
        height: 100%;
        overflow: hidden;
    }

    .hero-left .hero-media img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        backface-visibility: hidden;
        transform: translateZ(0);
        will-change: transform;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
        height: 100%;
    }
}
