/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  color: #1a1a2e;
  background: #ffffff;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

.wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 56px;
}

.full-width {
  margin: 0 calc(50% - 50vw);
  width: 100vw;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo img {
  height: 42px;
  width: auto;
}

.header-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.site-header.scrolled .header-logo .logo-text {
  color: #1a1a2e;
}

/* ===== NAV ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.3s ease;
  overflow: hidden;
  height: 40px;
}

.header-nav a .nav-en,
.header-nav a .nav-ja {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  white-space: nowrap;
}

.header-nav a .nav-en {
  display: block;
}

.header-nav a .nav-ja {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  opacity: 0;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: none;
}

.header-nav a:hover .nav-en {
  transform: translateY(-100%);
  opacity: 0;
}

.header-nav a:hover .nav-ja {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.header-nav a:hover {
  color: #ffffff;
}

.site-header.scrolled .header-nav a {
  color: rgba(0, 0, 0, 0.75);
}

.site-header.scrolled .header-nav a:hover {
  color: #000000;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #7ec8f4;
  transition: width 0.3s ease, left 0.3s ease, background 0.3s ease;
}

.site-header.scrolled .header-nav a::after {
  background: #1a1a2e;
}

.header-nav a:hover::after {
  width: 60%;
  left: 20%;
}

/* ===== Dropdown menu ===== */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.3s ease;
  overflow: hidden;
  height: 40px;
  cursor: pointer;
}

.nav-dropdown-toggle .nav-en,
.nav-dropdown-toggle .nav-ja {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  white-space: nowrap;
}

.nav-dropdown-toggle .nav-en { display: block; }

.nav-dropdown-toggle .nav-ja {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  opacity: 0;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: none;
}

.nav-dropdown:hover .nav-dropdown-toggle .nav-en {
  transform: translateY(-100%);
  opacity: 0;
}

