/* Loading Screen Styles */

:root {
    --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-power1-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-power4-out: cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: #ffffff;
}

/* ローディング画面 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #2fa9a3, #92c37e);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 背景オーブ層 */
.orbs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    animation: orbsFadeIn 1.5s ease-out 1.3s forwards;
}

@keyframes orbsFadeIn {
    to { opacity: 1; }
}

/* オーブスタイル */
.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
    opacity: .2;
    mix-blend-mode: screen;
    transform: translate3d(0,0,0);
    animation: drift-fast 3s linear infinite alternate;
    background:#FFF;
    /* 虹色グラデーション */
    /* background: radial-gradient(circle at 30% 30%,
        rgba(255,255,255,.95) 0%,
        rgba(255,140,200,.85) 22%,
        rgba(255,210,130,.65) 38%,
        rgba(120,240,255,.60) 56%,
        rgba(140,120,255,.55) 70%,
        rgba(200,120,255,0) 82%); */
}

/* 個別配置 */
.o1 { top: 6%;  left: 4%;  width: 300px; height: 300px; animation-duration: 5s; }
.o2 { top: 14%; right: -6%; width: 360px; height: 360px; animation-duration: 6s; opacity: .50; }
.o3 { bottom: -12%; left: 18%; width: 420px; height: 420px; animation-duration: 7s; opacity: .52; }
.o4 { bottom: 12%; right: 18%; width: 220px; height: 220px; animation-duration: 4.5s; opacity: .62; }

/* 色味バリエーション */
.o2 {
    background-color: yellow;
    /* background: radial-gradient(circle at 35% 35%,
        rgba(255,255,255,.92) 0%,
        rgba(130,190,255,.80) 26%,
        rgba(150,120,255,.60) 52%,
        rgba(255,160,210,.55) 70%,
        rgba(255,255,255,0) 84%);*/
} 
.o4 {
    background-color: yellowgreen;
    /* background: radial-gradient(circle at 35% 35%,
        rgba(255,255,255,.95) 0%,
        rgba(255,200,120,.75) 30%,
        rgba(255,120,170,.60) 55%,
        rgba(120,240,255,.50) 72%,
        rgba(255,255,255,0) 86%); */
}

@keyframes drift-fast {
    0%   { transform: translate3d(-200px,-150px,0) scale(0.9); }
    25%  { transform: translate3d(180px, 120px,0) scale(1.15); }
    50%  { transform: translate3d(-150px, 180px,0) scale(1.05); }
    75%  { transform: translate3d(220px, -100px,0) scale(0.95); }
    100% { transform: translate3d(-120px,-180px,0) scale(1.1); }
}

/* 回転も追加 */
.o1, .o3 { animation-name: driftSpin; }
@keyframes driftSpin {
    0%   { transform: translate3d(-180px,-120px,0) scale(0.9) rotate(0deg); }
    25%  { transform: translate3d(160px, 150px,0) scale(1.12) rotate(15deg); }
    50%  { transform: translate3d(-120px, 200px,0) scale(1.0) rotate(-10deg); }
    75%  { transform: translate3d(200px, -80px,0) scale(1.08) rotate(20deg); }
    100% { transform: translate3d(-100px,-160px,0) scale(0.95) rotate(-15deg); }
}

/* アクセシビリティ配慮 */
@media (prefers-reduced-motion: reduce) {
    .orb { animation: none; }
}

/* スマホ対応 */
@media (max-width: 768px) {
    /* オーブサイズ調整 */
    .orb { 
        filter: blur(40vw);
    }
    
    .o1 { 
        top: 6%;  
        left: 4%;  
        width: 80vw; 
        height: 80vw; 
        animation-duration: 5s;
    }
    
    .o2 { 
        top: 14%; 
        right: -6%; 
        width: 96vw; 
        height: 96vw; 
        animation-duration: 6s; 
        opacity: .50;
    }
    
    .o3 { 
        bottom: -12%; 
        left: 18%; 
        width: 112vw; 
        height: 112vw; 
        animation-duration: 7s; 
        opacity: .52;
    }
    
    .o4 { 
        bottom: 12%; 
        right: 18%; 
        width: 58.6vw; 
        height: 58.6vw; 
        animation-duration: 4.5s; 
        opacity: .62;
    }
    
    /* テキストサイズ調整 */
    .loading-text {
        font-size: 6.4vw;
        letter-spacing: 0.05em;
        padding: 0 5.3vw;
        line-height: 1.6;
    }
    
    /* アニメーション調整 */
    @keyframes drift-fast {
        0%   { transform: translate3d(-53.3vw, -40vw, 0) scale(0.9); }
        25%  { transform: translate3d(48vw, 32vw, 0) scale(1.15); }
        50%  { transform: translate3d(-40vw, 48vw, 0) scale(1.05); }
        75%  { transform: translate3d(58.6vw, -26.6vw, 0) scale(0.95); }
        100% { transform: translate3d(-32vw, -48vw, 0) scale(1.1); }
    }
    
    @keyframes driftSpin {
        0%   { transform: translate3d(-48vw, -32vw, 0) scale(0.9) rotate(0deg); }
        25%  { transform: translate3d(42.6vw, 40vw, 0) scale(1.12) rotate(15deg); }
        50%  { transform: translate3d(-32vw, 53.3vw, 0) scale(1.0) rotate(-10deg); }
        75%  { transform: translate3d(53.3vw, -21.3vw, 0) scale(1.08) rotate(20deg); }
        100% { transform: translate3d(-26.6vw, -42.6vw, 0) scale(0.95) rotate(-15deg); }
    }
}

/* テキストコンテナ - 光るエフェクト付き */
.loading-text {
    text-align: center;
    font-family: "游明朝", "Yu Mincho", "ヒラギノ明朝 ProN", "Hiragino Mincho ProN", "MS P明朝", "MS PMincho", serif;
    font-size: 5vw;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.1em;
    z-index: 100;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5em;
    margin-bottom: -0.5em;
    color: rgba(0, 0, 0, 0);
    background-image: radial-gradient(rgb(255, 255, 255) 0% 40%, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0.4) 60% 100%);
    background-repeat: no-repeat;
    background-position: 100% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 800% 250%;
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 600ms ease, transform 1000ms var(--ease-expo-out), background-size 1300ms 600ms ease, background-position 3200ms 600ms ease;
}

.loading-text.is-show {
    background-position: 50% 50%;
    background-size: 400% 250%;
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

@media (max-width: 768px) {
.loading-text {font-size: 9vw;}
}

/* フェードアウト */
#loading.fade-out {
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* メインコンテンツ */
#main-content {
    opacity: 0;
    transition: opacity 1s ease;
}

#main-content.is-loaded {
    opacity: 1;
}

/* 白フラッシュ */
.white-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    display: none;
}

.white-flash.active {
    animation: whiteFlash 0.3s ease-out forwards;
    display: none;
}

@keyframes whiteFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
