/* ===== Header ===== */
#header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 40px;
    transition: background .4s, padding .4s;
}
#header.is_scrolled{}
#header:after{
    content: "";
    display: block;
    width: 100%;
    height: 120%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}
.header_in{
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 103;
}
.site_logo{
    width: 180px;
}
.site_logo img{
    width: 100%;
    height: auto;
    display: block;
}
.header_r{
    align-items: center;
    gap: 12px;
}
#header .btn_04{
    width: 150px;
    padding: 4px 20px;
    font-size: 1.8rem;
}

/* Hamburger (circle) */
.hamburger{
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(21, 65, 44, 0.7);
    border: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    transition: background .3s;
    position: relative;
    z-index: 103;
}
.hamburger[aria-expanded="true"]{
    background: transparent;
}
.hamburger span{
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--color-white);
    transition: transform .3s, opacity .3s;
}
.hamburger[aria-expanded="true"] span:nth-child(1){
    transform: translateY(6.5px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2){
    opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3){
    transform: translateY(-6.5px) rotate(-45deg);
}
body.drawer_open #header .btn_w{
    pointer-events: none;
    opacity: 0;
}

/* Drawer (右からスライドイン) */
.drawer{
    position: fixed;
    top: 0;
    right: -100%;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-main);
    z-index: 101;
    transition: right .5s cubic-bezier(.2,.7,.2,1);
    overflow-y: auto;
    padding: 100px 50px 50px;
}
.drawer.is_open{
    right: 0;
}
.drawer_in{
    height: 100%;
}
.drawer_menu{
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.drawer_menu li a{
    display: flex;
    align-items: baseline;
    gap: 20px;
    color: var(--color-white);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    transition: opacity .3s;
}
.drawer_menu li a:hover{
    opacity: 0.6;
}
.drawer_menu li a .en{
    font-family: "adobe-garamond-pro", serif;
    font-size: 2.4rem;
    letter-spacing: 3px;
    line-height: 1;
}
.drawer_menu li a .jp{
    font-size: 1.2rem;
    letter-spacing: 2px;
    line-height: 1;
    opacity: 0.7;
}

/* Overlay */
.drawer_overlay{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s, visibility .4s;
}
.drawer_overlay.is_visible{
    opacity: 1;
    visibility: visible;
}

body.drawer_open{
    overflow: hidden;
}

@media screen and (max-width: 750px){
    #header{
        padding: 15px 20px;
    }
    #header.is_scrolled{
        padding: 10px 20px;
    }
    .site_logo{
        width: 120px;
    }
    .hamburger{
        width: 40px;
        height: 40px;
    }
    .drawer{
        padding: 80px 30px 40px;
    }
    .drawer_menu li a .en{
        font-size: 2rem;
    }
    #header .btn_04{
        width: 130px;
    }
    #header .btn_04:after{
        width: 15px;
    }
}


.loading{
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    pointer-events: all;
    /* 奥行きのある回転グラデ背景 */
    background:
        radial-gradient(ellipse at 30% 30%, rgba(58, 120, 85, 0.55) 0%, rgba(29, 74, 53, 0) 55%),
        radial-gradient(ellipse at 75% 70%, rgba(100, 160, 120, 0.35) 0%, rgba(29, 74, 53, 0) 60%),
        radial-gradient(ellipse at 50% 50%, rgba(29, 74, 53, 1) 0%, rgba(10, 31, 22, 1) 100%);
    transition:
        opacity .8s cubic-bezier(0.77, 0, 0.175, 1),
        visibility 0s linear 1s;
}
 
/* 回転する光のレイヤー(疑似要素で背景と別軸で動かす) */
.loading::before{
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(120, 180, 140, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 50%, rgba(180, 220, 200, 0.15) 0%, transparent 45%);
    animation: loadingBgRotate 24s linear infinite;
    will-change: transform;
    z-index: 0;
}
@keyframes loadingBgRotate{
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}
 
/* 上から下へゆっくり流れる縦方向の光膜(森の木漏れ日感) */
.loading::after{
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0) 70%,
            rgba(0, 0, 0, 0.25) 100%
        );
    pointer-events: none;
    z-index: 1;
}
 
/* ===== 中央コンテンツ ===== */
.loading .loading_inner{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}
 
/* ロゴ枠 */
.loading .loading_logo_w{
    position: relative;
    width: 100%;
    max-width: 280px;
}
.loading .loading_logo{
    display: block;
    width: 100%;
    height: auto;
}
/* 背景ロゴ:薄く表示 */
.loading .loading_logo_bg{
    opacity: 0.2;
    filter: blur(0.3px);
}
/* 前景ロゴ:clip-pathで左から塗り進行(JSで更新) */
.loading .loading_logo_fg{
    position: absolute;
    top: 0;
    left: 0;
    /* glow で白がより映える */
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
    clip-path: inset(0 100% 0 0);
}
 
/* ===== パーセント表示 ===== */
.loading .loading_percent{
    position: relative;
    font-size: 1.3rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-en, 'Noto Serif', serif);
    line-height: 1;
    margin: 0;
    /* 細い下線(プログレスバー風) */
    padding-bottom: 18px;
}
.loading .loading_percent::before{
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 180px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}
.loading .loading_percent::after{
    content: "";
    position: absolute;
    left: calc(50% - 90px); /* 180pxバーの左端 */
    bottom: 0;
    width: calc(var(--loading-percent, 0) * 1.8px);
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 1) 100%
    );
    transition: width .3s linear;
}
/* % の単位を疑似要素で追加 */
.loading .loading_percent::before{
    /* 既存で下線用に使ってるので、単位は content 変数方式で別途 */
}
 
/* ===== 完了時 ===== */
.loading.is_hidden{
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
/* 完了時の中身:少し上へスライド */
.loading.is_hidden .loading_inner{
    transform: translate(-50%, -60%);
    transition: transform .8s cubic-bezier(0.77, 0, 0.175, 1);
}
 
/* ===== SP ===== */
@media screen and (max-width: 750px) {
    .loading .loading_inner{
        max-width: 280px;
        gap: 30px;
    }
    .loading .loading_logo_w{
        max-width: 200px;
    }
    .loading .loading_percent{
        font-size: 1.1rem;
        letter-spacing: 3px;
    }
    .loading .loading_percent::before{
        width: 140px;
    }
    .loading .loading_percent::after{
        left: calc(50% - 70px);
        width: calc(var(--loading-percent, 0) * 1.4px);
    }
}