/* =========================================================
   Reset / Base
========================================================= */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
}

/* =========================================================
   CSS Variables（全体トークン）
========================================================= */
:root {
    --header-h-sp: clamp(56px, 9vw, 64px);

    /* Icon sizes / gaps */
    --icon-size-pc: 10vw;
    --icon-size-sp: 13vw;
    --icon-gap-pc: 7vw;
    --icon-gap-sp: 16px;

    /* Colors */
    --brand-purple: #615ff8;
    --focus: #93c5fd;
    --dotted: #fff4e1;
}

/* =========================================================
   Layout
========================================================= */
.wrapper {
    min-height: 100vh;
    /* フッターを下へ */
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 0 20px;
}

/* =========================================================
   Header
========================================================= */
.cloud-header {
    position: relative;
    background-size: cover;
    text-align: center;
    z-index: 99;
}

/* 区切りの点線 */
.dotted-line {
    border-bottom: 20px dashed var(--dotted);
    width: 100%;
    margin: 20px 0;
}

/* ロゴ */
.logo-area {
    margin-bottom: 1rem;
}

.logo-img {
    display: block;
    width: 100%;
    height: var(--header-h-pc);
    object-position: center center;
    margin: 0 auto;
    padding: 0;
}

.pc-logo {
    display: block;
}

.mobile-logo {
    display: none;
}

/* =========================================================
   Global Navigation (Desktop base)
========================================================= */
.main-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1002;
}

.main-nav li a {
    font-size: 1.2rem;
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 500;
    padding: .5rem .8rem;
    transition: color .2s ease, transform .2s ease;
}

/* Icon Navigation（PC基準） */
.main-nav .nav-icons {
    display: flex;
    justify-content: center;
    gap: var(--icon-gap-pc);
    list-style: none;
    padding: 0;
    margin: 1px 0;
}

.main-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform .18s ease;
    -webkit-tap-highlight-color: transparent;
}

/* 画像サイズは変数で一括管理 */
.main-nav .nav-item img {
    display: block;
    width: var(--icon-size-pc);
    height: auto;
}

.main-nav .nav-item .label {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
    line-height: 1.15;
}

.main-nav .nav-item .label .en {
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 12px;
    color: #5a4fff;
    text-transform: uppercase;
}

.main-nav .nav-item .label .kana {
    font-size: 11px;
    color: #6b6b90;
}

/* hover/focus */
@media (hover: hover) {
    .main-nav .nav-item:hover {
        transform: scale(1.08);
    }
}

.main-nav .nav-item:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
    border-radius: 8px;
}

/* 旧「斜め回転」効果は無効化（通常は水平） */
@media (min-width:768px) {
    .main-nav li a {
        transform: none;
    }

    .main-nav li a:hover {
        color: #d2bdfb;
        transform: none;
    }
}

/* =========================================================
   Dropdown / Hamburger basics
========================================================= */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    margin: 10px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.menu-toggle {
    display: none;
    /* SPで表示 */
    font-size: 2rem;
    background: none;
    border: none;
    color: #f5a1a1;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
    cursor: pointer;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #add8e6;
    border: 1px solid #add8e6;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 9999;
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: .5rem 1rem;
    white-space: nowrap;
}

.only-mobile {
    display: none;
}

.only-desktop {
    display: block;
}

.main-nav a:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 8px;
}

