:root {
  color-scheme: light;
  --bg: #0b1114;
  --bg-muted: #10181c;
  --bg-card: #0f1b21;
  --border: #1f2b32;
  --text: #f4f6f7;
  --text-muted: #c9d4da;
  --accent: #3fd09b;
  --accent-strong: #2fb080;
  --warning: #f7c948;
  --danger: #f26d6d;
  --link: #7cd1ff;
  --code-bg: #0a0f12;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --max-width: 1180px;
  --content-max: 880px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.05rem);
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 12px 16px;
  display: inline-block;
  background: var(--accent);
  color: #0a0f12;
  border-radius: var(--radius-sm);
  margin: 16px;
}

.header {
  background: linear-gradient(140deg, rgba(15, 27, 33, 0.95), rgba(9, 14, 17, 0.95)),
    url("../images/araponga-icon.svg") no-repeat right clamp(4%, 6vw, 8%) / clamp(140px, 22vw, 220px);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 32px;
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.return-banner {
  background: rgba(63, 208, 155, 0.12);
  border: 1px solid rgba(63, 208, 155, 0.4);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.return-banner a {
  color: var(--accent);
  font-weight: 600;
}

.hero-tag {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.4rem);
  margin: 12px 0 16px;
}

.hero p {
  max-width: 720px;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  background: var(--accent);
  color: #07251b;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 32px);
  padding: clamp(24px, 4vw, 32px) 0 clamp(48px, 6vw, 64px);
}

main {
  min-width: 0;
  width: 100%;
  max-width: var(--content-max);
}

.nav {
  position: sticky;
  top: 24px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  padding: 20px;
}

.nav h2 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(63, 208, 155, 0.12);
}

.section {
  padding: clamp(24px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(1.6rem, 1.5vw + 1rem, 2.2rem);
  margin-top: 0;
}

.section h3 {
  font-size: clamp(1.1rem, 0.9rem + 0.5vw, 1.4rem);
}

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

.section .eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 24px);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.card h3 {
  margin-top: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(63, 208, 155, 0.2);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.callout {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}

.code-block {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: clamp(12px, 2.5vw, 16px);
  overflow-x: auto;
  border: 1px solid var(--border);
  color: #d7e3ea;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.8rem, 0.75rem + 0.3vw, 0.95rem);
  line-height: 1.5;
}

pre,
code {
  overflow-x: auto;
}

code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre code {
  overflow-wrap: normal;
  white-space: pre;
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin-top: 16px;
  display: block;
  overflow-x: auto;
}

.kv-table th,
.kv-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.kv-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.diagram {
  margin: 24px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 16px;
  overflow-x: auto;
}

.diagram img {
  border-radius: 12px;
  margin: 0 auto;
}

.diagram figcaption {
  margin-top: 12px;
  color: #24333b;
  font-size: 0.9rem;
}

.flow-step {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 16px;
}

.flow-step h4 {
  margin: 0 0 6px;
}

.notice {
  background: rgba(247, 201, 72, 0.1);
  border: 1px solid rgba(247, 201, 72, 0.4);
  color: #f7d98c;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.api-explorer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-card);
}

.api-explorer .button {
  margin-top: 12px;
}

#openapi-browser {
  margin-top: 24px;
}

.swagger-hidden {
  display: none;
}

.openapi-tag {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.openapi-tag h3 {
  margin-top: 0;
}

.endpoint {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg-muted);
  overflow-x: auto;
}

.endpoint summary {
  cursor: pointer;
  list-style: none;
}

.endpoint summary::-webkit-details-marker {
  display: none;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 999px;
  margin-right: 8px;
  background: rgba(63, 208, 155, 0.2);
  color: var(--accent);
}

.method.post { background: rgba(124, 209, 255, 0.2); color: #7cd1ff; }
.method.put { background: rgba(247, 201, 72, 0.2); color: #f7c948; }
.method.patch { background: rgba(242, 109, 109, 0.2); color: #f26d6d; }
.method.delete { background: rgba(242, 109, 109, 0.2); color: #f26d6d; }

.schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.schema-card {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.schema-card h4 {
  margin-top: 0;
}

.schema-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.footer {
  padding: 40px 0 60px;
  color: var(--text-muted);
}

.footer a {
  color: var(--text);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .nav {
    position: relative;
    top: 0;
  }
}

@media (min-width: 640px) {
  .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-two {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    justify-content: center;
  }

  .kv-table th,
  .kv-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}
