/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', 'Meiryo',
    -apple-system, BlinkMacSystemFont, sans-serif;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Header / Nav ===== */
/* ナビスタイルは /shared-nav.css に移動（HP・ビズ書庫で共有） */

/* ===== Page Hero ===== */
.page-hero {
  padding: 180px 24px 80px;
  min-height: 520px;
  text-align: center;
  background: url('https://contentsx.jp/material/images/bizmanga/output_05.webp') center top / cover no-repeat;
  background-color: #FFF9F4;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,249,244,0.72);
  z-index: 0;
}
.page-hero > * {
  position: relative;
  z-index: 1;
}
.page-hero-label {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  color: #EB5200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
}
.page-hero-title em {
  font-style: normal;
  color: #EB5200;
}
.page-hero-desc {
  font-size: 18px; color: #444;
  font-weight: 600;
  line-height: 2;
  max-width: 650px;
  margin: 0 auto;
}
/* 実績カウント */
.works-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 20px;
  background: #fff;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.works-count-num {
  font-size: 22px;
  font-weight: 900;
  color: #EB5200;
}

/* ===== Works Section ===== */
.works-section {
  padding: 48px 24px 80px;
  background: #fff;
}

/* Category Filter */
.works-filter {
  max-width: 1100px;
  margin: 0 auto 36px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 80px;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px 0;
}
/* === マンガ吹き出し風 フィルターボタン === */
.filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 24px;
  border: 2px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.16s ease,
              background 0.16s ease,
              color 0.16s ease;
  margin-bottom: 12px; /* 吹き出し尾の表示領域 */
}
/* 吹き出しの尾（外側=黒い縁） */
.filter-btn::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 26px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 12px 0 0;
  border-color: #1a1a1a transparent transparent transparent;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(2px 2px 0 transparent);
}
/* 吹き出しの尾（内側=本体色）*/
.filter-btn::before {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 28px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 9px 0 0;
  border-color: #fff transparent transparent transparent;
  z-index: 1;
  transition: border-color 0.16s ease;
}
.filter-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #1a1a1a;
  background: #fff9f4;
}
.filter-btn:hover::after {
  transform: translateY(2px) rotate(-3deg);
}
.filter-btn.active {
  background: #EB5200;
  color: #fff;
  transform: translate(0, 0);
  box-shadow: 4px 4px 0 #1a1a1a;
}
.filter-btn.active::after {
  border-color: #1a1a1a transparent transparent transparent;
  transform: translateY(0) rotate(0);
  animation: filterTailWag 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.filter-btn.active::before {
  border-color: #EB5200 transparent transparent transparent;
}
@keyframes filterTailWag {
  0%   { transform: translateY(-4px) rotate(8deg); }
  50%  { transform: translateY(2px) rotate(-4deg); }
  100% { transform: translateY(0) rotate(0); }
}
.filter-btn .filter-count {
  font-family: "Hiragino Sans", sans-serif;
  font-size: 11px;
  font-weight: 800;
  background: #1a1a1a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  min-width: 24px;
  text-align: center;
  transition: background 0.16s ease, color 0.16s ease;
}
.filter-btn.active .filter-count {
  background: #fff;
  color: #EB5200;
}
.filter-btn:hover .filter-count {
  background: #EB5200;
  color: #fff;
}
.filter-btn.active:hover .filter-count {
  background: #fff;
  color: #EB5200;
}

/* Works Grid */
.works-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.work-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s ease;
}
.work-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(235,82,0,0.1), 0 8px 24px rgba(0,0,0,0.08);
}
.work-card.filter-hidden,
.work-card.page-hidden {
  display: none;
}
.work-card-img-wrapper {
  position: relative;
  background: linear-gradient(160deg, #f5f0ea 0%, #ece4da 50%, #e8ddd2 100%);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3.5;
  overflow: hidden;
}
.work-card-img {
  width: 65%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s ease;
  position: relative;
  z-index: 1;
}
.work-card:hover .work-card-img {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.12);
}
/* Tall-page cover: crop to show top portion */
.work-card-img-wrapper.tall-cover {
  aspect-ratio: 4 / 3.5;
}
.work-card-img-wrapper.tall-cover .work-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
  box-shadow: none;
}
.work-card-img-wrapper.tall-cover::before,
.work-card-img-wrapper.tall-cover::after {
  display: none;
}
/* Card-stack decorative cards */
.work-card-img-wrapper::before,
.work-card-img-wrapper::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 74%;
  border-radius: 4px;
  z-index: 0;
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1), box-shadow 0.45s ease, opacity 0.45s ease;
  opacity: 0.7;
}
.work-card-img-wrapper::before {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: rotate(-5deg);
  top: 10%; left: 18%;
}
.work-card-img-wrapper::after {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: rotate(5deg);
  top: 10%; right: 18%;
}
/* Hover: stack fans out with color */
.work-card:hover .work-card-img-wrapper::before {
  transform: translateX(-20px) rotate(-14deg);
  background: linear-gradient(135deg, #ffe8d4, #ffd4b0);
  box-shadow: 0 8px 24px rgba(235,82,0,0.12);
  opacity: 1;
}
.work-card:hover .work-card-img-wrapper::after {
  transform: translateX(20px) rotate(14deg);
  background: linear-gradient(135deg, #ffeede, #ffe2c8);
  box-shadow: 0 8px 24px rgba(235,82,0,0.12);
  opacity: 1;
}
.work-card-page-count {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.9);
  color: #555;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.work-card-body {
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(0,0,0,0.04);
}
/* カテゴリバッジ：画像左上オーバーレイ */
.work-card-category {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 3;
  display: inline-block;
  font-size: 11px; font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(235,82,0,0.88);
  color: #fff;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.3s ease;
}
.work-card:hover .work-card-category {
  background: rgba(235,82,0,0.95);
}
.work-card-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  color: #222;
  margin-bottom: 8px;
}
.work-card-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.work-tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: #888;
}
.work-tag::before {
  content: '#';
  color: #bbb;
}
.work-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.work-card-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e8e2d8;
  color: #666;
  font-size: 16px;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  margin-left: auto;
}
.work-card:hover .work-card-arrow {
  background: #EB5200;
  color: #fff;
  transform: scale(1.1) translateX(2px);
}

