/* AXION Neuralis — Public Docs (v2)
   Fully responsive · Dark neural aesthetic · Professional docs UI
*/

:root {
  --bg: #0b0d14;
  --bg-elevated: #11141f;
  --surface: #161a28;
  --surface-hover: #1c2133;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e8eaf0;
  --text-secondary: #a0a8c0;
  --muted: #6b7394;
  --accent: #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.12);
  --accent-glow: rgba(91, 141, 239, 0.25);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --header-h: 60px;
  --sidebar-w: 260px;
  --max-content: 820px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan); }

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  z-index: 200;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; top: 0; }

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 13, 20, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b5bdb 0%, #22d3ee 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 0 20px var(--accent-glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav-desktop {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}
.nav-desktop a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.nav-desktop a:hover,
.nav-desktop a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-icon svg { width: 20px; height: 20px; }

/* Mobile menu button */
.menu-toggle {
  display: none;
}

/* ========== LAYOUT ========== */
.layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 16px 40px;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.sidebar-section {
  margin-bottom: 28px;
}
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px;
  margin-bottom: 10px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sidebar-nav a:hover {
  background: var(--surface);
  color: var(--text);
}
.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-nav .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-meta {
  margin-top: auto;
  padding: 16px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.sidebar-meta a { color: var(--muted); }
.sidebar-meta a:hover { color: var(--accent); }

/* Main content */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 80px;
}

/* Hero / page header */
.doc-hero {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.doc-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.doc-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  background: linear-gradient(135deg, #e8eaf0 30%, #a0a8c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.doc-hero .lead {
  margin: 0;
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.doc-hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.badge.cyan {
  background: var(--cyan-soft);
  border-color: transparent;
  color: var(--cyan);
}

/* Toolbar */
.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: none;
  background: linear-gradient(135deg, #3b5bdb, #2563eb);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(59, 91, 219, 0.35);
}
.tts-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 91, 219, 0.45);
}
.tts-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }
.tts-btn.playing {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.tts-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.tts-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Note / callout */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(91, 141, 239, 0.08);
  border: 1px solid rgba(91, 141, 239, 0.2);
  border-radius: var(--radius);
  margin-bottom: 32px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.callout-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 1px;
}
.callout strong { color: var(--text); }

/* Document body */
.doc-body {
  max-width: var(--max-content);
}

.doc-body h2 {
  margin: 40px 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.doc-body h2:first-child { margin-top: 0; }

.doc-body h3 {
  margin: 28px 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.doc-body p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.doc-body ul, .doc-body ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
  color: var(--text-secondary);
}
.doc-body li { margin-bottom: 8px; }
.doc-body li::marker { color: var(--accent); }
.doc-body strong { color: var(--text); font-weight: 600; }

.doc-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Principle cards */
.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}
.principle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: border-color var(--transition), background var(--transition);
}
.principle-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.principle-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.principle-card h4 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.principle-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Numbered steps */
.step-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  counter-reset: step;
}
.step-list li {
  position: relative;
  padding: 14px 16px 14px 52px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  counter-increment: step;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b5bdb, #22d3ee);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 320px;
}
.doc-body th, .doc-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.doc-body th {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.doc-body td { color: var(--text-secondary); }
.doc-body tr:last-child td { border-bottom: none; }
.doc-body tr:hover td { background: rgba(255,255,255,0.02); }

/* Phase timeline */
.phase-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 28px;
  position: relative;
}
.phase-list::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--cyan));
  opacity: 0.4;
}
.phase-list li {
  position: relative;
  padding: 12px 16px 12px 48px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.phase-list li::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
}
.phase-list li strong { color: var(--text); }

/* Status footer in doc */
.doc-status {
  margin-top: 48px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.doc-status strong { color: var(--text); }

/* Loading */
.doc-loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.doc-loading::after {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 16px auto 0;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-secondary); margin: 0 6px; }
.site-footer a:hover { color: var(--accent); }
.footer-meta { margin-top: 8px; font-size: 0.78rem; }

