/* ひとひら ｜ 偶然でひらく、次の一篇
 * デザインシステム 案B「帯」（designSystem/README.md）。
 * 紙と墨の地に、リソグラフの重ね刷り。色と遊びは「本棚・背表紙・正体」に集め、
 * 操作部品と読む画面は紙と墨だけ。角は0、影はぼかさない「ずれ版」だけ。
 * ───────────────────────────────────────────────────────────── */

/* ===== トークン（designSystem/tokens.css と同じ値） ============= */
:root {
  --paper: #F4F3EE;
  --paper-raised: #FBFAF6;
  --paper-sunk: #E9E7DF;
  --ink: #222222;
  --ink-2: #55534E;
  --ink-3: #8A877F;
  --rule: #22222233;
  --on-ink: var(--paper);
  --pink: #FF48B0;
  --yellow: #FFE800;
  --blue: #0078BF;
  --focus: var(--blue);

  --font-display: "Dela Gothic One", "Noto Sans JP", sans-serif;
  --font-body: "Zen Old Mincho", "Noto Serif JP", serif;
  --font-ui: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;

  --shadow-pink: 4px 4px 0 var(--pink);
  --shadow-blue: 4px 4px 0 var(--blue);
  --shadow-ink: 6px 6px 0 var(--ink);
  --shadow-ink-sm: 3px 3px 0 var(--ink);
  --tap-min: 48px;

  --dur-press: 60ms;
  --dur-mark: 120ms;
  --dur-pull: 160ms;
  --dur-page: 220ms;
  --dur-paper-out: 240ms;
  --dur-spread: 360ms;
  --dur-obi: 420ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);

  /* 紙の粒（墨6%） */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .13 0 0 0 0 .13 0 0 0 0 .12 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ===== リセット ============================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
button { font: inherit; color: inherit; }
svg { display: block; }
p, h1, h2, ul { margin: 0; }
[hidden] { display: none !important; }

