/* ==========================================================================
   base.css — リセット / タイポグラフィ / レイアウト基盤
   色は tokens.css の var() のみを参照する（HEX直書き禁止）。
   ========================================================================== */

/* --- Font face -------------------------------------------------------- */
/* assets/fonts/ に woff2 を置けば自動で効く。未配置でも下のフォールバックで崩れない。 */
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-jp-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-jp-700.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/noto-sans-jp-900.woff2") format("woff2");
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-height);
}

body {
  min-height: 100svh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--weight-normal);
  line-height: var(--lh-body);
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 横スクロールを body で発生させない（横スクロール領域は内側に閉じ込める） */
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  line-height: var(--lh-heading);
  letter-spacing: 0.02em;
}

/* --- Accessibility ---------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent-3);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: var(--z-overlay);
  padding: var(--space-xs) var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-text);
  font-size: var(--fs-small);
  font-weight: var(--weight-bold);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

.container--narrow {
  max-width: var(--content-narrow);
}

/* セクション。破れ紙エッジを絶対配置するため relative を基準にする。 */
.section {
  position: relative;
  padding-block: var(--space-section);
  isolation: isolate;
}

.section--dark {
  background-color: var(--color-bg);
}

.section--deep {
  background-color: var(--color-bg-deep);
}

.section--light {
  background-color: var(--color-panel-light);
  color: var(--color-text-on-light);
}

/* --- Section heading -------------------------------------------------- */
.section-head {
  position: relative;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: var(--fs-h2);
  letter-spacing: 0.04em;
}

.section-title__en {
  display: block;
  margin-top: var(--space-2xs);
  font-family: var(--font-en);
  font-size: var(--fs-label);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

.section--light .section-title__en {
  color: var(--color-accent-strong);
}

/* 背面の巨大アウトライン英字（装飾専用・aria-hidden 必須）
   参考サイトでは白フチでハッキリ視認できるため、沈ませすぎない。 */
.section-bg-title {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: -1;
  translate: 0 -50%;
  font-family: var(--font-en);
  font-size: var(--fs-bg-title);
  font-weight: var(--weight-black);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-text);
  opacity: 0.34;
  pointer-events: none;
  user-select: none;
}

.section--light .section-bg-title {
  -webkit-text-stroke-color: var(--color-text-on-light);
  opacity: 0.22;
}

/* --- Text utilities --------------------------------------------------- */
.lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 2.1;
  color: var(--color-text-muted);
}

.section--light .lead {
  color: var(--color-text-on-light-muted);
}

.label {
  font-family: var(--font-en);
  font-size: var(--fs-label);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

/* 意味のまとまりの途中で改行させない（日本語の折り返し崩れ防止） */
.nowrap-unit {
  display: inline-block;
}
