/* unifabula 共通スタイル：紙の白・墨の黒・マンガのコマ枠。差し色の紫は少しだけ */
/* 見出し：源暎アンチック（SIL OFL。build.py が見出しの文字だけを切り出す） */
@font-face {
  font-family: "GenEi Head";
  src: url("/assets/fonts/genei-head.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --paper: #FBFAF7;
  --white: #FFFFFF;
  --ink: #121318;
  --ink-soft: #50525B;
  --rule: #D8D5CC;
  --uni: #5A46A8;
  --uni-pale: #EFECF8;
  --frame: 3px solid var(--ink);
  --wrap: 1120px;
  --head: "GenEi Head", "Zen Kaku Gothic New", "Hiragino Sans", "Meiryo", sans-serif;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.9;
}
h1, h2, h3, .brand .section-name, .placeholder strong { font-family: var(--head); font-weight: 400; letter-spacing: 0.02em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--uni); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* PR 表記 */
.pr-note { background: var(--ink); color: #C9CAD1; font-size: 12px; text-align: center; padding: 5px 16px; line-height: 1.6; }
.pr-note a { color: #fff; }

/* ヘッダー */
.site-header { background: var(--paper); border-bottom: var(--frame); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 28px; width: auto; }
.brand .section-name { font-size: 15px; white-space: nowrap; padding-left: 12px; border-left: 2px solid var(--ink); line-height: 1.2; }
.site-nav { display: flex; gap: 22px; font-size: 14px; font-weight: 700; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; color: var(--ink); }

/* ヒーロー */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.3; margin: 0 0 22px; }
.hero h1 .accent { color: var(--uni); }
.hero p.lead { font-size: 16.5px; color: var(--ink-soft); margin: 0 0 32px; }
.hero-visual { aspect-ratio: 4 / 3; }

/* コマ枠 */
.panel { border: var(--frame); background: var(--white); }
.placeholder {
  border: var(--frame); background: var(--white);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, #F1EFEA 14px 15px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--ink-soft); font-size: 13px; line-height: 1.6; padding: 16px; gap: 8px;
}
.placeholder img { width: 56px; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; text-decoration: none;
  font-weight: 700; padding: 14px 26px; border: 2px solid var(--ink); border-radius: 0;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--white); color: var(--ink); }

/* セクション */
section.block { padding: 64px 0; border-bottom: 1px solid var(--rule); }
section.block:last-of-type { border-bottom: 0; }
.block-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; padding-bottom: 12px; border-bottom: var(--frame); }
.block-head h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0; line-height: 1.3; }
.block-head .note { color: var(--ink-soft); font-size: 14px; margin-left: auto; }

/* ストーリーの並び（コマ枠のサムネイル＋文字） */
.story-list { display: grid; gap: 0; }
.story {
  display: grid; grid-template-columns: 240px 1fr auto; gap: 28px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink);
}
.story:first-child { padding-top: 4px; }
.story .thumb { aspect-ratio: 3 / 2; border: var(--frame); background: var(--uni-pale); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story .thumb .icon { width: 44px; height: 44px; color: var(--uni); stroke-width: 1.6; }
.story h3 { margin: 0 0 6px; font-size: 24px; line-height: 1.35; }
.story p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.story .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; }
a.story:hover h3 { color: var(--uni); }
a.story:hover .go { text-decoration: underline; }
.story-more { margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }

/* unifabula について */
.about { display: grid; grid-template-columns: 1fr 1.5fr; gap: 56px; }
.about .intro { margin: 0; font-size: 16px; }
.principles { margin: 0; border-top: var(--frame); }
.principles div { display: grid; grid-template-columns: 9em 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.principles dt { font-family: var(--head); font-size: 18px; line-height: 1.5; }
.principles dd { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* キャラクター */
.chars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; max-width: 820px; }
.char .portrait { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: var(--frame); background: var(--white); }
.char .portrait.mascot { display: flex; align-items: center; justify-content: center; background: var(--uni-pale); }
.char .portrait.mascot img { width: 46%; }
.char .body { padding: 14px 0 0; }
.char .role { font-size: 12.5px; font-weight: 700; color: var(--uni); }
.char h3 { margin: 0; font-size: 24px; line-height: 1.4; }
.char p { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); }

.empty { border: 2px dashed var(--rule); padding: 32px; text-align: center; color: var(--ink-soft); }

/* 本文ページ */
.page { padding: 48px 0 72px; }
.page .wrap { max-width: 780px; }
.page h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 28px; padding-bottom: 14px; border-bottom: var(--frame); }
.page h2 { font-size: 21px; margin: 40px 0 10px; line-height: 1.5; }
.page h2::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--uni); margin-right: 10px; vertical-align: 0.15em; }
.page p, .page li { font-size: 16px; }
.page table { width: 100%; border-collapse: collapse; border-top: var(--frame); }
.page th, .page td { text-align: left; padding: 12px 4px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.page th { width: 30%; font-weight: 700; }
.page .updated { color: var(--ink-soft); font-size: 14px; margin-top: 44px; }

/* お問い合わせフォーム */
.contact-form { display: grid; gap: 20px; margin-top: 28px; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--white); border: 2px solid var(--ink);
  border-radius: 0; padding: 10px 12px; width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 3px solid var(--uni-pale); outline-offset: 0; border-color: var(--uni); }
