/* ─── COMMON.CSS ─────────────────────────────────────────────────────────────
   全9ページ共通スタイル。読込順: common.css → connect.css/recruit-common.css → ai-chat.css → <style>
   ────────────────────────────────────────────────────────────────────────── */

/* ─── VARIABLES & RESET ─── */
:root {
  --blue: #0057ff;
  --blue2: #003acc;
  --orange: #f39800;
  --bg: #060b14;
  --bg2: #0d1a2e;
  --bg3: #0f2040;
  --text: #e8edf5;
  --muted: #4a6080;
  --muted2: #7a95b8;
  --border: rgba(0,87,255,0.15);
  --sw: 280px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.jakarta { font-family: 'Space Grotesk', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ─── 背景 Canvas（ネットワーク + トラック） ─── */
#network-canvas,
#truck-canvas {
  position: fixed;
  top: 0;
  left: var(--sw);
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}
#network-canvas { opacity: 0.28; }
#truck-canvas { display: none !important; }

/* ─── デジタルグリッドオーバーレイ ─── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,87,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,87,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

/* ─── SIDEBAR ─── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sw);
  background: rgba(4,8,16,0.97);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  z-index: 200;
  display: flex; flex-direction: column;
  padding: 24px 14px;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.sb-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: #fff;
  margin-bottom: 4px; padding: 0 10px;
}
.sb-logo em { color: var(--orange); font-style: normal; }
.sb-tag {
  font-size: 8px; letter-spacing: .3em; color: var(--muted); text-transform: uppercase;
  padding: 0 10px; margin-bottom: 24px;
}
.sb-nav {
  display: flex; flex-direction: column;
  gap: 3px; margin-bottom: 16px;
  overflow-y: auto; flex-grow: 1;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(0,87,255,0.1); border-radius: 2px; }
.sb-group {
  display: flex; flex-direction: column;
  gap: 2px; margin-bottom: 6px;
}
.sb-group-title {
  font-size: 15px; font-weight: 700; color: #fff;
  padding: 8px 10px; display: flex; align-items: center;
  text-decoration: none;
}
.sb-group-title.active { color: #60a5fa; }
.sb-sub-nav {
  display: flex; flex-direction: column;
  gap: 2px; border-left: 1px solid rgba(0,87,255,0.1);
  margin-left: 18px; padding-left: 8px;
}
.sb-item {
  display: flex; align-items: center;
  padding: 8px 12px; border-radius: 6px; text-decoration: none;
  color: rgba(255,255,255,.45); font-size: 14px; font-weight: 500;
  transition: all .2s; border: 1px solid transparent;
}
.sb-item:hover, .sb-item.active {
  background: rgba(0,87,255,.08); border-color: rgba(0,87,255,.15);
  color: rgba(255,255,255,.9);
}
.sb-item.active { color: #60a5fa; font-weight: 700; }
.sb-item.parent-link {
  font-size: 15px; font-weight: 700; color: #fff;
  padding: 8px 10px;
}
.sb-item.parent-link.active { color: #60a5fa; }
.sb-item.disabled {
  opacity: 0.35; cursor: not-allowed; pointer-events: none;
}
.sb-item.disabled::after {
  content: '✕'; font-size: 10px; color: var(--muted);
  margin-left: auto; font-weight: bold;
}
.sb-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.sb-cta {
  display: block; padding: 12px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  text-align: center; font-size: 13px; font-weight: 700;
  color: #fff; text-decoration: none; letter-spacing: .05em;
  transition: opacity .2s; margin-bottom: 12px;
}
.sb-cta:hover { opacity: .82; }
.sb-tel { text-align: center; font-size: 12px; color: var(--text); line-height: 1.8; margin-top: 4px; }
.sb-tel strong { color: #fff; font-size: 20px; display: block; letter-spacing: 0.02em; margin-bottom: 4px; font-weight: 700; }

/* ─── HAMBURGER ─── */
#hbg {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 300;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hl { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
#hbg.open .hl:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hbg.open .hl:nth-child(2) { opacity: 0; }
#hbg.open .hl:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
#ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 199; }

/* ─── MAIN ─── */
#main { margin-left: var(--sw); position: relative; z-index: 2; }

/* ─── SECTIONS ─── */
.sec { padding: 110px 80px; }
.lbl {
  display: block; font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .4em;
  color: var(--blue); text-transform: uppercase; margin-bottom: 20px;
}
.title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(36px,5vw,64px); font-weight: 700;
  line-height: 1.05; letter-spacing: -.035em;
}
.title .o { color: var(--orange); }
.body { font-size: 17px; color: var(--muted2); line-height: 1.95; max-width: 720px; margin-top: 18px; }
.reveal { opacity: 0; }

/* ─── SUBPAGE HERO ─── */
.sub-hero {
  padding: 140px 80px 80px;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,26,46,0.3) 0%, transparent 100%);
}
.sub-hero-glow {
  display: none;
}
.sub-hero-h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(40px,6vw,72px); font-weight: 700;
  line-height: 1.1; letter-spacing: -.03em; margin-bottom: 24px;
}

/* ─── CTA BANNER ─── */
.cta-banner {
  background: linear-gradient(135deg, #0d1a2e 0%, #0f2040 100%);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  text-align: center; padding: 80px 24px;
}
.cta-banner-title { font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 24px; }
.cta-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn-p {
  padding: 14px 32px; border-radius: 7px;
  background: var(--blue); color: #fff;
  font-weight: 700; font-size: 15px; text-decoration: none;
  letter-spacing: .05em; transition: all .22s;
  border: 1px solid var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-p:hover { background: var(--blue2); transform: translateY(-2px); color: #fff; }
.btn-s {
  padding: 14px 32px; border-radius: 7px;
  background: rgba(255,255,255,0.15); color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none;
  letter-spacing: .05em; transition: all .22s;
  border: 1px solid rgba(0,87,255,0.35);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-s:hover { border-color: rgba(0,87,255,.65); background: rgba(255,255,255,0.25); transform: translateY(-2px); color: #fff; }

/* ─── FOOTER ─── */
footer {
  background: #030608; border-top: 1px solid var(--border);
  padding: 80px 80px 60px;
}
.footer-container {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px;
}
.footer-left {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left;
}
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: rgba(255,255,255,.35); margin-bottom: 24px; }
.footer-logo em { color: var(--orange); font-style: normal; }
.footer-links { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.footer-links a { font-size: 15px; color: var(--muted2); text-decoration: none; font-weight: 500; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--muted); margin-top: auto; }
.footer-right { text-align: left; }
.footer-table {
  width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.8;
}
.footer-table td { padding: 6px 0; color: var(--text); border: none; }
.footer-table .ft-lbl { color: var(--muted); width: 140px; font-weight: 500; }

/* ─── AIチャットボット ─── */
#ai-chat {
  position: fixed; bottom: 28px; right: 28px; z-index: 500;
}
.ai-chat-btn {
  width: 60px; height: 60px; border-radius: 20px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 8px 32px rgba(0,87,255,.4);
  transition: transform .25s; font-size: 24px;
}
.ai-chat-btn:hover { transform: scale(1.08); }
.ai-chat-popup {
  position: absolute; bottom: 72px; right: 0;
  width: 320px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; display: none; box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.ai-chat-popup.open { display: block; }
.ai-chat-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.ai-chat-desc { font-size: 12px; color: var(--muted2); line-height: 1.7; margin-bottom: 16px; }
.ai-chat-soon {
  background: rgba(0,87,255,.1); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: 11px; color: var(--blue);
  letter-spacing: .1em; text-align: center;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .sec { padding: 84px 48px; }
  .sub-hero { padding: 130px 48px 72px; }
  footer { padding: 64px 48px 48px; }
  .footer-container { gap: 56px; }
}

@media (max-width: 900px) {
  :root { --sw: 0px; }
  #sidebar { transform: translateX(-280px); width: 280px; }
  #sidebar.open { transform: translateX(0); }
  #hbg { display: flex; }
  #ov.active { display: block; }
  #main { margin-left: 0; }
  #network-canvas,
  #truck-canvas { left: 0; }
  .sec { padding: 80px 24px; }
  .sub-hero { padding: 120px 24px 60px; }
  footer { padding: 60px 24px 40px; }
  .footer-container { grid-template-columns: 1fr; gap: 48px; }
  .footer-right { align-items: center; text-align: center; }
  .footer-links { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 16px; }
  .footer-copy { margin-top: 16px; }
  #ai-chat { bottom: 16px; right: 16px; }
}

/* ─── タブレット縦 / 小型タブレット ─── */
@media (max-width: 768px) {
  .sec { padding: 64px 20px; }
  .sub-hero { padding: 104px 20px 48px; }
  .body { font-size: 16px; line-height: 1.85; }
  .cta-banner { padding: 64px 20px; }
  .cta-btns { gap: 12px; }
  footer { padding: 52px 20px 36px; }
  .footer-container { gap: 36px; }
}

/* ─── スマートフォン ─── */
@media (max-width: 600px) {
  .sec { padding: 56px 18px; }
  .lbl { font-size: 11px; letter-spacing: .3em; margin-bottom: 14px; }
  .body { font-size: 15px; margin-top: 14px; }
  .sub-hero { padding: 96px 18px 44px; }
  .sub-hero-h1 { margin-bottom: 18px; }

  /* ボタンは横幅いっぱい・タップしやすく */
  .cta-banner { padding: 52px 18px; }
  .cta-banner-title { margin-bottom: 20px; }
  .cta-btns { flex-direction: column; gap: 12px; }
  .btn-p, .btn-s { width: 100%; padding: 15px 24px; font-size: 15px; }

  /* フッターを縦積み・読みやすく */
  footer { padding: 44px 18px 32px; }
  .footer-container { gap: 28px; }
  .footer-logo { font-size: 20px; margin-bottom: 18px; }
  .footer-links { gap: 12px 18px; }
  .footer-table { font-size: 14px; }
  .footer-table td { display: block; padding: 2px 0; }
  .footer-table .ft-lbl { width: auto; padding-top: 10px; color: var(--muted); }

  /* サイドバー（オープン時）を画面幅に追従 */
  #sidebar { width: min(280px, 86vw); }
  #sidebar.open { transform: translateX(0); }

  /* AIチャットを小さめに */
  .ai-chat-btn { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
  .ai-chat-popup { width: min(300px, calc(100vw - 32px)); }
}

/* ─── 小型スマートフォン（iPhone SE 等） ─── */
@media (max-width: 400px) {
  .sec { padding: 48px 14px; }
  .sub-hero { padding: 88px 14px 40px; }
  .body { font-size: 14px; }
  footer { padding: 40px 14px 28px; }
  #hbg { top: 12px; left: 12px; width: 42px; height: 42px; }
  #ai-chat { bottom: 12px; right: 12px; }
}
