/* =========================================================
   木村インダストリー株式会社 コーポレートサイト
   共通スタイルシート
   モノクロ基調 / ミニマル / 超大型タイポグラフィ
   ========================================================= */

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

html {
  scroll-behavior: smooth;
}

/* fixed ヘッダー（透明背景＋白チップのロゴ/ナビ）の実測高さ。
   JSが読み込み後・リサイズ時に正確な値へ上書きする。
   ここでの値は JS 無効時・実行前の暫定フォールバック */
:root {
  --header-h: 110px;
}

@media (max-width: 840px) {
  :root {
    --header-h: 84px;
  }
}

@media (max-width: 540px) {
  :root {
    --header-h: 70px;
  }
}

body {
  background: #fff;
  color: #000;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 2.25;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* ヘッダーは透明・fixedで浮いているため、本文側のオフセットは不要 */
  padding-top: 0;
}

/* モバイルのハンバーガーメニュー展開中は背景スクロールを止める */
body.nav-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* アンカー移動時に見出しが fixed ヘッダーに隠れないための余白 */
#about,
#services,
#company {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 50px;
}

.section {
  padding: 140px 0;
}

.section + .section {
  padding-top: 0;
}

/* Figma実測値に合わせた各セクションの上下パディング（ID指定で .section を上書き） */
#about {
  padding-top: 50px;
  padding-bottom: 100px;
}

#services {
  padding-top: 0;
  padding-bottom: 100px;
}

#company {
  padding-top: 0;
  padding-bottom: 0;
}

/* Figma仕様: COMPANY PROFILEバーと表の間の隙間は0（ABOUT/SERVICESの48pxはそのまま） */
#company .section-label-bar {
  margin-bottom: 0;
}

/* ---------- Fade-in on scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* JSが動かない/読み込み前は常に表示（コンテンツを隠さない） */
.no-js .fade-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   ヘッダー
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  /* 透明ヘッダー: 下のコンテンツ(ヒーロー動画など)に重なって浮く構成 */
  background: transparent;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 50px;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  color: #000;
  flex-shrink: 0;
  background: #fff;
  padding: 6px 10px;
}

.logo img {
  height: 48px;
  width: auto;
  max-width: 100%;
  display: block;
}

.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.nav a {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #000;
  background: #fff;
  padding: 4px 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: #000;
  color: #fff;
}

/* ハンバーガーメニュー用ボタン群。841px以上では非表示（840px以下は下部のメディアクエリで表示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: none;
  padding: 0;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #000;
}

.nav-close {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #000;
  line-height: 1;
  padding: 0;
}

.nav-toggle:focus-visible,
.nav-close:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* =========================================================
   ヒーロー
   ========================================================= */
.hero {
  position: relative;
  height: 95vh;
  min-height: 480px;
  background: #fff;
}

.hero-media {
  position: absolute;
  /* ヘッダーは透明・fixedで浮いているため、実測ヘッダー高＋余白ぶんの
     白帯を確保し、ロゴ/ナビの白チップがその中に収まるようにする */
  top: calc(var(--header-h) + 12px);
  left: 30px;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: #000;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   ABOUT
   （理念セクションはFigma側でABOUTに統合されたため削除・統合済み）
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
}

.about-grid h1 {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.75rem); /* 32px 〜 60px */
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.about-body {
  padding-top: 12px;
}

.about-body p {
  font-size: 16px;
  line-height: 2.25;
}

.about-body p + p {
  margin-top: 24px;
}

.about-photo {
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   共通セクションラベルバー（装飾のみ／ABOUT US・SERVICES・COMPANY PROFILE）
   CONTACTへのリンク付きバー(.section-bar)はFigma側で削除確定のため撤去済み
   ========================================================= */
.section-label-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  overflow: hidden;
  color: #000;
  /* セクション先頭に配置。直下の見出し/コンテンツとの間隔を確保 */
  margin-bottom: 48px;
}

.bar-label {
  position: relative;
  z-index: 1;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  transition: color 0.4s ease;
  padding-left: 50px;
}

.section-label-bar .bar-label {
  padding-left: 0;
}

/* =========================================================
   SERVICES
   ========================================================= */