.nav-dropdown:hover .nav-dropdown-toggle .nav-ja {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.nav-dropdown:hover .nav-dropdown-toggle { color: #ffffff; }

.site-header.scrolled .nav-dropdown-toggle { color: rgba(0, 0, 0, 0.75); }
.site-header.scrolled .nav-dropdown:hover .nav-dropdown-toggle { color: #000000; }

/* Underline */
.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #7ec8f4;
  transition: width 0.3s ease, left 0.3s ease, background 0.3s ease;
}
.site-header.scrolled .nav-dropdown-toggle::after { background: #1a1a2e; }
.nav-dropdown:hover .nav-dropdown-toggle::after {
  width: 60%;
  left: 20%;
}

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 2px 0 0 0;
}

.nav-dropdown-menu a {
  display: block;
  padding: 12px 24px;
  font-size: 13px;
  color: #1a1a2e;
  letter-spacing: 0.5px;
  text-transform: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
  height: auto;
  position: static;
}

/* Reset nav behaviors for dropdown links */
.nav-dropdown-menu a .nav-en,
.nav-dropdown-menu a .nav-ja { display: inline; position: static; transform: none; opacity: 1; }
.nav-dropdown-menu a::after { display: none; }

.nav-dropdown-menu a:hover {
  background: rgba(126, 200, 244, 0.15);
  color: #3b7fc4;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}

.site-header.scrolled .menu-toggle span {
  background: #1a1a2e;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== FOOTER ===== */
.site-footer {
  background: rgba(255, 255, 255, 0.65);
  color: #1a1a2e;
  padding: 56px 0 0;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 56px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-company .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.footer-company .footer-logo img {
  height: 36px;
  width: auto;
}

.footer-company .footer-logo span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #1a1a2e;
}

.footer-company p {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.9;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.footer-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  transition: color 0.2s;
  overflow: hidden;
  height: 24px;
}

.footer-links a .nav-en,
.footer-links a .nav-ja {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  white-space: nowrap;
}

.footer-links a .nav-en {
  display: block;
}

.footer-links a .nav-ja {
  position: absolute;
  left: 0;
  transform: translateY(100%);
  opacity: 0;
  font-size: 12px;
}

.footer-links a:hover .nav-en {
  transform: translateY(-100%);
  opacity: 0;
}

.footer-links a:hover .nav-ja {
  transform: translateY(0);
  opacity: 1;
}

.footer-links a:hover {
  color: #000000;
}

/* ===== Footer Recruit tree ===== */
.footer-recruit {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.footer-recruit-label {
  display: block;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.footer-recruit-children {
  position: relative;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-recruit-children::before {
  content: '';
  position: absolute;
  left: 6px;
  top: -6px;
  bottom: 12px;
  width: 1px;
  background: rgba(0, 0, 0, 0.35);
}
.footer-recruit-children a {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  color: rgba(0, 0, 0, 0.6);
  height: 22px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-recruit-children a::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 11px;
  width: 14px;
  height: 1px;
  background: rgba(0, 0, 0, 0.35);
}
.footer-recruit-children a:hover {
  color: #000;
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
  .wrapper {
    padding: 0 24px;
  }

  .header-inner {
    padding: 0 20px;
    height: 60px;
  }

  .header-logo img {
    height: 34px;
  }

  .header-logo .logo-text {
    font-size: 15px;
  }

  .menu-toggle {
    display: flex;
  }

  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    padding: 80px 32px 40px;
    gap: 0;
    transition: right 0.35s ease;
    backdrop-filter: blur(20px);
  }

  .header-nav.open {
    right: 0;
  }

  .header-nav a {
    width: 100%;
    padding: 14px 0;
    font-size: 14px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    height: auto;
    color: rgba(0,0,0,0.75);
  }

  .header-nav a .nav-ja {
    position: static;
    transform: none;
    opacity: 0.5;
    font-size: 11px;
    margin-left: 12px;
    display: inline;
  }

  .header-nav a .nav-en {
    display: inline;
  }

  .header-nav a:hover .nav-en {
    transform: none;
    opacity: 1;
  }

  .header-nav a:hover .nav-ja {
    opacity: 1;
  }

  .header-nav a::after {
    display: none;
  }

  /* Mobile: dropdown becomes flat */
  .nav-dropdown {
    width: 100%;
    display: block;
  }
  .nav-dropdown-toggle {
    width: 100%;
    padding: 14px 0;
    font-size: 14px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    height: auto;
    color: rgba(0,0,0,0.75);
  }
  .nav-dropdown-toggle .nav-en { display: inline; }
  .nav-dropdown-toggle .nav-ja {
    position: static;
    transform: none;
    opacity: 0.5;
    font-size: 11px;
    margin-left: 12px;
    display: inline;
  }
  .nav-dropdown-toggle::after { display: none; }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0 0 0 16px;
    border-radius: 0;
    min-width: 0;
  }
  .nav-dropdown-menu::before { display: none; }
  .nav-dropdown-menu a {
    padding: 10px 0;
    font-size: 13px;
    color: rgba(0,0,0,0.65);
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-inner {
    padding: 0 24px;
  }
}

/* ===== TABLET RESPONSIVE (768-1024px) ===== */
@media (min-width: 681px) and (max-width: 1024px) {
  .wrapper { padding: 0 32px; }
  .header-inner { padding: 0 32px; }
  .footer-inner { padding: 0 32px; }

  /* 3カラム → 2カラム */
  .mission-grid,
  .ro-mission-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }

  /* IT Solutionのチャート3カラム → 2カラム */
  .chart-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  /* 大きいHero → パディング縮小 */
  .hero-inner, .hero-content,
  .recruit-hero .hero-inner,
  .outsourcing-hero-content,
  .ro-hero-content,
  .about-hero-content {
    padding-left: 40px !important;
    padding-right: 40px !important;
  }

  /* タイトル縮小 */
  .section-title,
  .os-section-title,
  .ro-section-title {
    font-size: clamp(22px, 3.5vw, 28px) !important;
  }

  /* タッチターゲット拡張 */
  .hero-btn, .ro-hero-btn, .submit-btn,
  .ro-submit-btn, .os-recruit-btn {
    padding: 14px 28px !important;
  }
}

/* ===== EXTRA MOBILE (<=480px) — 最小端末最適化 ===== */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .wrapper { padding: 0 16px; }
  .header-inner { padding: 0 16px; height: 56px; }
  .header-logo img { height: 28px; }
  .header-logo .logo-text { font-size: 14px; }

  /* 画像の下余白などの微調整 */
  img { height: auto; }

  /* ボタンはフル幅・大きめ */
  .hero-btn, .ro-hero-btn, .os-recruit-btn {
    display: inline-block;
    padding: 14px 24px !important;
    font-size: 14px !important;
    min-height: 44px;
  }
}
