/* ============================================
   Monogatari — Base Styles
   ============================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Cinzel+Decorative:wght@400;700;900&family=Noto+Serif+JP:wght@200;300;400;500;600;700;900&family=Inter:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ── リセット ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-color: var(--color-void);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── テクスチャオーバーレイ ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--texture-grain);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

/* ── カスタムスクロールバー ── */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-dark-wood);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-abyss);
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-dark-wood) var(--color-abyss);
}

/* ── 基本要素 ── */
a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-gold-bright);
}

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

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

input, textarea {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-gold);
  line-height: 1.2;
  letter-spacing: 0.05em;
}

h1 { font-size: var(--text-hero); font-family: var(--font-display); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  margin-bottom: var(--space-md);
}

/* ── セレクション ── */
::selection {
  background: rgba(212, 168, 83, 0.3);
  color: var(--color-text-primary);
}

/* ── フォーカス ── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ── ユーティリティ ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.text-gold { color: var(--color-text-gold); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
