/* ===========================
   Base Styles
   =========================== */

html {
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-gothic);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 和紙テクスチャ風の微細なノイズ */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.022'/%3E%3C/svg%3E");
}

/* 本文のデフォルト padding-bottom（スマホ固定フッター分） */
body {
  padding-bottom: var(--mobile-cta-height);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.container--narrow {
  max-width: 800px;
}

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-mincho);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: 0.04em;
  /* Noto Serif JP のレンダリング最適化 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  line-height: var(--lh-body);
}

p + p {
  margin-top: 1.2em;
}

/* セクションラベル（英語）— 日本物流施設風 */
.section-label {
  font-family: var(--font-latin);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cta);
  display: inline-block;
  margin-bottom: 0.75rem;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}

/* 区切り余白 */
.section {
  padding-block: var(--section-pad);
}

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

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

/* ── Text utilities ── */
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-secondary); }
.text-light    { color: var(--text-light); }
.text-center   { text-align: center; }

/* ── Scroll Fade Animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in--delay-1 { transition-delay: 0.1s; }
.fade-in--delay-2 { transition-delay: 0.2s; }
.fade-in--delay-3 { transition-delay: 0.3s; }
.fade-in--delay-4 { transition-delay: 0.4s; }
.fade-in--delay-5 { transition-delay: 0.5s; }

/* ── Divider ── */
.divider {
  width: 48px;
  height: 2px;
  background-color: var(--accent);
  margin-block: var(--space-lg);
}

.divider--center {
  margin-inline: auto;
}

.divider--light {
  background-color: var(--accent-subtle);
}

/* ── Section heading group ── */
.section-heading {
  margin-bottom: var(--space-xl);
}

.section-heading h2 {
  margin-top: var(--space-sm);
}

/* ── Link ── */
a:not(.btn):not(.nav-link):not(.footer-link) {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) ease;
}

a:not(.btn):not(.nav-link):not(.footer-link):hover {
  color: var(--accent-hover);
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: var(--space-xl);
}

hr.hr--dark {
  border-top-color: var(--border-dark);
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background-color: var(--accent-faint);
  color: var(--text-primary);
}

/* ── Smooth scroll ── */
html {
  scroll-behavior: smooth;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ── 画像の読み込みを滑らかに ── */
img {
  transition: opacity 0.4s var(--ease-out);
}

/* ── インタラクティブ要素のカーソル統一 ── */
button, [role="button"], label[for] {
  cursor: pointer;
}

/* ── リンクのタップハイライト除去（モバイル） ── */
a, button {
  -webkit-tap-highlight-color: transparent;
}