/* ===== Manga Modal (Vertical Scroll & Spread Viewer) ===== */
.manga-modal {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  background: #2a1f16;
  overflow-y: auto;
}
.manga-modal.open { display: block; }
.manga-modal.mode-spread.open {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

/* Background image layer */
.manga-modal::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: url('https://contentsx.jp/material/images/backgrounds/manga_bg_06.webp') center center / cover no-repeat;
  filter: brightness(0.65) blur(2px);
}
/* Vignette + warm glow overlay */
.manga-modal::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,200,120,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at center, transparent 40%, rgba(15,10,5,0.3) 100%);
}

/* ===== Left Thumbnail Sidebar ===== */
.modal-thumb-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 100px;
  background: rgba(15,12,8,0.95);
  border-right: 1px solid rgba(255,200,120,0.06);
  z-index: 2150;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-thumb-sidebar::-webkit-scrollbar { width: 4px; }
.modal-thumb-sidebar::-webkit-scrollbar-track { background: transparent; }
.modal-thumb-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.modal-thumb-item {
  flex-shrink: 0;
  width: 84px; height: 112px;
  border-radius: 4px;
  object-fit: cover;
  border: 2px solid transparent;
  opacity: 0.35;
  cursor: pointer;
  transition: all 0.25s ease;
}
.modal-thumb-item:hover {
  opacity: 0.7;
  border-color: rgba(255,255,255,0.2);
}
.modal-thumb-item.active {
  border-color: #EB5200;
  opacity: 1;
  box-shadow: 0 0 12px rgba(238,107,29,0.4);
}

