/* ========================================
   かっかわ部 - かわいいデザイン
   ======================================== */

:root {
    --color-indigo: #003366;
    --color-aioiro: #0963AD;
    --color-sumi: #1C1C1C;
    --color-kinari: #F8F4E6;
    --color-vermillion: #B74329;
    --font-main: 'Zen Maru Gothic', sans-serif;
    --font-en: 'Fredoka One', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-aioiro);
    color: var(--color-kinari);
    line-height: 1.9;
    overflow-x: hidden;
}

/* ========================================
   Loading Screen
   ======================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.loading-logo {
    width: 250px;
    height: auto;
}

.loading-hana {
    width: 120px;
    height: auto;
}

.loading-hana-left {
    animation: loadingSpin 3s linear infinite reverse;
}

.loading-hana-right {
    animation: loadingSpin 3s linear infinite;
}

@keyframes loadingSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Header
   ======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: background-color 0.4s ease;
    animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.header-container {
    width: 100%;
    padding: 10px 40px;
    /* heightの固定を外してロゴの大きさに連動させます */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: padding 0.4s ease;
}

header.scrolled .header-container {
    padding: 5px 40px;
}

.logo img {
    height: 150px;
    /* 変化前は150px */
    margin-left: 5px;
    transition: height 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: headerFloat 5s ease-in-out infinite;
    /* 開いたときからフワフワ */
}

/* スクロール変化後のサイズ */
header.scrolled .logo img {
    height: 70px;
}

.logo img:hover {
    transform: scale(1.1) rotate(3deg);
    animation-play-state: paused;
}

/* PC Nav */
.nav-menu ul {
    display: flex;
    list-style: none;
    animation: headerFloat 6s ease-in-out infinite 0.5s;
    /* メニューもフワフワ */
}

.nav-menu li {
    margin-left: 8px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-kinari);
    font-weight: 700;
    font-size: 1.3rem;
    /* 変化前は大きめに設定 */
    position: relative;
    padding: 10px 18px;
    /* 余白も少し広げてゆとりを */
    margin-top: 15px;
    /* ロゴのトップ位置に合わせるための調整 */
    display: inline-block;
    border-radius: 50px;
    transition: all 0.4s ease;
    letter-spacing: 0.05em;
}

/* スクロール変化後のサイズ */
header.scrolled .nav-menu a {
    font-size: 1rem;
    padding: 6px 14px;
    margin-top: 5px;
}

.nav-menu a:hover {
    background-color: rgba(248, 244, 230, 0.25);
    color: var(--color-kinari);
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background-color: var(--color-kinari);
    border-radius: 10px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(-1px);
    background-color: var(--color-kinari);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(1px);
    background-color: var(--color-kinari);
}

/* ========================================
   Hero Section
   ======================================== */
#hero {
    height: 100vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 50%, rgba(0, 51, 102, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.wave {
    position: absolute;
    left: 0;
    width: 100%;
    height: 200px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 2;
}

.wave-top {
    top: 0;
    background-image: url('hero_top.png');
}

.wave-bottom {
    bottom: 0;
    height: clamp(180px, 20vw, 400px);
    /* 画面の幅に応じて高さを可変させ、お城が切れないよう調整 */
    background-image: url('hero_under.png');
    background-position: center bottom;
}

/* ========================================
   Castle Gallery Section（城慕情スライドショー）
   ======================================== */
#castle-gallery {
    aspect-ratio: 16 / 9;
    /* 画面幅に合わせて縦も比例して伸縮 */
    min-height: 400px;
    /* 最低限の高さを確保 */
    height: auto;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.castle-gallery-track {
    display: flex;
    width: max-content;
    /* 内容に合わせて幅を広げる */
    height: 100%;
    animation: castleScroll 60s linear infinite;
    /* 60秒かけて1周 */
    z-index: 0;
}

.castle-gallery-track img {
    height: 100%;
    width: auto;
    object-fit: cover;
    flex-shrink: 0;
    /* 縮まないように */
}

@keyframes castleScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* 2セットあるうちの1セット分左へ */
    }
}

.castle-wave-top {
    top: 0;
    background-image: url('castle_top.png');
}

.castle-wave-bottom {
    bottom: 0;
    height: clamp(120px, 15vw, 260px);
    background-image: url('castle_under.png');
    background-position: center bottom;
}


.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 1000px;
    z-index: 3;
    padding: 0 20px;
}

.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* 最背面に配置 */
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    /* クロスフェードをさらにゆっくりに */
}

.hero-img.active {
    opacity: 1;
    /* 写真自体を透過させず 100% で表示 */
}

.catchphrase {
    writing-mode: vertical-rl;
    font-size: 1.6rem;
    /* 大きな画面でのサイズ。小さすぎないように調整 */
    font-weight: 700;
    letter-spacing: 0.25em;
    line-height: 1.8;
    color: var(--color-kinari);
    border-right: 3px solid var(--color-vermillion);
    padding-right: 15px;

    /* お城の高さ(clamp)に少し余白を足して常に上に配置 */
    position: absolute;
    bottom: calc(clamp(180px, 20vw, 400px) + 30px);
    right: clamp(3%, 8%, 15%);
    /* もっと右側に寄せる */

    /* 読込時の現れるアニメ＋ふわふわホバーの併用 */
    animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        headerFloat 4s ease-in-out infinite 1s;
}

@keyframes headerFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ========================================
   Sections
   ======================================== */
section {
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
    /* はみ出した泡がスクロールバーを出さないため */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    /* 泡よりテキストなどの要素を手前に */
}

/* ========================================
   Section Waves (サイドの波)
   ======================================== */
.section-wave {
    position: absolute;
    /* 高さは個別指定 */
    width: clamp(200px, 35vw, 600px);
    height: 90%;
    z-index: -1;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25; /* 最初は控えめに設定。様子を見て調整 */
    transition: opacity 0.6s ease;
}

.left-side-wave {
    left: -5%; /* 少し外側に出す */
    top: 65%; /* 左側は中央より下げて配置 */
    transform: translateY(-50%);
    background-image: url('left_wave.png');
    background-position: left center;
}

.right-side-wave {
    right: -5%; /* 少し外側に出す */
    top: 35%; /* 右側は中央より上げて配置 */
    transform: translateY(-50%);
    background-image: url('right_wave.png');
    background-position: right center;
}

@media (max-width: 768px) {
    .section-wave {
        width: 150px;
        opacity: 0.15; /* モバイルではより薄く */
    }
}

/* ========================================
   Photo Bubbles (写真プレースホルダー)
   ======================================== */
.photo-bubble {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    /* 写真用ダミー */
    z-index: 0;
    pointer-events: none;
    /* リンクのクリック等を邪魔しないように */
    background-size: cover;
    background-position: center;
}

/* 個別写真の割り当て */
.about-l {
    background-image: url('concept/concept11.jpg');
}

.about-r {
    background-image: url('concept/concept2.jpg');
}

.about-3 {
    background-image: url('concept/concept12.jpg');
}

.castle-l {
    background-image: url('castle/castle9.jpg');
}

.castle-r {
    background-image: url('castle/castle3.jpg');
}

.tour-l {
    background-image: url('tour/Tour7.jpg');
}

.tour-r {
    background-image: url('tour/Tour6.jpg');
}

.recruit-l {
    background-image: url('recruitment/Recruit3.jpg');
}

.recruit-r {
    background-image: url('recruitment/Recruit1.jpg');
}

/* 薄黄色のチラ見えと非対称な配置 */
.left-bubble {
    left: 4%;
    top: 15%;
    box-shadow: 12px 12px 0px rgba(255, 250, 180, 0.4);
    animation: floatBubbleLeft 6s ease-in-out infinite;
}

.right-bubble {
    right: 3%;
    bottom: 20%;
    width: 160px;
    /* 左右で大きさを変えてよりシャボン玉っぽく */
    height: 160px;
    box-shadow: -10px -12px 0px rgba(255, 250, 180, 0.35);
    /* 影の向きもバラバラに */
    animation: floatBubbleRight 8s ease-in-out infinite reverse;
}

@keyframes floatBubbleLeft {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.03);
    }
}

