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

/* ========== ルート要素 ========== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--kc-font-sans);
  font-size: var(--kc-font-size-base);
  font-weight: var(--kc-font-weight-regular);
  line-height: var(--kc-line-height-base);
  color: var(--kc-color-text-primary);
  background: var(--kc-color-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 見出し(ヒラギノ明朝 ProN) ==========
 * design-spec §12.8: 大見出しは Light、小見出しは SemiBold。
 * 明朝体は「大きいほど細く、小さいほど太く」の黄金ルールに沿う。 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--kc-font-serif);
  line-height: var(--kc-line-height-tight);
  color: var(--kc-color-text-primary);
}

h1 {
  font-size: var(--kc-font-size-4xl);
  font-weight: var(--kc-weight-serif-light);
  letter-spacing: var(--kc-letter-spacing-tight);
}

h2 {
  font-size: var(--kc-font-size-3xl);
  font-weight: var(--kc-weight-serif-light);
  letter-spacing: var(--kc-letter-spacing-tight);
}

h3 {
  font-size: var(--kc-font-size-2xl);
  font-weight: var(--kc-weight-serif-bold);
}

h4 {
  font-size: var(--kc-font-size-xl);
  font-weight: var(--kc-weight-serif-bold);
}

h5, h6 {
  font-weight: var(--kc-weight-serif-bold);
}

strong {
  font-weight: var(--kc-weight-sans-bold);
}

/* モバイル時の見出し縮小 */
@media (max-width: 767px) {
  h1 { font-size: var(--kc-font-size-3xl); }
  h2 { font-size: var(--kc-font-size-2xl); }
  h3 { font-size: var(--kc-font-size-xl); }
}

/* ========== 段落・リンク ========== */
p {
  line-height: var(--kc-line-height-base);
}

a {
  color: var(--kc-color-text-accent);
  text-decoration: none;
  transition: opacity var(--kc-transition-fast);
}

a:hover {
  opacity: 0.7;
}

/* ========== 画像 ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== ボタン(ベース) ========== */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ========== リスト ========== */
ul, ol {
  list-style: none;
}

/* ========== フォーム要素 ========== */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* =========================================================
 * Warm Elegance 拡張(design-spec.md §4.4.2, §9.5, §12.4, §12.5)
 * - body全体に薄いグレインテクスチャを重ねて紙のような質感に
 * - Adobe Fonts 読み込み完了までは body を opacity: 0 で待機(FOUT対策)
 * ========================================================= */
body {
  position: relative;
  min-height: 100vh;

  opacity: 0;
  transition: opacity 400ms var(--kc-ease-gentle);
}

.wf-active body,
.wf-inactive body {
  opacity: 1;
}

.wf-loading body {
  opacity: 0;
  animation: kc-fout-fallback 600ms var(--kc-ease-gentle) 800ms forwards;
}

@keyframes kc-fout-fallback {
  to { opacity: 1; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../images/decorative/grain.svg");
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 600ms var(--kc-ease-gentle) 200ms;
}

.wf-active body::before,
.wf-inactive body::before {
  opacity: 0.35;
}

@media (max-width: 767px) {
  body::before {
    display: none;
  }
}
/* ========== コンテナ ========== */
.kc-container {
  width: 100%;
  max-width: var(--kc-container-default);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--kc-space-md);
  padding-right: var(--kc-space-md);
}

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

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

@media (min-width: 768px) {
  .kc-container {
    padding-left: var(--kc-space-xl);
    padding-right: var(--kc-space-xl);
  }
}

/* ========== ヘッダー ========== */
.kc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--kc-color-bg-base);
  border-bottom: 1px solid var(--kc-color-border-subtle);
  transition: box-shadow var(--kc-transition-base);
}

.kc-header--scrolled {
  box-shadow: var(--kc-shadow-subtle);
}

.kc-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.kc-header__logo {
  display: flex;
  flex-direction: column;
  color: var(--kc-color-text-primary);
  text-decoration: none;
}

.kc-header__logo-name {
  font-family: var(--kc-font-serif);
  font-size: var(--kc-font-size-xl);
  font-weight: var(--kc-font-weight-medium);
  line-height: 1.2;
}