/* ===== Modal Header ===== */
.modal-header {
  position: fixed; top: 0; right: 0;
  z-index: 2100;
  padding: 14px 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.modal-header-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.modal-header-right {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
  justify-content: flex-end;
}
/* Vertical mode header */
.manga-modal.mode-vertical .modal-header {
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.4) 70%,
    transparent 100%);
}
/* Spread mode header */
.manga-modal.mode-spread .modal-header {
  background: linear-gradient(to bottom,
    rgba(26,18,12,0.95),
    rgba(34,24,16,0.88)
  );
  border-bottom: 1px solid rgba(255,200,120,0.1);
  position: relative;
  left: auto;
  right: auto;
  width: 100%;
}
.modal-header.hidden {
  opacity: 0; transform: translateY(-100%); pointer-events: none;
}
.modal-title {
  color: #fff; font-size: 15px; font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.manga-modal.mode-spread .modal-title {
  color: #ede0d0;
  text-shadow: none;
  letter-spacing: 0.02em;
}
.modal-page {
  color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,0.12);
  padding: 4px 12px; border-radius: 20px;
  white-space: nowrap;
}
.manga-modal.mode-spread .modal-page {
  color: rgba(237,224,208,0.8);
  background: rgba(255,200,120,0.1);
  border: 1px solid rgba(255,200,120,0.12);
}
/* ===== View Toggle Button (spread ⇔ vertical) ===== */
.view-toggle-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(200,16,100,0.15);
  border: 1.5px solid rgba(200,16,100,0.5);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 22px;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.view-toggle-btn:hover {
  background: rgba(200,16,100,0.35);
  border-color: rgba(200,16,100,0.7);
}
.view-toggle-icon { display: flex; align-items: center; line-height: 1; }
.manga-modal.mode-spread .view-toggle-btn {
  background: rgba(200,16,100,0.12);
  border-color: rgba(200,16,100,0.4);
  color: #f0dce6;
}
.manga-modal.mode-spread .view-toggle-btn:hover {
  background: rgba(200,16,100,0.3);
  border-color: rgba(200,16,100,0.6);
}
@media (max-width: 768px) {
  .view-toggle-btn { display: none !important; }
}
.modal-close {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(200,16,100,0.15);
  border: 1.5px solid rgba(200,16,100,0.5);
  color: #fff; font-size: 22px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all 0.2s;
}
.manga-modal.mode-spread .modal-close {
  background: rgba(200,16,100,0.12);
  border-color: rgba(200,16,100,0.4);
  color: #f0dce6;
}
.modal-close:hover {
  background: rgba(200,16,100,0.35);
  border-color: rgba(200,16,100,0.7);
}

/* ===== Manga Container ===== */
.modal-manga {
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 1;
  transition: max-width 0.4s ease;
}
.modal-manga.wide { max-width: 900px; }
.modal-manga img {
  width: 100%; display: block;
  margin: 0; padding: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: opacity;
  content-visibility: auto;
}
.modal-manga img.loaded { opacity: 1; }

/* ===== Zoom Controls ===== */
.modal-zoom-controls {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 2150;
  display: flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 10px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
}
.modal-zoom-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 18px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-zoom-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.modal-zoom-btn:disabled { opacity: 0.25; cursor: default; }
.modal-zoom-label {
  color: rgba(255,255,255,0.6);
  font-size: 12px; font-weight: 600;
  min-width: 40px; text-align: center;
}
.modal-zoom-btn.reset {
  font-size: 11px;
  width: auto;
  padding: 0 10px;
  border-radius: 14px;
}

/* ===== Progress Bar ===== */
.modal-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 2200;
  background: rgba(255,255,255,0.1);
}
.modal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #EB5200, #ff8a47);
  width: 0%; transition: width 0.15s ease-out;
  will-change: width;
}

/* ===== Side Page Indicator ===== */
.modal-side-indicator {
  position: fixed;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  z-index: 2150;
  display: flex; flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}
.modal-side-indicator.visible { opacity: 1; }
.modal-side-dot {
  width: 4px; height: 8px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  transition: all 0.2s;
  cursor: pointer;
}
.modal-side-dot.active {
  background: #EB5200;
  height: 14px;
}

/* ===== Back to Top Button ===== */
.modal-back-to-top {
  position: fixed;
  bottom: 24px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(238,107,29,0.9);
  border: none;
  color: #fff; font-size: 20px;
  cursor: pointer; z-index: 2150;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.modal-back-to-top.visible {
  opacity: 1; transform: scale(1); pointer-events: auto;
}
.modal-back-to-top:hover {
  background: #EB5200; transform: scale(1.1);
}

/* ===== Modal Footer ===== */
.modal-footer {
  text-align: center;
  padding: 40px 20px 60px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

/* ===== PC layout ===== */
@media (min-width: 769px) {
  .modal-thumb-sidebar { display: flex; }
  .modal-header { left: 100px; }
  .modal-progress { left: 100px; }
  .manga-modal { padding-left: 100px; }
  .modal-manga img {
    border-radius: 2px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  }
  .modal-side-indicator { right: 16px; }
  .modal-zoom-controls { left: calc(50% + 50px); }
}
/* ===== Mobile layout ===== */
@media (max-width: 768px) {
  .modal-thumb-sidebar { display: none !important; }
  .modal-header { left: 0; }
  .modal-progress { display: none !important; }
  .modal-side-indicator { display: none !important; }
  .manga-modal { padding-left: 0; }
  .modal-manga { max-width: 100%; padding: 0; }
  .modal-manga img {
    border-radius: 0;
    box-shadow: none;
  }
  .modal-zoom-controls { display: none !important; }
  .modal-back-to-top { bottom: 16px; right: 12px; width: 38px; height: 38px; font-size: 16px; }
}

/* ===== Book-Style Manga Modal ===== */
.manga-modal.mode-vertical::before {
  background: url('https://contentsx.jp/material/images/backgrounds/manga_bg_06.webp') center center / cover no-repeat;
  filter: brightness(0.65) blur(2px);
}
.manga-modal.mode-vertical::after {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,200,120,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at center, transparent 40%, rgba(15,10,5,0.3) 100%);
}
.manga-modal.mode-spread::before {
  background: url('https://contentsx.jp/material/images/backgrounds/bg_02.webp') center center / cover no-repeat;
  filter: brightness(0.85) blur(3px);
}
.manga-modal.mode-spread::after {
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.25) 100%);
}

/* Book display area */
.book-area {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
  user-select: none;
}

/* Click zones */
.click-zone {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 50;
  cursor: pointer;
}
.click-zone-left {
  left: 0; width: 50%;
}
.click-zone-right {
  right: 0; width: 50%;
}
.click-zone:hover {
  background: rgba(255,255,255,0.02);
}

/* Book container (the open book) */
.book {
  display: flex;
  flex-direction: row-reverse;
  position: relative;
  z-index: 10;
  max-width: 90vw;
  max-height: calc(100vh - 160px);
  perspective: 2500px;
  overflow: visible;
  border-radius: 4px;
  box-shadow:
    3px 1px 0 0 #e8e0d4,
    5px 2px 0 0 #e0d8cc,
    7px 3px 0 0 #d8d0c4,
    9px 4px 0 0 #d0c8bc,
    10px 5px 0 0 #c8c0b4,
    -3px 1px 0 0 #e8e0d4,
    -5px 2px 0 0 #e0d8cc,
    -7px 3px 0 0 #d8d0c4,
    -9px 4px 0 0 #d0c8bc,
    -10px 5px 0 0 #c8c0b4,
    1px 3px 0 0 #e8e0d4,
    2px 5px 0 0 #e0d8cc,
    3px 7px 0 0 #d8d0c4,
    4px 9px 0 0 #d0c8bc,
    5px 10px 0 0 #c8c0b4,
    12px 14px 20px rgba(0,0,0,0.4),
    0 0 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.05);
}

/* Individual page panel */
.book-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f4ef;
  overflow: hidden;
}
.book-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  will-change: contents;
  position: relative;
  z-index: 1;
}

/* Right page */
.book-page-right {
  border-radius: 0 4px 4px 0;
}
.book-page-right::after {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(270deg, transparent, rgba(0,0,0,0.08));
  pointer-events: none;
  z-index: 5;
}

