/* ============================================================
   SYNALUM AI Mentor — Situs dokumentasi (Cloudflare Pages)
   Kontrak desain: docs/DESIGN.md (Papan Putih / Tinta / Merah Pena /
   Kuning Sorot / Hijau Papan / Abu Garis; Archivo + Instrument Sans +
   JetBrains Mono; radius 4px; tanpa gradient, tanpa Inter).
   Referensi struktur: Docspace (Framer) — layout docs 3 kolom.
   ============================================================ */

:root {
  --paper: #faf8f2;
  --paper-soft: #f3efe4;
  --card: #ffffff;
  --ink: #1c1b17;
  --ink-soft: #55524a;
  --ink-mute: #6E6959;
  --red-pen: #C02E22;
  --red-pen-soft: rgba(217, 56, 43, 0.08);
  --highlight: #ffd23f;
  --green-board: #1e5b4a;
  --green-soft: rgba(30, 91, 74, 0.08);
  --line: #e3dfd3;
  --line-strong: #cfc9b8;

  --radius: 4px;
  --radius-lg: 8px;

  --font-display: "Archivo", "Instrument Sans", sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--red-pen); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red-pen); outline-offset: 2px; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--red-pen);
}

pre {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
h2 { font-size: 1.55rem; font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 1rem; font-weight: 700; margin: 18px 0 8px; }
section { scroll-margin-top: 84px; }

.section-intro { color: var(--ink-soft); max-width: 68ch; margin-bottom: 20px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 60px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-pen); color: #fff;
  font-family: var(--font-display); font-weight: 900; font-size: 1.1rem;
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--ink);
}
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em; }
.brand-sub { font-weight: 500; color: var(--ink-soft); }

.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  color: var(--ink-soft); font-size: 0.88rem; font-weight: 600;
  padding: 8px 12px; border-radius: var(--radius);
}
.topnav a:hover { color: var(--ink); background: var(--paper-soft); text-decoration: none; }

.github-btn {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.85rem; font-weight: 700; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 14px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.github-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; }
.github-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Layout 3 kolom ---------- */
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
}

