/* 案C「白い檻」— 白い紙に黒い格子。言葉は檻の中に閉じこめられ、表紙だけが格子を押し広げて外へ出る */

/* ページ間の遷移: 12本の格子の隙間が開くように、次のページが縦の帯で現れる。表紙は形をつないで移る */
@property --slat { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-group(*) { animation-duration: .75s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
::view-transition-old(root) { animation: c-dim .85s ease both; }
::view-transition-new(root) {
  -webkit-mask-image: linear-gradient(90deg, #000 var(--slat), transparent var(--slat)); mask-image: linear-gradient(90deg, #000 var(--slat), transparent var(--slat));
  -webkit-mask-size: calc(100% / 12) 100%; mask-size: calc(100% / 12) 100%;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  animation: c-slats .85s cubic-bezier(.7, 0, .2, 1) both;
}
@keyframes c-slats { from { --slat: 0%; } to { --slat: 100%; } }
@keyframes c-dim { to { opacity: .35; } }
/* 一覧の表示切替（同じページ内）は帯の演出をせず、作品だけが位置を移る */
html.vt-archive::view-transition-old(root), html.vt-archive::view-transition-new(root) { animation: none; -webkit-mask: none; mask: none; }
html.vt-archive::view-transition-group(*) { animation-duration: .62s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

:root {
  --paper: #F3F2EE;        /* 紙（白すぎない白） */
  --white: #FFFFFF;
  --ink: #0B0B0C;          /* 格子・文字 */
  --ink-2: #5A5853;        /* 補助の文字（紙の上で 6.6:1） */
  --hair: rgb(11 11 12 / .09);
  --red: #D4002A;          /* 唯一の差し色（印・×・現在地） */
  --gutter: clamp(16px, 3vw, 44px);
  --ff: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  --ff-num: "Antonio", "Zen Kaku Gothic New", sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 15px/1.85 var(--ff); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 80; padding: 12px 16px; background: var(--ink); color: var(--white); }
.skip:focus { top: 8px; }
.x { color: var(--red); }

/* 檻の格子: 12本の細い縦線がページ全体を貫く。中身はこの線に揃う */
body::before { content: ""; position: fixed; inset: 0 var(--gutter); z-index: 0; pointer-events: none; border-right: 1px solid var(--hair); background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px calc(100% / 12)); }
.hd, main, .site-foot { position: relative; z-index: 1; }

.lbl { margin: 0; font: 500 11px/1.2 var(--ff-num); letter-spacing: .28em; text-transform: uppercase; }
.num { font-family: var(--ff-num); font-weight: 500; letter-spacing: .04em; }

/* ── ヘッダー: 細い罫で区切った帯 ── */
.hd { position: fixed; z-index: 50; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; height: 60px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink); }
.hd-logo { display: inline-flex; align-items: baseline; gap: 10px; min-height: 44px; padding-top: 12px; font: 900 19px/1 var(--ff); letter-spacing: .14em; }
.hd-logo small { font: 500 11px/1 var(--ff-num); letter-spacing: .34em; color: var(--ink-2); }
.hd-nav { display: flex; }
.hd-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font: 700 13px/1 var(--ff); letter-spacing: .14em; transition: color .2s; }
.hd-nav a span { font: 500 10px/1 var(--ff-num); letter-spacing: .26em; color: var(--ink-2); }
.hd-nav a:hover { color: var(--red); }

/* ── ボタン: 触れると、6本の格子の隙間が赤で埋まる ── */
.btn { --slat: 0%; position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 52px; padding: 0 20px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--white); font: 700 14px/1 var(--ff); letter-spacing: .12em; transition: color .3s; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--red) var(--slat), transparent var(--slat)) 0 0 / calc(100% / 6) 100% repeat-x; transition: --slat .5s var(--ease-out); --slat: 0%; }
.btn:hover::before, .btn:focus-visible::before { --slat: 100%; }
.btn .arr { font-family: var(--ff-num); transition: translate .3s var(--ease-out); }
.btn:hover .arr { translate: 4px 0; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line::before { background-image: linear-gradient(90deg, var(--ink) var(--slat), transparent var(--slat)); }
.btn-line:hover, .btn-line:focus-visible { color: var(--white); }
/* Amazon のページがまだ無い作品: 押せない札。破線で「まだ」を示す */
.btn-wait { justify-content: center; background: transparent; color: var(--ink-2); border-style: dashed; cursor: default; }
.btn-wait::before { content: none; }
.wait { font: 700 12px/1.4 var(--ff); letter-spacing: .1em; color: var(--red); }

/* ── 本の長さ: 8ページごとに1本の縦線（短い本は檻が狭い） ── */
.ticks { display: inline-block; vertical-align: middle; width: calc(var(--n, 10) * 4px); height: 12px; background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 4px); }

/* ── 著者・後付け ── */
.about { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); padding: clamp(80px, 11vw, 150px) var(--gutter) clamp(72px, 9vw, 120px); border-top: 1px solid var(--ink); }
.about-name { grid-column: 1 / 8; margin: 0; position: relative; font: 900 clamp(84px, 17vw, 260px)/.92 var(--ff); letter-spacing: -.04em; }
/* 名前も檻の中（細い格子が文字の上を通る） */
.about-name::after { content: ""; position: absolute; inset: -4% 0; background: repeating-linear-gradient(90deg, var(--paper) 0 2px, transparent 2px 22px); pointer-events: none; }
.about-body { grid-column: 9 / 13; align-self: end; display: flex; flex-direction: column; gap: 16px; }
.about-body h2 { margin: 0; font: 900 22px/1.3 var(--ff); letter-spacing: .1em; word-break: auto-phrase; }   /* 「年下攻/めBL」と割れないよう文節で折る */
.about-body p { margin: 0; }
.about .note { font-size: 12px; color: var(--ink-2); }
.about-links { display: grid; grid-template-columns: min(100%, 300px); gap: 10px; margin-top: 8px; }   /* X・pixiv・Amazon を同じ幅で縦に積む（3つを横に流すと幅によって段がばらつく） */
/* お問い合わせは作家の居場所（X・pixiv・Amazon）とは性質が違うので、見出しを付けて少し離す。幅は上のボタンに揃える */
.about-contact { display: grid; grid-template-columns: min(100%, 300px); gap: 10px; margin-top: 18px; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 22px var(--gutter) 30px; border-top: 1px solid var(--ink); font-size: 12px; color: var(--ink-2); }
.site-foot p { margin: 0; }

/* 動きを減らす設定: 格子が埋まる・下線が伸びる等の小さな動きも止め、状態だけを切り替える */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

@media (max-width: 760px) {
  body::before { background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px calc(100% / 6)); }
  .hd { height: 56px; padding: 0 12px 0 16px; }
  .hd-logo { font-size: 17px; }
  .hd-logo small { display: none; }
  .hd-nav a { padding: 0 10px; gap: 0; }
  .hd-nav a span { display: none; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .about-name, .about-body { grid-column: 1; }
}
