/* ── Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f0f4ff; /* Cool blue-tinted page background */
  --surface: #f8fafc; /* Card / lifted surface */
  --sidebar-bg: #ffffff; /* Sidebar white */
  --border: #dde3ed; /* Cool border */
  --text: #1e242b; /* Main text */
  --text-muted: #6c757d; /* Muted text */
  --accent: #0d6efd; /* Primary blue */
  --accent-hover: #0b5ed7;
  --accent-light: #dbeafe; /* Accent tint */
  --code-bg: #212830; /* Dark code background */
  --radius: 8px;
  --radius-sm: 5px;
  --sidebar-w: 264px;
  --bg-gradient: linear-gradient(135deg, #fcefea 0%, #e8eefc 50%, #8daeff 100%);

  /* HTTP method badge colors */
  --get-bg: #d1fae5;
  --get-fg: #065f46;
  --post-bg: #dbeafe;
  --post-fg: #1e40af;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}
body[data-lang="ja"] {
  font-family: "Noto Sans JP", "Inter", system-ui, sans-serif;
}

/* ── Layout ────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.lang-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Nav */
.nav {
  flex: 1;
  padding: 12px 0 32px;
  overflow-y: auto;
}
.nav a {
  display: block;
  padding: 6px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.nav a:hover {
  color: var(--text);
  background: var(--bg);
}
.nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}

/* ── Main content ──────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}
.content {
  max-width: 840px;
  margin: 0 auto;
  padding: 56px 52px 96px;
}

/* ── Sections ──────────────────────────────────────────────────── */
.section {
  margin-bottom: 72px;
  scroll-margin-top: 24px;
}
.section + .section {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ── Typography ────────────────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
}
h2 {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 32px;
}
h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 20px;
}
p {
  margin-bottom: 14px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
strong {
  font-weight: 600;
}
ul,
ol {
  padding-left: 22px;
  margin-bottom: 14px;
}
li {
  margin-bottom: 7px;
}

/* ── Hero block ────────────────────────────────────────────────── */
.hero {
  background: var(--bg-gradient);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px 48px;
  margin-bottom: 44px;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hero h1 {
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── Callout ───────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 14px;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.callout.info {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
}
.callout.warning {
  background: #fffbeb;
  border-left: 3px solid #d97706;
}
.callout.success {
  background: #ecfdf5;
  border-left: 3px solid #059669;
}
.callout-icon {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}
.callout p:last-child {
  margin-bottom: 0;
}

/* ── Numbered steps ────────────────────────────────────────────── */
.steps {
  counter-reset: steps;
  list-style: none;
  padding: 0;
}
.steps > li {
  counter-increment: steps;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.steps > li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content {
  flex: 1;
}
.step-content h4 {
  margin-top: 0;
}

/* ── Code ──────────────────────────────────────────────────────── */
code {
  font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", monospace;
  font-size: 0.875em;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}
pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 22px;
  position: relative;
}
pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: #e8e2d9;
  line-height: 1.7;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 3px 11px;
  font-size: 11.5px;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.copy-btn.copied {
  background: rgba(5, 150, 105, 0.25);
  border-color: rgba(5, 150, 105, 0.45);
  color: #6ee7b7;
}
.code-file {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

/* ── Table ─────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
}
th {
  background: var(--bg);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: none;
}
td code {
  font-size: 12px;
}

/* ── HTTP method badges ────────────────────────────────────────── */
.method {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}
.method-get {
  background: var(--get-bg);
  color: var(--get-fg);
}
.method-post {
  background: var(--post-bg);
  color: var(--post-fg);
}
.method-patch {
  background: #f3e8ff;
  color: #7e22ce;
}
.method-delete {
  background: #fee2e2;
  color: #b91c1c;
}

/* ── Endpoint card ─────────────────────────────────────────────── */
.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.endpoint-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 13.5px;
  font-weight: 500;
}
.endpoint-body {
  font-size: 13.5px;
  color: var(--text-muted);
}
.endpoint-body code {
  font-size: 12px;
  color: var(--text);
}

/* ── GitHub card ───────────────────────────────────────────────── */
.github-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  margin-top: 28px;
}
.github-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(13, 110, 253, 0.12);
  text-decoration: none;
}
.github-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.github-card-body h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}
.github-card-body p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ── FAQ item ──────────────────────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.faq-q {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}
.faq-a {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}
.faq-a code {
  font-size: 12px;
  color: var(--text);
}
.faq-a a {
  color: var(--accent);
}

/* ── Nav groups ────────────────────────────────────────────────── */
.nav-group-label {
  display: block;
  padding: 16px 20px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}
.nav-group + .nav-group .nav-group-label {
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.nav-group a {
  padding-left: 28px;
}

/* ── Coming soon badge ─────────────────────────────────────────── */
.badge-coming-soon {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Overview section ──────────────────────────────────────────── */
.overview-theme {
  margin-bottom: 36px;
}
.overview-theme-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.overview-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}
.overview-card h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.4;
}
.overview-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* ── i18n language blocks ──────────────────────────────────────── */
div[data-lang] {
  display: none;
}
div[data-lang].visible {
  display: block;
}
span[data-lang] {
  display: none;
}
span[data-lang].visible {
  display: inline;
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 28px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── Mobile ────────────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99;
}
.sidebar-overlay.visible {
  display: block;
}

@media (max-width: 800px) {
  .mobile-menu-btn {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 40px 20px 64px;
  }
  .hero {
    padding: 28px 24px;
  }
}
