/* ひなた野医療大学 リハビリテーション学部（架空）の特設サイト。
   空を画面に止めて、その上を白い手書きの一言と白い線画の場面が流れていく。
   空は、下へ送るにつれて 夜明け → 朝焼け → 青空 と明るくなる */

:root {
  --shiro: #fff;
  --sora: #4d6db5;               /* 空の写真が読み込まれる前の色 */
  --ai: #283264;                 /* 白い地の字の色 */
  --ai-usui: #5f6890;
  --momo: #ee8f77;               /* 差し色（矢印の丸・目次の写真の輪）。ここ以外には使わない */
  --yoake-obi: linear-gradient(100deg, #f9dfd6 0%, #e9e1f5 48%, #dbe6f8 100%);   /* 夜明けの空の色の帯 */
  --f-ja: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --f-en: "Quicksand", "Zen Maru Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  color: var(--shiro);
  background: var(--sora);
  font-family: var(--f-ja);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .05em;
  line-break: strict;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.kakushi {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 空（画面に止めておく。3枚を重ね、上の2枚の濃さを送った量で変える） ---------- */
.sora {
  position: fixed; top: 0; left: 0; z-index: -1;
  width: 100%; height: 100vh; height: 100lvh;
  background: var(--sora);
}
.sora__mai { position: absolute; inset: 0; background: center / cover no-repeat; }
.sora__mai--yoake { background-image: url(../img/sora_yoake.jpg); }
.sora__mai--asayake { background-image: url(../img/sora_asayake.jpg); opacity: var(--asa, 0); }
.sora__mai--ao { background-image: url(../img/sora_ao.jpg); opacity: var(--hiru, 0); }

/* ---------- ロゴ ---------- */
.atama { position: absolute; top: 0; left: 0; z-index: 10; padding: 44px 0 0 4%; }
.rogo { display: flex; align-items: center; gap: 12px; }
.rogo__shirushi {
  width: 44px; height: 44px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round;
}
.rogo__moji { display: flex; flex-direction: column; gap: 5px; }
.rogo__en { font-family: var(--f-en); font-weight: 600; font-size: 9px; line-height: 1; letter-spacing: .16em; }
.rogo__ja { font-weight: 700; font-size: 19px; line-height: 1.1; letter-spacing: .1em; }

/* ---------- 最初の画面 ---------- */
.fv { position: relative; height: 100vh; height: 100svh; min-height: 560px; }
.fv__midashi {
  position: absolute; top: 48%; left: 50%;
  width: min(620px, 82vw);
  transform: translate(-50%, -50%);
}
.tegaki { display: block; width: 100%; height: auto; overflow: visible; }
.tegaki .ji-nuri { fill: var(--shiro); }
.tegaki .ji-sen { fill: none; stroke: var(--shiro); stroke-width: 1.8; stroke-linejoin: round; }

.fv__kaisetsu {
  position: absolute; left: 4%; bottom: 40px;
  display: flex; align-items: baseline; gap: 14px;
  font-size: 14px; letter-spacing: .14em;
}
.fv__nen { font-family: var(--f-en); font-weight: 600; font-size: 18px; letter-spacing: .08em; }

/* SCROLL の文字の下に縦の線。光が上から下へ流れる */
.sukuroru {
  position: absolute; left: 50%; bottom: 0;
  padding-bottom: 76px;
  transform: translateX(-50%);
  font-family: var(--f-en); font-weight: 600; font-size: 11px; letter-spacing: .24em;
}
.sukuroru::before, .sukuroru::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 1px; height: 64px; margin-left: -.5px;
}
.sukuroru::before { background: rgba(255, 255, 255, .35); }
.sukuroru::after { background: var(--shiro); animation: nagare 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes nagare {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- 場面（白い線画と文）。絵の左右は場面ごとに入れ替える ---------- */
.ba {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: min(92%, 1400px); min-height: max(100vh, 800px);
  margin: 10vh auto 0;
}
.ba__e svg { display: block; width: 100%; height: auto; }
.ba--e-hidari .ba__e { order: 0; }
.ba--e-hidari .ba__bun { order: 1; padding: 0 6% 5% 4%; }
.ba--e-migi .ba__bun { order: 0; padding: 0 4% 5% 10%; }
.ba--e-migi .ba__e { order: 1; }

.ba__no { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; font-size: 13px; letter-spacing: .24em; }
.ba__kazu { font-family: var(--f-en); font-weight: 600; font-size: 22px; letter-spacing: .06em; }
.ba__midashi { font-weight: 700; font-size: clamp(22px, 2.7vw, 42px); line-height: 1.65; letter-spacing: .03em; }
.ba__honbun { margin-top: 2em; font-size: 17px; line-height: 2.25; letter-spacing: .01em; }

/* 白い線画: 太さのそろった丸い線 */
.sen path { fill: none; stroke: var(--shiro); stroke-width: var(--w); stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 学部名と写真 ---------- */
/* 4つ目の場面の線を引き終えるまで、空の上で少し間をあける */
.gakubu { position: relative; height: 100vh; min-height: 640px; margin-top: 14vh; overflow: hidden; background: #eef1f5; color: var(--ai); }
.gakubu__shashin { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 68% 50%; }
.gakubu::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .72) 34%, rgba(255, 255, 255, 0) 60%);
}
.gakubu__bun { position: absolute; z-index: 2; left: 8%; top: 50%; transform: translateY(-50%); }
.gakubu__daigaku { font-weight: 700; font-size: 18px; letter-spacing: .32em; }
.gakubu__mei { margin-top: 8px; font-weight: 700; font-size: clamp(36px, 4.2vw, 62px); line-height: 1.3; letter-spacing: .05em; }
.gakubu__kaisetsu { margin-top: 22px; font-weight: 700; font-size: 22px; letter-spacing: .12em; }
.gakubu__suji { font-family: var(--f-en); font-weight: 600; font-size: 1.4em; letter-spacing: .04em; }
.gakubu__gakka { margin-top: 4px; font-size: 15px; letter-spacing: .14em; color: var(--ai-usui); }
.gakubu__douga { display: flex; align-items: center; gap: 16px; margin-top: 44px; color: var(--ai); }
.gakubu__maru {
  display: grid; place-items: center; width: 72px; height: 72px;
  border: 1.5px solid currentColor; border-radius: 50%;
  transition: transform .3s, background-color .3s, color .3s;
}
.gakubu__maru svg { width: 14px; height: 16px; margin-left: 4px; fill: currentColor; }
.gakubu__douga:hover .gakubu__maru { transform: scale(1.07); background: var(--ai); color: var(--shiro); }
.gakubu__douga-moji { font-family: var(--f-en); font-weight: 600; font-size: 13px; letter-spacing: .22em; }

/* ---------- 目次 ---------- */
.mokuji { position: relative; padding: 120px 0 110px; background: var(--shiro); color: var(--ai); }
.mokuji::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44%; background: var(--yoake-obi); }
.mokuji__atama { position: relative; text-align: center; }
.mokuji__midashi { font-family: var(--f-en); font-weight: 600; font-size: 44px; line-height: 1; letter-spacing: .14em; }
.mokuji__ko { margin-top: 14px; font-size: 14px; letter-spacing: .2em; }
.mokuji__ichiran {
  position: relative; list-style: none;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(16px, 2.2vw, 32px);
  width: min(1180px, 90%); margin: 60px auto 0;
}
.mokuji__fuda { display: flex; flex-direction: column; align-items: center; height: 100%; text-align: center; }
.mokuji__e {
  width: 100%; max-width: 190px; aspect-ratio: 1; overflow: hidden; border-radius: 50%;
  box-shadow: 0 0 0 6px var(--shiro), 0 14px 30px rgba(40, 50, 100, .12);
  transition: box-shadow .3s;
}
.mokuji__e img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.mokuji__moji { display: flex; flex-direction: column; align-items: center; }
.mokuji__kazu { margin-top: 24px; font-family: var(--f-en); font-weight: 600; font-size: 15px; letter-spacing: .14em; }
.mokuji__dai { margin-top: 6px; font-weight: 700; font-size: clamp(12px, 1.12vw, 16px); line-height: 1.65; letter-spacing: .03em; }
.mokuji__dai > span { display: block; white-space: nowrap; }   /* 行の中では折り返さない（1字だけの行を作らない） */
/* 矢印は下向き（同じページの下へ進む） */
.mokuji__yajirushi {
  position: relative; flex: none; width: 30px; height: 30px; margin-top: auto;
  border: 1px solid currentColor; border-radius: 50%;
  transition: background-color .3s, color .3s, border-color .3s;
}
.mokuji__fuda .mokuji__moji { margin-bottom: 16px; }
.mokuji__yajirushi::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translate(-50%, -70%) rotate(45deg);
}
.mokuji__fuda:hover .mokuji__e { box-shadow: 0 0 0 6px var(--momo), 0 14px 30px rgba(40, 50, 100, .16); }
.mokuji__fuda:hover .mokuji__e img { transform: scale(1.07); }
.mokuji__fuda:hover .mokuji__yajirushi { background: var(--momo); border-color: var(--momo); color: var(--shiro); }

/* ---------- カリキュラムの帯（文が左・写真が右） ---------- */
.karikyuramu-waku { padding: 100px 0 130px; background: var(--shiro); }
.karikyuramu {
  display: grid; grid-template-columns: 1fr 1fr;
  width: min(1100px, 90%); min-height: 240px; margin: 0 auto; overflow: hidden;
  border-radius: 24px; background: var(--yoake-obi); color: var(--ai);
  box-shadow: 0 16px 36px rgba(40, 50, 100, .08);
}
.karikyuramu__bun { display: flex; flex-direction: column; justify-content: center; padding: 36px 52px; }
.karikyuramu__ko { font-family: var(--f-en); font-weight: 600; font-size: 14px; letter-spacing: .18em; color: var(--ai-usui); }
.karikyuramu__dai { margin-top: 6px; font-weight: 700; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.5; letter-spacing: .03em; }
.karikyuramu__setsu { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: 14px; letter-spacing: .08em; }
.karikyuramu__yajirushi {
  position: relative; flex: none; width: 34px; height: 34px;
  border: 1px solid currentColor; border-radius: 50%;
  transition: background-color .3s, color .3s, border-color .3s;
}
.karikyuramu__yajirushi::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
  transform: translate(-70%, -50%) rotate(45deg);
}
.karikyuramu__e { position: relative; overflow: hidden; }   /* 写真は帯の高さに合わせて切る（写真の比率で帯を高くしない） */
.karikyuramu__e::before {   /* 写真の左はしを帯の色になじませる */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, #e9e1f5 0%, rgba(233, 225, 245, 0) 26%);
}
.karikyuramu__e img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.karikyuramu:hover .karikyuramu__e img { transform: scale(1.05); }
.karikyuramu:hover .karikyuramu__yajirushi { background: var(--momo); border-color: var(--momo); color: var(--shiro); }

