/* ==========================================================================
   base.css — リセット・地（紙のグレイン）・タイポグラフィの土台
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  /* 2画面スライドの裏側が横スクロールで露出しないように封じる。
     clip非対応の旧iOS向けに hidden を先に置く（新ブラウザは後勝ちでclip） */
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* 光の層（上から金・下から緑・周辺を落として奥行き）。
   スクロールしても動かないよう position:fixed の下敷きにする */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(125% 62% at 50% -12%, rgba(172, 138, 78, .21), transparent 58%),
    radial-gradient(95% 55% at 100% 108%, rgba(45, 74, 62, .12), transparent 62%),
    radial-gradient(115% 85% at 50% 45%, transparent 55%, rgba(78, 56, 25, .06));
}

/* 紙のグレイン（SVGノイズを全面にうっすら） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  border: 0;
  background: transparent;
  resize: vertical;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 見出しはセリフ */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.5;
}

/* 動きを抑える設定の端末ではアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
