/* ============================================================
   神戸大学 システム情報学部 受験生サイト トップページ
   モダンリニューアル用スタイルシート
   ============================================================ */

:root {
    --navy: #070d19;          /* ページ全体のダークネイビー */
    --navy-soft: #0a1322;     /* 一回り明るいパネル色 */
    --panel: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.12);
    --text: #e9eef6;
    --muted: #9db0ca;
    --accent: #4da3ff;
    --accent-deep: #008aee;
    --radius: 18px;
    --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-serif: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 64px;
}

body {
    margin: 0;
    background-color: var(--navy);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* 埋め込み要素が親幅を超えないようにする土台。
   個別のサイズ指定（.hero__img など）は class セレクタなのでこれより優先される。 */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* ---- ページ本体のフェードイン（visibility.js が is-visible を付与） ---- */
main {
    position: relative;
}

/* フェードインは JS が動いているときだけ（js-visibility は js/visibility.js が付与） */
.js-visibility main {
    opacity: 0;
    transition: opacity 0.9s ease;
}

.js-visibility main.is-visible { opacity: 1; }

main *, main *::before, main *::after { box-sizing: border-box; }

/* ---- スクロール連動のフェードイン ---- */
.js-visibility .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.9s ease var(--d, 0s),
        transform 1s var(--ease-out) var(--d, 0s);
}

.js-visibility .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   1. ファーストビュー：建物の画像を画面いっぱいに
   ============================================================ */
.hero {
    position: sticky;   /* 後続のダークセクションが上にスライドしてくる */
    top: 0;
    z-index: 0;
    height: 100vh;
    height: 100svh;
    min-height: 540px;
    overflow: hidden;
}

.hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    animation: heroZoom 3s var(--ease-out) both;
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
}

/* 常時かかるシャード（文字の可読性を確保するグラデーション） */
.hero__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 13, 25, 0.42) 0%, rgba(7, 13, 25, 0) 32%),
        linear-gradient(180deg, rgba(7, 13, 25, 0) 42%, rgba(7, 13, 25, 0.82) 100%);
}

/* スクロールに合わせて濃くなるダークレイヤー（--fade は heroEffect.js が制御） */
.hero__dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 13, 25, 0.35) 0%, rgba(7, 13, 25, 0.86) 62%, #070d19 100%);
    opacity: var(--fade, 0);
    pointer-events: none;
}

/* ---- 右下のキャッチコピー ---- */
.hero__content {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    padding: 0 clamp(20px, 6vw, 92px) clamp(64px, 10vh, 116px);
    text-align: right;
    color: #fff;
    pointer-events: none;
    /* スクロールに合わせて文字が浮き上がって消える */
    opacity: calc(1 - var(--fade, 0) * 1.6);
    transform: translateY(calc(var(--fade, 0) * -40px));
}

.hero__eyebrow {
    margin: 0 0 18px;
    font-size: clamp(11px, 1.1vw, 14px);
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    animation: heroIn 1.1s var(--ease-out) 0.25s both;
}

.hero__copy {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(27px, 4.4vw, 56px);
    line-height: 1.5;
    letter-spacing: 0.06em;
    /* 日本語は既定だと文字単位で折り返すため「め」だけが次行に落ちる。
       やむを得ず折り返すときも文節の切れ目（スペース）だけを使う。 */
    word-break: keep-all;
    text-shadow: 0 2px 32px rgba(0, 0, 0, 0.5);
    animation: heroIn 1.1s var(--ease-out) 0.45s both;
}

@keyframes heroIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

/* ---- 左下のマスコット ---- */
.hero__mascot {
    position: absolute;
    z-index: 3;
    left: clamp(20px, 5vw, 72px);
    bottom: clamp(56px, 9vh, 96px);
    width: clamp(150px, 16vw, 250px);
    pointer-events: none;
    opacity: calc(1 - var(--fade, 0) * 1.8);
}

.hero__mascot img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.4));
    animation:
        heroIn 1.2s var(--ease-out) 0.9s both,
        mascotFloat 3.6s ease-in-out 2.2s infinite;
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

/* ---- スクロールを促すインジケーター ---- */
.hero__scroll {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-decoration: none;
    opacity: calc(1 - var(--fade, 0) * 2);
}

.hero__scroll i {
    animation: cueDown 1.8s ease-in-out infinite;
}

@keyframes cueDown {
    0%, 100% { transform: translateY(0);    opacity: 1; }
    50%      { transform: translateY(7px);  opacity: 0.35; }
}
/* ============================================================
   2. 共通セクションパーツ
   ============================================================ */
.section {
    position: relative;
    z-index: 1;
    padding: clamp(88px, 12vh, 140px) 24px;
    background-color: var(--navy);
}

