/* ============================================================
   AIM Playr — public API documentation
   Loaded after app.css / theme.css, before neon.css.
   Uses the theme-neon tokens set on body.theme-neon.
   ============================================================ */

body.page-api-docs .site-header {
  border-bottom-color: var(--line);
}

.docs-hero {
  position: relative;
  padding: 88px 0 44px;
  border-bottom: 1px solid var(--line);
}

.docs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 300px at 18% 0%, rgba(255, 176, 46, 0.1), transparent 70%),
    linear-gradient(rgba(255, 176, 46, 0.045) 1px, transparent 1px);
  background-size: auto, 100% 44px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.docs-hero .container {
  position: relative;
}

.docs-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  max-width: 820px;
}

.docs-hero p.docs-hero__lede {
  margin: 20px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.docs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 176, 46, 0.035);
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.docs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 48px 0 96px;
}

.docs-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.docs-nav__label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.docs-nav a {
  display: block;
  padding: 8px 0 8px 14px;
  border-left: 1px solid transparent;
  margin-left: -1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-nav a:hover,
.docs-nav a:focus-visible {
  color: var(--green-soft);
  border-left-color: var(--green);
}

.docs-nav__meta {
  margin-top: 22px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 176, 46, 0.03);
}

.docs-nav__meta span {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.docs-nav__meta code {
  display: block;
  margin-top: 8px;
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}

.docs-body {
  min-width: 0;
}

.docs-section {
  padding: 0 0 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.docs-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.docs-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.docs-kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--green);
  opacity: 0.7;
}

.docs-section h2 {
  margin: 12px 0 0;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.docs-section > p,
.docs-prose {
  margin: 14px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.docs-prose a,
.docs-section > p a {
  color: var(--green-soft);
  text-decoration: underline;
  text-decoration-color: rgba(255, 176, 46, 0.35);
  text-underline-offset: 3px;
}

.docs-prose code,
.docs-section > p code,
.docs-list code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 176, 46, 0.05);
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.docs-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 680px;
}

.docs-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.docs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
  opacity: 0.75;
}

/* ---------- Endpoint cards ---------- */

.endpoint {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 176, 46, 0.035), transparent 60%),
    var(--panel);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.endpoint__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 5px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.method--get {
  color: var(--green);
  border: 1px solid rgba(255, 176, 46, 0.35);
  background: rgba(255, 176, 46, 0.07);
}

.method--post {
  color: var(--red);
  border: 1px solid rgba(255, 106, 77, 0.35);
  background: rgba(255, 106, 77, 0.07);
}

.endpoint__path {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.endpoint__desc {
  color: var(--muted-2);
  font-size: 12.5px;
}

.endpoint__body {
  padding: 18px 20px 20px;
  display: grid;
  gap: 16px;
}

.endpoint__body > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 660px;
}

.endpoint__body strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Code blocks ---------- */

.code-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0806;
  overflow: hidden;
}

.code-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 176, 46, 0.1);
  background: rgba(255, 176, 46, 0.035);
}

.code-card__bar span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.code-copy {
  appearance: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.code-copy:hover,
.code-copy:focus-visible {
  color: var(--green-soft);
  border-color: var(--line-2);
}

.code-card pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #e9dcc6;
  font-family: var(--font-mono);
  font-size: 12.25px;
  line-height: 1.7;
  tab-size: 2;
}

.code-card code {
  font-family: inherit;
}

.code-card--inline {
  margin: 0;
}

/* ---------- Tables ---------- */

.docs-table-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: var(--panel);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.docs-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 176, 46, 0.07);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.6;
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-table td:first-child {
  white-space: nowrap;
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.docs-table code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 176, 46, 0.05);
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- Callout ---------- */

.docs-note {
  position: relative;
  margin-top: 20px;
  padding: 16px 18px 16px 44px;
  border: 1px solid rgba(255, 176, 46, 0.28);
  border-radius: 6px;
  background: rgba(255, 176, 46, 0.05);
  color: var(--green-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.docs-note::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 15px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 176, 46, 0.5);
  border-radius: 50%;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.docs-note b {
  color: var(--text);
}

/* ---------- Steps ---------- */

.docs-steps {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.docs-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
}

.docs-step__n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
}

.docs-step__body h3 {
  margin: 2px 0 8px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.docs-step__body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

/* ---------- Bottom CTA ---------- */

.docs-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 8px;
  padding: 26px 28px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(255, 176, 46, 0.1), transparent 70%),
    var(--panel);
}

.docs-cta h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.docs-cta p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.docs-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 36px;
  }

  .docs-nav {
    position: static;
  }

  .docs-nav ul {
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }

  .docs-nav a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 1px solid transparent;
    margin: 0;
    padding: 9px 12px;
  }

  .docs-nav a:hover,
  .docs-nav a:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--green);
  }

  .docs-nav__meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .docs-hero {
    padding: 64px 0 36px;
  }

  .docs-hero p.docs-hero__lede {
    font-size: 15px;
  }

  .docs-section {
    padding-bottom: 40px;
    margin-bottom: 40px;
  }

  .endpoint__head {
    padding: 14px 16px;
  }

  .endpoint__body {
    padding: 16px;
  }

  .code-card pre {
    padding: 14px;
    font-size: 11.5px;
  }

  .docs-cta {
    padding: 20px;
  }
}
