/* ============================================================
   BLUE CHESTNUT GALLERY - style.css (motion edition)
   白ベース × 夜のインクブルー × キャラクター3色
   ============================================================ */

:root {
  --base: #FBFBF8;
  --ink: #1F2B5B;
  --chestnut: #7C4A32;
  --shirasu: #F08A3C;
  --clover: #3E8E5A;
  --cherry: #D9455F;
  --line: rgba(31, 43, 91, .14);
  --night: #141B3C;

  --font-en: "Bricolage Grotesque", "Zen Kaku Gothic New", sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .04em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.wrap { width: min(1160px, 92vw); margin-inline: auto; }
main { padding-top: 84px; }
.section { padding: clamp(72px, 10vw, 150px) 0; }

/* ---------------- ローディング演出 ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--night);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 22px;
  transition: clip-path 1s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.loader.done { clip-path: polygon(0 0, 100% 0, 100% -20%, 0 0); pointer-events: none; }
.loader-logo {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: .04em;
  color: #F3F2EC; display: flex; overflow: hidden;
}
.loader-logo span {
  display: inline-block; transform: translateY(110%);
  animation: riseUp .8s var(--ease) forwards;
}
.loader-logo .dot { color: var(--shirasu); }
.loader-chips { display: flex; gap: 12px; }
.loader-chips i {
  width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg);
  opacity: 0; animation: chipIn .6s var(--ease) forwards;
}
@keyframes chipIn { to { opacity: 1; } }
@keyframes riseUp { to { transform: translateY(0); } }

/* ---------------- ページ遷移オーバーレイ ---------------- */
.transition-veil {
  position: fixed; inset: 0; z-index: 999;
  background: var(--night); pointer-events: none;
  clip-path: polygon(0 100%, 100% 120%, 100% 100%, 0 100%);
  transition: clip-path .65s var(--ease);
}
body.leaving .transition-veil {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ---------------- カスタムカーソル ---------------- */
@media (pointer: fine) {
  .cursor {
    position: fixed; z-index: 998; left: 0; top: 0;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--ink); pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width .3s, height .3s, background .3s, opacity .3s;
    mix-blend-mode: multiply; opacity: .85;
  }
  .cursor.hover { width: 52px; height: 52px; background: var(--shirasu); opacity: .5; }
}
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------------- ヘッダー ---------------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(251,251,248,.82);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  animation: headerIn .8s var(--ease) 1.35s forwards;
}
@keyframes headerIn { to { transform: none; } }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-en); font-weight: 800; font-size: 17px; letter-spacing: .06em; }
.logo .dot { color: var(--shirasu); }
.gnav { display: flex; gap: clamp(16px, 3vw, 36px); align-items: center; }
.gnav a {
  font-family: var(--font-en); font-weight: 700; font-size: 12.5px;
  letter-spacing: .22em; position: relative; padding: 6px 0;
}
.gnav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.gnav a:hover::after, .gnav a.current::after { transform: scaleX(1); transform-origin: left; }
.gnav .x-link {
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 7px 18px; transition: background .3s, color .3s;
}
.gnav .x-link::after { display: none; }
.gnav .x-link:hover { background: var(--ink); color: var(--base); }

/* ---------------- 見出し共通 ---------------- */
.eyebrow {
  font-family: var(--font-en); font-weight: 700; font-size: 12px;
  letter-spacing: .34em; text-transform: uppercase; color: var(--chestnut);
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--chestnut); }
.section-title {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.05; letter-spacing: .01em; margin: 14px 0 10px;
}
.section-title .char { display: inline-block; }
.section-lead { max-width: 34em; color: rgba(31,43,91,.78); }

/* ---------------- ヒーロー ---------------- */
.hero {
  min-height: calc(100svh - 84px);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; padding: 40px 0 90px;
}
.hero-title {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(3.4rem, 12.5vw, 10.5rem);
  line-height: .96; letter-spacing: -.01em;
  position: relative; z-index: 2;
}
.hero-title .row { display: block; overflow: hidden; }
.hero-title .char {
  display: inline-block; transform: translateY(115%);
}
.hero-title .row:nth-child(2) { color: var(--chestnut); }
.hero-meta {
  margin-top: 34px; display: flex; flex-wrap: wrap;
  gap: 18px 40px; align-items: center; opacity: 0;
  position: relative; z-index: 2;
}
.hero-meta .id { font-family: var(--font-en); font-weight: 700; letter-spacing: .16em; font-size: 13px; }
.hero-chips { display: flex; gap: 10px; }
.hero-chips i { width: 14px; height: 14px; border-radius: 4px; display: block; transform: rotate(45deg); }

