/* ============================== base ============================== */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --ink: #111111;
  --grey: #8a8a8a;
  --line: #e7e7e7;
  --pad: 22px;
  --maxcap: 1500px;
  font-size: 15px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Inter, Arial, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.32;
  letter-spacing: 0.005em;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
.small { font-size: 0.78rem; }
.muted { color: var(--grey); }

/* page wrapper keeps consistent margins */
.wrap { padding: var(--pad); min-height: 100vh; display: flex; flex-direction: column; }
.spacer { flex: 1 1 auto; }

/* ============================== INDEX (Basic Feed) ============================== */
/* top-left info block */
.info { font-size: 0.92rem; line-height: 1.45; max-width: 33ch; }
.info .name { font-weight: 600; }
.info a:hover { color: var(--grey); }

/* feed = single left column of project covers */
.feed { margin-top: 48px; display: flex; flex-direction: column; gap: 52px; }
.feed-item { width: 33vw; max-width: 460px; }
.feed-item .thumb { overflow: hidden; background: #f3f3f3; }
.feed-item img { transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.feed-item:hover img { transform: scale(1.02); }
.feed-cap { display: flex; gap: 12px; margin-top: 9px; font-size: 0.82rem; }
.feed-cap .num { color: var(--grey); }
.feed-cap .ttl { font-weight: 500; }
.feed-cap .yr  { color: var(--grey); margin-left: auto; }

.footer { margin-top: 60px; font-size: 0.78rem; color: var(--grey); }

/* index tag filter bar sits under the info block */
.filterbar.idx { margin: 34px 0 6px; }
.tagfeed-head { font-size: 0.8rem; color: var(--grey); margin: 14px 0 18px; }

/* cross-project image grid (index, filtered by tag) */
.tagfeed { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 20px; }
.tagfeed-item .thumb { overflow: hidden; background: #f3f3f3; aspect-ratio: 4 / 3; }
.tagfeed-item .thumb img { width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.tagfeed-item:hover .thumb img { transform: scale(1.03); }
.tagfeed-cap { display: flex; gap: 12px; margin-top: 8px; font-size: 0.8rem; }
.tagfeed-cap .ttl { font-weight: 500; }
.tagfeed-cap .proj { color: var(--grey); margin-left: auto; text-align: right; }

/* ============================== DETAIL (Slideshow / Index) ============================== */
.detail-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; font-size: 0.82rem;
}
.detail-top .back:hover { color: var(--grey); }
.detail-top .meta { text-align: right; color: var(--grey); }

.intro {
  margin: 26px 0 8px;
  font-size: 1.18rem;
  line-height: 1.4;
  max-width: 60ch;
  letter-spacing: -0.01em;
}

/* image sequence, centered column */
.plates { margin: 40px auto 0; display: flex; flex-direction: column; gap: 80px; }
.plate { max-width: 760px; margin: 0 auto; width: 100%; }
.plate .frame { background: #f3f3f3; }
.plate-cap { display: flex; gap: 14px; margin-top: 12px; font-size: 0.82rem; align-items: baseline; }
.plate-cap .num { color: var(--grey); min-width: 1.6em; flex: 0 0 auto; }
.plate-cap .cap-body { display: block; }
.plate-cap .ttl { font-weight: 600; margin-right: 8px; }
.plate-cap .desc { color: var(--grey); }
/* per-image tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag {
  font-size: 0.7rem;
  line-height: 1;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tag:hover { border-color: var(--ink); }
.tag.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* tag filter bar (top of detail page) */
.filterbar { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 4px; }
.filter-chip {
  font: inherit; font-size: 0.74rem; line-height: 1; cursor: pointer;
  color: var(--grey); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-chip:hover { color: var(--ink); border-color: var(--ink); }
.filter-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.detail-footer {
  margin-top: 72px; display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--grey);
}

/* ============================== mobile (Basic Feed / Slideshow mobile) ============================== */
@media (max-width: 720px) {
  :root { --pad: 16px; font-size: 14px; }
  .info { max-width: none; }
  .feed { margin-top: 30px; gap: 40px; }
  .feed-item { width: 100%; max-width: none; }    /* full-width covers on mobile */
  .intro { font-size: 1.05rem; }
  .plates { gap: 54px; }
  .plate { max-width: none; }
  .plate-cap { flex-wrap: wrap; }
  .plate-cap .ttl { white-space: normal; }
}

/* background music: hidden YouTube player host + small floating toggle */
#bgm-host {
  position: fixed; right: 0; bottom: 0;
  width: 1px; height: 1px; overflow: hidden;
  opacity: 0; pointer-events: none;
}
#bgm-host iframe { width: 1px; height: 1px; border: 0; }
.bgm-toggle {
  position: fixed; right: 18px; bottom: 16px; z-index: 50;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; font-size: 0.95rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .25s ease, transform .25s ease;
}
.bgm-toggle:hover { transform: scale(1.06); }
.bgm-toggle .bgm-ico { animation: spin 4s linear infinite; }
.bgm-toggle.off { color: var(--grey); }
.bgm-toggle.off .bgm-ico { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }

/* gentle fade-in */
.fade { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }
