@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&display=swap');

/* DEN.Ai English header v6
   Master geometry: approved Japanese desktop header screenshot.
   This stylesheet intentionally owns the header layout by itself. */
.site-header,
.site-header * { box-sizing: border-box; }

.site-header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e6edf7;
  position: sticky;
  top: 0;
  z-index: 9999;
  font-family: "Poppins", "Noto Sans JP", Arial, sans-serif;
  overflow: visible;
}

.header-inner {
  width: 100%;
  height: 132px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
}

.logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  width: auto;
  height: 78px;
  display: block;
}

#menu-toggle,
.hamburger { display: none; }

.nav-menu {
  margin-left: 108px;
  display: flex;
  align-items: center;
  gap: 70px;
  flex: 0 0 auto;
}

.nav-menu a {
  color: #071d49;
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  transition: color .2s ease;
}

.nav-menu a:hover { color: #005ce6; }

/* Right-side area: language switch sits above Contact Us, exactly like JP reference. */
.header-actions {
  margin-left: auto;
  height: 100px;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  position: relative;
  padding: 0;
  overflow: visible;
}

.header-actions .btn {
  height: 52px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  padding: 0 24px;
  transition: background-color .2s ease;
}

.header-actions .btn.primary {
  width: 285px;
  min-width: 285px;
  background: #0861e8;
  color: #fff;
}

.header-actions .btn.outline {
  width: 252px;
  min-width: 252px;
  background: #ff9633;
  color: #fff;
}

.header-actions .btn.primary:hover { background: #ff9633; }
.header-actions .btn.outline:hover { background: #0861e8; }

.header-actions .language-switch {
  position: absolute;
  top: 0;
  right: 0;
  width: 136px;
  height: 40px;
  padding: 3px;
  display: flex;
  align-items: center;
  border: 1px solid #b9d5ff;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.header-actions .language-switch__item {
  flex: 1 1 50%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #005ce6;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.header-actions .language-switch__item.is-active {
  color: #fff;
  background: #0861e8;
}

.header-actions a.language-switch__item:hover {
  background: #eef5ff;
  color: #005ce6;
}

.mobile-language-switch { display: none; }

/* Laptop scaling: preserve the same visual hierarchy, never clip the language switch. */
@media (min-width: 1100px) and (max-width: 1500px) {
  .header-inner {
    height: 118px;
    padding: 0 28px;
  }

  .logo img { height: 70px; }

  .nav-menu {
    margin-left: 62px;
    gap: 42px;
  }

  .nav-menu a { font-size: 15px; }

  .header-actions {
    height: 90px;
    gap: 16px;
  }

  .header-actions .btn {
    height: 48px;
    font-size: 14px;
  }

  .header-actions .btn.primary {
    width: 225px;
    min-width: 225px;
  }

  .header-actions .btn.outline {
    width: 180px;
    min-width: 180px;
  }

  .header-actions .language-switch {
    top: 0;
    width: 124px;
    height: 36px;
  }

  .header-actions .language-switch__item {
    height: 28px;
    font-size: 12px;
  }
}

/* Existing compact/mobile behavior. */
@media (max-width: 1099px) {
  .header-inner {
    height: 78px;
    padding: 0 20px;
    justify-content: space-between;
  }

  .logo img { height: 62px; }

  .hamburger {
    display: block;
    width: 34px;
    cursor: pointer;
    z-index: 10002;
  }

  .hamburger span {
    display: block;
    height: 3px;
    background: #071d49;
    margin: 7px 0;
    border-radius: 4px;
  }

  .nav-menu,
  .header-actions { display: none; }

  #menu-toggle:checked ~ .nav-menu {
    display: flex;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 22px 24px;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    border-top: 1px solid #e6edf7;
    box-shadow: 0 14px 30px rgba(6,36,92,.10);
  }

  .nav-menu a { font-size: 16px; }
  .mobile-language-switch { display: flex; }
}


/* v7: compact DcodingX-style language switch.
   Only language-switch sizing/spacing is changed. */
@media (min-width: 1181px) {
  .header-actions .language-switch {
    top: -11px !important;
    right: 0 !important;
    width: 100px !important;
    height: 30px !important;
    padding: 2px !important;
    border-radius: 8px !important;
  }

  .header-actions .language-switch__item {
    height: 24px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 24px !important;
  }

  .header-actions {
    /* Gives the compact switch a clear, Japanese-reference gap above the CTA row. */
    padding-top: 0 !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .header-actions .language-switch {
    width: 96px !important;
    height: 30px !important;
    padding: 2px !important;
    border-radius: 8px !important;
  }

  .header-actions .language-switch__item {
    height: 24px !important;
    padding: 0 6px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 24px !important;
  }
}


/* v10: preserve the approved language-switch position and tighten only
   the vertical gap to the CTA buttons. */
@media (min-width: 1181px) {
  .header-actions {
    height: 92px !important;
    align-items: flex-end !important;
  }

  .header-actions .language-switch {
    top: -11px !important;
  }
}

/* FINAL HEADER SPACING — language switch position preserved; CTA row lifted closer. */
@media (min-width: 1181px) {
  .header-actions {
    height: 78px !important;
    align-items: flex-end !important;
    gap: 30px !important;
  }
  .header-actions .language-switch {
    top: -11px !important;
  }
}

/* FINAL JP-REFERENCE DESKTOP GEOMETRY — 2026-09-17 */
@media (min-width: 1181px) {
  .header-inner {
    height: 96px !important;
    min-height: 96px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center !important;
  }

  .header-actions {
    height: 84px !important;
    padding: 0 !important;
    align-items: flex-end !important;
    gap: 20px !important;
    overflow: visible !important;
  }

  .header-actions .btn {
    height: 48px !important;
    font-size: 16px !important;
  }

  .header-actions .language-switch {
    top: 0 !important;
    right: 0 !important;
    width: 100px !important;
    height: 30px !important;
    padding: 2px !important;
    border-radius: 8px !important;
  }

  .header-actions .language-switch__item {
    height: 24px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 24px !important;
  }
}
