/* ==========================================================================
   Base : リセットと要素の既定スタイル
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-ivory);
  color: var(--c-charcoal);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  line-break: strict;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-menu-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--heading);
  font-family: var(--ff-serif);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  font-feature-settings: "palt";
  text-wrap: balance;
  word-break: auto-phrase; /* 文節単位で改行（対応ブラウザのみ） */
}

p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  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;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--c-ink);
  color: var(--c-ivory);
  font-size: var(--fs-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* セクションのテーマ面：背景と文字色を semantic token から取る */
.theme-ink,
.theme-charcoal,
.theme-white,
.theme-ivory {
  background: var(--surface);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
