/* v32：紙面の背景にだけ粒子を置く。文字・画像にはノイズを重ねない。 */
:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23000' filter='url(%23paper)' opacity='.03' d='M0 0h128v128H0z'/%3E%3C/svg%3E");
}
body, .site-header, .work-bridge, .about, .likes, .contact, .work-card,
.likes-list, .likes-detail, .visitor-counter, footer {
  background-image: var(--paper-grain);
  background-repeat: repeat;
  background-size: 128px 128px;
}
.hero {
  background-color: var(--paper);
  /* Astra r1：背景と文字色の同時補間は中間色で読めなくなるため瞬時切替。 */
  transition: none;
}
.contact, .visitor-counter, footer { background-color: var(--paper); }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--paper-grain) repeat;
  background-size: 128px 128px;
  opacity: 1;
  transition: opacity 620ms ease;
}
/* SVG内のalpha .03 × 2/3 = 夜のalpha .02。 */
.hero.is-night::after { opacity: .6666667; }
.hero .portrait-frame { transition: opacity 520ms ease; }
.hero .portrait-frame img { filter: sepia(.06) saturate(.96); }
.portrait-frame, .work-image { position: relative; }
.portrait-frame::after, .work-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 247, .9);
}
.work-image { box-shadow: 0 2px 5px #17171312; }
/* v31の役割色は4.084:1。6件だけ暗い赤にして本文AAを満たす。 */
#works.works-unified .work-role { color: #b73328; }
.about .kana { color: #5b554c; }
/* 既存の拡大を解除。文字を含む作品画像のcontainと比率は維持。 */
.work-link:hover .work-image img { transform: none; }
.work-image img { transition: none; }
@media (hover: hover) and (pointer: fine) {
  .work-image, .like-icon { transition: transform 180ms ease; }
  .work-link:hover .work-image, .like-item:hover .like-icon { transform: translateY(-2px); }
}
/* タッチの疑似hoverは塗りと動きを残さない。選択状態はv31どおり。 */
@media (hover: none), (pointer: coarse) {
  .work-link:hover .work-image, .like-item:hover .like-icon { transform: none; transition: none; }
  .like-item:hover:not(.is-active):not(:focus-visible) { background-color: transparent; }
  .like-item:hover:not(.is-active):not(:focus-visible)::before { content: none; }
  .sky-toggle:hover { background-color: #ef7d32; }
  .hero.is-night .sky-toggle:hover { background-color: #f3efe5; }
  .all-works-link:hover { background-color: transparent; }
}
/* 本文は初フレームから可読。初回だけ淡い無彩色の光が通る。 */
html.v32-loading::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, #fff 48%, transparent 78%);
  opacity: 0;
  animation: paperArrival 600ms ease-out both;
}
@keyframes paperArrival {
  0% { opacity: 0; transform: translateX(-20%); }
  30% { opacity: .04; }
  100% { opacity: 0; transform: translateX(20%); }
}
@media (prefers-reduced-motion: reduce) {
  html.v32-loading::after { display: none; animation: none; }
  .work-link:hover .work-image, .like-item:hover .like-icon { transform: none; }
  .hero, .hero::after, .hero .portrait-frame, .work-image, .like-icon { transition: none; }
}
