/* =========================================================
   久留米工業大学 AI応用研究所  共通スタイル
   ・配色は組織図（soshiki）と背景画像（cta01）に合わせた
     淡いスカイブルー／ラベンダー＋ブルーのアクセント
   ・ビルド不要。このファイル1つで全ページを賄う
   ========================================================= */

:root {
  --navy: #1b2447;
  --text: #2b3150;
  --muted: #5a6283;
  --accent: #3b5bdb;        /* リンク・強調（白地でコントラスト比 5.5:1） */
  --accent-2: #577dff;      /* 組織図の青 */
  --lavender: #9b8cf0;
  --sky: #b6d9f6;
  --bg: #ffffff;
  --bg-soft: #f3f6fd;
  --line: #dfe5f5;
  --grad: linear-gradient(120deg, #577dff 0%, #9b8cf0 100%);
  --lit: #3f7d0a;           /* リテラシーレベル（旧 #8bd12a を濃くした） */
  --adv: #0b7f94;           /* 応用基礎レベル（旧 #3bd6eb を濃くした） */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(40, 60, 140, .08);
  --max: 1120px;
  --header-h: 64px;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.9;
  font-feature-settings: "palt" 0; overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.45; margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.3em; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section--soft { background: var(--bg-soft); }
.section--pattern { background: #eef2fb url(../../images/hero.webp) center / cover; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); }
.section-head h2::after {
  content: ""; display: block; width: 56px; height: 4px; margin: 14px auto 0;
  border-radius: 2px; background: var(--grad);
}
.section-head p { color: var(--muted); margin: 0; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h3 { font-size: 1.2rem; margin-top: 2em; padding-left: 12px; border-left: 4px solid var(--accent-2); }
.prose p { text-align: justify; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); margin-right: auto; }
.brand img { height: 44px; width: auto; }
.brand small { display: block; font-size: .7rem; color: var(--muted); line-height: 1.2; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.3; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 8px; font-size: .9rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: var(--bg-soft); color: var(--accent); }
.nav .nav-em a { background: var(--grad); color: #fff; }
.nav .nav-em a:hover { color: #fff; opacity: .9; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  border-radius: 8px; color: var(--navy);
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding: 8px 16px 16px; gap: 0; }
  .nav a { padding: 14px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .nav .nav-em a { margin-top: 12px; border-radius: 8px; text-align: center; border: 0; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; padding: 96px 0 88px;
  background: #dfe8f8;
  overflow: hidden;
}
/* ヒーローのワイヤー：背景画像と同じ座標系（1920×1080基準）に canvas で描く。
   描画は main.js（30fps上限、画面外・非表示タブでは停止） */
.hero-fx {
  /* 左端（水色）を基準に、横幅いっぱい（狭い画面では1100px）に広げて縦は中央で切る */
  position: absolute; top: 50%; left: 0; transform: translateY(-50%);
  width: max(100%, 1100px); aspect-ratio: 16 / 9; pointer-events: none;
  background: url(../../images/hero.webp) center / 100% 100% no-repeat;
}
.hero-fx canvas { display: block; width: 100%; height: 100%; }
.hero::before { /* ゆっくり横切る光の帯 */
  content: ""; position: absolute; top: -50%; bottom: -50%; left: 0; width: 40%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-120%) rotate(8deg); animation: sweep 14s ease-in-out 2s infinite; pointer-events: none;
}
@keyframes sweep {
  0% { transform: translateX(-120%) rotate(8deg); }
  45%, 100% { transform: translateX(320%) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { display: none; }
}
.hero::after { /* 文字の可読性確保のための白いグラデーション */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,.15) 50%, rgba(255,255,255,0) 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero-kicker { font-weight: 700; color: var(--accent); letter-spacing: .08em; margin-bottom: .4em; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.4rem); letter-spacing: .04em; margin-bottom: .4em; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 720px; font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }

/* ---------- buttons / badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border-radius: 999px; font-weight: 700; text-decoration: none; line-height: 1.4;
  border: 2px solid transparent; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary { background: var(--grad); color: #fff; }
.btn--ghost { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn svg { width: 18px; height: 18px; flex: none; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 6px;
  font-size: .82rem; font-weight: 700; color: #fff; background: var(--accent); line-height: 1.7;
}
.badge--lit { background: var(--lit); }
.badge--adv { background: var(--adv); }
.badge--outline { background: #fff; color: var(--navy); border: 1px solid var(--line); font-weight: 500; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: #fff; border: 1px solid #d3dbf3; border-radius: var(--radius);
  padding: 28px; position: relative;
  box-shadow: var(--hard) var(--hard) 0 var(--sh);
  transition: transform .15s, box-shadow .15s;
}
a.card:hover, .card:has(a:hover) { transform: translate(-1px, -1px); box-shadow: calc(var(--hard) + 1px) calc(var(--hard) + 1px) 0 var(--sh); }
.card h3 { font-size: 1.12rem; }
.card p:last-child { margin-bottom: 0; }

/* ぼかしなしのドロップシャドウ。並び順に色を少しずつずらし、
   一群のカード全体でスカイブルー→ラベンダーのグラデーションに見せる */
.card, .members li, .doc-list a {
  --hard: 4px;
  --sh: color-mix(in oklab, var(--sh-from) , var(--sh-to) calc(var(--i, 0) * var(--step, 11%)));
}
:root { --sh-from: #9fcdf5; --sh-to: #c3a3ef; }
.grid > :nth-child(1), .members > :nth-child(1), .doc-list > :nth-child(1) a { --i: 0; }
.grid > :nth-child(2), .members > :nth-child(2), .doc-list > :nth-child(2) a { --i: 1; }
.grid > :nth-child(3), .members > :nth-child(3), .doc-list > :nth-child(3) a { --i: 2; }
.grid > :nth-child(4), .members > :nth-child(4) { --i: 3; }
.grid > :nth-child(5), .members > :nth-child(5) { --i: 4; }
.grid > :nth-child(6), .members > :nth-child(6) { --i: 5; }
.grid > :nth-child(7), .members > :nth-child(7) { --i: 6; }
.grid > :nth-child(8), .members > :nth-child(8) { --i: 7; }
.grid > :nth-child(9), .members > :nth-child(9) { --i: 8; }
.grid > :nth-child(10), .members > :nth-child(10) { --i: 9; }
/* 枚数に応じて1枚あたりの変化量を調整（最後の1枚が --sh-to になる） */
.grid:has(> :last-child:nth-child(3)), .doc-list { --step: 50%; }
.grid:has(> :last-child:nth-child(5)) { --step: 25%; }
.grid:has(> :last-child:nth-child(7)) { --step: 16.6%; }
.card-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #e6edff, #efeaff); color: var(--accent); margin-bottom: 16px;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); /* 組織図の六角形モチーフ */
}
.card-title { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.card-title .card-icon { margin-bottom: 0; flex: none; }
.card-title h3 { margin: 0; font-size: 1.15rem; }
.center { text-align: center; }
.callout .center { margin: 0; }
.prose p.center { text-align: center; }
.card-icon svg { width: 26px; height: 26px; }
.card .links { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.card .links li { margin: 6px 0; }
.card .note { font-size: .88rem; color: var(--muted); }

/* members（顔写真なし：部門・氏名・学科） */
.members { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.members li { background: #fff; border: 1px solid #d3dbf3; border-radius: 10px; padding: 14px 18px; --hard: 3px; box-shadow: var(--hard) var(--hard) 0 var(--sh); }
.members p { margin: 0; line-height: 1.6; }
.members .role { font-size: .8rem; color: var(--accent); font-weight: 700; }
.members .name { font-weight: 700; color: var(--navy); font-size: 1.08rem; }
.members .name span { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: .5em; }
.members .dept { font-size: .85rem; color: var(--muted); }

/* feature：地域課題解決型AI教育プログラム（トップの目玉） */
.feature { padding-top: 0; margin-top: -40px; position: relative; z-index: 2; }
.feature-box {
  background: #fff; border-radius: 20px; padding: 48px clamp(20px, 4vw, 56px);
  border: 1px solid #d3dbf3; position: relative;
}
.feature .container { position: relative; isolation: isolate; }
.feature-box::after { /* ぼかしなしのシャドウ自体をグラデーションに */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  transform: translate(6px, 6px); background: linear-gradient(120deg, var(--sh-from), var(--sh-to));
}
.feature-head { padding-right: 170px; }
.feature-head .mdash { /* カード上端からぶら下げる */
  position: absolute; top: -1px; right: clamp(20px, 4vw, 56px); width: 140px; height: auto;
}
@media (max-width: 760px) {
  .feature-head { padding-right: 0; padding-top: 88px; }
  .feature-head .mdash { width: 100px; right: 20px; }
}
.feature-kicker { font-weight: 700; letter-spacing: .12em; font-size: .8rem; color: var(--accent); margin: 0 0 .3em; }
.feature-head h2 { font-size: clamp(1.5rem, 1rem + 2vw, 2.2rem); margin-bottom: .5em; }
.feature-head > p { max-width: 860px; }
.stats { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats li { background: var(--bg-soft); border-radius: 14px; padding: 20px; text-align: center; }
.stats strong { display: block; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.3; color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }
.stats strong small { font-size: .5em; margin-left: .15em; }
.stats span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.flow-title { font-size: 1.1rem; margin-top: 8px; }
.flow { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; counter-reset: f; }
.flow li {
  position: relative; padding: 16px 12px 16px; border-radius: 12px; text-align: center;
  background: linear-gradient(180deg, #eef3ff, #f4f0ff); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.flow li:not(:last-child)::after {
  content: ""; position: absolute; right: -8px; top: 50%; width: 8px; height: 14px; transform: translateY(-50%);
  background: var(--accent-2); clip-path: polygon(0 0, 100% 50%, 0 100%); z-index: 1;
}
.flow-stage { display: inline-block; align-self: center; font-size: .75rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 10px; }
.flow strong { color: var(--navy); font-size: .95rem; line-height: 1.5; }
.flow-note { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.flow li:nth-child(n+5) .flow-stage { background: #6b55d6; }
.feature-cta { text-align: center; margin: 0; }
@media (max-width: 960px) {
  .flow { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .flow li:nth-child(3)::after { display: none; }
}
@media (max-width: 640px) {
  .feature { margin-top: -24px; }
  .feature-box { padding: 36px 20px; }
  .stats { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow li { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: 4px 10px; }
  .flow li::after { display: none; }
  .flow-stage { align-self: auto; }
  .flow-note { width: 100%; }
}

/* figure */
.figure { margin: 32px auto 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.figure img { margin: 0 auto; border-radius: 8px; }
.figure figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.figure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.figure-pair a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: box-shadow .15s; }
.figure-pair a:hover { box-shadow: var(--shadow); }
@media (max-width: 640px) { .figure-pair { grid-template-columns: 1fr; } }

/* callout */
.callout { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 1em 0 1.5em; }
.callout dl { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.callout dt { font-weight: 700; color: var(--navy); }
.callout dd { margin: 0; color: var(--muted); }

/* list: reports */
.doc-list { list-style: none; padding: 0; margin: 0 auto; max-width: 820px; }
.doc-list li { margin-bottom: 16px; }
.doc-list a {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #fff;
  border: 1px solid #d3dbf3; border-radius: 12px; text-decoration: none; color: var(--navy); font-weight: 700;
  --hard: 3px; box-shadow: var(--hard) var(--hard) 0 var(--sh); transition: transform .15s, box-shadow .15s;
}
.doc-list a:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--sh); }
.doc-list svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.doc-list .meta { margin-left: auto; font-weight: 400; font-size: .85rem; color: var(--muted); }

.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list h4 { font-size: .98rem; margin: 0 0 2px; }
.mini-list p { font-size: .9rem; margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #d7dcf0; padding: 64px 0 24px; font-size: .92rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: 1em; }
.site-footer h3 { color: #fff; font-size: .95rem; margin-bottom: .3em; }
.site-footer a { color: #b9c6ff; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; }
.contact { margin-bottom: 20px; }
.contact p { margin: 0; }
.copyright { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); text-align: center; font-size: .82rem; color: #9aa3c7; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }
  .card { padding: 22px; }
  .card, .members li, .doc-list a { --hard: 3px; }
  .brand img { height: 36px; }
  .brand strong { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* オープンバッジ（修了証） */
.open-badges { list-style: none; padding: 0; margin: 8px 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: center; }
.open-badges img { width: 100%; max-width: 160px; margin: 0 auto 8px; }
.open-badges strong { display: block; color: var(--navy); }
.open-badges span { font-size: .82rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card, .doc-list a { transition: none; } }
