/* ==========================================================================
   G-TEC Design System | base.css
   Modern Reset + Base Typography
   ========================================================================== */

/* ---- Modern CSS Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: var(--f-sans);
  font-size: 18px; /* 50-60代でも読みやすい基本サイズ */
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul, ol { list-style: none; }

a {
  color: var(--c-gold);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-gold-hover); }

address { font-style: normal; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* ---- 見出し（Typography Hierarchy） ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-serif);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--c-text);
}

h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  font-weight: 600;
  line-height: 1.3;
}

h2 {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 600;
  line-height: 1.4;
}

h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.5;
}

h4 {
  font-size: clamp(19px, 1.9vw, 22px);
  font-weight: 500;
}

p {
  line-height: 1.9;
}

strong { font-weight: 700; color: var(--c-text); }

small { font-size: 0.9em; }

/* ---- 日本語の改行最適化 ---- */
h1, h2, h3, h4, h5, h6, p {
  /* 句読点・カッコ等の行頭禁則・行末禁則を厳格化 */
  line-break: strict;
  /* 単語を区切りで改行（対応ブラウザで有効） */
  word-break: auto-phrase;
  /* 孤立語・見栄え最適化（Chrome/Safari最新） */
  text-wrap: pretty;
}

/* 途中改行させたくないフレーズ用の汎用クラス */
.u-nobreak {
  display: inline-block;
}

/* ---- セレクション（選択時のハイライト） ---- */
::selection {
  background: var(--c-gold);
  color: var(--c-bg);
}

/* ---- スクロールバー（WebKit） ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-bg-deep); }
::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--c-gold); }

/* ---- フォーカスリング（アクセシビリティ） ---- */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

/* ---- 汎用ユーティリティ ---- */
.container {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 0 var(--s-lg);
}

.container-narrow {
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 var(--s-lg);
}

.container-wide {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--s-lg);
}

@media (max-width: 640px) {
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--s-md);
  }
}
