/* KYE Developers — developer portal. Light theme, Stripe-ish. */

:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --paper-2: #f7f8fb;
  --paper-3: #eef0f7;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #0b1020;
  --text-muted: #4b5673;
  --text-dim: #6b7390;
  --accent: #5b21b6;
  --accent-2: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.08);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --success: #047857;
  --success-soft: #d1fae5;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px; height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.nav { display: flex; gap: 4px; flex: 1; margin-left: 18px; }
.nav a { color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--paper-2); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-muted); }
.cta {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}
.cta:hover { background: #4c1d95; text-decoration: none !important; }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }

aside.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 20px 60px;
  position: sticky; top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 16px 0 8px;
  font-weight: 700;
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar a {
  display: block;
  padding: 5px 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: 6px;
}
.sidebar a:hover { background: var(--paper-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main.content { padding: 36px 40px 80px; min-width: 0; }
@media (max-width: 800px) { main.content { padding: 28px 22px; } aside.sidebar { display: none; } }

h1.page-title { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 700; }
.page-sub { color: var(--text-muted); font-size: 15px; margin: 0 0 28px; }

h2 { font-size: 19px; margin: 32px 0 12px; letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: 15px; margin: 22px 0 10px; font-weight: 700; }
p { margin: 0 0 14px; }

code { font-family: var(--mono); font-size: 13px; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; color: var(--text); }
pre { font-family: var(--mono); background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 0 0 14px; }
pre code { background: transparent; padding: 0; color: inherit; font-size: 12.5px; }

.hero {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  padding: 40px 36px;
  margin-bottom: 28px;
}
.hero h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p { font-size: 16px; color: var(--text-muted); max-width: 640px; }
.hero-cta { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4c1d95; text-decoration: none; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper-2); text-decoration: none; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--text-muted); }
.card a.more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 13px; }

.endpoint {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
}
.endpoint:hover { background: var(--paper-2); }
.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  min-width: 56px;
  text-align: center;
}
.method-GET    { background: var(--info-soft); color: var(--info); }
.method-POST   { background: var(--success-soft); color: var(--success); }
.method-PUT    { background: var(--warning-soft); color: var(--warning); }
.method-PATCH  { background: var(--warning-soft); color: var(--warning); }
.method-DELETE { background: var(--danger-soft); color: var(--danger); }
.path { font-family: var(--mono); font-size: 13px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.summary { color: var(--text-muted); font-size: 13px; }

.tag-section { margin-top: 26px; }
.tag-section h2 { display: flex; align-items: center; gap: 10px; }
.tag-pill { background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.kye { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.kye th, table.kye td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.kye thead th { background: var(--paper-2); color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
table.kye td.mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }

.search { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; margin-bottom: 18px; font-family: inherit; }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.step { display: flex; gap: 16px; margin-bottom: 20px; }
.step-num {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin-top: 0; }

footer.kye-footer { margin-top: 60px; padding: 24px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-dim); text-align: center; }
.muted { color: var(--text-muted); }

/* === Mobile safety net (added to fix sev0 horizontal scroll) === */
html, body { overflow-x: hidden; max-width: 100vw; }
* { box-sizing: border-box; }
img, video, iframe, svg, canvas { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-break: normal; }
table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
  .topbar, .top, header.top, header.topbar, .header { flex-wrap: wrap !important; row-gap: 8px; padding: 10px 12px !important; }
  .topbar-right, .topbar .right, .top-right { width: 100%; justify-content: flex-start; font-size: 11px; flex-wrap: wrap; }
  .nav { flex-wrap: wrap !important; row-gap: 4px; gap: 2px !important; flex: 1 1 100% !important; margin-left: 0 !important; }
  .nav a { font-size: 12.5px; padding: 6px 10px !important; }
  .layout, .grid-2, .grid-3, .grid-4, .grid-2-asym, .split { grid-template-columns: 1fr !important; }
  .container, .wrap, main, section { max-width: 100% !important; }
  .hero, h1 { font-size: clamp(22px, 6vw, 30px) !important; line-height: 1.15; }
  h2 { font-size: clamp(18px, 5vw, 24px) !important; }
  .stat, .badge, .chip, .pill { font-size: 11px !important; }
  .card, .row, .panel { padding: 12px !important; }
  .term-prompt, .topbar-right .meta, .top-meta { display: none; }
}
@media (max-width: 420px) {
  .nav a { font-size: 12px; padding: 5px 8px !important; }
  body { font-size: 14px; }
}
