/* Nezuko APIs — design system (ivory + warm gold, charcoal text, limited pink accent) */
:root {
  --bg: #fbf8f1;
  --surface: #ffffff;
  --surface-2: #f6f1e6;
  --border: #ebe3d2;
  --border-strong: #ddd2bb;
  --text: #22201c;
  --text-2: #4a453d;
  --muted: #777064;
  --gold: #c8961e;
  --gold-strong: #9c7110;
  --gold-soft: #fbf1d6;
  --gold-softer: #fdf8ea;
  --pink: #c9577f;
  --pink-soft: #fbeaf0;
  --success: #2f7d4f;
  --success-soft: #e7f4ec;
  --danger: #b4352f;
  --danger-soft: #fbeceb;
  --code-bg: #1f1d1a;
  --code-text: #f3eee3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(60, 45, 15, .05);
  --shadow: 0 1px 2px rgba(60, 45, 15, .04), 0 6px 20px -8px rgba(60, 45, 15, .12);
  --shadow-lg: 0 18px 48px -18px rgba(60, 45, 15, .22);
  --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1160px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nz-ic { flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.nav { position: sticky; top: 0; z-index: 40; background: rgba(251, 248, 241, .88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.nav-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.brand b { font-size: 1.02rem; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); line-height: 1; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav-links a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--text-2); transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--gold-soft); color: var(--gold-strong); }
@media (max-width: 640px) {
  .nav-in { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  .nav-links { width: 100%; margin: 0; justify-content: space-between; }
  .nav-links a { flex: 1; justify-content: center; padding: 8px 6px; font-size: .85rem; }
}
@media (max-width: 1100px) {
  .nav-in { height: auto; flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .brand { width: 100%; justify-content: flex-end; gap: 12px; }
  .brand img { width: 42px; height: 42px; border-radius: 12px; }
  .brand b { font-size: 1.2rem; }
  .brand small { font-size: .8rem; }
  .nav-links { width: 100%; margin: 0; justify-content: space-between; gap: 6px; }
  .nav-links a { flex: 1; justify-content: center; min-height: 44px; padding: 9px 8px; font-size: .95rem; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -8px rgba(156, 113, 16, .6); }
.btn-primary:hover { background: var(--gold-strong); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f1cfcc; }
.btn-danger:hover { background: #f7dcda; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 9px; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.ok { color: var(--success); border-color: #bfe0cb; background: var(--success-soft); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip-gold { background: var(--gold-soft); color: var(--gold-strong); border-color: #f0dfae; }
.chip-pink { background: var(--pink-soft); color: var(--pink); border-color: #f3cfdc; }
.method { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .03em; background: var(--success-soft); color: var(--success); flex-shrink: 0; }
.method.post { background: var(--gold-soft); color: var(--gold-strong); }
.method.delete { background: var(--danger-soft); color: var(--danger); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--success); font-weight: 500; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--success-soft); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--gold-strong); background: var(--gold-soft); border: 1px solid #f0dfae; padding: 5px 12px; border-radius: 999px; }
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
h1, h2, h3 { line-height: 1.3; }
.muted { color: var(--muted); }

.field { position: relative; }
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 12px 14px; line-height: 1.6; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(200, 150, 30, .15); }
.field > .nz-ic { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.field > .input { padding-inline-start: 42px; }
label.lbl { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.code { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: .84rem; line-height: 1.6; overflow-x: auto; direction: ltr; text-align: left; white-space: pre; margin: 0; }
.code-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 7px 7px 7px 14px; direction: ltr; color: var(--text); }
.code-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .86rem; }

.sk { position: relative; overflow: hidden; background: #efe8da; border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: nz-shimmer 1.4s infinite; }
@keyframes nz-shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } html { scroll-behavior: auto; } }

.state { text-align: center; padding: 48px 20px; }
.state .state-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.state.error .state-ic { background: var(--danger-soft); color: var(--danger); }
.state h3 { margin: 0 0 6px; font-size: 1.05rem; }
.state p { margin: 0 auto 16px; color: var(--muted); max-width: 420px; }

.toast-wrap { position: fixed; z-index: 60; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow-lg); animation: nz-up .22s ease; pointer-events: auto; }
.toast.ok .nz-ic { color: #8fd3a8; }
.toast.err { background: var(--danger); }
@keyframes nz-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: nz-fade .35s ease both; }
@keyframes nz-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spin { animation: nz-spin 1s linear infinite; }
@keyframes nz-spin { to { transform: rotate(360deg); } }

.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 26px 0 34px; color: var(--muted); font-size: .88rem; }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
