/* collage.css — the collage page (GATHER; HANG in drafts). PC pieces sit at their web.psb
   position (% of the spread), SP pieces at their スマホ+.psb position (vw); the variant
   scripts only write transform / opacity. */
/* The collage lies on a kraft desk (from the designer's envelope scan) in both modes: on PC a wide
   screen's margins, on SP the gaps between the pieces and the first moment before they gather, are
   kraft, not bare white (2026-11-17 Josh: SP opened on a pure white page). --desk is the scan's
   average colour, painted on the first frame before the image arrives, so nothing jumps when it does. */
.v-collage {
  --desk: #d3bc91;
  --thread: #a8352c;
  --hot: #e3221b; /* the red of the handwritten dates */
  --hot-inv: #ff3a2e; /* the same red, lit up on the black chips */
  background: var(--desk) url(../assets/desk/kraft.webp) center / cover no-repeat;
}
.cl-main { position: relative; }
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: clip;
  isolation: isolate;
}
.board {
  position: relative;
  width: min(100vw, calc(100svh * 5787 / 4093));
  aspect-ratio: 5787 / 4093;
}
.pc, .pc-anchor {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  margin: 0;
}
.pc {
  height: auto;
  max-width: none;
  transform-origin: 50% 50%;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.pc-anchor { aspect-ratio: var(--ar); pointer-events: none; visibility: hidden; }
img.pc { display: block; }
.board picture { display: contents; }
.pc.pc-off { display: none; }

/* ── menu labels: the original chips; on hover the black lettering turns red ── */
.pc-lbl {
  aspect-ratio: var(--ar);
  display: block;
  pointer-events: auto;
  transition: none; /* the script owns transform */
}
.pc-lbl:hover, .pc-lbl:focus-visible, .pc-lbl:active { transform: none; }
.chip { position: absolute; display: block; }
.chip img { display: block; width: 100%; height: 100%; }
.chip .ink {
  position: absolute;
  inset: 0;
  background: var(--hot);
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.chip .ink.is-inv { background: var(--hot-inv); }
.pc-lbl.is-hot .ink, .pc-lbl:focus-visible .ink { opacity: 1; }
.pc-lbl:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
/* ≥44px hit area without moving the art (Sounds sits right above Management: grow that one down) */
.pc-lbl::after {
  content: "";
  position: absolute;
  top: min(-0.3vw, calc((100% - 44px) / 2));
  bottom: min(-0.3vw, calc((100% - 44px) / 2));
  left: -0.3vw;
  right: -0.3vw;
}

/* ── the sign sticker (a hidden toy), the venue → map spot, the SNS icons ── */
.pc-egg, .pc-sns-block { aspect-ratio: var(--ar); padding: 0; border: 0; background: none; }
.pc-egg { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pc-egg img, .pc-sns-block > img { display: block; width: 100%; height: 100%; }
.pc-egg img { transform-origin: 82% 18%; transition: transform 320ms cubic-bezier(.3,.7,.3,1); }
.pc-egg:hover img { transform: rotate(-4deg) translate(-1px, -1px); }
.pc-egg:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 50%; }
.egg-stamp {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(25, 24, 21, 0.25));
}

.pc-hit { padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; aspect-ratio: var(--ar); }
/* the key visual: the book opens 本の購入 */
.pc-key { padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; aspect-ratio: var(--ar); -webkit-tap-highlight-color: transparent; }
.pc-key img { display: block; width: 100%; height: 100%; }
.pc-key:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.pc-hit:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.map-tag {
  position: absolute;
  right: 0;
  top: -2px;
  translate: 0 -100%;
  padding: 2px 6px 1px;
  font-family: var(--serif-en);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #fff;
  background: var(--hot);
  opacity: 0;
  transition: opacity 200ms ease-out, translate 260ms cubic-bezier(.2,.7,.2,1);
}
/* PC: in the gap after 「@タワーギャラリー」, left of the sign sticker (above it a thimble sits) */
.pc-venue.sp-off .map-tag { top: 2px; translate: 0 4px; }
.pc-venue.sp-off:hover .map-tag, .pc-venue.sp-off:focus-visible .map-tag { translate: 0 0; }
.pc-hit:hover .map-tag, .pc-hit:focus-visible .map-tag { opacity: 1; translate: 0 calc(-100% - 3px); }

.pc-sns-block { pointer-events: none; }
.sns-spot { position: absolute; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; border-radius: 6px; }
.sns-spot::after { content: ""; position: absolute; inset: -6px; }
.sns-spot:hover { background: rgba(227, 34, 27, 0.08); }
.sns-spot:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sns-tip {
  position: fixed;
  z-index: 35;
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(25, 24, 21, 0.86);
  pointer-events: none;
  translate: -50% calc(-100% - 10px);
}

/* PC: Sounds sits right above Management */
.pc-lbl-sound::after { bottom: -1px; }
.pc-lbl-management::after { top: -1px; bottom: min(-0.3vw, calc(100% - 43px)); }

/* ── SP: the designer's own vertical composition (スマホ+.psb), phone width = artboard width ──
   (keep in step with SP_MQ in src/shiniroku/collage.mjs and spMQ in awake/kit.js) */
@media (max-width: 899px), (orientation: portrait) and (max-width: 1100px), (max-height: 560px) and (max-width: 1100px) {
  .stage { display: block; min-height: 0; }
  .board { width: 100vw; height: calc(var(--sp-h) * 1vw); aspect-ratio: auto; }
  .pc, .pc-anchor {
    left: calc(var(--sx) * 1vw);
    top: calc(var(--sy) * 1vw);
    width: calc(var(--sw) * 1vw);
  }
  .pc.pc-off { display: block; }
  .pc.sp-off { display: none; }
  .map-tag { font-size: 9px; }
  .pc-hit.is-ready .map-tag { opacity: 1; }
  /* SP: the tag rests at the end of the URL line, clear of the dates above */
  .pc-hit.pc-venue .map-tag, .pc-hit.pc-venue:hover .map-tag { top: auto; bottom: 0; translate: 0 0; }
  .pc-lbl::after { left: -6px; right: -6px; }
  /* Management sits right above Special Thanks: one grows up, the other down */
  .pc-lbl-sp-management::after { top: min(-0.3vw, calc(100% - 44px)); bottom: -1px; }
  .pc-lbl-sp-thanks::after { top: -1px; bottom: min(-0.3vw, calc(100% - 44px)); }
  /* CREDITS sits right under the book (which opens 本の購入): its tap area grows down only */
  .pc-lbl-sp-credits::after { top: -1px; bottom: min(-0.3vw, calc(100% - 44px)); }
  /* About SHIN-(E)-ROKU ends where Purchase the Book begins */
  .pc-lbl-sp-about-work::after { right: 0; }
  .pc-lbl-sp-book::after { left: 0; }
}

/* ── boot gate: hidden until the variant takes over (failsafe after 4s if JS fails) ── */
.js .v-collage .stage { opacity: 0; animation: cl-failsafe 0s 4s forwards; }
.js .v-collage.aw-live .stage { opacity: 1; animation: none; }
@keyframes cl-failsafe { to { opacity: 1; } }

/* ── loading: blank paper; a quiet line only if the images take a while ── */
.cl-loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  animation: cl-ld-in 400ms ease-out 700ms forwards;
}
@keyframes cl-ld-in { to { opacity: 1; } }
.cl-ld { display: grid; justify-items: center; gap: 12px; }
.cl-ld-bar { width: 120px; height: 1px; background: rgba(25, 24, 21, 0.12); overflow: hidden; }
.cl-ld-bar i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.cl-ld-sub {
  margin: 0;
  font-family: var(--serif-en);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink);
}
.board.is-camera { transform-origin: 0 0; will-change: transform, opacity; }