/* ヒーロー背景の浮遊シェイプ（パララックス対象） */
.hero-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero-shapes .sh {
  position: absolute; border-radius: 26%;
  transform: rotate(45deg); opacity: .16;
  animation: floaty 7s ease-in-out infinite;
}
.hero-shapes .sh1 { width: 130px; height: 130px; background: var(--shirasu); right: 12%; top: 16%; }
.hero-shapes .sh2 { width: 90px;  height: 90px;  background: var(--clover);  right: 28%; bottom: 22%; animation-delay: 1.2s; }
.hero-shapes .sh3 { width: 60px;  height: 60px;  background: var(--cherry);  right: 6%;  bottom: 34%; animation-delay: 2.4s; }
.hero-shapes .sh4 { width: 44px;  height: 44px;  background: var(--ink);     left: 4%;   bottom: 12%; animation-delay: .6s; opacity: .08; }
@keyframes floaty { 50% { translate: 0 -22px; } }

.hero-scroll {
  position: absolute; right: 0; bottom: 28px; z-index: 2;
  font-family: var(--font-en); font-size: 11px; letter-spacing: .3em;
  writing-mode: vertical-rl; color: rgba(31,43,91,.55);
  display: flex; align-items: center; gap: 10px;
}
.hero-scroll::after {
  content: ""; width: 1px; height: 56px; background: var(--ink);
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine { 0%{transform:scaleY(0);transform-origin:top} 45%{transform:scaleY(1);transform-origin:top} 55%{transform:scaleY(1);transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

/* ---------------- 無限マーキー ---------------- */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-block: 1px solid var(--line);
  padding: 18px 0; user-select: none;
}
.marquee-track { display: inline-flex; will-change: transform; }
.marquee-track span {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(1.4rem, 3.4vw, 2.4rem); letter-spacing: .06em;
  padding-right: 3.2rem; color: var(--ink);
}
.marquee-track span i {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 1.5px var(--chestnut);
}

/* ---------------- スクロール出現（フォールバック兼用） ---------------- */
.reveal { opacity: 0; transform: translateY(40px); }
.reveal.is-view {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.wipe { position: relative; display: inline-block; overflow: hidden; }
.wipe > .wipe-in {
  display: inline-block;
  clip-path: polygon(0 0, 0 0, -20% 100%, -20% 100%);
}
.wipe.is-view > .wipe-in {
  clip-path: polygon(0 0, 120% 0, 100% 100%, -20% 100%);
  transition: clip-path 1.1s var(--ease);
}

/* ---------------- ギャラリーグリッド ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(18px, 3vw, 34px);
  margin-top: clamp(36px, 5vw, 60px);
}
.card { position: relative; }
.card .thumb {
  position: relative; overflow: hidden; border-radius: 14px;
  aspect-ratio: 4 / 5; background: #EDEDE6; cursor: pointer;
}
.card .thumb img {
  width: 100%; height: 116%; object-fit: cover;   /* パララックス用に少し大きく */
  transition: scale .8s var(--ease);
  will-change: transform;
}
.card:hover .thumb img { scale: 1.06; }
.card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,27,60,.35), transparent 45%);
  opacity: 0; transition: opacity .5s;
}
.card:hover .thumb::after { opacity: 1; }
.card-info { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.card-chip { flex: none; width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); position: relative; top: -1px; }
.card-title { font-weight: 700; font-size: 14.5px; line-height: 1.5; }
.card-date { margin-left: auto; flex: none; font-family: var(--font-en); font-size: 11px; letter-spacing: .12em; color: rgba(31,43,91,.55); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.filters button {
  font-family: var(--font-jp); font-size: 13px; letter-spacing: .08em;
  padding: 8px 20px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  transition: border-color .3s, background .3s, color .3s;
}
.filters button:hover { border-color: var(--ink); }
.filters button.active { background: var(--ink); border-color: var(--ink); color: var(--base); }

/* ---------------- 動画 ---------------- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(22px, 3vw, 40px);
  margin-top: clamp(36px, 5vw, 60px);
}
.movie-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 8px; background: #fff; }
.movie-card video { width: 100%; border-radius: 10px; }
.movie-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }

/* ---------------- 21:30 ナイトセクション ---------------- */
.night {
  background: linear-gradient(160deg, var(--night), #1F2B5B 70%, #2A2450);
  color: #F3F2EC; border-radius: 26px;
  padding: clamp(48px, 7vw, 96px) clamp(26px, 6vw, 90px);
  position: relative; overflow: hidden;
}
.night .eyebrow { color: var(--shirasu); }
.night .eyebrow::before { background: var(--shirasu); }
.night-time {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 7rem); line-height: 1; letter-spacing: .02em;
  position: relative; z-index: 2;
}
.night p { max-width: 32em; color: rgba(243,242,236,.82); margin-top: 18px; position: relative; z-index: 2; }
.night .stars { position: absolute; inset: -20% 0; pointer-events: none; z-index: 1; }
.night .stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #fff; opacity: .5;
  animation: twinkle 3.4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .95; scale: 1.6; } }
