/* =========================================================
   ベーススタイル（リセットと要素の既定値）
   ========================================================= */

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

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100dvh;
  /* 本文が横にはみ出さないようにする（表やコードは各要素の中でスクロールさせる） */
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 700; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

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

button { font-family: inherit; }

code, pre { font-family: var(--font-mono); }

/* フォーカスリングは消さない（NFR-U-04） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 画面に出さないが読み上げには載せる */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* キーボード操作でヘッダを飛ばせるようにする */
.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  transition: top 0.15s;
}

.skip-link:focus { top: var(--sp-2); }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
[hidden] { display: none !important; }