/* Left page */
.book-page-left {
  border-radius: 4px 0 0 4px;
}
.book-page-left::before {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08));
  pointer-events: none;
  z-index: 5;
}

/* Center spine line */
.book-spine {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  z-index: 20;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0,0,0,0.3) 35%,
    rgba(0,0,0,0.5) 50%,
    rgba(0,0,0,0.3) 65%,
    transparent 100%
  );
  pointer-events: none;
}

/* Page hover effect */
.book-page {
  cursor: pointer;
  transition: filter 0.2s;
}
.book-page:hover { filter: brightness(1.02); }

/* Single page (cover or last odd page) */
.book.single-page {
  justify-content: center;
}
.book.single-page .book-page {
  border-radius: 2px;
}
.book.single-page .book-spine {
  display: none;
}

/* Empty page style */
.book-page.empty {
  background: #e8e8e8;
}

/* Paper texture overlay */
.paper-texture {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 150px;
}

/* Page Flip Animation */
.flip-overlay {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 25;
  display: none;
  will-change: transform;
}
.flip-overlay.active { display: block; }

.flip-overlay.flip-next {
  right: 0; left: auto;
  transform-origin: left center;
}
.flip-overlay.flip-prev {
  left: 0; right: auto;
  transform-origin: right center;
}

.flip-face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: #f8f4ef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flip-face img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}
.flip-front { z-index: 2; }
.flip-back {
  transform: rotateY(180deg);
  z-index: 1;
}

/* Shadow cast on book during flip */
.page-shadow {
  position: absolute;
  top: 0; width: 80px; height: 100%;
  pointer-events: none;
  z-index: 22;
  opacity: 0;
  transition: opacity 0.15s;
}
.page-shadow.active { opacity: 1; }
.page-shadow-left {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.25), transparent);
}
.page-shadow-right {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.25), transparent);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: relative;
  z-index: 2100;
  background: linear-gradient(to bottom,
    rgba(34,24,16,0.88),
    rgba(26,18,12,0.95)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,200,120,0.1);
  padding: 12px 20px 14px;
  display: none;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.manga-modal.mode-spread .bottom-nav { display: flex; }

.nav-btn {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,200,120,0.08);
  border: 1px solid rgba(255,200,120,0.12);
  color: #ede0d0;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.nav-btn:hover {
  background: rgba(238,107,29,0.2);
  border-color: rgba(238,107,29,0.3);
}
.nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Scrubber / slider */
.nav-scrubber-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
  direction: rtl;
}
.nav-scrubber::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
  border-radius: 3px;
}
.nav-scrubber::-moz-range-track {
  background: transparent;
  height: 6px;
  border-radius: 3px;
}
.nav-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #EB5200;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin-top: -6px;
}
.nav-scrubber::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #EB5200;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Thumbnail strip */
.nav-thumbnails {
  display: flex;
  flex-direction: row-reverse;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}
.nav-thumbnails::-webkit-scrollbar { display: none; }
.nav-thumb {
  width: 36px; height: 50px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all 0.15s;
}
.nav-thumb:hover {
  opacity: 0.8;
}
.nav-thumb.active {
  border-color: #EB5200;
  opacity: 1;
}
.nav-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.nav-page-info {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
  flex-shrink: 0;
}

/* Page turn hint (縦書き) */
.page-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  color: rgba(237,224,208,0.85);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 30;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.page-hint-left { left: 40px; }
.page-hint-right { right: 40px; }

/* Mobile View (1-page) */
.mobile-view {
  display: none;
  position: relative;
  width: 100%; height: 100%;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center,
      transparent 30%,
      rgba(15,10,6,0.5) 100%
    ),
    url('https://contentsx.jp/material/images/backgrounds/bg_02.webp') center center / cover no-repeat;
  filter: none;
}

.mobile-page-container {
  position: relative;
  max-width: 100vw; max-height: 100vh;
  width: auto; height: auto;
}