.service-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 500px);
  gap: 60px;
  align-items: center;
  padding: 30px 0 50px;
  border-top: 1px solid #000;
}

.service-block:first-child {
  border-top: none;
}

.service-number {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: clamp(4rem, 2.1rem + 8.7vw, 9rem); /* 64px 〜 144px */
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.service-name {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 3rem); /* 28px 〜 48px */
  line-height: 1.4;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

/* 英字ブランド名（THE SAKURA / Nord Guitar Vault / coffee & sweets）が
   単語の途中で折れないようにする。ただし540px以下の狭幅では
   横スクロール発生を防ぐため折り返しを許可する */
.brand-nowrap {
  white-space: nowrap;
}

@media (max-width: 540px) {
  .brand-nowrap {
    white-space: normal;
  }
}

.service-desc {
  font-size: 16px;
  line-height: 2.25;
  max-width: 560px;
}

.service-note {
  font-size: 13px;
  line-height: 1.8;
  margin-top: 16px;
  color: #000;
}

.service-photo {
  width: 100%;
  aspect-ratio: 500 / 340; /* Figma仕様: 500×340枠にcover表示。幅は列側のminmax(280px,500px)で上限500pxに制御 */
  overflow: hidden;
}

.service-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   COMPANY
   ========================================================= */
.company-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid #000;
}

.company-row:first-child {
  border-top: 1px solid #000;
}

.company-row dt {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 14px;
}

.company-row dd {
  font-size: 15px;
  line-height: 1.9;
}

.company-row dd p + p {
  margin-top: 8px;
}

/* =========================================================
   フッター
   ========================================================= */
.site-footer {
  padding: 50px 0 30px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 80px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  color: #000;
}

