/* ==========================================================================
   Base — リセットと要素の既定スタイル
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: 0.01em;
  word-break: auto-phrase; /* 日本語の見出しを文節で改行（対応ブラウザのみ） */
  text-wrap: balance;
}
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
small { font-size: var(--fs-sm); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

:focus-visible {
  outline: 3px solid var(--c-leap);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }

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

/* Layout primitives */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--c-ink);
  color: var(--c-paper);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--s-4); }

.muted { color: var(--c-ink-3); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 仮の文言マーカー（本番では出力されない） */
.ph {
  text-decoration: underline dotted var(--c-leap) 2px;
  text-underline-offset: 0.25em;
  cursor: help;
}