.mobile-current-page {
  max-width: 100vw; max-height: calc(100vh - 120px);
  width: auto; height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.mobile-flip-overlay {
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 10;
  display: none;
  will-change: transform;
}
.mobile-flip-overlay.active { display: block; }

.mobile-flip-front, .mobile-flip-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.mobile-flip-front { z-index: 2; }
.mobile-flip-back {
  transform: rotateY(180deg);
  z-index: 1;
}
.mobile-flip-front img, .mobile-flip-back img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.mobile-flip-shadow {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.1s;
}
.mobile-flip-shadow.active { opacity: 1; }

/* Tap areas for mobile */
.tap-area {
  position: absolute;
  top: 0; height: 100%;
  z-index: 10;
  cursor: pointer;
}
.tap-left { left: 0; width: 40%; }
.tap-right { right: 0; width: 40%; }

/* ===== PC / Mobile view switching ===== */
@media (min-width: 769px) {
  .manga-modal.mode-spread .mobile-view { display: none !important; }
  .manga-modal.mode-spread .book-area { display: flex; }
}
@media (max-width: 768px) {
  .manga-modal.mode-spread.open .mobile-view { display: flex; }
  .manga-modal.mode-spread .book-area { display: none !important; }
  .manga-modal.mode-spread .page-hint { display: none !important; }
  .bottom-nav { padding: 10px 12px; gap: 8px; }
  .nav-btn { width: 34px; height: 34px; font-size: 15px; }
  .nav-thumbnails { display: none; }
}

/* ===== 最終ページCTA（クライアント公式サイトへの送客） ===== */
.bm-manga-cta {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 30px);
  z-index: 2200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bm-manga-cta.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
/* 縦スクロール時はbottom-navが無いので位置を下げる */
.manga-modal.mode-vertical .bm-manga-cta { bottom: 28px; }

.bm-manga-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-width: 240px;
  height: 56px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--bm-accent, #EB5200);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(235, 82, 0, 0.45),
              0 4px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.bm-manga-cta-btn:hover {
  background: var(--bm-accent-hover, #C44400);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(235, 82, 0, 0.55),
              0 6px 14px rgba(0, 0, 0, 0.22);
}
.bm-manga-cta-btn:active { transform: translateY(-1px); }

/* ホバーで「テキスト→Let's go !!」が下からスライドアップ（bm-sticky-cta-btnと同パターン） */
.bm-manga-cta-btn .bm-btn-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bm-manga-cta-btn .bm-btn-text,
.bm-manga-cta-btn .bm-btn-icon {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
  color: #fff;
}
.bm-manga-cta-btn .bm-btn-text { top: 0; }
.bm-manga-cta-btn .bm-btn-icon {
  top: 100%;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.bm-manga-cta-btn:hover .bm-btn-text { top: -100%; }
.bm-manga-cta-btn:hover .bm-btn-icon { top: 0; }

/* グロー演出（ホバー時に淡く広がる） */
.bm-manga-cta-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 180, 100, 0.45) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}
.bm-manga-cta-btn:hover::after { opacity: 1; }

/* スマホ最適化 */
@media (max-width: 768px) {
  .bm-manga-cta { bottom: 20px; width: calc(100% - 32px); max-width: 360px; }
  .bm-manga-cta-btn {
    width: 100%;
    height: 52px;
    font-size: 15px;
    min-width: 0;
  }
  .manga-modal.mode-spread .bm-manga-cta { bottom: 88px; }
  .manga-modal.mode-vertical .bm-manga-cta { bottom: 20px; }
}

/* QRモード（外部直アクセス）でも常に表示可能 */
.qr-mode .bm-manga-cta { z-index: 9999; }

/* ===== Card Grid Pagination Bar ===== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
}
.pg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: #f5f0eb;
  border: 1px solid #e0d6cc;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pg-btn:first-child {
  border-radius: 6px 0 0 6px;
}
.pg-btn:last-child {
  border-radius: 0 6px 6px 0;
}
.pg-btn:hover {
  background: #ebe4db;
  color: #333;
}
.pg-btn.active {
  background: #EB5200;
  border-color: #EB5200;
  color: #fff;
  font-weight: 800;
}
.pg-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}
.pg-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  background: #f5f0eb;
  border: 1px solid #e0d6cc;
  color: #aaa;
  font-size: 13px;
  cursor: default;
}

@media (max-width: 768px) {
  .pg-btn { min-width: 34px; height: 34px; font-size: 12px; padding: 0 8px; }
  .pg-ellipsis { min-width: 34px; height: 34px; }
}

/* ===== Footer ===== */
.footer {
  background: #222;
  color: #aaa;
  padding: 40px 24px;
  text-align: center;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo {
  display: inline-block;
  text-decoration: none;
  flex-shrink: 0;
}
.footer-logo-img {
  height: 48px;
  min-width: 170px;
  width: auto;
  display: block;
  filter: brightness(10);
}
.footer-links {
  display: flex; gap: 24px;
  list-style: none;
}
.footer-links a {
  color: #aaa; text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-company {
  width: 100%;
  margin-top: 16px;
  font-size: 12px;
  color: #888;
}
.footer-copy {
  width: 100%;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  color: #666;
}

/* ===== No Results ===== */
.no-results {
  text-align: center;
  padding: 60px 24px;
  color: #999;
  font-size: 15px;
  display: none;
}
.no-results.visible { display: block; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: #fff;
    padding: 16px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    gap: 0;
  }
  .nav-links.open li { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
  .nav-links.open li:last-child { border-bottom: none; padding-top: 16px; }
  .nav-links.open .nav-dropdown .dropdown-menu {
    display: block;
    position: static;
    transform: none;
    box-shadow: none;
    opacity: 1;
    padding: 4px 0 0 16px;
    min-width: auto;
    border-radius: 0;
  }
  .nav-links.open .dropdown-menu::before,
  .nav-links.open .dropdown-menu::after { display: none; }
  .nav-links.open .dropdown-menu li a { padding: 8px 0; font-size: 12px; }
  .hamburger { display: flex; }
  .header-inner { height: 56px; }
  .page-hero { padding: 100px 16px 40px; min-height: 320px; background-position: right 0% top -40%; }
  .page-hero-desc { font-size: 14px; line-height: 1.7; }
  .works-section { padding: 28px 12px 48px; }
  .works-filter {
    top: 56px;
    gap: 6px;
    padding: 10px 4px;
  }
  .filter-btn { padding: 8px 14px; font-size: 12.5px; box-shadow: 2px 2px 0 #1a1a1a; margin-bottom: 10px; }
  .filter-btn::after { left: 18px; border-width: 7px 9px 0 0; bottom: -7px; }
  .filter-btn::before { left: 20px; border-width: 5px 6px 0 0; bottom: -5px; }
  .filter-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1a1a1a; }
  .filter-btn .filter-count { padding: 1px 6px; font-size: 10px; min-width: 20px; }
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .work-card { border-radius: 10px; }
  .work-card-img-wrapper { padding: 10px; aspect-ratio: 4 / 3.5; }
  .work-card-img { width: 65%; }
  .work-card-img-wrapper::before,
  .work-card-img-wrapper::after { width: 45%; height: 68%; }
  .work-card-category { font-size: 10px; padding: 3px 8px; top: 7px; left: 7px; }
  .work-card-page-count { font-size: 10px; padding: 3px 7px; top: 7px; right: 7px; }
  .work-card-body { padding: 8px 10px 10px; border-top: none; }
  .work-card-title { font-size: 12px; margin-bottom: 4px; line-height: 1.4; }
  .work-card-arrow { width: 28px; height: 28px; font-size: 13px; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; gap: 16px; }
  .footer-links a { font-size: 12px; }
  .footer { padding: 30px 16px; }
}
@media (max-width: 480px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .work-card-img { width: 65%; }
  .work-card-img-wrapper { aspect-ratio: 4 / 3.5; padding: 20px; }
  .work-card-body { padding: 16px 18px 18px; }
  .work-card-title { font-size: 15px; }
}

/* ===== Pre-production Carousel (赤ペン・ネーム) ===== */
.pre-section {
  padding: 48px 24px 60px;
  background: #f4f4f4;
  color: #333;
}
.pre-section-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.pre-section-title em {
  color: #EB5200;
  font-style: normal;
}
.pre-section-subtitle {
  text-align: center;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 32px;
}
.pre-carousel-wrap {
  margin: 0 auto 40px;
  max-width: 1200px;
}
.pre-carousel-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid #EB5200;
  color: #333;
}
.pre-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}
.pre-carousel-track {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}
.pre-carousel-track::-webkit-scrollbar {
  display: none;
}
.pre-carousel-slide {
  width: 33.333% !important;
  min-width: 33.333% !important;
  max-width: 33.333% !important;
  flex: 0 0 33.333% !important;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.3s;
  box-sizing: border-box;
  scroll-snap-align: start;
}
.pre-carousel-slide:hover {
  transform: scale(1.03);
}
.pre-slide-img-wrap {
  overflow: hidden;
  border-radius: 6px;
  background: #e8e8e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  height: 500px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.pre-slide-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.pre-carousel-slide .pre-slide-title {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pre-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(238,107,29,0.85);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pre-carousel-btn:hover {
  background: rgba(238,107,29,1);
}
.pre-carousel-btn.prev { left: 4px; }
.pre-carousel-btn.next { right: 4px; }
.pre-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}
.pre-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.pre-carousel-dot.active {
  background: #EB5200;
}

