/*
 * 共通ヘッダー専用スタイル（自己完結）
 * ============================================================
 * 独自のデザインシステムを持つツール（例: gtm-diff）に、
 * 共通ヘッダーだけを安全に載せるためのCSSです。
 *
 * 通常の共通テーマ（assets/css/style.css）を読み込むツールは
 * このファイルは不要です。style.css 側に同等の定義があります。
 *
 * 衝突回避のため、すべて `.tooles-header` 配下にスコープしています。
 * 変数も #tooles-header-scope に閉じ込めているため、ホスト側の
 * :root 変数を上書きしません。
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Syne:wght@700;800&display=swap');

#tooles-header-scope {
  --th-bg:        #0a0a0f;
  --th-surface2:  #1a1a26;
  --th-border:    #2a2a3d;
  --th-accent:    #00e5ff;
  --th-text:      #e2e2f0;
  --th-muted:     #6b6b8a;
  --th-header-bg: rgba(10,10,15,0.85);
}
#tooles-header-scope[data-theme="light"] {
  --th-bg:        #f0f4f8;
  --th-surface2:  #e8edf3;
  --th-border:    #c8d3e0;
  --th-accent:    #0099bb;
  --th-text:      #1a1a2e;
  --th-muted:     #6b7a8d;
  --th-header-bg: rgba(240,244,248,0.9);
}

.tooles-header {
  --th-height: 57px; /* sticky オフセット計算用 */
  border-bottom: 1px solid var(--th-border);
  height: var(--th-height);
  padding: 0 1.25rem;
  background: var(--th-header-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: 'Syne', sans-serif;
}
.tooles-header * { box-sizing: border-box; }

.tooles-header .th-logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--th-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.tooles-header .th-dot {
  width: 8px; height: 8px;
  background: var(--th-accent);
  border-radius: 50%;
  animation: th-pulse 2s infinite;
}
@keyframes th-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .4; transform: scale(.8); }
}

.tooles-header .th-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tooles-header .th-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.tooles-header .th-nav-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--th-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tooles-header .th-nav-item:hover {
  color: var(--th-accent);
  border-color: var(--th-border);
  background: var(--th-surface2);
}
.tooles-header .th-nav-item.active {
  color: var(--th-accent);
  border-color: var(--th-accent);
  background: rgba(0,229,255,0.06);
}
#tooles-header-scope[data-theme="light"] .th-nav-item.active {
  background: rgba(0,153,187,0.08);
}

.tooles-header .th-toggle {
  background: var(--th-surface2);
  border: 1px solid var(--th-border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--th-muted);
  transition: all 0.2s;
  white-space: nowrap;
}
.tooles-header .th-toggle:hover {
  border-color: var(--th-accent);
  color: var(--th-accent);
}
.tooles-header .th-toggle .toggle-icon { font-size: 0.9rem; transition: transform 0.4s ease; }
.tooles-header .th-toggle:hover .toggle-icon { transform: rotate(20deg); }

@media (max-width: 640px) {
  .tooles-header .th-nav { display: none; }
}
