/* 色：写真の ETERNA ブリーチバイパスのような、彩度を落としたアクセント */
:root {
  --color-l-accent: #5f7470;
  --color-d-accent: #9fb3ae;

  /* 紙っぽい背景色 */
  --color-l-background: #f3efe6;
  --color-d-background: #1c1b18;

  /* ざらつき（SVG のノイズ） */
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-noise-opacity: 0.22;
}
:root[data-theme="dark"] {
  --paper-noise-opacity: 0.35;
}

/* 画面全体にノイズを重ねる（クリックは素通り） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: var(--paper-noise);
  background-size: 240px 240px;
  opacity: var(--paper-noise-opacity);
  mix-blend-mode: multiply;
  animation: paper-grain 0.8s steps(1) infinite;
}

/* ざらつきを動かす（フィルムグレインのように位置を飛ばす） */
@keyframes paper-grain {
  0%   { background-position: 0 0; }
  12%  { background-position: -37px 81px; }
  25%  { background-position: 113px -24px; }
  37%  { background-position: -92px -133px; }
  50%  { background-position: 58px 147px; }
  62%  { background-position: -151px 33px; }
  75%  { background-position: 129px 96px; }
  87%  { background-position: -18px -167px; }
}

/* 動きを減らす設定の人には止める */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
:root[data-theme="dark"] body::before {
  filter: invert(1);
  mix-blend-mode: screen;
}

/* 日本語本文の行間と字間 */
.rendered-mdx {
  line-height: 1.9;
  letter-spacing: 0.02em;
}
.rendered-mdx h1,
.rendered-mdx h2,
.rendered-mdx h3 {
  font-feature-settings: "palt";
  letter-spacing: 0.04em;
}