.section__inner {
    max-width: 1020px;
    margin: 0 auto;
}

.section__label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.section__label::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--accent);
}

.section__title {
    margin: 0 0 18px;
    font-size: clamp(25px, 3.4vw, 38px);
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.04em;
    color: #fff;
}

.section__lead {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.9;
}

/* ============================================================
   3. ABOUT：中央寄せの見出し + 説明文
   ============================================================ */
.about {
    position: relative;
    z-index: 1;
    padding: clamp(96px, 14vh, 160px) 24px;
    text-align: center;
    overflow: hidden;
    /* 上端は半透明にして、sticky なヒーローとの間をクロスフェードさせる */
    background:
        radial-gradient(720px 340px at 84% -6%, rgba(0, 138, 238, 0.16), transparent 70%),
        radial-gradient(560px 300px at 6% 110%, rgba(77, 163, 255, 0.10), transparent 70%),
        /* ブループリント風の薄いグリッドパターン */
        repeating-linear-gradient(0deg, rgba(119, 165, 255, 0.05) 0 1px, transparent 1px 44px),
        repeating-linear-gradient(90deg, rgba(119, 165, 255, 0.05) 0 1px, transparent 1px 44px),
        linear-gradient(180deg, rgba(7, 13, 25, 0.55) 0%, var(--navy) 320px);
    background-color: var(--navy);
}

/* システムのネットワークを描くキャンバス（js/aboutNetwork.js） */
.about__canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
    pointer-events: none;
}

/* カーソルを追うスポットライト（--mx / --my は js/aboutNetwork.js が更新） */
.about::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 28%), rgba(77, 163, 255, 0.12), transparent 72%);
}

.about__inner {
    position: relative;
    z-index: 2;
    max-width: 780px;
    margin: 0 auto;
}

.about .section__label::after {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--accent);
}

.about__heading {
    margin: 0 0 48px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(23px, 3.8vw, 40px);
    line-height: 1.7;
    letter-spacing: 0.05em;
    color: #fff;
}

.about__heading .accent {
    padding: 0 2px;
    background: linear-gradient(transparent 64%, rgba(77, 163, 255, 0.38) 64%);
}

.about__body {
    max-width: 700px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
    text-align: left;
}

.about__body p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 2.05;
    letter-spacing: 0.02em;
}

.about__body strong {
    color: #fff;
    font-weight: 700;
    font-size: 1.08em;
}

.about__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 44px;
}

.about__chips span {
    padding: 9px 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #cfe0f4;
    font-size: 13px;
    letter-spacing: 0.08em;
}
/* ============================================================
   4. MOVIE + 学部長メッセージ
   ============================================================ */
.movie .video {
    width: 100%;
    max-width: 920px;
    aspect-ratio: 16 / 9;
    margin: 36px auto 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #000;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.movie .video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 動画と学部長コメントを横並びに配置（小さい画面では縦並び） */
.movie__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: clamp(28px, 4vw, 52px);
    align-items: stretch;
    margin-top: 40px;
}

.movie__grid .video {
    margin: 0;
    max-width: none;
}

