:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #5f6b7a;
  --line: #d9e0e7;
  --accent: #0e7c86;
  --accent-dark: #095861;
  --accent-soft: #e5f4f5;
  --warn-soft: #fff5de;
  --code-bg: #101820;
  --code-ink: #e7edf3;
  --shadow: 0 18px 50px rgba(24, 38, 52, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
}

p,
li,
.notice,
td,
th {
  overflow-wrap: anywhere;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

pre {
  margin: 0;
  overflow-x: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}

.topnav a {
  color: var(--muted);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(42px, 7vw, 76px) 0 36px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero h1 span {
  display: block;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.primary,
button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.terminal,
.code-view,
.side-panel,
.info-card,
.endpoint,
.api-map article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.terminal {
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid #283440;
  background: #17222d;
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8aa0b4;
}

.terminal pre,
.code-view pre,
.side-panel pre {
  padding: 18px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 14px;
  line-height: 1.6;
}

.notice {
  margin: 0 0 40px;
  padding: 16px 18px;
  border: 1px solid #ead392;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #4c3b0e;
}

.section {
  padding: 70px 0;
}

.section-head {
  max-width: 780px;
  margin-bottom: 24px;
}

.section-head.row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.section h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  letter-spacing: 0;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.section p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.hero > *,
.split > *,
.grid > *,
.flow > *,
.api-map > * {
  min-width: 0;
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.api-map article,
.side-panel {
  padding: 20px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 26px;
  align-items: start;
}

.steps {
  display: grid;
  gap: 12px;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.steps li {
  position: relative;
  padding: 16px 18px 16px 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.steps span {
  display: block;
  color: var(--muted);
}

.inline-code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eef3f6;
  color: #18323a;
}

.accent {
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding-right: max(16px, calc(50vw - 590px));
  padding-left: max(16px, calc(50vw - 590px));
  background: var(--accent-soft);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.flow div {
  padding: 18px;
  border: 1px solid #b8dce0;
  border-radius: 8px;
  background: #fff;
}

.flow span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 800;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
  border-bottom: 0;
}

.endpoint-list {
  display: grid;
  gap: 12px;
}

.endpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

.endpoint.featured {
  border-color: var(--accent);
  background: #f2fbfc;
}

.endpoint div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  min-height: 28px;
  border-radius: 6px;
  background: #18323a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.endpoint p {
  max-width: 520px;
  margin: 0;
}

.filter-label {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 13px;
}

.filter-label input {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

.tabs {
  margin-bottom: 14px;
}

.tabs button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 14px;
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.code-title p {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f6;
}

.api-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 60px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 920px) {
  .hero,
  .split,
  .grid.four,
  .grid.two,
  .flow,
  .api-map {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .section-head.row,
  .endpoint {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  main,
  .footer {
    width: min(320px, calc(100% - 40px));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.18;
    word-break: break-all;
  }

  .lead {
    font-size: 15px;
  }

  .terminal pre,
  .code-view pre,
  .side-panel pre {
    font-size: 13px;
  }

  .terminal pre,
  .terminal code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .endpoint div {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-title {
    align-items: stretch;
    flex-direction: column;
  }
}
