/* ============================================================
   Upranke Knowledge Base — single shared stylesheet
   Standalone static site. No app CSS imported.
   Linked as:
     index.html      →  assets/style.css
     articles/*.html →  ../assets/style.css
   ============================================================ */

:root {
  --accent: #6D28D9;
  --accent-light: #EDE9FE;
  --accent-hover: #5B21B6;
  --accent-soft: #F5F3FF;
  --bg: #F8F7FB;
  --card: #FFFFFF;
  --border: #EAE8F0;
  --text: #1A1523;
  --text-soft: #6B6577;
  --text-mute: #9A94A6;
  --concept: #0369A1;
  --concept-soft: #E0F2FE;
  --tip: #047857;
  --tip-soft: #ECFDF5;
  --tip-border: #A7F3D0;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --warn-border: #FDE68A;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.is-hidden { display: none !important; }

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover { color: var(--text); }

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}

.kb-pill {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-links a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 14px;
}
.topbar-links a:hover { color: var(--accent); }

.topbar-links a.btn-app {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9px;
}
.topbar-links a.btn-app:hover { background: var(--accent-hover); color: #fff; }

/* ---------------- Layout shell ---------------- */

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.content {
  max-width: 820px;
  min-width: 0;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-search input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sidebar-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.sidebar-search input::placeholder { color: var(--text-mute); }

.nav-group { margin-top: 22px; }

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 6px;
  padding: 0 10px;
}

.sidebar-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}
.sidebar-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- Home: hero + category cards ---------------- */

.hero {
  text-align: center;
  padding: 36px 0 8px;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.hero > p {
  color: var(--text-soft);
  font-size: 17px;
  margin: 0 0 26px;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(26, 21, 35, 0.05);
}
.hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.hero-search input::placeholder { color: var(--text-mute); }

.hero-hint {
  font-size: 13px;
  color: var(--text-mute);
  margin: 10px 0 0;
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 36px;
}

.cat-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.1);
  color: var(--text);
}

.cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.cat-icon-guide   { background: var(--accent-soft); }
.cat-icon-feature { background: var(--accent-light); }
.cat-icon-concept { background: var(--concept-soft); }
.cat-icon-faq     { background: var(--warn-soft); }

.cat-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-card p {
  color: var(--text-soft);
  font-size: 14.5px;
  margin: 5px 0 12px;
}

.cat-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.cat-card:hover .cat-link { color: var(--accent-hover); }

/* ---------------- Article ---------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--accent); }
.crumb-sep { color: var(--text-mute); }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag-feature { background: var(--accent-light); color: var(--accent); }
.tag-guide   { background: var(--accent-soft); color: var(--accent); }
.tag-concept { background: var(--concept-soft); color: var(--concept); }
.tag-faq     { background: var(--warn-soft); color: var(--warn); }

.article h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 6px 0 14px;
}

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 26px;
}

.article h2 {
  font-size: 23px;
  letter-spacing: -0.01em;
  margin: 38px 0 12px;
}

.article h3 {
  font-size: 18px;
  margin: 26px 0 8px;
}

.article p { margin: 0 0 16px; }

.article ul,
.article ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.article li { margin-bottom: 8px; }

.article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--accent-hover);
}

/* ---------------- Callouts ---------------- */

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0 0 20px;
  font-size: 15px;
}
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin: 0; }

.callout-icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  color: #fff;
}

.callout-tip  { background: var(--tip-soft);    border-color: var(--tip-border); }
.callout-tip .callout-icon { background: var(--tip); }

.callout-note { background: var(--accent-soft); border-color: var(--accent-light); }
.callout-note .callout-icon { background: var(--accent); }

.callout-warn { background: var(--warn-soft);   border-color: var(--warn-border); }
.callout-warn .callout-icon { background: var(--warn); }

/* ---------------- Numbered steps ---------------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
}

.step {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body strong {
  display: block;
  margin-bottom: 2px;
}

.step-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

/* ---------------- Video slot ----------------
   To embed later: delete .video-placeholder and drop an
   <iframe> or <video> straight inside .video-slot. */

.video-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #241B33, #151020);
  margin: 0 0 28px;
}

.video-slot iframe,
.video-slot video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #CFC9DC;
}
.video-placeholder p {
  margin: 0;
  font-size: 14px;
}

.play-glyph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.play-glyph svg { margin-left: 3px; }

/* ---------------- Related articles ---------------- */

.related {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 19px;
  margin: 0 0 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.related-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(109, 40, 217, 0.08);
}

.related-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}

.related-title {
  font-weight: 600;
  color: var(--text);
}

.related-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* ---------------- Footer ---------------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13.5px;
}
.footer a { color: var(--text-soft); }
.footer a:hover { color: var(--accent); }

/* ---------------- Mobile ---------------- */

@media (max-width: 860px) {
  .shell {
    display: block;
    padding: 24px 18px 48px;
  }
  .sidebar { display: none; }
  .content { max-width: 100%; }
  .cat-grid,
  .related-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .article h1 { font-size: 28px; }
  .hero-hint { display: none; }
  .kb-pill { display: none; }
}
