/* =========================================================
   base.css - リセット + 素の要素の既定スタイル
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--h-header) + var(--s-5));
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: var(--lh-base);
  /* 文字の輪郭を締めて、白背景でのコントラストを保つ */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote {
  margin: 0;
}

h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* 数字が並ぶ箇所は等幅数字にして桁を揃える */
.num {
  font-variant-numeric: tabular-nums;
}

/* キーボード操作時のみフォーカスリングを出す */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--c-accent-weak);
  color: var(--c-accent-ink);
}

/* 視覚的には隠すがスクリーンリーダーには読ませる */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 動きを減らす設定を尊重する */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