/* ── overlays ── */
.cl-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 33; pointer-events: none; }
.cl-veil {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 255, 255, 0.62);
}

/* ── popup ── */
.v-collage .sheet::backdrop { background: transparent; }
.v-collage .sheet.is-tx .sheet-paper,
.v-collage .sheet.is-out-tx .sheet-paper { animation: none; }
.v-collage .sheet-paper { will-change: transform, clip-path, opacity; box-shadow: none; }
.v-collage .sheet { filter: drop-shadow(0 18px 30px rgba(25, 24, 21, 0.16)); overflow: clip; }
/* phones: the card sits in the middle of the screen (not a bottom sheet), with room to breathe —
   smaller label art clear of 閉じる, a narrow heading column so values stay on one line, a calmer type scale */
@media (max-width: 640px) {
  .v-collage .sheet { align-items: center; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
  .v-collage .sheet-paper { max-height: calc(100dvh - 40px); }
  .v-collage .sheet-content { padding: 22px 22px 28px; }
  .v-collage .sheet-close { top: 12px; right: 12px; padding: 0 10px; font-size: 13px; }
  .v-collage .sheet-close span[aria-hidden] { font-size: 19px; }
  .v-collage .pop-head { padding-right: 92px; margin-bottom: 14px; }
  .v-collage .pop-title { gap: 6px; }
  .v-collage .pop-art { width: min(calc(var(--pw) * 0.17px), 100%); }
  .v-collage .pop-ja { font-size: 15px; }
  .v-collage .pop-body { font-size: 14px; line-height: 1.7; }
  .v-collage .pop-body p { margin: 0 0 10px; }
  .v-collage .pop-table p { margin: 0; }
  .v-collage .pop-name { font-size: 22px; }
  .v-collage .pop-hw { width: min(230px, 72%); margin: 2px 0 10px; }
  .v-collage .pop-table { margin-bottom: 14px; }
  .v-collage .pop-table th, .v-collage .pop-table td { padding: 8px 0; }
  .v-collage .pop-table th { width: 4.4em; padding-right: 10px; }
  .v-collage .pop-note { font-size: 12.5px; }
  .v-collage .pop-cta { font-size: 14px; }
  .v-collage .pop-split .pop-cover { width: min(200px, 60%); }
  .v-collage .acc-venue { font-size: 16px; }
}
/* the card's text is written in: a soft ink edge moves left → right (--pen = how far it has got) */
@property --pen { syntax: "<length>"; inherits: false; initial-value: 0px; }
.pen {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--pen) - 30px), transparent var(--pen));
  mask-image: linear-gradient(90deg, #000 calc(var(--pen) - 30px), transparent var(--pen));
}
/* masking tape over the card's corners (placed and stuck by the script; grows from its left end) */
.sheet-tape {
  position: absolute;
  z-index: 3;
  width: 110px;
  max-width: none;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform-origin: 0% 50%;
  mix-blend-mode: multiply;
}
.pop-art { position: relative; display: block; width: min(calc(var(--pw) * 0.3px), 100%); aspect-ratio: var(--ar); }
.pop-art .chip .ink { display: none; }
.pop-access { display: grid; gap: 12px; }
.pop-access p { margin: 0; }
.acc-venue { font-family: var(--serif-ja); font-size: 17px; }
.acc-addr { display: block; margin-top: 4px; font-family: var(--sans, inherit); font-size: 13px; }
.acc-note { font-size: 13px; color: var(--blue); }
.acc-map { position: relative; aspect-ratio: 4 / 3; background: #eeece6; }
.acc-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(.35) contrast(1.02); }
.acc-link { color: var(--blue); border-bottom: 1px solid currentColor; text-decoration: none; }
.cl-sheet-threads { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; overflow: visible; }
.cl-sheet-threads line { stroke: var(--thread); stroke-width: 1; vector-effect: non-scaling-stroke; }

@media (prefers-reduced-motion: reduce) {
  .pc { will-change: auto; }
  .map-tag { transition: none; }
  .chip .ink { transition: none; }
}