/* =========================================================
   Footer
========================================================= */
footer {
    background: linear-gradient(to bottom, #ffffff 10%, #9dd9f7);
    color: #3a3a3a;
    padding: 2rem 1.5rem;
    font-size: .9rem;
    text-align: center;
    line-height: 1.6;
    font-weight: 500;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 auto;
    max-width: 1000px;
    padding: 1rem;
}

.footer-left,
.footer-center,
.footer-right {
    flex: 1 1 30%;
    text-align: center;
    min-width: 200px;
}

.footer-center p {
    font-weight: bold;
    color: #333;
    margin: .5rem 0;
}

.footer-left ul,
.footer-center ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-left a {
    color: #0b0b0b;
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.footer-left a:hover {
    color: #0b0b0b;
    text-decoration: underline;
}

.footer-left a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 6px;
    border-radius: 6px;
}

.footer-right p {
    margin: .2rem 0;
    font-size: .95rem;
    color: #3a3a3a;
}

.footer-right p:last-child {
    font-size: .85rem;
    font-style: italic;
    color: #070707;
}

/* =========================================================
   Utilities
========================================================= */
.fade-page {
    opacity: 1;
    transition: opacity 2s ease;
}

.fade-page.fade-out {
    opacity: 0;
}

body.active {
    overflow: hidden;
}

/* メニュー開時のスクロールロック */

.top-main>section+section {
    margin-top: clamp(18px, 3vw, 28px);
}

/* =========================================================
   Tablet+ (>=768px)
========================================================= */
@media screen and (min-width:768px) {
    .only-mobile {
        display: none;
    }

    .only-desktop {
        display: block;
    }

    .menu-toggle {
        display: none;
    }

    .pc-logo {
        display: block;
        height: var(--header-h-pc);
    }

    .mobile-logo {
        display: none;
    }

    /* メニューイラストはPCで非表示 */
    .menu-illustration,
    .menu-illustration img {
        display: none;
    }
}

:root {
    --header-h-pc: clamp(120px, 14vw, 180px);
    --header-h-sp: clamp(56px, 9vw, 64px);
}

/* =========================================================
   Mobile (<=600px)
========================================================= */
@media screen and (max-width:600px) {

    /* 固定ヘッダ */
    body {
        padding-top: 0;
    }

    .cloud-header {
        position: static;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
    }

    .pc-logo {
        display: none;
    }

    .mobile-logo {
        display: block;
        height: auto;
    }

    .dotted-line {
        display: none;
    }

    /* ヘッダ直下の点線は隠す */
    .hamburger {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    /* スライドインメニュー */
    .main-nav {
        padding-top: calc(var(--header-h-sp) + 24px);
        position: fixed;
        inset: 0 0 auto 0;
        width: 100%;
        height: 100dvh;
        background: linear-gradient(to bottom, #fef6f9 0%, #d6f0fa 100%);
        z-index: 9999;
        transform: translateY(-100%);
        transition: transform .4s ease-in-out;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .main-nav.active {
        transform: translateY(0);
    }

    /* 3列グリッド＋端数センター寄せ */
    .main-nav ul {
        margin-top: 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(120px, 1fr));
        justify-items: center;
        gap: var(--icon-gap-sp) 14px;
        list-style: none;
        padding: 0;
    }

    /* 5個など、下段が2個のとき中央寄せ */
    .nav-icons li:nth-last-child(2):nth-child(3n + 1) {
        grid-column: 2;
    }

    /* 下段が1個のとき中央寄せ */
    .nav-icons li:last-child:nth-child(3n + 1) {
        grid-column: 2;
    }

    .main-nav li a {
        display: block;
        background: #fff;
        border-radius: 12px;
        padding: 1rem;
        text-align: center;
        font-size: 1.1rem;
        color: var(--brand-purple);
        box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
        text-decoration: none;
        font-weight: 600;
    }

    /* アイコンをSP用サイズに */
    .main-nav .nav-item {
        min-width: 120px;
    }

    .main-nav .nav-item img {
        width: var(--icon-size-sp);
    }

    .main-nav .nav-item .label {
        margin-top: 8px;
    }
}

/* =========================================================
   Menu illustration（ふわふわ）
========================================================= */
.menu-illustration {
    align-items: flex-end;
    justify-content: center;
    background: none
}

.menu-illustration img {
    width: min(35vw, 380px);
    height: auto;
    transform-origin: 50% 90%;
    will-change: transform;
    padding-bottom: 90px;
}

/* 通常はアニメを有効化 */
@media (prefers-reduced-motion: no-preference) {
    @keyframes sway {
        0% {
            transform: rotate(-2deg) translateY(0);
        }

        50% {
            transform: rotate(2deg) translateY(-4px);
        }

        100% {
            transform: rotate(-2deg) translateY(0);
        }
    }

    .menu-illustration img {
        animation: sway 5.2s ease-in-out infinite;
    }
}



/* PCではイラストを非表示（SPでのみ表示） */
@media (min-width: 601px) {
    .menu-illustration img {
        display: none;
    }
}

/* ===========================
   1) PC版 HOMEメニュー（5アイコン）
   目標：
   - 600～730px   → 3個 + 2個 の2段（下段は中央寄せ）
   - 730～920px   → 4個 + 1個 の2段（下段は中央寄せ）
   - 920px～      → 5個横一列
   ※ 600px以下は既存のSP表示を適用
=========================== */
@media (min-width:601px) {
    .main-nav .nav-icons {
        display: grid;
        gap: var(--icon-gap-pc) clamp(16px, 2vw, 24px);
        justify-content: center;
    }

    .main-nav .nav-item img {
        /* PCアイコンが大きすぎると改行の原因になるので少しだけ可変に */
        width: clamp(96px, 12vw, var(--icon-size-pc));
    }
}

@media (min-width:601px) and (max-width:2000px) {
    .main-nav .nav-icons {
        grid-template-columns: repeat(5, auto);
    }

}

/* ===========================
   2) コンテンツカード .home-grid
   共有：ここはグローバルのレイアウトとして管理（列数だけ制御）
=========================== */
@media (max-width:754px) {
    .home-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(240px, 1fr));
        gap: clamp(16px, 3vw, 28px);
    }
}

@media (min-width:755px) and (max-width:1000px) {
    .home-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(280px, 1fr));
        gap: clamp(18px, 2.5vw, 28px);
        justify-content: center;
    }
}

@media (min-width:1001px) {
    .home-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(220px, 1fr));
        gap: clamp(18px, 2vw, 28px);
    }
}