/* ─── Zellbase Wiki — Design System ─── */

:root {
  --cyan: #0891b2;
  --cyan-light: #22d3ee;
  --cyan-dark: #0e7490;
  --teal: #14b8a6;
  --blue: #3b82f6;
  --gradient: linear-gradient(135deg, var(--cyan), var(--blue));
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --green: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --radius: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2') format('woff2'); font-weight: 300 800; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-ext.woff2') format('woff2'); font-weight: 300 800; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-700);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wiki-layout { display: grid; grid-template-columns: 280px 1fr; gap: 48px; min-height: calc(100vh - 200px); }
.wiki-content { max-width: 800px; padding: 48px 0 100px; }

@media (max-width: 900px) {
  .wiki-layout { grid-template-columns: 1fr; gap: 0; }
  .wiki-sidebar { display: none; }
  .wiki-sidebar.open { display: block; position: fixed; inset: 0; z-index: 50; background: var(--white); padding: 80px 24px 24px; overflow-y: auto; }
  .mobile-menu-btn { display: flex !important; }
}

/* ─── Header ─── */

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gray-900); }
.header-brand img { height: 28px; }
.header-brand span { font-weight: 700; font-size: 1.0625rem; }
.header-brand .wiki-badge {
  background: rgba(8, 145, 178, 0.1); color: var(--cyan-dark);
  padding: 2px 10px; border-radius: 50px; font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.04em;
}
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a {
  padding: 8px 16px; border-radius: 8px; font-size: 0.8125rem; font-weight: 500;
  color: var(--gray-600); text-decoration: none; transition: all 0.2s;
}
.header-nav a:hover { background: var(--gray-100); color: var(--cyan); }
.header-nav a.active { background: var(--cyan); color: var(--white); }
.mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--gray-600);
}

/* ─── Sidebar ─── */

.wiki-sidebar {
  position: sticky; top: 72px; height: fit-content; max-height: calc(100vh - 88px);
  overflow-y: auto; padding: 32px 0; border-right: 1px solid var(--gray-100);
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-label {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gray-400); padding: 0 16px; margin-bottom: 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px;
  font-size: 0.8125rem; color: var(--gray-600); text-decoration: none;
  border-radius: 8px; transition: all 0.15s; margin: 1px 8px;
}
.sidebar-link:hover { background: var(--gray-50); color: var(--cyan); }
.sidebar-link.active { background: rgba(8,145,178,0.08); color: var(--cyan-dark); font-weight: 600; }
.sidebar-link svg { flex-shrink: 0; opacity: 0.6; }

/* ─── Content Typography ─── */

.wiki-content h1 {
  font-size: 2rem; font-weight: 800; color: var(--gray-900);
  line-height: 1.2; margin-bottom: 16px;
}
.wiki-content .subtitle {
  font-size: 1.0625rem; color: var(--gray-500); line-height: 1.6;
  margin-bottom: 40px;
}
.wiki-content h2 {
  font-size: 1.375rem; font-weight: 700; color: var(--gray-900);
  line-height: 1.3; margin-top: 56px; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--gray-100);
}
.wiki-content h3 {
  font-size: 1.0625rem; font-weight: 700; color: var(--gray-800);
  line-height: 1.4; margin-top: 36px; margin-bottom: 12px;
}
.wiki-content p {
  margin-bottom: 20px; font-size: 0.9375rem; line-height: 1.8; color: var(--gray-700);
}
.wiki-content a { color: var(--cyan); text-decoration: none; font-weight: 500; }
.wiki-content a:hover { text-decoration: underline; }
.wiki-content strong { font-weight: 600; color: var(--gray-800); }

/* ─── Content Blocks ─── */

.info-box {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px 28px; margin: 28px 0;
}
.info-box.cyan {
  background: rgba(8,145,178,0.05); border-color: rgba(8,145,178,0.15);
}
.info-box.green {
  background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.15);
}
.info-box.amber {
  background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.15);
}
.info-box-title {
  font-size: 0.875rem; font-weight: 700; color: var(--gray-800);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.info-box p:last-child { margin-bottom: 0; }

.illustration {
  display: flex; justify-content: center; align-items: center;
  margin: 32px 0; padding: 32px;
  background: var(--gray-50); border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}
.illustration svg { max-width: 100%; height: auto; }

.step-flow {
  display: flex; gap: 16px; margin: 32px 0; flex-wrap: wrap;
}
.step-card {
  flex: 1; min-width: 180px; background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 20px; text-align: center; position: relative;
  box-shadow: var(--shadow-sm);
}
.step-number {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; margin: 0 auto 12px;
}
.step-card h4 { font-size: 0.875rem; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.step-card p { font-size: 0.8125rem; color: var(--gray-500); margin: 0; line-height: 1.5; }

.metric-explain {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0;
}
.metric-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow-sm);
}
.metric-card .label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-400); margin-bottom: 4px; }
.metric-card .value { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.metric-card .desc { font-size: 0.8125rem; color: var(--gray-500); line-height: 1.6; }

@media (max-width: 640px) {
  .metric-explain { grid-template-columns: 1fr; }
  .step-flow { flex-direction: column; }
  .wiki-content h1 { font-size: 1.5rem; }
  .wiki-content h2 { font-size: 1.125rem; }
}

/* ─── Footer ─── */

.footer {
  background: var(--gray-900); color: var(--gray-400); padding: 48px 0 24px;
  font-size: 0.8125rem; margin-top: 80px;
}
.footer a { color: var(--gray-400); text-decoration: none; }
.footer a:hover { color: var(--cyan-light); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }

/* ─── Scrollbar ─── */
.wiki-sidebar::-webkit-scrollbar { width: 4px; }
.wiki-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

/* ─── Support Block ─── */

.support-block {
  margin-top: 56px; padding: 24px 28px;
  background: linear-gradient(135deg, rgba(8,145,178,0.06), rgba(59,130,246,0.04));
  border: 1px solid rgba(8,145,178,0.15); border-radius: var(--radius);
}
.support-block h3 { font-size: 0.9375rem; font-weight: 700; color: var(--gray-800); margin-bottom: 12px; }
.support-links { display: flex; gap: 24px; flex-wrap: wrap; }
.support-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--gray-600); text-decoration: none; font-weight: 500;
}
.support-link:hover { color: var(--cyan); }
.support-link svg { flex-shrink: 0; }

@media (max-width: 640px) { .support-links { flex-direction: column; gap: 12px; } }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.wiki-content { animation: fadeIn 0.4s ease; }
