/* ============================================
   QUANTUM CIRCUIT — Multi-Agent Design Theme
   Color: Dark Navy × Electric Blue × Amber
   Fonts: Outfit + Noto Sans JP
   ============================================ */

/* --- 1. Variables --- */
:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1d32;
  --bg-tertiary: #142440;
  --bg-card: rgba(15, 29, 50, 0.65);
  --bg-glass: rgba(10, 22, 40, 0.75);
  --accent-blue: #00d4ff;
  --accent-amber: #ffb800;
  --accent-blue-dim: rgba(0, 212, 255, 0.15);
  --accent-amber-dim: rgba(255, 184, 0, 0.15);
  --text-primary: #e8edf5;
  --text-secondary: #8899b0;
  --text-heading: #ffffff;
  --border-glass: rgba(0, 212, 255, 0.12);
  --border-glow: rgba(0, 212, 255, 0.4);
  --glow-blue: 0 0 20px rgba(0, 212, 255, 0.15);
  --glow-blue-strong: 0 0 30px rgba(0, 212, 255, 0.25);
  --glow-amber: 0 0 20px rgba(255, 184, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 64px;
  --max-width: 1200px;
  --sidebar-width: 320px;
  --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', 'Outfit', sans-serif;
}

/* --- 2. Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-amber); }
ul, ol { list-style: none; }

/* --- 3. Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.3;
  font-weight: 700;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1.2em; }

/* --- 4. Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 64px;
}
.main-content { min-width: 0; }

/* --- 5. Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 1000;
  transition: background 0.3s;
}
.site-header.scrolled {
  background: rgba(10, 22, 40, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--accent-blue); }
.logo-icon {
  color: var(--accent-blue);
  font-size: 1.3rem;
}

/* --- 6. Navigation --- */
.main-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-body);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}
.dropdown-toggle .arrow {
  font-size: 0.7em;
  transition: transform 0.2s;
}
.nav-item.has-dropdown:hover .dropdown-toggle .arrow,
.nav-item.has-dropdown.open .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

/* --- 7. Dropdown --- */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.nav-item.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu li a {
  display: block;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.dropdown-menu li a:hover {
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}

/* --- 8. Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- 9. Hero --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: var(--header-height);
}
.hero-sub { min-height: 50vh; }
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.25) 0%, rgba(10, 22, 40, 0.55) 100%);
  z-index: 1;
}
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  max-width: 900px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000, 0 4px 8px rgba(0,0,0,0.5);
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  font-weight: 400;
}

/* --- 10. Breadcrumb --- */
.breadcrumb {
  padding: 14px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb a { color: var(--accent-blue); }
.breadcrumb span.sep { margin: 0 8px; opacity: 0.5; }

/* --- 11. Section Styling --- */
.section-block {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.section-block:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-blue);
}
.section-block h2 {
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent-blue-dim);
}
.section-block h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--accent-blue);
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent-blue);
}
.section-block h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-amber);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--accent-amber);
}
.section-block ul,
.section-block ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}
.section-block ul { list-style: none; padding-left: 0; }
.section-block ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
}
.section-block ul li::before {
  content: '\25B8';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
}
.section-block ol { list-style: decimal; padding-left: 1.5em; }
.section-block ol li { margin-bottom: 8px; }

/* --- 12. Feature Cards (Index) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.feature-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-blue-strong);
  transform: translateY(-4px);
}
.feature-card h3 {
  color: var(--accent-blue);
  margin-bottom: 12px;
}
.feature-card h3 a { color: inherit; }
.feature-card h3 a:hover { color: var(--accent-amber); }
.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- 13. News Section --- */
.news-list { margin-top: 16px; }
.news-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent-amber);
  white-space: nowrap;
  flex-shrink: 0;
}
.news-title { font-size: 0.95rem; font-weight: 500; }
.news-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- 14. Sidebar --- */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-section {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue-dim);
  color: var(--accent-blue);
}
.sidebar-toc ul { display: flex; flex-direction: column; gap: 4px; }
.sidebar-toc a {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.sidebar-toc a:hover {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  padding-left: 18px;
}
.sidebar-related ul { display: flex; flex-direction: column; gap: 6px; }
.sidebar-related a {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar-related a:hover {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  padding-left: 18px;
}

/* --- 15. Banners --- */
.amazon-banner {
  background: linear-gradient(135deg, rgba(255, 153, 0, 0.12), rgba(255, 184, 0, 0.08));
  border: 1px solid rgba(255, 184, 0, 0.2);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.amazon-banner:hover {
  border-color: rgba(255, 184, 0, 0.4);
  box-shadow: var(--glow-amber);
}
.amazon-banner a {
  color: var(--accent-amber);
  font-weight: 600;
  font-size: 0.95rem;
}
.sidebar-banner {
  text-align: center;
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-banner a { display: inline-block; }
.sidebar-banner img { border-radius: var(--radius-sm); }
.inline-banner {
  margin: 24px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  text-align: center;
}
.inline-banner a { display: inline-block; }
.inline-banner img { border-radius: var(--radius-sm); max-width: 100%; }

/* --- 16. Article Image --- */
.article-image {
  border-radius: var(--radius);
  margin-bottom: 32px;
  border: 1px solid var(--border-glass);
  overflow: hidden;
}
.article-image img { width: 100%; display: block; }

/* --- 17. Benefits List --- */
.benefits-list li {
  position: relative;
  padding: 12px 16px 12px 40px;
  margin-bottom: 8px;
  background: var(--accent-blue-dim);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-blue);
}
.benefits-list li::before {
  content: '\2713';
  position: absolute;
  left: 14px;
  color: var(--accent-blue);
  font-weight: 700;
}

/* --- 18. CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--accent-blue-dim);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-top: 32px;
}
.cta-section h2::before { display: none; }
.cta-section p { color: var(--text-secondary); }
.cta-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.cta-link {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent-blue-dim);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}
.cta-link:hover {
  background: rgba(0, 212, 255, 0.25);
  color: #fff;
  transform: translateY(-2px);
}

/* --- 19. Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  padding: 40px 24px;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.footer-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent-blue); }
.site-footer p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* --- 20. Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.stagger-children .fade-in:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .fade-in:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .fade-in:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .fade-in:nth-child(5) { transition-delay: 0.4s; }

/* --- 21. Responsive --- */
@media (max-width: 1024px) {
  :root { --sidebar-width: 280px; }
  .content-wrapper { gap: 30px; }
}

@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sidebar { position: static; order: 2; }
  .hamburger { display: flex; }
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100dvh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-glass);
    padding: var(--header-height) 0 24px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
    flex-direction: column;
  }
  .main-nav.active { right: 0; }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
  }
  .nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    justify-content: space-between;
  }
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(0, 212, 255, 0.05);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: none;
    backdrop-filter: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }
  .nav-item.has-dropdown.open .dropdown-menu {
    max-height: 500px;
    padding: 8px;
  }
  .dropdown-menu li a {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
  .nav-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  .nav-overlay.active { opacity: 1; visibility: visible; }
}

@media (max-width: 600px) {
  .hero { min-height: 50vh; }
  .hero-sub { min-height: 40vh; }
  .hero h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
  .section-block { padding: 20px 16px; }
  .container { padding: 0 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .news-item { flex-direction: column; gap: 4px; }
  .site-logo { font-size: 1rem; }
  .header-inner { padding: 0 12px; }
  .cta-links { flex-direction: column; align-items: center; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.4rem; }
  .hero-subtitle { font-size: 0.9rem; }
}
