/* base.css - リセットCSSとグローバルスタイル */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2026-08-11 修正バッチM2-7。土台のページは rem で組んであるため、
   ここを上げると本文も見出しも同じ比で大きくなる（1.3倍級）。
   ツール画面の px は tokens.css 側で同じ1.3倍にそろえてある */
html {
  font-size: 130%;
  /* 上に貼り付くヘッダーが、飛んだ先の見出しを隠さないようにする。
     現行でも15px隠れており、文字を大きくすると26pxまで増えた＝2026-08-11 実測 */
  scroll-padding-top: 5.5rem;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 和紙テクスチャ: 固定表示（コンテンツだけが流れることで空間の奥行きが出る）
   素材は容栄さん自作（妖孽奇譚サイトから流用・使用承認済み）。§5.2「背景」 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/assets/washi-texture.webp");
  background-size: 400px;
  mix-blend-mode: overlay;
  opacity: 0.30;
  pointer-events: none;
  z-index: -1;
}

/* 青海波: 上ほど見え、下は紙にとける（既定=薄く重ねる）。§5.2「背景」
   ※CSSグラデーション描画は粗くなるためSVGで描く */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cg fill='none' stroke='%233c5578' stroke-opacity='0.085' stroke-width='1.3'%3E%3Ccircle cx='60' cy='60' r='57'/%3E%3Ccircle cx='60' cy='60' r='43'/%3E%3Ccircle cx='60' cy='60' r='29'/%3E%3Ccircle cx='60' cy='60' r='15'/%3E%3Ccircle cx='0' cy='0' r='57'/%3E%3Ccircle cx='0' cy='0' r='43'/%3E%3Ccircle cx='0' cy='0' r='29'/%3E%3Ccircle cx='0' cy='0' r='15'/%3E%3Ccircle cx='120' cy='0' r='57'/%3E%3Ccircle cx='120' cy='0' r='43'/%3E%3Ccircle cx='120' cy='0' r='29'/%3E%3Ccircle cx='120' cy='0' r='15'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 60px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.3) 50%, transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.3) 50%, transparent 85%);
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* セレクションカラー */
::selection {
  background-color: var(--indigo-tint);
  color: var(--indigo-deep);
}

/* フォーカスアウトライン */
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

a {
  color: var(--indigo);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--indigo-deep);
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

/* ユーティリティクラス */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