.contact-form .btn { justify-self: start; cursor: pointer; font: inherit; font-weight: 700; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { border: 2px solid #B3261E; color: #B3261E; padding: 12px 16px; font-weight: 700; }

/* アイコン（Lucide） */
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.15em; }

/* フッター */
.site-footer { background: var(--ink); color: #C9CAD1; padding: 44px 0 28px; margin-top: 0; font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer img { height: 28px; width: auto; margin-bottom: 10px; }
.site-footer .tagline { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #E4E5EA; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .copy { width: 100%; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 18px; color: #8E909B; font-size: 12.5px; }

@media (max-width: 760px) {
  .hero { padding: 36px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  section.block { padding: 44px 0; }
  .block-head { flex-wrap: wrap; gap: 4px 16px; }
  .block-head .note { margin-left: 0; width: 100%; }
  .story { grid-template-columns: 1fr; gap: 14px; }
  .story .go { justify-self: start; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .principles div { grid-template-columns: 1fr; gap: 4px; }
  .chars { grid-template-columns: 1fr; gap: 32px; }
  .site-nav { gap: 14px; font-size: 13px; }
  .site-nav .hide-sp { display: none; }
  .brand img { height: 22px; }
  .brand .section-name { font-size: 13px; padding-left: 8px; }
  .page th { width: 36%; }
}

/* マンガのページ */
.episode { padding: 40px 0 72px; }
.episode .wrap { max-width: 760px; }
.episode-head { border-bottom: var(--frame); padding-bottom: 14px; margin-bottom: 28px; }
.episode-no { margin: 0; font-size: 13px; font-weight: 700; color: var(--uni); }
.episode-head h1 { margin: 2px 0 0; font-size: clamp(26px, 4.4vw, 38px); line-height: 1.35; }
.manga { margin: 0; }
.manga img { width: 100%; height: auto; background: #fff; }
.hitokoto { display: grid; grid-template-columns: 112px 1fr; gap: 22px; align-items: start; margin: 48px 0 0; }
.hitokoto .face { width: 112px; height: 112px; object-fit: cover; border: var(--frame); background: #fff; }
.hitokoto .balloon { position: relative; background: #fff; border: var(--frame); padding: 18px 22px; }
.hitokoto .balloon::before { content: ""; position: absolute; left: -16px; top: 34px; border: 8px solid transparent; border-right: 14px solid var(--ink); border-left: 0; }
.hitokoto .balloon::after { content: ""; position: absolute; left: -10px; top: 37px; border: 5px solid transparent; border-right: 10px solid #fff; border-left: 0; }
.hitokoto h2 { margin: 0 0 8px; font-size: 20px; }
.hitokoto ul { margin: 0; padding-left: 1.2em; }
.hitokoto li { margin: 6px 0; font-size: 15.5px; }
.hitokoto li strong { font-weight: 700; }
.episode-nav { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); }
.episode-nav a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.episode-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.episode-nav a.prev .icon { transform: rotate(180deg); }
.episode-nav a.next { margin-left: auto; }
.hitokoto li a { color: var(--uni); }
.story .thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  .hitokoto { grid-template-columns: 1fr; gap: 14px; }
  .hitokoto .face { width: 80px; height: 80px; }
  .hitokoto .balloon::before, .hitokoto .balloon::after { display: none; }
}

/* メインのイラスト・動画 */
.hero-visual.panel { overflow: hidden; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual.wide { aspect-ratio: 16 / 9; }
.video-episode { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-text h3 { margin: 0 0 10px; font-size: 26px; line-height: 1.35; }
.video-text p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }
.video-text .episode-no { color: var(--uni); font-weight: 700; font-size: 13px; margin: 0; }
.video-text .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; text-decoration: none; }
.video-text .go:hover { text-decoration: underline; }
@media (max-width: 760px) { .video-episode { grid-template-columns: 1fr; gap: 18px; } }

/* スマホのヘッダー：ナビはロゴの下の段に */
.site-nav a { white-space: nowrap; }
@media (max-width: 760px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; row-gap: 4px; padding-top: 10px; padding-bottom: 8px; }
  .brand { width: 100%; }
  .site-nav { width: 100%; gap: 18px; }
}

/* メインビジュアルにキャッチコピーを重ねる（マンガのナレーションの囲み） */
.hero-overlap { padding: 56px 0 64px; }
.hero-overlap .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0; align-items: center; }
.hero-overlap .hero-visual { grid-column: 5 / 13; grid-row: 1; }
.hero-overlap .hero-copy {
  grid-column: 1 / 6; grid-row: 1; position: relative; z-index: 2;
  background: var(--white); border: var(--frame); box-shadow: 10px 10px 0 var(--ink);
  padding: 36px 36px 34px;
}
.hero-overlap h1 { font-size: clamp(28px, 3.8vw, 46px); margin: 0 0 18px; }
.hero-overlap p.lead { font-size: 15.5px; margin: 0 0 26px; }
@media (max-width: 760px) {
  .hero-overlap { padding: 20px 0 40px; }
  .hero-overlap .wrap { grid-template-columns: 1fr; }
  .hero-overlap .hero-visual { grid-column: 1; grid-row: 1; }
  .hero-overlap .hero-copy { grid-column: 1; grid-row: 2; margin: -22px 12px 0 8px; padding: 24px 22px 24px; box-shadow: 7px 7px 0 var(--ink); }
}
