/*
 * base.css — リセット・デザイントークン（CSS Custom Properties）・基礎タイポグラフィ
 *
 * 実際の配色・フォント・文字サイズは assets/css/presets/{slug}.css が
 * デザインプリセットごとに上書きする。ここで定義するのは、
 * プリセットCSSが万一読み込まれない場合の最低限のfallback値と、
 * 3プリセット共通のGlobal Layout Tokens（コンテナ幅・余白・角丸・
 * トランジション）。レイアウトtokenはpreset側に依存しない値のため、
 * ここが唯一の定義場所になる。
 */

/* ---------- リセット ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	overflow-x: hidden;
}

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

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

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

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

table {
	border-collapse: collapse;
}

/* ---------- デザイントークン：色・フォント fallback（プリセットCSS未読込時の安全値） ---------- */
:root {
	--color-primary: #1b3a5c;
	--color-primary-strong: #12283f;
	--color-accent: #c9a227;
	--color-text: #1f2328;
	--color-text-subtle: #5b636b;
	--color-bg: #ffffff;
	--color-bg-subtle: #f5f7f9;
	--color-border: #e2e6ea;
	--color-button-text: #ffffff;
	--color-focus: #2f6fed;

	--font-base: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", sans-serif;
	--font-heading: var(--font-base);
	--font-en: var(--font-base);

	/* フォントのweight・字間・行間（presetごとに上書きする。既定値は従来の見た目と同じ） */
	--font-weight-body: 400;
	--font-weight-heading: 700;
	--font-weight-statement: var(--font-weight-heading);
	--letter-spacing-body: normal;
	--letter-spacing-heading: normal;
	--line-height-body: 1.8;
	--line-height-heading: 1.35;

	--font-size-body: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
	--font-size-small: 0.875rem;
	--font-size-label: 0.8125rem;
	--font-size-hero: clamp(2rem, 1.6rem + 2vw, 3.25rem);
	--font-size-section: clamp(1.5rem, 1.3rem + 0.9vw, 2.25rem);
	--font-size-heading: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
	--font-size-subheading: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

/* ---------- Global Layout Tokens（3preset共通・色/フォントに依存しない） ---------- */
:root {
	/* コンテナ幅：wide＝Hero等の大胆な写真、既定＝通常コンテンツ、narrow＝本文・メッセージ */
	--container-wide: 1600px;
	--container: 1240px;
	--container-narrow: 760px;
	--container-pad: clamp(20px, 4vw, 48px);

	/* セクション縦余白（clampのみでbreakpoint分岐を作らない） */
	--section-space: clamp(64px, 9vw, 152px);
	--section-space-small: clamp(40px, 6vw, 88px);

	/* 汎用スペーシングスケール */
	--space-xs: clamp(4px, 0.4vw + 3px, 8px);
	--space-sm: clamp(10px, 0.6vw + 7px, 14px);
	--space-md: clamp(16px, 1.4vw + 11px, 24px);
	--space-lg: clamp(24px, 2.6vw + 16px, 40px);
	--space-xl: clamp(40px, 4.5vw + 24px, 72px);

	/* 角丸 */
	--radius-sm: 4px;
	--radius-md: 12px;
	--radius-lg: 24px;

	/* トランジション */
	--transition-fast: 160ms ease;
	--transition-base: 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 基礎タイポグラフィ ---------- */
body {
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-base);
	font-size: var(--font-size-body);
	font-weight: var(--font-weight-body);
	letter-spacing: var(--letter-spacing-body);
	line-height: var(--line-height-body);
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-heading);
	line-height: var(--line-height-heading);
	letter-spacing: var(--letter-spacing-heading);
	margin: 0;
	font-weight: var(--font-weight-heading);
}

p {
	margin: 0 0 1em;
}

p:last-child {
	margin-bottom: 0;
}

/* ---------- アクセシビリティ ---------- */
.nm-skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	z-index: 1000;
	padding: var(--space-sm) var(--space-md);
	background: var(--color-primary);
	color: var(--color-button-text);
	transition: top var(--transition-fast);
}

.nm-skip-link:focus {
	top: 0;
}

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

@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;
		scroll-behavior: auto !important;
	}
}