@keyframes floatBubbleRight {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-25px) scale(0.97);
    }
}

.section-title {
    margin-bottom: 20px;
    text-align: center;
}

.section-title .en {
    display: block;
    font-family: var(--font-en);
    font-size: 1rem;
    color: rgba(248, 244, 230, 0.75);
    letter-spacing: 0.15em;
    margin-bottom: 10px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--color-kinari);
    font-weight: 700;
    position: relative;
    display: inline-block;
}



/* 全セクション共通の背景：bodyで設定済みのため削除 */

/* ========================================
   About Section Specific
   ======================================== */
#about .section-title,
#about .content {
    text-align: left;
    margin-left: 0;
}



#about .about-l {
    right: calc(8% - 10px);
    top: calc(10% - 14px);
    width: 220px;
    height: 220px;
    z-index: 0;
}

#about .about-3 {
    right: calc(11% + 180px);
    top: 40%;
    width: 140px;
    height: 140px;
    z-index: 0;
}

#about .about-r {
    right: 10%;
    bottom: 3%;
    width: 180px;
    height: 180px;
    z-index: 0;
}



.content {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 2.1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ========================================
   Recruitment
   ======================================== */
/* 背景色は上の #about 等と共通で --color-aioiro を適用しています */

.recruitment-box {
    padding: 20px 40px;
    text-align: center;
}



.btn-recruitment {
    display: inline-block;
    margin-top: 36px;
    padding: 18px 52px;
    background-color: var(--color-vermillion);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    font-size: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: 0 6px 20px rgba(183, 67, 41, 0.35);
}

.btn-recruitment:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 12px 30px rgba(183, 67, 41, 0.5);
}

.btn-recruitment:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-note {
    font-size: 0.7rem;
    color: rgba(248, 244, 230, 0.6);
    margin-top: 15px;
    text-align: center;
}

/* ========================================
   Footer
   ======================================== */
footer {
    padding: 60px 20px 36px;
    text-align: center;
    position: relative;
}

.footer-logo {
    height: 80px;
    margin-bottom: 20px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-logo:hover {
    transform: scale(1.08) rotate(2deg);
}

.copyright {
    font-size: 0.85rem;
    color: var(--color-kinari);
    opacity: 0.8;
}

/* ========================================
   Animations
   ======================================== */

/* ========================================
   ひらひら舞う花アニメーション
   ======================================== */
#flower-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* クリックを邪魔しない */
    z-index: 9999;
    /* 最前面に表示 */
    overflow: hidden;
}

.flower-petal {
    position: absolute;
    top: -100px;
    /* 画面外スタート */
    pointer-events: none;
    will-change: transform, opacity;
    animation:
        flowerFall linear forwards,
        flowerSway ease-in-out infinite alternate,
        flowerRotate linear infinite;
}

@keyframes flowerFall {
    0% {
        top: -100px;
        opacity: 0;
    }

    5% {
        opacity: 0.9;
    }

    85% {
        opacity: 0.85;
    }

    100% {
        top: 110vh;
        opacity: 0;
    }
}

@keyframes flowerSway {
    0% {
        margin-left: 0px;
    }

    100% {
        margin-left: 60px;
    }
}

@keyframes flowerRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* アニメーション: ぷりんと浮かび上がる */
.pop-in,
.fade-in {
    opacity: 0;
    transform: scale(0.88) translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pop-in.visible,
.fade-in.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.75);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}



/* ========================================
   Responsive
   ======================================== */
/* 1024pxの不自然な巨大化を削除し、PCからスマホへ自然に縮小されるようにしました */

