/* ひとこま展 — ひろい白の中に、ひとこまを並べる */
:root {
  --bg: #ffffff; --ink: #2b2a27; --sub: #8a857b; --line: #ebe7dd; --back: #ece8de;
  --w: clamp(280px, 24vw, 400px);  /* こま1枚の幅（PC） */
  --side: clamp(28px, 9vw, 160px); /* 左の余白 */
  --veil: rgba(255,255,255,.97); --hover: #f5f3ee; --shade: rgba(43,42,39,.10);
  color-scheme: light;
}
/* あかり：夜のアトリエ */
:root[data-light="night"] { --bg: #1e1d1b; --ink: #efece4; --sub: #8f8a80; --line: #e2ddd1; --veil: rgba(30,29,27,.96); --hover: #2c2a27; --shade: rgba(0,0,0,.45); color-scheme: dark; }
/* あかり：黄色いランプのアトリエ */
:root[data-light="lamp"] { --bg: #ecdf74; --ink: #2b2a27; --sub: #6f6638; --line: #e4dfd2; --veil: rgba(236,223,116,.96); --hover: #e2d466; --shade: rgba(90,70,0,.16); }
body, .view { transition: background-color 700ms ease, color 700ms ease; }
:root[data-light="night"] .page { box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
:root[data-light="night"] .koma + .koma .page { box-shadow: inset 1px 0 0 var(--line), 0 18px 40px -18px rgba(0,0,0,.7); }
:root[data-light="lamp"] .page { box-shadow: 0 16px 36px -20px rgba(90,70,0,.35); }
:root[data-light="lamp"] .koma + .koma .page { box-shadow: inset 1px 0 0 var(--line), 0 16px 36px -20px rgba(90,70,0,.35); }

/* あかりのスイッチ（右上） */
.sw { position: fixed; z-index: 5; top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--bg); transition: background-color 700ms; }
.plate { position: relative; display: block; width: 64px; height: 26px; border-radius: 13px; border: 1px solid var(--ink); transition: border-color 700ms; }
.plate .rail { position: absolute; left: 12px; right: 12px; top: 12px; height: 1px; background: var(--ink); transition: background 700ms; }
.plate .pin { position: absolute; top: 10px; width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg); transition: background 700ms, border-color 700ms; }
.plate .p1 { left: 10px; } .plate .p2 { left: 29px; } .plate .p3 { left: 48px; }
.plate .knob { position: absolute; top: 5px; left: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink);
  transition: left 420ms cubic-bezier(.3,1.4,.5,1), background 700ms; }
:root[data-light="night"] .plate .knob { left: 25px; }
:root[data-light="lamp"] .plate .knob { left: 44px; background: #2b2a27; box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
.sw-name { font-size: 10px; letter-spacing: .22em; color: var(--sub); min-width: 3.4em; text-align: left; }
@media (hover: hover) and (pointer: fine) { .sw:hover .plate { background: var(--hover); } }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Zen Kaku Gothic New", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.en { font-family: "Jost", sans-serif; letter-spacing: .08em; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* 入口 */
.head { padding: clamp(56px, 12vh, 140px) var(--side) clamp(64px, 14vh, 160px); }
.home { font-size: 11px; letter-spacing: .24em; color: var(--sub); }
.home:hover { color: var(--ink); }
.head h1 { margin-top: clamp(40px, 8vh, 88px); font-weight: 500; font-size: clamp(30px, 4.4vw, 52px); letter-spacing: .14em; }
.intro { margin-top: 22px; font-size: 14px; line-height: 2.1; letter-spacing: .08em; color: var(--sub); }
.count { margin-top: 26px; font-size: 11px; color: var(--sub); letter-spacing: .2em; }

/* 部屋（記事ごとのひとこま） */
.hall { padding-bottom: 12vh; }
.room { margin-bottom: clamp(88px, 18vh, 200px); padding-left: calc(var(--side) + var(--shift, 0) * 5vw); }
.strip { list-style: none; display: flex; overflow-x: auto; overflow-y: visible; scrollbar-width: none;
  padding: 10px var(--side) 10px 0; margin: -10px 0; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { scroll-snap-type: none; cursor: grabbing; }
.koma { flex: none; width: var(--w); scroll-snap-align: start; }
.koma + .koma .page { box-shadow: inset 1px 0 0 var(--line); }

/* こま：ホバーで右下がぺらっとめくれる */
.page { display: block; position: relative; width: 100%; aspect-ratio: 4 / 5; background: #f8f7f3;
  transition: transform 260ms cubic-bezier(.2,.7,.3,1); }
.page img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%, 0 100%);
  transition: clip-path 260ms cubic-bezier(.2,.7,.3,1); }
.fold { position: absolute; right: 0; bottom: 0; width: 0; height: 0; pointer-events: none;
  background: linear-gradient(to top left, transparent 50%, var(--back) 50%, #f6f3ec 100%);
  filter: drop-shadow(-3px -3px 4px rgba(43,42,39,.16));
  transition: width 260ms cubic-bezier(.2,.7,.3,1), height 260ms cubic-bezier(.2,.7,.3,1); }
@media (hover: hover) and (pointer: fine) {
  .page:hover { transform: translateY(-4px); z-index: 1; }
  .page:hover img { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 64px), calc(100% - 64px) 100%, 0 100%); }
  .page:hover .fold { width: 64px; height: 64px; }
}
.page:focus-visible { outline-offset: -1px; z-index: 1; }

/* 部屋の札 */
.label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 22px; padding-right: var(--side); font-size: 13px; letter-spacing: .06em; }
.label .no, .label .tag { font-size: 11px; color: var(--sub); letter-spacing: .16em; }
.label .ttl { border-bottom: 1px solid transparent; transition: border-color 160ms; }
.label .ttl:hover { border-color: var(--ink); }
.label .arrow { margin-left: 8px; font-family: "Jost", sans-serif; }

.foot { padding: 0 var(--side) 64px; font-size: 11px; letter-spacing: .24em; color: var(--sub); }

/* スマホ：こまは小さくせず、指でするする */
@media (max-width: 700px) {
  :root { --w: 80vw; --side: 24px; }
  .sw-name { display: none; }
  .room { padding-left: 0; margin-bottom: 96px; }
  .strip { padding: 10px 10vw; scroll-snap-type: x mandatory; }
  .koma { scroll-snap-align: center; }
  .label { padding: 0 10vw; }
}

/* 大きく見る */
.view { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; padding: 0;
  background: var(--veil); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.view[open] { display: flex; }
.view::backdrop { background: transparent; }
.view img { max-width: min(92vw, 760px); max-height: calc(100dvh - 140px); width: auto; height: auto; box-shadow: 0 10px 40px var(--shade); }
.view-bar { display: flex; align-items: center; gap: 28px; font-size: 13px; letter-spacing: .08em; }
.view-bar a { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.view-bar .nav { font-family: "Jost", sans-serif; font-size: 20px; width: 44px; height: 44px; border-radius: 50%; }
.view-bar .nav:hover { background: var(--hover); }
.close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; }
.close i, .close i::after { position: absolute; left: 13px; top: 21px; width: 18px; height: 1.5px; background: var(--ink); transform: rotate(45deg); content: ""; }
.close i::after { left: 0; top: 0; transform: rotate(90deg); }
.close:hover { background: var(--hover); }

@media (prefers-reduced-motion: reduce) { .page, .page img, .fold { transition: none; } }