.sidenav {
  position: sticky; top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 28px 20px 28px 24px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.sidenav-title {
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.sidenav a {
  color: var(--ink-soft); font-size: 0.88rem;
  padding: 6px 10px; border-radius: var(--radius);
  border-left: 3px solid transparent;
}
.sidenav a:hover { color: var(--ink); background: var(--paper-soft); text-decoration: none; }
.sidenav a.active { color: var(--red-pen); border-left-color: var(--red-pen); background: var(--red-pen-soft); font-weight: 600; }
.sidenav-note {
  margin-top: 20px;
  font-size: 0.78rem; line-height: 1.55; color: var(--ink-soft);
  background: var(--red-pen-soft);
  border-left: 3px solid var(--red-pen);
  padding: 10px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.sidenav-note-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem; font-weight: 700;
  color: var(--red-pen); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.content { padding: 40px 40px 64px; min-width: 0; }
.content > section + section { margin-top: 56px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: start;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 600;
  color: var(--red-pen);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.pen-wrap { position: relative; display: inline-block; white-space: nowrap; }
.pen-underline { position: absolute; left: 0; right: 0; bottom: -6px; width: 100%; height: 8px; }
.pen-underline path { fill: none; stroke: var(--red-pen); stroke-width: 2.5; stroke-linecap: round; }

.hero-sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 52ch; margin-top: 18px; }

.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center;
  font-weight: 700; font-size: 0.92rem;
  border-radius: var(--radius);
  padding: 12px 20px;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.btn-primary {
  color: #fff; background: var(--red-pen);
  border: 1px solid var(--red-pen);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary {
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-secondary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.btn-secondary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.hero-facts {
  list-style: none;
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-facts li { font-size: 0.85rem; color: var(--ink-soft); }
.hero-facts strong {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 800; color: var(--ink);
  margin-right: 4px;
}

/* Terminal */
.hero-terminal {
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--line-strong);
}
.terminal-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #26241f;
  border-bottom: 1px solid #3a372f;
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; background: #55524a; }
.terminal-dot:first-child { background: var(--red-pen); }
.terminal-dot:nth-child(2) { background: var(--highlight); }
.terminal-dot:nth-child(3) { background: var(--green-board); }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem; color: #a39e90;
  margin-left: 8px; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.terminal-body { border-radius: 0; padding: 16px; font-size: 0.8rem; }
.terminal-body code { color: #e8e2d2; }
.terminal-foot {
  font-size: 0.75rem; color: #a39e90;
  padding: 10px 16px 14px;
}
.terminal-foot a { color: var(--highlight); }

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  color: var(--paper);
  background: transparent;
  border: 1px solid #55524a;
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 120ms ease-out, background 120ms ease-out;
}
.copy-btn:hover { border-color: var(--highlight); color: var(--highlight); }
.copy-btn.copied { border-color: var(--green-board); color: #7fbfa5; }

/* ---------- Status strip ---------- */
.status-strip {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red-pen);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.status-strip p { max-width: 75ch; color: var(--ink-soft); }
.status-strip p + p { margin-top: 10px; }
.status-strip strong { color: var(--ink); }
.status-note {
  font-size: 0.88rem;
  background: var(--red-pen-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.status-note-label {
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 700;
  color: var(--red-pen); text-transform: uppercase; letter-spacing: 0.1em;
  margin-right: 6px;
}

/* ---------- Langkah / deploy ---------- */
.steps-list, .deploy-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.steps-list > li, .deploy-list > li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.step-title { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; margin-bottom: 10px; }
.step-title::before {
  content: "→";
  color: var(--red-pen);
  font-weight: 900;
  margin-right: 8px;
}
.deploy-list p:not(.step-title) { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Endpoint cards ---------- */
.endpoint-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
}
.endpoint-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}
.method-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 600;
  color: #fff;
  border-radius: var(--radius);
  padding: 4px 10px;
}
.method-get { background: var(--green-board); }
.method-post { background: var(--red-pen); }
.endpoint-path { font-size: 1rem; font-weight: 600; color: var(--ink); background: none; padding: 0; }
.endpoint-desc { font-size: 0.88rem; color: var(--ink-soft); }
.endpoint-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
}
.endpoint-col { min-width: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 4px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-display); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
td { color: var(--ink-soft); }
td:first-child { white-space: nowrap; }

/* ---------- Contoh / tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  font-family: var(--font-display);
  font-size: 0.88rem; font-weight: 700;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  transition: color 120ms ease-out, border-color 120ms ease-out, background 120ms ease-out;
}
.tab-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.tab-btn.active { color: #fff; background: var(--red-pen); border-color: var(--red-pen); }
.tab-panel { display: none; margin-top: 12px; }
.tab-panel.active { display: block; }
.tab-panel pre { border-radius: 0 0 var(--radius) var(--radius); }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #26241f; color: #a39e90;
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.examples-note { margin-top: 16px; color: var(--ink-soft); font-size: 0.92rem; max-width: 75ch; }

/* ---------- Batas ---------- */
.limits-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.limits-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.92rem; color: var(--ink-soft);
}
.limits-list strong { color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 0.85rem; color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .endpoint-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 12px 16px; gap: 4px;
  }
  .sidenav-title { display: none; }
  .sidenav a { border-left: none; }
  .sidenav a.active { border-left: none; }
  .sidenav-note { display: none; }
  .content { padding: 28px 16px 48px; }
  .topnav { display: none; }
  .topbar { padding: 0 16px; gap: 12px; }
  .github-btn { margin-left: auto; }
  .hero-facts { gap: 16px; }
  .endpoint-head { padding: 14px 16px; }
  .endpoint-body { padding: 16px; }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