/* ========== MOBILE OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    bottom: 0;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    width: min(300px, 85vw);
  }
  .sidebar.open { transform: translateX(0); }

  .menu-toggle { display: grid; }

  .nav-desktop { display: none; }

  .main-content {
    padding: 24px 20px 60px;
  }
}

@media (max-width: 600px) {
  :root { --header-h: 56px; }

  .navbar { padding: 0 14px; }
  .brand-text span { font-size: 0.95rem; }
  .brand-mark { width: 32px; height: 32px; font-size: 0.68rem; }

  .main-content { padding: 20px 16px 50px; }

  .doc-hero h1 { font-size: 1.55rem; }
  .doc-hero .lead { font-size: 0.98rem; }

  .doc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .tts-btn { justify-content: center; }

  .principle-grid {
    grid-template-columns: 1fr;
  }

  .callout { padding: 14px; font-size: 0.88rem; }

  .doc-body h2 { font-size: 1.2rem; margin-top: 32px; }
  .doc-body th, .doc-body td { padding: 10px 12px; font-size: 0.85rem; }
}

@media (min-width: 961px) and (max-width: 1200px) {
  .main-content { padding: 28px 28px 70px; }
}

/* Print */
@media print {
  .site-header, .sidebar, .doc-toolbar, .site-footer, .skip-link { display: none !important; }
  .main-content { padding: 0; }
  body { background: #fff; color: #111; }
  .doc-body, .doc-body p, .doc-body li { color: #222; }
}

/* =========================================================
   v3 — AXION DataForge (app hub + legal + ads) + banner
   ========================================================= */

/* Announcement banner (rilis aplikasi baru) */
.announce-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(59,91,219,.22), rgba(34,211,238,.14));
  border-bottom: 1px solid var(--border-strong);
  font-size: 0.9rem;
  color: var(--text);
}
.announce-banner .tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b5bdb, #22d3ee);
  color: #fff;
}
.announce-banner a.announce-cta {
  font-weight: 700;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.announce-banner .banner-close {
  margin-left: auto;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--transition);
}
.announce-banner .banner-close:hover { color: var(--text); border-color: var(--border-strong); }
.announce-banner.dismissed { display: none; }

/* App download buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  min-width: 200px;
}
.btn-app:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); box-shadow: var(--shadow); }
.btn-app .store-icon { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; }
.btn-app .store-label { display: flex; flex-direction: column; line-height: 1.2; }
.btn-app .store-label small { font-size: 0.68rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.btn-app .store-label b { font-size: 0.95rem; }
.btn-app.primary { background: linear-gradient(135deg, #3b5bdb, #2563eb); border-color: transparent; color: #fff; }
.btn-app.primary .store-label small { color: rgba(255,255,255,.75); }
.btn-app.soon { opacity: 0.6; pointer-events: none; }
.btn-app .soon-pill {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--warning); color: #1a1a1a; margin-left: auto;
}

/* Feature / spec grid for app pages */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.spec-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.spec-card .spec-k { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.spec-card .spec-v { font-size: 0.95rem; font-weight: 600; color: var(--text); }

/* Legal doc last-updated */
.legal-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 24px; font-family: var(--font-mono); }
.legal-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.legal-toc b { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.legal-toc ol { margin: 8px 0 0; padding-left: 1.2rem; }
.legal-toc li { margin: 4px 0; font-size: 0.9rem; }

/* App subpage sidebar active + section labels */
.sidebar-nav .sub { padding-left: 30px !important; font-size: 0.85rem !important; }

/* Ads page: ad-slot illustration placeholder */
.ad-note {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--surface);
  margin: 18px 0;
}
.ad-note b { color: var(--warning); display: block; margin-bottom: 4px; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* app-ads.txt code block */
pre.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  line-height: 1.6;
}

/* v3.1 — Hamburger nav dropdown (app pages) */
.nav-wrap { position: relative; }
.nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 230px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; display: none; z-index: 300; text-align: left;
}
.nav-dropdown.open { display: block; animation: fade .18s ease; }
.nav-dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-secondary); font-size: .88rem; font-weight: 500; }
.nav-dropdown a:hover { background: var(--surface-hover); color: var(--text); }
.nav-dropdown .nd-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 10px 12px 4px; font-weight: 700; }
.nav-dropdown .nd-label:first-child { padding-top: 4px; }
