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

/* テーマ定義 */
:root {
  /* ダーク（ナイト）モード - デフォルト */
  --bg-color: #05050a;
  --bg-color-rgb: 5, 5, 10;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0d0c1d 0%, #05050a 100%);
  --panel-bg: rgba(10, 10, 20, 0.7);
  --panel-border: rgba(0, 240, 255, 0.2);
  --text-main: #f0f0f5;
  --text-muted: #8a8a9e;
  
  /* エレクトリックネオンカラー */
  --neon-blue: #00f0ff;
  --neon-purple: #bd00ff;
  --neon-green: #39ff14;
  --neon-blue-glow: rgba(0, 240, 255, 0.6);
  --neon-purple-glow: rgba(189, 0, 255, 0.6);
  --neon-green-glow: rgba(57, 255, 20, 0.6);

  --shadow-sm: 0 0 10px rgba(0, 240, 255, 0.1);
  --shadow-md: 0 0 20px rgba(0, 240, 255, 0.25);
  --shadow-lg: 0 0 30px rgba(189, 0, 255, 0.35);

  --font-sans: 'Inter', sans-serif;
  --font-cyber: 'Orbitron', sans-serif;
  
  /* インフラセクション背景 & 境界線 */
  --infra-bg: rgba(10, 10, 20, 0.4);
  --border-dashed: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
  /* ライトモード */
  --bg-color: #f5f7fa;
  --bg-color-rgb: 245, 247, 250;
  --bg-gradient: radial-gradient(circle at 50% 50%, #ffffff 0%, #e2e8f0 100%);
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(0, 119, 255, 0.2);
  --text-main: #0f172a;
  --text-muted: #334155; /* コントラスト比を改善するため濃いスレートに変更 */
  
  --neon-blue: #0077ff;
  --neon-purple: #8b5cf6;
  --neon-green: #0d9488; /* 少し濃いグリーンにして視認性を確保 */
  --neon-blue-glow: rgba(0, 119, 255, 0.15);
  --neon-purple-glow: rgba(139, 92, 246, 0.15);
  --neon-green-glow: rgba(13, 148, 136, 0.15);

  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.12);
  
  --infra-bg: rgba(226, 232, 240, 0.6); /* 明るいグレーに変更 */
  --border-dashed: rgba(15, 23, 42, 0.15); /* 暗い点線に変更 */
}

/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* パーティクル用キャンバス */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* 共通レイアウト構造 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ヘッダー */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(var(--bg-color-rgb), 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-cyber);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 1.5px;
  color: var(--text-main);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue-glow);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-icon::before {
  content: '';
  width: 12px;
  height: 12px;
  background-color: var(--neon-purple);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-purple-glow);
  animation: pulse 2s infinite alternate;
}

.logo span {
  background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--neon-blue);
  text-shadow: 0 0 8px var(--neon-blue-glow);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue-glow);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* テーマ・コントロール */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  border-color: var(--neon-blue);
  box-shadow: var(--shadow-md);
  color: var(--neon-blue);
}

/* ヒーローセクション */
.hero {
  padding: 180px 0 100px 0;
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.hero-text {
  z-index: 10;
}

.tagline {
  font-family: var(--font-cyber);
  color: var(--neon-blue);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-family: var(--font-cyber);
  font-weight: 900;
  font-size: 3.8rem;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero h1 span.accent {
  background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
}

/* グリッチ効果用の影クラス */
.hero h1 span.accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue-glow);
}

.hero-desc {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ボタン */
.btn {
  font-family: var(--font-cyber);
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(189, 0, 255, 0.6);
}

.btn-secondary {
  background: rgba(10, 10, 20, 0.5);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px var(--neon-blue-glow);
  color: var(--neon-blue);
  transform: translateY(-2px);
}

/* ヒーローグラフィック */
.hero-graphic {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.orb-container {
  width: 300px;
  height: 300px;
  position: relative;
}

.orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--neon-blue-glow) 0%, transparent 70%);
  position: absolute;
  animation: float-orb 6s ease-in-out infinite;
}

.orb-ring {
  width: 120%;
  height: 120%;
  border: 2px dashed var(--neon-purple);
  border-radius: 50%;
  position: absolute;
  top: -10%;
  left: -10%;
  box-shadow: 0 0 20px var(--neon-purple-glow);
  animation: rotate-ring 15s linear infinite;
  opacity: 0.5;
}

.orb-ring-inner {
  width: 80%;
  height: 80%;
  border: 1px solid var(--neon-blue);
  border-radius: 50%;
  position: absolute;
  top: 10%;
  left: 10%;
  box-shadow: 0 0 15px var(--neon-blue-glow);
  animation: rotate-ring-reverse 10s linear infinite;
  opacity: 0.7;
}

.orb-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-cyber);
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: 0 0 10px var(--neon-blue);
  letter-spacing: 2px;
  color: #fff;
  z-index: 2;
}

/* セクション定義 */
section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 70px;
}

.section-title {
  font-family: var(--font-cyber);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.section-title span {
  color: var(--neon-blue);
  text-shadow: 0 0 10px var(--neon-blue-glow);
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* プロダクトグリッド */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

/* プロダクトカード */
.product-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 40px 30px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--neon-blue);
  box-shadow: var(--shadow-md);
}

.product-card:hover::before {
  opacity: 1;
}