.kc-header__logo-role {
  font-size: var(--kc-font-size-xs);
  color: var(--kc-color-text-secondary);
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.kc-header__nav-list {
  display: flex;
  gap: var(--kc-space-xl);
  align-items: center;
}

.kc-header__nav-link {
  color: var(--kc-color-text-primary);
  font-size: var(--kc-font-size-sm);
  padding: var(--kc-space-sm) 0;
  position: relative;
}

.kc-header__nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--kc-color-pink-400);
  transition: width var(--kc-transition-base), left var(--kc-transition-base);
}

.kc-header__nav-link:hover::after {
  width: 100%;
  left: 0;
  opacity: 1;
}

.kc-header__nav-link--cta {
  background: var(--kc-color-pink-400);
  color: var(--kc-color-text-inverse);
  padding: var(--kc-space-sm) var(--kc-space-lg);
  border-radius: var(--kc-radius-full);
  font-weight: var(--kc-font-weight-medium);
}

.kc-header__nav-link--cta::after {
  display: none;
}

.kc-header__nav-link--cta:hover {
  opacity: 0.9;
}

.kc-header__menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.kc-header__menu-toggle-bar {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--kc-color-text-primary);
  transition: transform var(--kc-transition-base), opacity var(--kc-transition-base);
}

/* モバイル */
@media (max-width: 767px) {
  .kc-header__nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--kc-color-bg-base);
    border-bottom: 1px solid var(--kc-color-border-subtle);
    padding: var(--kc-space-lg) 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--kc-transition-base), opacity var(--kc-transition-base);
  }

  .kc-header__nav--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .kc-header__nav-list {
    flex-direction: column;
    gap: var(--kc-space-md);
    align-items: center;
  }

  .kc-header__menu-toggle {
    display: flex;
  }

  .kc-header__menu-toggle[aria-expanded="true"] .kc-header__menu-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .kc-header__menu-toggle[aria-expanded="true"] .kc-header__menu-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .kc-header__menu-toggle[aria-expanded="true"] .kc-header__menu-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

/* ========== フッター ========== */
.kc-footer {
  background: var(--kc-color-bg-subtle);
  padding: var(--kc-space-3xl) 0 var(--kc-space-xl);
  margin-top: var(--kc-space-4xl);
}

.kc-footer__main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--kc-space-2xl);
  padding-bottom: var(--kc-space-2xl);
  border-bottom: 1px solid var(--kc-color-border-subtle);
}

.kc-footer__brand-name {
  font-family: var(--kc-font-serif);
  font-size: var(--kc-font-size-2xl);
  color: var(--kc-color-text-primary);
  margin-bottom: var(--kc-space-sm);
}

.kc-footer__brand-tagline {
  font-size: var(--kc-font-size-sm);
  color: var(--kc-color-text-secondary);
}

.kc-footer__nav-title {
  font-family: var(--kc-font-sans);
  font-size: var(--kc-font-size-sm);
  font-weight: var(--kc-font-weight-medium);
  color: var(--kc-color-text-accent);
  margin-bottom: var(--kc-space-md);
  letter-spacing: 0.1em;
}

.kc-footer__nav-list li,
.kc-footer__sns-list li {
  margin-bottom: var(--kc-space-sm);
}

.kc-footer__nav-list a,
.kc-footer__sns-list a {
  color: var(--kc-color-text-primary);
  font-size: var(--kc-font-size-sm);
}

.kc-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--kc-space-lg);
}

.kc-footer__legal {
  display: flex;
  gap: var(--kc-space-lg);
}

.kc-footer__legal a {
  font-size: var(--kc-font-size-xs);
  color: var(--kc-color-text-secondary);
}

.kc-footer__copyright {
  font-size: var(--kc-font-size-xs);
  color: var(--kc-color-text-secondary);
}

/* モバイル */
@media (max-width: 767px) {
  .kc-footer__main {
    grid-template-columns: 1fr;
    gap: var(--kc-space-xl);
  }

  .kc-footer__bottom {
    flex-direction: column;
    gap: var(--kc-space-md);
    text-align: center;
  }
}

/* =========================================================
 * Warm Elegance: ヘッダーナビリンクの上質化(design-spec.md §6.2)
 * 右から消え、左から現れる二段階の下線アニメーション
 * ========================================================= */
.kc-header__nav-link {
  overflow: hidden;
}

.kc-header__nav-link::after {
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 500ms var(--kc-ease-gentle);
}

.kc-header__nav-link:hover::after {
  width: 100%;
  left: 0;
  transform: scaleX(1);
  transform-origin: left center;
}