/* ---------- 終わり ---------- */
.ashi { padding: 64px 6% 72px; background: var(--ai); color: var(--shiro); text-align: center; }
.ashi .rogo { justify-content: center; }

/* 見本で省いたページへのリンクを押したときの知らせ */
.shirase {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(40, 50, 100, .92); color: var(--shiro);
  font-size: 13px; letter-spacing: .06em; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.shirase.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 動き（JS が動くときだけ隠しておく） ---------- */
/* 手書き: かたまりごとに、輪郭を 0.4 秒で引いてから白く塗る。0.1 秒ずつずらす。
   動き（transition）は .is-on が付いたときだけ。付く前から効かせると、JS が物差しを入れ直した瞬間に「消える動き」が走る */
.js .tegaki .ji-sen { stroke-dasharray: var(--L) var(--L); stroke-dashoffset: var(--L); }
.js .tegaki .ji-nuri { opacity: 0; }
.js .tegaki.is-on .ji-sen { stroke-dashoffset: 0; transition: stroke-dashoffset .4s ease-in calc(var(--i) * .1s); }
.js .tegaki.is-on .ji-nuri {
  opacity: 1;
  transition: opacity .1s cubic-bezier(.95, .05, .795, .035) calc(var(--i) * .1s + .4s);
}

/* 書き終わったら、開設の年と SCROLL を出す */
.js .fv__kaisetsu, .js .sukuroru { opacity: 0; transition: opacity 1.2s ease; }
.js .fv.is-kaita .fv__kaisetsu, .js .fv.is-kaita .sukuroru { opacity: 1; }

/* 線画: 組ごとに 2 秒で線を引く。組は 0.2 秒ずつずらす（動きは .is-on が付いたときだけ） */
.js .sen path { stroke-dasharray: var(--L) var(--L); stroke-dashoffset: var(--L); }
.js .sen.is-on path { stroke-dashoffset: 0; transition: stroke-dashoffset 2s ease calc(var(--k) * .2s); }

/* 文: 下から浮かび上がる */
.js .fuwa { opacity: 0; transform: translateY(50px); }
.js .fuwa.is-on { opacity: 1; transform: none; transition: opacity 1.5s ease, transform 1.5s ease; }
.js .fuwa.is-on.osoku { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fuwa, .js .tegaki .ji-nuri, .js .fv__kaisetsu, .js .sukuroru { opacity: 1; transform: none; transition: none; }
  .js .tegaki .ji-sen, .js .sen path { stroke-dashoffset: 0; transition: none; }
  .sukuroru::after { animation: none; transform: none; }
}

/* ---------- タブレットまで（1100px 以下）: PC 用に決めた本文の改行を外して流す。題は決めた所で切る ---------- */
.made1100 { display: none; }
@media (max-width: 1100px) {
  .ba__honbun br.pc { display: none; }
  .made1100 { display: inline; }
}

/* ---------- スマホ ---------- */
.sp { display: none; }
@media (max-width: 768px) {
  body { font-size: 15px; }
  .pc { display: none; }
  .sp { display: inline; }
  .atama { padding: 20px 0 0 5%; }
  .rogo { gap: 9px; }
  .rogo__shirushi { width: 34px; height: 34px; }
  .rogo__en { font-size: 7.5px; }
  .rogo__ja { font-size: 15px; }
  .fv__midashi { top: 45%; width: 86vw; }
  .fv__kaisetsu { left: 5%; bottom: 26px; gap: 10px; font-size: 12px; }
  .fv__nen { font-size: 15px; }
  .sukuroru { left: auto; right: 6%; transform: none; padding-bottom: 64px; font-size: 10px; }
  .sukuroru::before, .sukuroru::after { height: 52px; }

  .ba { grid-template-columns: 1fr; width: 88%; min-height: 0; margin-top: 22vh; }
  .ba .ba__bun { order: 0; padding: 0; }
  .ba .ba__e { order: 1; margin-top: 8px; }
  .ba__no { margin-bottom: 14px; }
  .ba__kazu { font-size: 19px; }
  .ba__midashi { font-size: 24px; }
  .ba__honbun { margin-top: 1.4em; font-size: 15px; line-height: 2.1; }

  .gakubu { height: 100svh; min-height: 560px; margin-top: 18vh; }
  .gakubu__shashin { object-position: 74% 50%; }
  .gakubu::before {
    background: linear-gradient(0deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .8) 36%, rgba(255, 255, 255, 0) 62%);
  }
  .gakubu__bun { left: 6%; right: 6%; top: auto; bottom: 6%; transform: none; }
  .gakubu__daigaku { font-size: 14px; letter-spacing: .24em; }
  .gakubu__mei { margin-top: 4px; font-size: min(29px, 7.4vw); white-space: nowrap; }   /* 幅 360 でも「学部」を2行に割らない */
  .gakubu__kaisetsu { margin-top: 10px; font-size: 17px; }
  .gakubu__gakka { font-size: 12px; }
  .gakubu__douga { margin-top: 20px; gap: 12px; }
  .gakubu__maru { width: 54px; height: 54px; }

  .mokuji { padding: 76px 0 64px; }
  .mokuji::before { height: 62%; }
  .mokuji__midashi { font-size: 32px; }
  .mokuji__ko { margin-top: 10px; font-size: 13px; }
  .mokuji__ichiran { grid-template-columns: 1fr; gap: 12px; width: 88%; margin-top: 36px; }
  .mokuji__fuda {
    flex-direction: row; gap: 16px; padding: 12px 14px; text-align: left;
    border-radius: 16px; background: var(--shiro); box-shadow: 0 6px 18px rgba(40, 50, 100, .08);
  }
  .mokuji__e { flex: none; width: 72px; box-shadow: none; }
  .mokuji__fuda:hover .mokuji__e { box-shadow: 0 0 0 3px var(--momo); }
  .mokuji__fuda .mokuji__moji { align-items: flex-start; margin: 0; }
  .mokuji__kazu { margin-top: 0; font-size: 13px; }
  .mokuji__dai { margin-top: 0; font-size: 15px; line-height: 1.55; }
  .mokuji__yajirushi { margin: 0 0 0 auto; width: 28px; height: 28px; }

  .karikyuramu-waku { padding: 56px 0 80px; }
  .karikyuramu { grid-template-columns: 1fr; width: 88%; border-radius: 18px; }
  .karikyuramu__e { order: -1; aspect-ratio: 16 / 9; }
  .karikyuramu__e::before { background: linear-gradient(0deg, #f3e2e6 0%, rgba(243, 226, 230, 0) 30%); }
  .karikyuramu__bun { padding: 22px 22px 26px; }
  .karikyuramu__dai { font-size: 18px; }
  .karikyuramu__setsu { margin-top: 12px; font-size: 13px; }

  .ashi { padding: 48px 6% 56px; }
  .shirase { bottom: 20px; font-size: 12px; white-space: normal; width: max-content; max-width: 88vw; text-align: center; }
}