.product-icon {
  font-size: 2.8rem;
  margin-bottom: 24px;
  color: var(--neon-blue);
  text-shadow: 0 0 12px var(--neon-blue-glow);
  display: inline-block;
}

.product-card.spartan .product-icon {
  color: var(--neon-blue);
}

.spartan-icon {
  height: 3.8rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--neon-blue-glow));
}

.spartan-icon.light-only {
  display: none;
}

.spartan-icon.dark-only {
  display: inline-block;
}

[data-theme="light"] .spartan-icon.light-only {
  display: inline-block;
}

[data-theme="light"] .spartan-icon.dark-only {
  display: none;
}

.lstocker-icon {
  height: 3.8rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--neon-green-glow));
  border-radius: 12px;
}

.product-name {
  font-family: var(--font-cyber);
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.product-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-description {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 30px;
  font-size: 0.95rem;
  flex-grow: 1;
}

.product-features-list {
  list-style: none;
  margin-bottom: 30px;
}

.product-features-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.product-features-list li::before {
  content: '⚡';
  position: absolute;
  left: 0;
  color: var(--neon-blue);
  font-size: 0.8rem;
}

.product-card.lstocker .product-features-list li::before {
  color: var(--neon-green);
}

.product-tech-badge {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tech-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-family: var(--font-cyber);
}

/* インフラ・認証セクション */
.infra-section {
  background: var(--infra-bg);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.infra-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.infra-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 40px;
  max-width: 750px;
  margin: 40px auto 0 auto;
  position: relative;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.05);
  text-align: left;
}

.infra-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 20px;
  height: 20px;
  border-top: 3px solid var(--neon-green);
  border-left: 3px solid var(--neon-green);
  border-top-left-radius: 12px;
}

.infra-box::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid var(--neon-green);
  border-right: 3px solid var(--neon-green);
  border-bottom-right-radius: 12px;
}

.infra-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

.infra-dot {
  width: 8px;
  height: 8px;
  background-color: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-green-glow);
  display: inline-block;
  animation: pulse-green-dot 1.5s infinite alternate;
}

@keyframes pulse-green-dot {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.infra-terminal-title {
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  color: var(--neon-green);
  letter-spacing: 2px;
}

.infra-lead {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--text-main);
}

.infra-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
}

[data-theme="light"] .infra-box {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .infra-box {
    padding: 30px 20px;
    margin-top: 30px;
  }
  .infra-lead {
    font-size: 1.1rem;
  }
  .infra-body {
    font-size: 0.9rem;
  }
}

/* お問い合わせ */
.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 50px 30px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.contact-icon {
  font-size: 3rem;
  color: var(--neon-blue);
  margin-bottom: 20px;
  text-shadow: 0 0 10px var(--neon-blue-glow);
}

.contact-email {
  font-family: var(--font-cyber);
  font-size: 1.8rem;
  color: var(--text-main);
  text-decoration: none;
  margin: 20px 0;
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
}

.contact-email:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 15px var(--neon-blue-glow);
}

.contact-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* フッター */
footer {
  border-top: 1px solid var(--panel-border);
  padding: 40px 0;
  text-align: center;
  background: rgba(5, 5, 10, 0.8);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-cyber);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

.footer-logo span {
  color: var(--neon-blue);
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

[data-theme="light"] footer {
  background: rgba(226, 232, 240, 0.8);
  border-top: 1px solid rgba(15, 23, 42, 0.15);
}

[data-theme="light"] footer .footer-logo {
  color: var(--text-main);
}

[data-theme="light"] footer .copyright {
  color: var(--text-muted);
}

/* レスポンシブナビ */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* アニメーション関連 */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

@keyframes float-orb {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

@keyframes rotate-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotate-ring-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero h1 {
    font-size: 3.2rem;
  }
}

@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero {
    padding: 120px 0 60px 0;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2.0rem; /* 中間幅での不自然な改行を防ぐため縮小 */
    line-height: 1.2;
  }

  .hero-desc {
    font-size: 1rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
  }

  .hero-actions {
    justify-content: center;
    gap: 12px;
  }

  .section-title {
    font-size: 2rem; /* スマホ向けに縮小 */
  }

  .section-desc {
    font-size: 0.95rem;
  }

  .orb-container {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  .products-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .product-card {
    padding: 30px 20px;
  }

  .infra-content {
    gap: 30px;
  }

  .menu-toggle {
    display: block;
    margin-left: 15px;
  }

  nav {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(5, 5, 10, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 60px 40px;
    transition: left 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 99;
  }

  [data-theme="light"] nav {
    background: rgba(245, 247, 250, 0.98);
  }

  nav.open {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }
  
  .contact-content {
    padding: 40px 20px;
  }
}

/* スマホ表示向けの対応 (576px以下) */
@media (max-width: 576px) {
  .hero h1 {
    font-size: 1.7rem; /* スマホ用 */
  }

  .hero-actions {
    display: flex;
    flex-direction: column !important;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-email {
    font-size: 1.3rem; /* 長いメールアドレスのはみ出し防止 */
    word-break: break-all;
  }

  section {
    padding: 60px 0; /* セクションの余白をコンパクトに */
  }

  .logo span {
    font-size: 1.1rem; /* ロゴテキストがスマホではみ出ないように */
  }
}