@media (max-width: 768px) {

    /* Loading Screen Mobile */
    .loading-content {
        gap: 20px;
    }

    .loading-logo {
        width: 140px;
    }

    .loading-hana {
        width: 70px;
    }

    /* Header */
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        /* 上寄せに変更 */
        padding: 10px 20px;
    }

    .logo img {
        height: 70px;
        /* 100pxから70pxに縮小 */
        margin-left: 0;
    }

    /* Hamburger */
    .menu-toggle {
        display: flex;
        margin-top: 15px;
        /* ロゴのトップに合わせる */
        transition: margin-top 0.4s ease;
    }

    /* スクロール時の位置調整 */
    header.scrolled .menu-toggle {
        margin-top: 5px;
    }

    /* Mobile full-screen menu */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        /* 明るい青（#5691f0）をベースにしたグラデーションに変更 */
        background: linear-gradient(135deg, rgba(86, 145, 240, 0.98) 0%, rgba(70, 130, 230, 0.98) 100%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.45s cubic-bezier(0.34, 1.10, 0.64, 1);
        z-index: 1000;
        visibility: hidden;
    }

    .nav-menu.active {
        right: 0;
        visibility: visible;
    }

    .nav-menu ul {
        flex-direction: column;
        text-align: center;
        transform: none;
        /* PCのtranslateYをリセット */
        gap: 10px;
    }

    .nav-menu li {
        margin: 0;
    }

    .nav-menu a {
        font-size: 1.4rem;
        padding: 12px 30px;
        display: block;
    }

    /* Hero */
    #hero {
        padding-top: 80px;
        /* ヘッダーの高さを考慮して増やす */
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: auto;
    }

    .hero-content {
        flex-direction: column;
        justify-content: center;
        padding: 40px 20px;
        gap: 15px;
        height: 100%;
    }



    .catchphrase {
        writing-mode: vertical-rl;
        font-size: clamp(10px, 4.2vw, 1.1rem);
        /* 少しだけ小さく調整 */
        letter-spacing: 0.15em;
        line-height: 1.4;
        border-right: 2px solid var(--color-vermillion);
        padding-right: 6px;
        position: absolute;
        bottom: 55px;
        right: 6%;
        max-height: 55%;
        /* ヘッダーへの侵食を防ぐためさらに制限 */
    }

    /* Waves */
    .wave-top {
        height: 100px;
    }

    .wave-bottom {
        height: 60px;
        /* 高さが225px程度になるため、波もさらに低く */
    }

    .castle-wave-top {
        height: 50px;
    }

    .castle-wave-bottom {
        height: 70px;
    }

    /* Castle Gallery */
    #castle-gallery {
        min-height: auto;
        /* 比率を優先するため解除 */
        aspect-ratio: 16 / 9;
    }

    .castle-wave-top {
        height: 40px;
    }

    .castle-wave-bottom {
        height: 60px;
    }

    /* Sections */
    section {
        padding: 70px 16px;
    }

    .photo-bubble {
        width: 120px;
        height: 120px;
    }

    .right-bubble {
        width: 100px;
        height: 100px;
    }

    /* About セクション：スマホでは不透明にして下に配置 */
    #about {
        padding-bottom: 300px;
        /* 下側にシャボン玉を置くための余白を追加 */
    }

    #about .photo-bubble {
        opacity: 1;
        /* 透過を0に（不透明） */
        z-index: 1;
    }

    #about .about-l {
        width: 160px;
        height: 160px;
        right: 15%;
        /* 少し左に寄せました */
        top: auto;
        bottom: 150px;
    }

    #about .about-3 {
        width: 120px;
        height: 120px;
        left: 18%;
        /* 少し右に寄せました */
        top: auto;
        bottom: 80px;
    }

    #about .about-r {
        width: 140px;
        height: 140px;
        right: 25%;
        /* さらに左・下に寄せました */
        bottom: 10px;
    }

    #about .section-title,
    #about .content {
        text-align: center;
        /* 真ん中寄せ */
    }

    .section-title h2 {
        font-size: 1.7rem;
    }

    .content {
        font-size: 1rem;
        padding: 0 4px;
        position: relative;
        z-index: 2;
    }

    /* スマホでは本文内の改行を無効化して、自然に流れるように調整 */
    .content p br {
        display: none;
    }

    /* Recruitment */
    .recruitment-box {
        padding: 30px 20px;
        border-radius: 24px;
    }

    .btn-recruitment {
        font-size: 1.1rem;
        padding: 15px 36px;
    }

    /* Footer */
    footer {
        padding: 50px 20px 28px;
    }

    .footer-logo {
        height: 64px;
    }
}

@media (max-width: 375px) {
    .section-title h2 {
        font-size: 1.4rem;
    }
}