/* === Design Tokens (Dark Neon — always default) === */
:root {
  --bg: #121212;
  --surface: #1E1E1E;
  --inactive-fill: #2A2E35;
  --inactive-stroke: #4A5560;
  --active-core: #00E5FF;
  --active-core-hover: #00D4EB;
  --glow: rgba(0,212,235,.6);
  --glow-bright: #22D3EE;
  --text-high: rgba(255,255,255,.87);
  --text-mid: rgba(255,255,255,.60);
  --text-low: rgba(255,255,255,.38);
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --focus-ring: #00E5FF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-high);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--inactive-stroke);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

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

.site-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--active-core);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 0;
}
.site-logo:hover { color: var(--active-core-hover); }
.site-logo:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-high);
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.nav-toggle svg { display: block; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
}

.site-nav a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 12px 10px;
  border-radius: 6px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--text-high);
  background: rgba(255,255,255,.05);
}
.site-nav a[aria-current="page"] {
  color: var(--active-core);
  font-weight: 600;
}
.site-nav a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--inactive-stroke);
    padding: 8px 16px 16px;
    z-index: 900;
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .site-nav a {
    padding: 14px 12px;
    font-size: 0.9rem;
  }
}

/* === Main content === */
.page-main {
  flex: 1;
  padding: 24px 16px;
}

.page-container {
  max-width: 800px;
  margin: 0 auto;
}

/* === Footer === */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--inactive-stroke);
  padding: 20px 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-low);
}

.footer-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-low);
  text-decoration: none;
  font-size: 0.72rem;
  padding: 4px 0;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--active-core); }
.footer-links a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.site-footer a {
  color: var(--text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--active-core); }
.site-footer a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* === Content pages === */
.page-title {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-high);
}

.content-section {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--inactive-stroke);
  padding: 24px;
  margin-bottom: 20px;
}

.content-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--active-core);
  margin-bottom: 12px;
}

.content-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-high);
  margin: 16px 0 8px 0;
}

.content-section p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 12px;
}
.content-section p:last-child { margin-bottom: 0; }

.content-section ul {
  list-style: none;
  padding: 0;
}
.content-section li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-mid);
  padding-left: 1.2em;
  position: relative;
  margin-bottom: 4px;
}
.content-section li::before {
  content: "―";
  position: absolute;
  left: 0;
  color: var(--active-core);
}

.content-section a {
  color: var(--active-core);
  text-underline-offset: 2px;
}
.content-section a:hover { color: var(--active-core-hover); }
.content-section a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.placeholder-notice {
  background: rgba(0,229,255,.08);
  border: 1px solid rgba(0,229,255,.25);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-mid);
}

/* === Theme cards (themes.html) === */
.theme-section { margin-bottom: 32px; }
.theme-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--active-core);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--inactive-stroke);
}

/* Theme chips (summary nav) */
.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  align-items: center;
}
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--inactive-stroke);
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 999px;
  min-height: 44px;
  transition: border-color 0.15s, color 0.15s;
}
.theme-chip:hover {
  border-color: var(--active-core);
  color: var(--active-core);
}
.theme-chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.theme-chip-count {
  background: var(--active-core);
  color: #06222A;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
}
.theme-chip-total {
  font-size: 0.78rem;
  color: var(--text-low);
  padding: 8px 4px;
}

/* Scroll margin for anchor links under fixed header */
.theme-section {
  scroll-margin-top: 72px;
}

/* Theme note (annotation) */
.theme-note {
  font-size: 0.75rem;
  color: var(--text-low);
  margin: -8px 0 12px 0;
  font-style: italic;
}

.theme-subheading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-mid);
  margin: 20px 0 12px 0;
  padding-left: 8px;
  border-left: 3px solid var(--active-core);
}

.theme-card {
  background: var(--surface);
  border: 1px solid var(--inactive-stroke);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}
.theme-card-block {
  font-size: 0.75rem;
  color: var(--text-low);
  margin-bottom: 4px;
}
.theme-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-high);
}
.theme-card-desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 12px;
}
.theme-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--active-core);
  color: #06222A;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.15s;
}
.theme-card-link:hover { background: var(--active-core-hover); }
.theme-card-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.theme-card-link svg { width: 14px; height: 14px; }

/* === News list === */
.news-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--inactive-stroke);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.8rem;
  color: var(--text-low);
  white-space: nowrap;
  min-width: 90px;
}
.news-text {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.6;
}