/* 自作アイコン：線幅3px・角は直角 */
.ibtn svg path, .backbtn svg path, .pg svg path, .btn svg path, .close svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
}
.close svg path { stroke-width: 2.6; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* マウス／タッチで文言を出し分ける */
.only-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .only-touch { display: none; }
  .only-mouse { display: inline; }
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.rotunda, .aisle, .reveal, .loading, .fail {
  background: var(--paper) var(--grain);
}

/* ===== 文字の部品 ============================================ */
/* ロゴ：ピンクの版が右下へずれる */
.logo {
  position: relative;
  display: inline-block;
  isolation: isolate;
  font: 400 20px/1 var(--font-display);
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo::before {
  content: attr(data-t);
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  z-index: -1;
  color: var(--pink);
  mix-blend-mode: multiply;
  white-space: nowrap;
}
.logo--big { font-size: 44px; }
.logo--big::before { left: 3px; top: 3px; }

.screen-title { font: 400 24px/1.25 var(--font-display); }
.body-ui { font: 500 13px/1.6 var(--font-ui); color: var(--ink-2); }
.label { font: 700 11px/1.4 var(--font-ui); letter-spacing: .16em; color: var(--ink-2); }
.num { font: 400 16px/1 var(--font-display); letter-spacing: .02em; }

.tlink {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: none;
  font: 700 13px/1 var(--font-ui);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.tlink:active { transform: translateY(1px); }

/* ===== ボタン ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--tap-min);
  padding: 0 22px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--on-ink);
  font: 700 15px/1 var(--font-ui);
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-pink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear, opacity var(--dur-mark);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--pink); }
.btn--sub {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-blue);
}
.btn--sub:active { box-shadow: inset 0 0 0 2px var(--ink), 2px 2px 0 var(--blue); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .35; box-shadow: none; pointer-events: none; }
.btn--sub[disabled] { box-shadow: inset 0 0 0 2px var(--ink); }

.ibtn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-ink-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear;
}
.ibtn:active { transform: translate(2px, 2px); box-shadow: inset 0 0 0 2px var(--ink), 1px 1px 0 var(--ink); }

.hdr {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 56px;
  padding: 0 16px;
  margin-top: env(safe-area-inset-top);
}
.hdr--rule { border-bottom: 2px solid var(--ink); }
.hdr__links { display: flex; align-items: center; gap: 18px; }
.backbtn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 8px 0 0;
  border: 0;
  background: none;
  font: 700 14px/1 var(--font-ui);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

/* ===== 1. 本棚をえらぶ ======================================= */
.rotunda {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: opacity 200ms var(--ease-out);
}
.rotunda__ttl { flex: none; padding: 16px 16px 0; }
.rotunda__ttl p { margin-top: 6px; }

.rotunda__stage {
  position: relative;
  z-index: 1; /* 棚どうしの重なりをこの中に閉じこめる */
  flex: 1;
  min-height: 220px;
  margin-top: 8px;
  border-bottom: 2px solid var(--ink); /* 床 */
  overflow: visible;
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.rotunda__stage.is-grabbing { cursor: grabbing; }
/* 正面の棚は影と▲で示すので、枠は出さない */
.rotunda__stage:focus-visible { outline: none; }
.sh {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--sw, 260px);
  height: var(--sh, 460px);
  margin-left: calc(var(--sw, 260px) / -2);
  transform-origin: 50% 100%;
  line-height: 0;
  cursor: pointer;
  will-change: transform;
}
.sh svg { width: 100%; height: 100%; overflow: visible; transition: filter var(--dur-mark) var(--ease-out); }
.sh.is-front svg { filter: drop-shadow(6px 6px 0 #222); }
/* 正面の棚の足元の▲ */
.rotunda__mark {
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 0;
  height: 0;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top: 0;
  border-bottom: 10px solid var(--pink);
  transition: opacity var(--dur-mark) var(--ease-out);
}
.rotunda__stage.is-grabbing .rotunda__mark,
.rotunda__stage.is-moving .rotunda__mark { opacity: 0; }

.ticks {
  display: flex;
  flex: none;
  justify-content: center;
  align-items: flex-end;
  gap: 7px;
  height: 18px;
  margin-top: 42px;
}
.ticks span { width: 3px; height: 8px; background: var(--ink-3); }
.ticks span.on { width: 4px; height: 18px; background: var(--pink); }

.rotunda__ctrl {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  margin-top: 30px;
}
.rotunda__ctrl .btn { flex: 1; }

.rotunda__ft {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 24px 16px max(22px, env(safe-area-inset-bottom));
  font: 500 11px/1 var(--font-ui);
  color: var(--ink-2);
}
.keys { align-items: center; gap: 8px; font-size: 13px; }
@media (hover: hover) and (pointer: fine) {
  .only-mouse.keys { display: inline-flex; }
}
kbd {
  padding: 5px 7px;
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font: 700 12px/1 var(--font-ui);
  color: var(--ink);
}

@media (max-height: 700px) {
  .ticks { margin-top: 34px; }
  .rotunda__ctrl { margin-top: 20px; }
  .rotunda__ft { padding-top: 16px; }
}

/* PC：同じ部品を広げるだけ */
@media (min-width: 820px) {
  .hdr { height: 72px; padding: 0 40px; }
  .rotunda .logo { font-size: 26px; }
  .rotunda__ttl { position: absolute; left: 40px; top: 96px; padding: 0; z-index: 3; }
  .screen-title { font-size: 34px; }
  .rotunda__ttl .body-ui { font-size: 14px; margin-top: 8px; }
  .rotunda__stage { margin-top: 38px; }
  .rotunda__mark { bottom: -30px; margin-left: -9px; border-width: 0 9px 11px; }
  .ticks { gap: 8px; }
  .rotunda__ctrl { justify-content: center; margin-top: 18px; }
  .rotunda__ctrl .btn { flex: none; width: 260px; }
  .rotunda__ctrl .ibtn {
    position: absolute;
    top: 46%;
    width: 56px;
    height: 56px;
    z-index: 50;
  }
  #rotPrev { left: 40px; }
  #rotNext { right: 40px; }
  .rotunda__ft { padding: 18px 40px 36px; }
  .rotunda__ft > span:first-child { visibility: hidden; }
}

/* ===== 2. 本をえらぶ ========================================= */
.aisle {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}
.app[data-view="aisle"] .aisle { opacity: 1; pointer-events: auto; }
.app[data-view="aisle"] .rotunda { opacity: 0; pointer-events: none; }

.mini { display: flex; align-items: center; gap: 8px; font: 700 11px/1 var(--font-ui); color: var(--ink-2); }

/* 選んだ本棚の本体インクが画面のふち（側板10px・天板14px）になる */
.aisle__case {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 10px 0;
  background: var(--body, var(--ink));
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.aisle__case::-webkit-scrollbar { display: none; }
.aisle__inner {
  position: relative;
  max-width: 736px; /* 内のり最大720px＋左右8px */
  min-height: 100%;
  margin: 0 auto;
  background: var(--paper) var(--grain);
}
.aisle__back { position: absolute; inset: 0; overflow: hidden; }
.aisle__back svg { position: absolute; left: 0; top: 0; }
.aisle__rows {
  position: relative;
  padding: 0 8px max(24px, env(safe-area-inset-bottom));
}
.row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
}
.plank { height: 12px; margin: 0 -8px; background: var(--body, var(--ink)); }

/* 本（背表紙・面陳） */
.bk {
  position: relative;
  flex: none;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: var(--origin, 50% 100%);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-pull) var(--ease-out);
}
.bk svg { transition: filter var(--dur-pull) var(--ease-out); }
@media (hover: hover) {
  .bk:hover { transform: translateY(-10px) rotate(var(--tilt, 0deg)); }
  .bk:hover svg { filter: drop-shadow(3px 3px 0 #FF48B0); }
}
.bk:focus-visible { transform: translateY(-10px) rotate(var(--tilt, 0deg)); outline-offset: 2px; }
.bk.is-pulled {
  z-index: 5;
  transform: translateY(-34px) scale(1.05) rotate(var(--tilt, 0deg));
  transform-origin: 50% 100%;
}
.bk.is-pulled svg { filter: drop-shadow(5px 5px 0 #222); }

.hint {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 8;
  transform: translateX(-50%);
  padding: 12px 16px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-blue);
  font: 700 13px/1 var(--font-ui);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.hint.is-gone { opacity: 0; transform: translate(-50%, 8px); }

@media (min-width: 820px) {
  .aisle .hdr { padding: 0 40px; }
}

/* 本を抜いたあと、本の地の色が画面に広がる */
.wipe {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: var(--wipe, var(--ink));
  pointer-events: none;
  visibility: hidden;
}
.wipe.is-on { visibility: visible; }

/* ===== 3. 読む ============================================== */
.reader {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: var(--paper-raised);
}
.reader.is-in { animation: paper-in 180ms var(--ease-out) both; }
.reader.is-out { animation: paper-out var(--dur-paper-out) var(--ease-in) both; }
.reader__top {
  position: absolute;
  left: 0;
  right: 0;
  top: env(safe-area-inset-top);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px 0 8px;
  transition: opacity 160ms var(--ease-out);
}
.close {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  font: 700 13px/1 var(--font-ui);
  color: var(--ink);
  cursor: pointer;
}
.reader__strip {
  width: 6px;
  height: 28px;
  margin-right: 4px;
  background: var(--strip, var(--ink));
  box-shadow: inset 0 0 0 1px var(--ink);
}
.reader__page {
  position: absolute;
  left: 28px;
  right: 28px;
  top: calc(64px + env(safe-area-inset-top));
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-height: 640px;
  margin: auto 0;
  overflow: hidden;
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.reader__text {
  height: 100%;
  font: 400 18px/1.9 var(--font-body);
  letter-spacing: .04em;
  font-feature-settings: "vkrn" 0;
  text-align: justify;
  line-break: strict;
  hanging-punctuation: allow-end;
  color: var(--ink);
}
.reader__text p { margin: 0; }
.reader__text rt { font-size: .5em; letter-spacing: 0; }
.reader__text .end-mark { margin-top: 8em; color: var(--ink-2); }
.reader__text.is-loading {
  writing-mode: horizontal-tb;
  display: grid;
  place-items: center;
  font: 500 13px/1.6 var(--font-ui);
  color: var(--ink-2);
}
.reader__bot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: calc(88px + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  border-top: 1.5px solid var(--ink);
  background: var(--paper-raised);
  transition: opacity 160ms var(--ease-out);
}
.pg {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--tap-min);
  padding: 0 12px;
  border: 0;
  background: none;
  font: 700 14px/1 var(--font-ui);
  color: var(--ink);
  cursor: pointer;
}
.pg[disabled] { opacity: .35; cursor: default; }
.pg--next, .btn--fin { justify-self: start; grid-column: 1; grid-row: 1; }
.btn--fin { height: 48px; margin-left: 8px; padding: 0 16px; gap: 6px; }
.reader__cnt { grid-column: 2; text-align: center; }
.reader__cnt small {
  display: block;
  margin-top: 6px;
  font: 500 10px/1 var(--font-ui);
  letter-spacing: .1em;
  color: var(--ink-2);
}
.pg--prev { justify-self: end; grid-column: 3; }
/* 中央タップで上下の操作を隠す */
.reader.is-bare .reader__top,
.reader.is-bare .reader__bot { opacity: 0; pointer-events: none; }

/* ===== 4. 正体 ============================================== */
.reveal {
  position: absolute;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.reveal__in {
  width: min(100%, 452px);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}
.rbook {
  position: relative;
  margin-top: 26px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-ink);
}
.rbook__cover { line-height: 0; }
.rbook__cover svg { width: 100%; height: auto; }
.rbook::after { /* 墨の枠を表紙・帯の上に重ねる */
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px var(--ink);
  pointer-events: none;
}
.obi {
  position: relative;
  padding: 18px 18px 14px;
  border-top: 2px solid var(--ink);
  background: var(--obi, var(--yellow));
}
.obi__lead { color: var(--ink); letter-spacing: .14em; }
.obi__title {
  position: relative;
  isolation: isolate;
  margin: 10px 0 8px;
  font: 400 72px/1.05 var(--font-display);
  letter-spacing: .01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.obi__title::before {
  content: attr(data-t);
  position: absolute;
  left: 3px;
  right: -3px;
  top: 3px;
  z-index: -1;
  color: var(--mis, var(--pink));
  mix-blend-mode: multiply;
}
.obi__title a { color: inherit; text-decoration: none; }
.obi__author { font: 700 19px/1.4 var(--font-body); }
.obi__author small { display: block; font: 400 14px/1.5 var(--font-body); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.chips li {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font: 700 12px/1 var(--font-ui);
  white-space: nowrap;
}
.obi__read { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.obi__read .label { color: var(--ink); letter-spacing: .1em; }
.obi__pages { font-size: 28px; }
.obi__pages small { margin-left: 4px; font: 700 13px/1 var(--font-ui); }
.stamp {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  margin-left: auto;
  border-radius: 50%;
  /* 読了印は帯の色の補色で押す（黄→青、ピンク→緑、紙→ピンク）。
     補色を乗算すると墨に近くなり字が沈むので、印だけは不透明に刷る */
  background: var(--stamp, var(--pink));
  font: 400 19px/1 var(--font-display);
  color: var(--ink);
  transform: rotate(-10deg);
}
.obi__note { margin-top: 6px; font: 500 10.5px/1.4 var(--font-ui); }
.obi__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px solid var(--ink);
  font: 500 11px/1 var(--font-ui);
}
.obi__foot .tlink { font-size: 12px; border-bottom-width: 1.5px; padding-bottom: 2px; }
.reveal__acts { display: flex; gap: 14px; margin-top: 28px; }
.reveal__acts .btn { flex: 1; padding: 0 12px; }
.reveal__more { margin-top: 28px; text-align: center; }

/* 正体が出る：紙が下へ抜ける → 帯が巻かれる → 題名のピンク版 → 墨版 → 項目 → 読了印 */
.reveal.is-in .rbook__cover { animation: fade 200ms var(--ease-out) both; }
.reveal.is-in .obi { animation: obi-wrap var(--dur-obi) var(--ease-out) 60ms both; }
.reveal.is-in .obi__title::before { animation: fade var(--dur-mark) var(--ease-out) 380ms both; }
.reveal.is-in .obi__title { animation: ink-on var(--dur-mark) var(--ease-out) 500ms both; }
.reveal.is-in .obi__lead { animation: fade 160ms var(--ease-out) 380ms both; }
.reveal.is-in .obi__author { animation: fade 160ms var(--ease-out) 620ms both; }
.reveal.is-in .chips { animation: fade 160ms var(--ease-out) 660ms both; }
.reveal.is-in .obi__read { animation: fade 160ms var(--ease-out) 700ms both; }
.reveal.is-in .obi__note,
.reveal.is-in .obi__foot { animation: fade 160ms var(--ease-out) 740ms both; }
.reveal.is-in .stamp { animation: stamp 200ms var(--ease-out) 900ms both; }
.reveal.is-in .reveal__acts,
.reveal.is-in .reveal__more { animation: fade 200ms var(--ease-out) 780ms both; }

/* ===== 読んだ本 ============================================ */
.log {
  position: absolute;
  inset: 0;
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: var(--paper) var(--grain);
}
.log .hdr { max-width: 720px; margin-left: auto; margin-right: auto; }
.log__body {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px max(48px, env(safe-area-inset-bottom));
}
/* 読み物ページの見出し：ピンクのずれ版2px */
.page-title {
  position: relative;
  display: inline-block;
  isolation: isolate;
  margin: 8px 0 10px;
  font: 400 30px/1.3 var(--font-display);
}
.page-title::before {
  content: attr(data-t);
  position: absolute;
  left: 2px;
  right: -2px;
  top: 2px;
  z-index: -1;
  color: var(--pink);
  mix-blend-mode: multiply;
}
.log__list { margin: 20px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.log__item {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1.5px solid var(--ink);
}
.log__cover { line-height: 0; box-shadow: var(--shadow-ink-sm); align-self: start; }
.log__text { min-width: 0; padding-right: 44px; }
.log__title {
  font: 400 18px/1.35 var(--font-display);
  overflow-wrap: anywhere;
}
.log__author { margin-top: 4px; font: 700 14px/1.5 var(--font-body); }
.log__author small { display: block; font: 400 12px/1.5 var(--font-body); }
.log__meta { margin-top: 6px; font: 500 11px/1 var(--font-ui); color: var(--ink-2); }
.log__meta .num { margin-right: 2px; font-size: 14px; color: var(--ink); }
.log__acts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.log__acts .tlink { font-size: 12px; }
.stamp--sm {
  position: absolute;
  right: 0;
  top: 16px;
  width: 38px;
  height: 38px;
  margin: 0;
  font-size: 12px;
}
.log__empty { margin-top: 28px; }
.log__empty p { margin-bottom: 24px; font: 400 15px/1.95 var(--font-body); }
.log__clear { margin-top: 32px; }

/* ===== 読み込み中・失敗 ===================================== */
.loading, .fail {
  position: absolute;
  inset: 0;
  z-index: 100;
}
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 80px;
  transition: opacity 200ms var(--ease-out);
}
.loading.is-out { opacity: 0; pointer-events: none; }
.loading__shelf {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 240px;
  height: 150px;
  margin-top: 48px;
  padding: 0 4px;
  border-bottom: 8px solid var(--blue);
}
.loading__shelf .bk {
  opacity: 0;
  cursor: default;
  animation: put 3.2s var(--ease-out) infinite;
}
.loading__msg { margin-top: 28px; text-align: center; }
.loading__msg b { display: block; font: 700 16px/1.4 var(--font-ui); }
.loading__msg span { display: block; margin-top: 6px; font: 500 12px/1.7 var(--font-ui); color: var(--ink-2); }

.fail { display: flex; align-items: center; justify-content: center; padding: 24px; }
.fail__in { width: min(100%, 420px); }
.fail__art { position: relative; height: 150px; border-bottom: 8px solid var(--blue); }
.fail__art .bk { position: absolute; bottom: 0; cursor: default; }
.fail__title { margin: 28px 0 10px; font: 400 26px/1.35 var(--font-display); }
.fail__msg { margin-bottom: 28px; font: 500 14px/1.8 var(--font-ui); color: var(--ink-2); }
.fail__acts { display: flex; gap: 14px; }
.fail__acts .btn { flex: 1; }

/* ===== アニメーション ======================================= */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes paper-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes paper-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes obi-wrap { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ink-on { from { color: transparent; } to { color: var(--ink); } }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-10deg) scale(1.4); }
  100% { opacity: 1; transform: rotate(-10deg) scale(1); }
}
@keyframes put {
  0% { opacity: 0; transform: translateY(-16px); }
  6% { opacity: 1; transform: translateY(0); }
  86% { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(0); }
}

/* ===== 動きを減らす設定 ===================================== */
@media (prefers-reduced-motion: reduce) {
  .reveal.is-in .rbook__cover,
  .reveal.is-in .obi,
  .reveal.is-in .obi__title,
  .reveal.is-in .obi__title::before,
  .reveal.is-in .obi__lead,
  .reveal.is-in .obi__author,
  .reveal.is-in .chips,
  .reveal.is-in .obi__read,
  .reveal.is-in .obi__note,
  .reveal.is-in .obi__foot,
  .reveal.is-in .stamp,
  .reveal.is-in .reveal__acts,
  .reveal.is-in .reveal__more { animation: none; }
  .reveal.is-in .rbook { animation: fade 200ms var(--ease-out) both; }
  .reader.is-in { animation: fade 150ms linear both; }
  .reader.is-out { animation: none; }
  .loading__shelf .bk { animation: none; opacity: 1; }
  .bk, .bk svg { transition-duration: 0ms; }
}

/* ===== 読み物ページ（about / privacy） ======================= */
body:has(.doc) {
  height: auto;
  overflow: auto;
  touch-action: auto;
  background: var(--paper) var(--grain);
}
.doc { min-height: 100dvh; }
.doc .hdr { max-width: 720px; margin: env(safe-area-inset-top) auto 0; }
.doc__body {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px max(48px, env(safe-area-inset-bottom));
}
.doc h1 {
  position: relative;
  display: inline-block;
  isolation: isolate;
  margin: 8px 0 18px;
  font: 400 30px/1.3 var(--font-display);
}
.doc h1::before {
  content: attr(data-t);
  position: absolute;
  left: 2px;
  right: -2px;
  top: 2px;
  z-index: -1;
  color: var(--pink);
  mix-blend-mode: multiply;
}
.doc p { margin: 0 0 16px; font: 400 15px/1.95 var(--font-body); }
.doc h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 12px;
  font: 700 12px/1 var(--font-ui);
  letter-spacing: .16em;
  color: var(--ink-2);
}
.doc h2::after { content: ""; flex: 1; height: 1.5px; background: var(--ink); }
.doc a:not(.logo):not(.backbtn) {
  padding-bottom: 2px;
  border-bottom: 2px solid var(--ink);
  font: 700 13px/1 var(--font-ui);
  color: var(--ink);
  text-decoration: none;
}
.how {
  display: grid;
  grid-template-columns: 72px 1fr;
  row-gap: 12px;
  align-items: baseline;
  margin: 0 0 8px;
}
.how dt {
  position: relative;
  display: inline-block;
  justify-self: start;
  padding-bottom: 6px;
  font: 400 20px/1 var(--font-display);
}
.how dt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  mix-blend-mode: multiply;
}
.how dt:nth-of-type(1)::after { background: var(--yellow); }
.how dt:nth-of-type(2)::after { background: var(--pink); }
.how dt:nth-of-type(3)::after { background: var(--blue); }
.how dd { margin: 0; font: 400 14px/1.8 var(--font-body); }
.doc__fine { margin-top: 28px; font: 500 11px/1.8 var(--font-ui); color: var(--ink-2); }
.doc .doc__fine a { font-size: 11px; border-bottom-width: 1.5px; }
.doc .doc__meta { font: 500 12px/1.6 var(--font-ui); color: var(--ink-2); }