.footer-logo img {
  height: 56px;
  width: auto;
  max-width: 100%;
  display: block;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-nav-col a {
  text-decoration: none;
  color: #000;
  font-size: 15px;
}

.footer-nav-col.jp a {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
}

.footer-nav-col a:hover {
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  border-top: 1px solid #000;
  padding-top: 24px;
}

.footer-address {
  /* 存在する場合は左に寄せ、コピーライトを右端に押し出す。
     住所を省略するページ（index.html）でもコピーライトが右寄せのまま崩れない */
  margin-right: auto;
  font-size: 13px;
  line-height: 1.9;
}

.footer-copyright {
  font-size: 13px;
}

/* =========================================================
   CONTACT ページ
   ========================================================= */
.contact-hero {
  /* ヘッダーが透明・fixedで浮いているため、実測ヘッダー高＋余白ぶんを
     上パディングとして確保し、見出しが隠れないようにする */
  padding: calc(var(--header-h) + 20px) 0 60px;
}

.contact-hero h1 {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(2.25rem, 1.37rem + 3.9vw, 4.5rem); /* 36px 〜 72px */
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.contact-hero p {
  font-size: 16px;
  line-height: 2.25;
  max-width: 640px;
}

.contact-form-section {
  padding: 40px 0 120px;
}

.contact-form {
  max-width: 830px;
}

.form-group {
  margin-bottom: 32px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.required-badge {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 2px;
}

.form-input,
.form-textarea {
  width: 100%;
  background: #f7f7f7;
  border: 1px solid #000;
  font-family: inherit;
  font-size: 16px;
  padding: 0 20px;
  height: 56px;
  transition: border-width 0.15s ease, padding 0.15s ease;
}

.form-textarea {
  height: 180px;
  padding: 16px 20px;
  resize: vertical;
  line-height: 1.8;
}

.form-input:focus,
.form-textarea:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
  border-width: 2px;
  padding-left: 19px;
}

.form-textarea:focus {
  padding-left: 19px;
  padding-top: 15px;
}

.form-note {
  font-size: 13px;
  color: #444;
  margin-top: 12px;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 16px;
  padding: 20px 60px;
  transition: background 0.3s ease, color 0.3s ease;
}

.submit-btn:hover {
  background: #fff;
  color: #000;
}

.direct-contact {
  border-top: 1px solid #000;
  padding: 80px 0 120px;
}

.direct-contact h2 {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 20px;
  margin-bottom: 40px;
}

.direct-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
}

.direct-contact-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.direct-contact-item span {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.direct-contact-item a {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(1.25rem, 0.9rem + 3.5vw, 2.5rem); /* 20px 〜 40px、狭幅で自動縮小 */
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
}

.direct-contact-item a:hover {
  text-decoration: underline;
}

/* =========================================================
   レスポンシブ: 840px
   ========================================================= */
@media (max-width: 840px) {
  .container {
    padding: 0 30px;
  }

  .section {
    padding: 90px 0;
  }

  /* Figma実測値のデスクトップ余白をモバイルで比例的に縮小（約0.65倍） */
  #about {
    padding-top: 32px;
    padding-bottom: 65px;
  }

  #services {
    padding-bottom: 65px;
  }

  .site-footer {
    padding-top: 32px;
    padding-bottom: 20px;
  }

  .header-inner {
    padding: 18px 30px;
  }

  .logo {
    padding: 5px 8px;
  }

  .logo img {
    height: 36px;
  }

  /* デフォルトは非表示。ハンバーガーで開いたときだけ .is-open で表示する */
  .nav {
    display: none;
    gap: 10px;
  }

  .nav a {
    font-size: 12px;
    padding: 3px 6px;
  }

  /* ハンバーガーボタンを表示 */
  .nav-toggle {
    display: flex;
  }

  /* メニュー展開時: 全画面の白背景メニュー */
  .nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    gap: 32px;
    background: #fff;
    z-index: 1100;
  }

  .nav.is-open a {
    background: none;
    font-size: 24px;
    padding: 12px 24px;
  }

  .nav.is-open .nav-close {
    display: flex;
    position: absolute;
    top: 18px;
    right: 30px;
    width: 44px;
    height: 44px;
    font-size: 32px;
  }

  /* メニュー展開中はハンバーガー自体を隠し、フォーカスも当たらないようにする */
  .nav.is-open ~ .nav-toggle {
    visibility: hidden;
  }

  /* JS無効時は従来どおり横並びチップナビを表示し、ハンバーガーは出さない */
  .no-js .nav-toggle {
    display: none;
  }

  .no-js .nav {
    display: flex;
  }

  .hero-media {
    top: calc(var(--header-h) + 12px);
    left: 16px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-body {
    padding-top: 0;
  }

  /* 縦積みで幅が広く取れるため、指定改行を解除して自然に折り返す */
  .about-body p br {
    display: none;
  }

  /* 840px以下では写真を非表示（PCでは従来どおり表示） */
  .about-photo {
    display: none;
  }

  .service-block {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0 40px;
  }

  /* 縦積みで幅が広く取れるため、指定改行を解除して自然に折り返す */
  .service-desc br {
    display: none;
  }

  .company-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-top {
    flex-direction: column;
    gap: 40px;
    padding-bottom: 60px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .contact-hero {
    padding: calc(var(--header-h) + 20px) 0 40px;
  }
}

/* =========================================================
   レスポンシブ: 540px
   ========================================================= */
@media (max-width: 540px) {
  .container {
    padding: 0 20px;
  }

  .header-inner {
    padding: 14px 20px;
  }

  .logo {
    padding: 4px 7px;
  }

  .logo img {
    height: 32px;
  }

  .nav {
    gap: 8px;
  }

  .nav a {
    font-size: 11px;
    padding: 3px 5px;
  }

  .hero {
    height: 70vh;
  }

  .hero-media {
    top: calc(var(--header-h) + 12px);
    left: 12px;
  }

  .bar-label {
    font-size: 15px;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
    padding: 18px 30px;
  }

  .direct-contact-list {
    gap: 32px;
  }
}

/* =========================================================
   レスポンシブ: 400px以下（ヘッダーのCONTACTが画面外に切れる問題への対処）
   ========================================================= */
@media (max-width: 400px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .logo {
    padding: 3px 6px;
  }

  /* 折り返し時にロゴ画像が幅を圧迫してnavが崩れないよう上限を設ける */
  .logo img {
    height: 28px;
    max-width: 140px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
    gap: 4px 8px;
  }

  .nav a {
    font-size: 10px;
    padding: 2px 5px;
  }
}

/* =========================================================
   アクセシビリティ: motionを減らす設定への対応
   ========================================================= */
@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;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