.night .moon {
  position: absolute; right: clamp(20px, 8vw, 110px); top: -40px; z-index: 1;
  width: clamp(120px, 18vw, 220px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #FFF3DC, #F0C97F 58%, #C89A55);
  opacity: .9; box-shadow: 0 0 90px rgba(240,201,127,.45);
}

/* ---------------- キャラクター ---------------- */
.chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 34px); margin-top: clamp(36px, 5vw, 60px); }
.char-card { position: relative; }
.char-card .thumb { overflow: hidden; border-radius: 16px; aspect-ratio: 4/5; border-bottom: 4px solid var(--c, var(--ink)); }
.char-card .thumb img { width: 100%; height: 116%; object-fit: cover; transition: scale .8s var(--ease); will-change: transform; }
.char-card:hover .thumb img { scale: 1.05; }
.char-name { margin-top: 16px; display: flex; align-items: baseline; gap: 12px; font-weight: 700; font-size: 18px; }
.char-name .en { font-family: var(--font-en); font-weight: 800; font-size: 12px; letter-spacing: .28em; color: var(--c, var(--chestnut)); }
.char-desc { font-size: 13.5px; color: rgba(31,43,91,.78); margin-top: 6px; }

/* ---------------- リンク・ライトボックス・フッター ---------------- */
.more-link {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 44px;
  font-family: var(--font-en); font-weight: 700; letter-spacing: .2em; font-size: 13px;
  border-bottom: 2px solid var(--ink); padding-bottom: 6px; transition: gap .3s;
}
.more-link:hover { gap: 24px; }
.more-link::after { content: "→"; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,27,60,.9);
  display: none; align-items: center; justify-content: center;
  padding: 4vmin; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; animation: lbIn .5s var(--ease); }
@keyframes lbIn { from { opacity: 0; scale: .94; } }
.lightbox .lb-caption {
  position: absolute; left: 50%; bottom: 3vmin; transform: translateX(-50%);
  color: #fff; font-size: 13px; letter-spacing: .08em; text-align: center;
}

.footer { border-top: 1px solid var(--line); padding: 60px 0 40px; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer .logo { font-size: 20px; }
.footer small { font-family: var(--font-en); letter-spacing: .14em; font-size: 11px; color: rgba(31,43,91,.55); }

.page-head { padding: clamp(56px, 8vw, 110px) 0 0; }
.breadcrumb { font-family: var(--font-en); font-size: 11px; letter-spacing: .22em; color: rgba(31,43,91,.5); margin-bottom: 20px; }
.empty-note {
  margin-top: 50px; padding: 40px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 16px;
  color: rgba(31,43,91,.6); font-size: 14px;
}

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 760px) {
  .gnav { gap: 14px; }
  .gnav a { font-size: 11px; letter-spacing: .14em; }
  .gnav .x-link { padding: 6px 12px; }
  .chars { grid-template-columns: 1fr; }
  .hero-scroll { display: none; }
  .night .moon { top: auto; bottom: -30px; }
}

/* ---------------- モーション低減設定 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
  .loader { display: none; }
  .header { transform: none; animation: none; }
  .hero-title .char { transform: none !important; opacity: 1 !important; }
  .hero-meta { opacity: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .wipe > .wipe-in { clip-path: none; }
  .marquee-track { transform: none !important; }
}
