:root {
  --font-japanese: var(--font-sans);
  --font-outfit: var(--font-english);
  --color-header-navy: #07172b;
  --color-header-navy-deep: #051120;
  --color-header-navy-light: #102a45;
  --color-header-navy-accent: #0b223d;
  --color-header-border: rgba(7, 23, 43, 0.8);
  --color-primary: #111827;
  --color-secondary: #1e293b;
  --color-accent-start: var(--primary-color, #00bfff);
  --color-accent-end: var(--secondary-color, #0284c7);
  --color-accent-orange: #ea580c;
  --color-bg-dark: #070e17;
  --color-bg-light: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 20px;
  --glass-shadow:
    0 4px 30px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(10, 20, 40, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --header-height: 74px;
}

@media (max-width: 1024px) {
  :root {
    --header-height: 64px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 58px;
  }
}

.header,
.header * {
  box-sizing: border-box;
}

.header a {
  text-decoration: none;
}

.header ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ヘッダー本体：画面最上部に固定（位置・幅の変動なし、スクロールで背景のみ徐々に白へ変化） */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  color: var(--color-ink, #111823);
  background-color: rgba(255, 255, 255, calc(var(--header-progress, 0) * 0.98));
  backdrop-filter: blur(calc(20px * var(--header-progress, 0)));
  -webkit-backdrop-filter: blur(calc(20px * var(--header-progress, 0)));
  border: none;
  border-bottom: 1px solid rgba(7, 23, 43, calc(0.1 * var(--header-progress, 0)));
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, calc(0.06 * var(--header-progress, 0)));
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.header__spacer {
  height: var(--header-height);
}

.home .header__spacer,
.page-recruit:has(.recruit-hero) .header__spacer {
  display: none;
}

.header__inner {
  max-width: var(--layout-max-width, 1440px);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  flex-shrink: 0;
  min-width: 0;
  position: relative;
  z-index: 1101;
}

.header__logo a {
  position: relative;
  display: flex;
  align-items: center;
  font-family: var(--font-outfit);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--color-ink, #111823);
  text-decoration: none;
}

.header__logo-wrap {
  position: relative;
  display: block;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 309 / 50;
}

.header__logo-img,
.header__logo img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  aspect-ratio: 309 / 50;
  object-fit: contain;
}

/* 白ロゴ用オーバーレイレイヤー（page-workstyleなどで最上部を白く表示しスクロールでフェードアウト） */
.header__logo-img--white {
  display: none;
}

.page-workstyle .header__logo-img--white {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
  opacity: calc(1 - var(--header-progress, 0));
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.header__logo-accent {
  color: var(--color-accent-start, var(--primary-color));
}

.header__logo-sub {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--color-secondary);
  margin-left: 2px;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header__cta {
  display: flex;
  align-items: center;
}

.header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-header-navy, #07172b) !important;
  background: transparent;
  border: 1px solid rgba(7, 23, 43, 0.4);
  border-radius: 2px;
  transition: border-color 0.35s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.header__btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--color-header-navy, #07172b);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.header__btn span {
  position: relative;
  z-index: 2;
  color: var(--color-header-navy, #07172b) !important;
  transition: color 0.3s ease;
}

.header__btn-icon {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  color: var(--color-header-navy, #07172b) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.header__btn:hover {
  border-color: var(--color-header-navy, #07172b);
}

.header__btn:hover::before {
  width: 100%;
}

.header__btn:hover span,
.header__btn:hover .header__btn-icon {
  color: #ffffff !important;
}

.header__btn:hover .header__btn-icon {
  transform: translateX(4px);
}

.header__btn:active {
  color: #ffffff !important;
}

.header__nav {
  display: flex;
  align-items: center;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header__menu-item {
  display: flex;
  align-items: center;
}

.header .header__menu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px 8px;
  margin-top: 4px;
  position: relative;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.header .header__menu-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold, #c5a880);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__menu-en {
  font-family: var(--font-outfit, "Outfit", sans-serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-ink, #111823);
  text-shadow: 0 0.5px 0.5px rgba(17, 24, 35, 0.08);
  transition: color 0.25s ease, transform 0.25s ease;
}

.header__menu-ja {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1.2;
  margin-top: 3px;
  color: var(--color-header-navy-accent, #0b2f56);
  transition: color 0.25s ease;
}

.header .header__menu-link:hover {
  transform: translateY(-3px);
}

.header .header__menu-link:hover .header__menu-en {
  color: var(--color-gold, #c5a880) !important;
}

.header .header__menu-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   ハンバーガーメニューボタン（背景濃紺・白抜き・MENU文字付き）
   ========================================================================== */
.header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--color-header-navy, #07172b);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 8px 14px;
  height: 38px;
  margin: 0;
  cursor: pointer;
  z-index: 1100;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(7, 23, 43, 0.18);
  position: relative;
}

.header__toggle:hover {
  background-color: #0b2f56;
  border-color: rgba(197, 168, 128, 0.5);
}

/* 左側の「MENU / CLOSE」文字（白抜き） */
.header__toggle::before {
  content: "MENU";
  font-family: var(--font-outfit, "Outfit", sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
  line-height: 1;
  display: inline-block;
  margin-right: 24px;
}

.header__toggle.is-open::before {
  content: "CLOSE";
  color: var(--color-gold, #c5a880);
}

/* 白抜きの3本バー */
.header__toggle-bar {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast), background-color var(--transition-fast);
}

.header__toggle-bar:nth-child(1) {
  top: 13px;
}

.header__toggle-bar:nth-child(2) {
  top: 18px;
}

.header__toggle-bar:nth-child(3) {
  top: 23px;
}

.header__toggle.is-open .header__toggle-bar {
  background-color: var(--color-gold, #c5a880);
}

.header__toggle.is-open .header__toggle-bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.header__toggle.is-open .header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.header__toggle.is-open .header__toggle-bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ==========================================================================
   レスポンシブ：早めにハンバーガーメニューへ切り替え（1200px以下）
   ========================================================================== */
@media (max-width: 1200px) {
  .header__inner {
    padding: 0 var(--container-gutter, 16px);
  }

  .header__toggle {
    display: inline-flex;
  }

  .header__logo img {
    max-width: 190px;
  }

  /* ドロワーメニュー：ヘッダーメニュー同様の白背景 × 濃紺枠線 */
  .header__right {
    position: fixed;
    top: calc(var(--header-height) + 8px) !important;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: calc(100% - 24px);
    max-width: 480px;
    height: auto;
    max-height: calc(100dvh - var(--header-height) - 16px);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1.5px solid rgba(7, 23, 43, 0.85);
    border-radius: 12px;
    z-index: 1000;
    padding: 24px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 20px 40px rgba(7, 23, 43, 0.16);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
  }

  .header__right.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }

  .header__cta {
    margin-top: 24px;
    width: 100%;
  }

  .header__btn {
    width: 100%;
    padding: 14px 0;
    font-size: 15px;
    color: #0f172a;
  }

  .header__nav {
    width: 100%;
    display: block;
  }

  .header__menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .header__menu-item {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(7, 23, 43, 0.08);
  }

  .header__menu-item:not(:last-child)::after {
    display: none;
  }

  .header .header__menu-link {
    font-size: 16px;
    padding: 15px 8px;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    position: relative;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .header .header__menu-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold, #c5a880);
    border-radius: 2px;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .header__menu-en {
    font-family: var(--font-outfit, "Outfit", sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-ink, #111823) !important;
    transition: color 0.25s ease;
  }

  .header__menu-ja {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-top: 0;
    color: var(--color-header-navy-accent, #0b2f56) !important;
    transition: color 0.25s ease;
  }

  .header .header__menu-link:hover,
  .header .header__menu-link:active {
    transform: translateX(6px);
  }

  .header .header__menu-link:hover .header__menu-en,
  .header .header__menu-link:active .header__menu-en {
    color: var(--color-gold, #c5a880) !important;
  }

  .header .header__menu-link:hover::after,
  .header .header__menu-link:active::after {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header__inner {
    padding: 0 var(--container-gutter, 12px);
  }

  .header__logo a {
    font-size: 19px;
  }

  .header__logo img {
    max-width: 140px;
  }

  .header__right {
    padding: 20px 24px 30px;
  }
}

