* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #525252;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #262626;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.header-link:hover,
.header-link.active {
  color: var(--text-primary);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: white;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.header-cta:hover {
  background: var(--accent-hover);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent);
  color: white;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

/* Section */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
.footer {
  padding: 3rem 1.5rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Docs/Specs Layout */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 4rem;
}

.docs-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  position: fixed;
  top: 4rem;
  bottom: 0;
  overflow-y: auto;
}

.docs-sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.docs-sidebar-nav {
  list-style: none;
}

.docs-sidebar-nav li {
  margin-bottom: 0.25rem;
}

.docs-sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.docs-sidebar-nav a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.docs-sidebar-nav a.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}

.docs-sidebar-section {
  margin-top: 2rem;
}

.docs-content {
  flex: 1;
  margin-left: 280px;
  padding: 3rem;
  max-width: 900px;
}

.docs-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.docs-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.5rem;
}

.docs-content code {
  background: var(--bg-card);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.875em;
}

.docs-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.docs-content pre code {
  background: none;
  padding: 0;
}

.docs-content a {
  color: var(--accent);
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content .lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.card-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Spec Status */
.spec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.spec-status.draft {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.spec-status.stable {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.spec-status.experimental {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

/* Spec Scope (Federation vs Local) */
.spec-scope {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.spec-scope.federation {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.spec-scope.local {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* Category Section */
.category-section {
  margin-top: 3rem;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

.category-section.federation {
  background: rgba(59, 130, 246, 0.03);
  border-color: rgba(59, 130, 246, 0.2);
}

.category-section.local {
  background: rgba(34, 197, 94, 0.03);
  border-color: rgba(34, 197, 94, 0.2);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.category-icon.federation {
  background: rgba(59, 130, 246, 0.1);
}

.category-icon.local {
  background: rgba(34, 197, 94, 0.1);
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  border: none;
  padding: 0;
}

.category-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .docs-sidebar {
    display: none;
  }

  .docs-content {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.75rem 1rem;
  }

  .header-links {
    display: none;
  }

  .docs-content {
    padding: 1.5rem 1rem;
  }

  .docs-content h1 {
    font-size: 2rem;
  }
}