/* コメントカードは動画の高さに合わせて伸び、内容を垂直中央に置く */
.movie__grid .dean {
    margin: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dean {
    position: relative;
    max-width: 720px;
    margin: 72px auto 0;
    padding: 32px 36px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.dean::before {
    content: "“";
    position: absolute;
    top: -30px;
    left: 20px;
    font-family: var(--font-serif);
    font-size: 88px;
    line-height: 1;
    color: rgba(77, 163, 255, 0.55);
}

.dean blockquote {
    margin: 0;
}

.dean blockquote p {
    margin: 0;
    color: #dbe5f3;
    font-size: 15.5px;
    line-height: 2.1;
}

.dean__author {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.dean__author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.dean__role {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.dean__name {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
/* ============================================================
   5. 情報価値創造教育棟
   ============================================================ */
.building {
    background-color: var(--navy-soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.building__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(36px, 5vw, 72px);
    align-items: center;
    max-width: 1020px;   /* .section__inner と同じ幅にそろえる */
    margin: 0 auto;
}

.building__body {
    display: grid;
    gap: 20px;
}

.building__body p {
    margin: 0;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 2.05;
}

.building__figure {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.building__figure img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s var(--ease-out);
}

.building__figure img.is-active {
    opacity: 1;
}
/* ============================================================
   6. コンテンツナビゲーションカード
   ============================================================ */
.navcards__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin: 44px 0 0;
}

.navcard {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    isolation: isolate;
    text-decoration: none;
    transition:
        transform 0.5s var(--ease-out),
        border-color 0.3s ease,
        box-shadow 0.5s ease;
}

.navcard img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55) saturate(0.9);
    transition: transform 0.8s var(--ease-out), filter 0.4s ease;
}

.navcard::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(200deg, rgba(7, 13, 25, 0.05) 30%, rgba(7, 13, 25, 0.78) 100%);
}

.navcard__text {
    position: absolute;
    left: 26px;
    bottom: 22px;
    color: #fff;
    font-size: clamp(20px, 2.4vw, 27px);
    font-weight: 800;
    letter-spacing: 0.1em;
}

.navcard__arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.navcard:hover,
.navcard:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(77, 163, 255, 0.65);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.navcard:hover img,
.navcard:focus-visible img {
    transform: scale(1.07);
    filter: brightness(0.68) saturate(1);
}

.navcard:hover .navcard__arrow,
.navcard:focus-visible .navcard__arrow {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    transform: translateX(4px);
}
/* ---- 資料請求 / よくある質問 ---- */
.quick {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 56px;
}

.quick a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.quick a i {
    color: var(--accent);
    font-size: 14px;
    transition: color 0.3s ease;
}

.quick a:hover,
.quick a:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #0a1526;
    transform: translateY(-2px);
}

.quick a:hover i,
.quick a:focus-visible i {
    color: var(--accent-deep);
}

/* ============================================================
   7. レスポンシブ
   ============================================================ */
@media (max-width: 900px) {
    .hero__mascot {
        display: none;
    }

    /* 動画とコメントは小さい画面では縦並びに */
    .movie__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .movie__grid .video {
        max-width: 920px;
        margin: 0 auto;
    }

    .movie__grid .dean {
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
    }

    .building__grid {
        grid-template-columns: 1fr;
    }

    .building__figure {
        order: -1;
    }
}

@media (max-width: 640px) {
    .navcards__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 28px;
    }

    .navcard {
        aspect-ratio: 1 / 1;
        min-height: 0;
        border-radius: 10px;
    }

    .navcard__text {
        left: 12px;
        bottom: 12px;
        font-size: 15px;
        letter-spacing: 0.06em;
    }

    .navcard__arrow {
        right: 10px;
        top: auto;
        bottom: 10px;
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .quick {
        gap: 10px;
        margin-top: 32px;
    }

    .quick a {
        padding: 12px 20px;
        font-size: 13px;
    }

    .hero__scroll {
        display: none;
    }

    .hero__content {
        padding-right: 22px;
        padding-bottom: 56px;
    }

    /* 4.4vw は 614px 以下で下限27pxに張り付き、スマホでは実質固定になる。
       この幅では傾きを上げて画面幅に追従させる（640pxでの見た目は据え置き）。 */
    .hero__copy {
        font-size: clamp(19px, 6vw, 28px);
    }

    .dean {
        padding: 26px 22px 24px;
    }
}

/* ---- モーション低減設定への配慮 ---- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero__img,
    .hero__eyebrow,
    .hero__copy,
    .hero__mascot img,
    .hero__scroll i {
        animation: none !important;
    }

    /* ABOUTのインタラクティブ演出はモーション低減時は無効化 */
    .about__canvas {
        display: none;
    }

    .about::after {
        content: none;
    }

    .js-visibility .reveal,
    .js-visibility main {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   8. トップページのナビゲーションバー（透明 + 白ロゴ）
   header.html / header.css は全ページ共通のため、
   body.top-page スコープでのみ上書きする。
   ============================================================ */
.top-page .head-banner {
    background: linear-gradient(180deg, rgba(7, 13, 25, 0.6) 0%, rgba(7, 13, 25, 0) 100%);
    box-shadow: none;
}

.top-page .head-banner .headBtn {
    color: #fff;
}

/* 遷移メニューは透過ガラス風のチップに */
.top-page .head-banner .pageBtn {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.top-page .head-banner .pageBtn:hover,
.top-page .head-banner .headBtn:hover {
    background-color: rgba(0, 138, 238, 0.95);
    color: #fff;
}

/* モバイルのハンバーガーも白に */
.top-page .head-banner #xsMenu span {
    background-color: #fff;
}

/* header.css はメニュー展開中にヘッダーを白くしてロゴを隠すが、
   トップページでは透明ヘッダーと白ロゴのまま見せる。
   × は白いドロワーの上に来るので濃色のまま（header.css）にし、
   グラデーションもドロワーにかからない左側だけに敷く（幅は #mobileMenu と同じ）。 */
body.top-page.menu-open .head-banner {
    background: linear-gradient(180deg, rgba(7, 13, 25, 0.6) 0%, rgba(7, 13, 25, 0) 100%)
        left top / calc(100% - min(340px, 88vw)) 100% no-repeat;
    box-shadow: none;
}

body.top-page.menu-open .head-banner #logo {
    opacity: 1;
    pointer-events: auto;
}