/* --- 変数とベース設定 --- */
:root {
    /* --- 色（全ページ共通） --- */
    --ink: #1f2328;
    /* 本文・見出し・黒いボタン */
    --muted: #5f6670;
    /* 補足の文字 */
    --line: #e6e8eb;
    /* 枠線・区切り線 */
    --bg-soft: #f6f7f9;
    /* 下層ページの背景、淡い面 */
    --miku: #39c5bb;
    /* ミクグリーン（英字ラベル・アクセント） */
    --miku-deep: #1d7f78;
    /* ミクグリーンの文字色（白背景で読める濃さ） */
    --miku-tint: #eef9f8;
    /* ミクグリーンの淡い面 */
    --pink: #ff65e4;
    --cyan: #2bd7e0;
    /* 背景の三角の飾りの2色 */

    /* --- 文字・形（全ページ共通） --- */
    --label-size: 0.75rem;
    --label-spacing: 0.28em;
    /* 英字の小さなラベル（ACTIVITIES など）の大きさと字間 */
    --heading-spacing: 0.04em;
    /* 見出しの字間 */
    --radius: 16px;
    /* カード・枠の角丸 */
    --radius-sm: 12px;
    /* 動画など、カードの中の要素の角丸 */
    --shadow-hover: 0 16px 32px rgba(31, 35, 40, 0.07);
    /* マウスを乗せたとき・開いたときの影 */
    /* サイト共通のグラデーション：ミクグリーン→髪の青→髪の影の青。
       3色の明るさ（OKLCHのL=0.70）をそろえ、中間色もOKLCHで補間した値を並べている */
    --gradient-miku-stops: #36b4ab 0%, #32b3b5 12.5%, #33b1bf 25%, #3aafc7 37.5%, #44adcf 50%, #4eabd4 62.5%, #59a8d9 75%, #63a5dd 87.5%, #6ea2df 100%;
    /* 線・枠など、ボタン以外に使う明るい版（同じ色相で明るさをL=0.83にそろえたもの） */
    --gradient-miku-light-stops: #68ded4 0%, #65dddf 12.5%, #65dbe9 25%, #6ad9f2 37.5%, #71d7fa 50%, #7bd4ff 62.5%, #8ad1ff 75%, #96ceff 87.5%, #a0cbfe 100%;
    --gradient-miku: linear-gradient(90deg, var(--gradient-miku-light-stops));
    /* 淡い背景の光に使う色。片方はサイトの差し色のピンク（#ff65e4）、もう片方はグラデーションの青 */
    --miku-glow-a: rgba(255, 101, 228, 0.16);
    --miku-glow-b: rgba(110, 162, 223, 0.2);
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--ink);
    background-color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
    /* 画像がはみ出してもスクロールバーを出さない */
}

/* --- ヘッダー --- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.logo {
    display: block;
    width: 250px;
    /* ここでロゴの幅を調整 */
}

.logo img {
    width: 100%;
    height: auto;
}

.nav-links ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--miku);
}

/* スマホのメニューボタン（三本線。開くと×になる）。PCでは出さない */
.nav-toggle {
    display: none;
}

.hero {
    position: relative;
    /* 画像の縦横比（2460 × 3479）に合わせ、画面の高さを上限にする */
    height: min(141.42vw, 100vh);
    height: min(141.42vw, 100svh);
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* 背景の装飾グラデーション */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(57, 197, 187, 0.1), transparent 50%);
    z-index: 1;
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    filter: blur(3px);
    overflow: hidden;
    pointer-events: none;
}

.hero-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    max-width: 8vw;
    aspect-ratio: 1;
    background: var(--pink);
    opacity: 0.5;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: translate(-50%, -50%) rotate(var(--rotation));
    animation: particleFloat var(--duration) ease-in-out var(--delay) infinite alternate;
}

.hero-particle:nth-child(even) {
    background: var(--cyan);
}

@keyframes particleFloat {
    to {
        transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y))) rotate(calc(var(--rotation) + var(--spin)));
    }
}

/* 画面サイズに合わせたキャラクターの中央配置 */
.hero-character {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: auto;
    max-width: 100%;
    z-index: 2;
    object-fit: contain;
    pointer-events: none;
}