@media (max-width: 768px) {
  .pre-carousel-slide {
    width: 80% !important;
    min-width: 80% !important;
    max-width: 80% !important;
    flex: 0 0 80% !important;
  }
  .pre-section { padding: 32px 16px 40px; }
  .pre-section-title { font-size: 20px; }
  .pre-carousel-wrap { max-width: 95%; }
  .pre-slide-img-wrap { height: 500px; }
}

/* ===== Direct Mode (QR code flicker prevention) ===== */
html.direct-mode .header,
html.direct-mode .page-hero,
html.direct-mode .works-section,
html.direct-mode .pre-section,
html.direct-mode .footer { display: none !important; }
html.direct-mode body { background: #1a1a1a; overflow: hidden; }
/* QR経由(外部リファラー)のときだけ閉じるボタンを非表示にして書庫へ戻らせない */
html.qr-mode .modal-close { display: none !important; }

/* ===== Manga Page Loader ===== */
/* 見開き: スピナー要素が背景カバー + スピナー表示を兼ねる */
.book-page .bm-page-spinner {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f4ef;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.book-page.img-loaded .bm-page-spinner {
  opacity: 0;
  pointer-events: none;
}
/* スピナー内にインナー要素を使う */
.bm-page-spinner-inner {
  transform: rotateZ(45deg);
  perspective: 1000px;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  font-size: 80px;
  color: #bbb;
  position: relative;
}
.bm-page-spinner-inner::before,
.bm-page-spinner-inner::after {
  content: '';
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: inherit; height: inherit;
  border-radius: 50%;
  transform: rotateX(70deg);
  animation: bmLoaderSpin 1s linear infinite;
}
.bm-page-spinner-inner::after {
  color: #EB5200;
  transform: rotateY(70deg);
  animation-delay: 0.4s;
}

/* モバイルビューア */
.mobile-page-container .bm-page-spinner {
  position: absolute;
  inset: 0;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 244, 239, 0.9);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.mobile-page-container.img-loaded .bm-page-spinner {
  opacity: 0;
  pointer-events: none;
}

@keyframes bmLoaderSpin {
  0%, 100% { box-shadow: .2em 0 0 0 currentcolor; }
  12% { box-shadow: .2em .2em 0 0 currentcolor; }
  25% { box-shadow: 0 .2em 0 0 currentcolor; }
  37% { box-shadow: -.2em .2em 0 0 currentcolor; }
  50% { box-shadow: -.2em 0 0 0 currentcolor; }
  62% { box-shadow: -.2em -.2em 0 0 currentcolor; }
  75% { box-shadow: 0 -.2em 0 0 currentcolor; }
  87% { box-shadow: .2em -.2em 0 0 currentcolor; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-page-spinner-inner::before,
  .bm-page-spinner-inner::after { animation: none !important; box-shadow: .2em 0 0 0 currentcolor !important; }
}