.hero-character.is-revealed {
    animation: characterReveal 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes characterReveal {
    from {
        opacity: 0;
        filter: blur(12px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-character.is-revealed,
    .hero-particle {
        animation: none;
    }
}

/* ページ内リンクで飛んだとき、固定ヘッダーに見出しが隠れないようにする */
#about {
    scroll-margin-top: 100px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* --- トップ下部（サークル紹介・活動・入会）。見出しとカードは subpage.css の共通部品 --- */
.top-sections {
    background: var(--bg-soft);
}

.top-sections .sub-main {
    padding-top: 8px;
}

.top-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.top-action {
    margin-top: 28px;
    text-align: center;
}

/* --- フッター：濃い地に、上端のグラデーションのライン --- */
.footer {
    position: relative;
    padding: 48px 5% 24px;
    background: var(--ink);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-miku);
}

.footer-content {
    max-width: 1040px;
    margin: 0 auto 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-label {
    color: var(--miku);
    font-size: var(--label-size);
    font-weight: 700;
    letter-spacing: var(--label-spacing);
}

.footer-contact h2 {
    margin: 6px 0 12px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: var(--heading-spacing);
}

.footer-contact p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact a {
    color: #fff;
    text-underline-offset: 3px;
}

.footer-contact a:hover {
    color: var(--miku);
}

.footer-operator {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

/* アクセス解析の告知（Google Analytics の規約で必要な表示） */
.footer-analytics {
    max-width: 640px;
    margin: 10px auto 0;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    line-height: 1.7;
}

.footer-analytics a {
    color: inherit;
    text-underline-offset: 3px;
}

.footer-analytics a:hover {
    color: #fff;
}

/* スマホ対応 */
@media (max-width: 900px) {
    .header {
        position: sticky;
        flex-direction: column;
        gap: 4px;
        padding: 6px 5%;
    }

    .logo {
        width: 220px;
        max-width: 100%;
    }

    .logo img {
        display: block;
    }

    .nav-links ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 8px;
    }

    .nav-links a {
        display: block;
        padding: 2px 0;
        font-size: 14px;
    }

    /* --- JavaScript が使えるとき：ロゴとメニューボタンを1行に並べ、メニューはボタンで下に開く --- */
    .js .header {
        flex-direction: row;
        gap: 12px;
        padding: 8px 4%;
    }

    .js .logo {
        width: 160px;
    }

    .js .nav-toggle {
        position: relative;
        display: grid;
        place-items: center;
        flex: none;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--ink);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .js .nav-toggle span,
    .js .nav-toggle span::before,
    .js .nav-toggle span::after {
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        transition: transform 0.25s, background-color 0.25s;
    }

    .js .nav-toggle span {
        position: relative;
    }

    .js .nav-toggle span::before,
    .js .nav-toggle span::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .js .nav-toggle span::before {
        transform: translateY(-7px);
    }

    .js .nav-toggle span::after {
        transform: translateY(7px);
    }

    .js .is-nav-open .nav-toggle span {
        background: transparent;
    }

    .js .is-nav-open .nav-toggle span::before {
        transform: rotate(45deg);
    }

    .js .is-nav-open .nav-toggle span::after {
        transform: rotate(-45deg);
    }

    .js .nav-toggle:focus-visible {
        outline: 2px solid var(--ink);
        outline-offset: 2px;
    }

    /* メニュー：ヘッダーのすぐ下に重ねて開く（ページの中身は動かさない） */
    .js .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--line);
        box-shadow: 0 14px 28px rgba(31, 35, 40, 0.1);
    }

    .js .is-nav-open .nav-links {
        display: block;
    }

    .js .nav-links ul {
        flex-direction: column;
        gap: 0;
        padding: 4px 5% 10px;
    }

    .js .nav-links li + li {
        border-top: 1px solid var(--line);
    }

    .js .nav-links a {
        padding: 13px 4px;
        font-size: 1rem;
    }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
    .js .nav-toggle span,
    .js .nav-toggle span::before,
    .js .nav-toggle span::after {
        transition: none;
    }
}

@media (max-width: 600px) {
    .top-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 画面には表示せず、検索エンジンや読み上げソフトにだけ伝える文字 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
