/* ── SC Platform DocsHub ── */
/* Shared styles across all pages       */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --sc: #d32028;
  --sc-dk: #a81a20;
  --sc-glow: rgba(211,32,40,.35);

  --bg: #0b0e17;
  --bg2: #10131e;
  --surf: #161a27;
  --surf2: #1c2030;
  --surf3: #232838;

  --brd: rgba(255,255,255,.06);
  --brd2: rgba(255,255,255,.1);
  --brd3: rgba(255,255,255,.15);

  --ink: #e5e9f0;
  --ink2: #8a94a8;
  --ink3: #4e576a;

  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
}

html {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
}

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

img { max-width: 100%; border-radius: var(--radius); }

/* ── Top Navigation ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(11,14,23,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--brd);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}
.topnav-logo:hover { text-decoration: none; }

.logo-mark {
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.topnav-title {
  font: 700 14px/1 'Inter';
  color: var(--ink);
}

.topnav-sub {
  font: 400 10px/1 'Inter';
  color: var(--ink3);
  margin-top: 2px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.topnav-link {
  font: 500 11px/1 'Inter';
  color: var(--ink2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .15s;
}
.topnav-link:hover {
  background: rgba(255,255,255,.05);
  color: var(--ink);
  text-decoration: none;
}
.topnav-link.active {
  background: rgba(255,255,255,.07);
  color: var(--ink);
}

/* Mode pill toggle */
.mode-pill {
  display: flex;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--brd);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  margin-left: .5rem;
}
.mode-btn {
  background: none;
  border: none;
  padding: 4px 11px;
  border-radius: 5px;
  font: 500 10.5px/1 'Inter';
  color: var(--ink3);
  cursor: pointer;
  transition: all .2s;
}
.mode-btn.on {
  background: rgba(255,255,255,.07);
  color: var(--ink);
}
.mode-btn.roadmap-on {
  background: rgba(6,182,212,.13);
  color: var(--accent-cyan);
}

/* ── Page Layout ── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

.page-wide {
  max-width: 1200px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font: 400 12px/1 'Inter';
  color: var(--ink3);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--ink3);
  transition: color .15s;
}
.breadcrumb a:hover {
  color: var(--ink2);
  text-decoration: none;
}
.breadcrumb .sep {
  opacity: .4;
}

/* ── Page Header ── */
.page-header {
  margin-bottom: 2.5rem;
}

.page-icon {
  font-size: 2.2rem;
  margin-bottom: .7rem;
  display: block;
}

.page-title {
  font: 800 2rem/1.15 'Inter';
  color: var(--ink);
  letter-spacing: -.03em;
  margin-bottom: .3rem;
}

.page-subtitle {
  font: 400 14px/1.4 'Inter';
  color: var(--ink2);
  margin-bottom: .5rem;
}

.page-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 500 11px/1 'Inter';
  padding: 3px 10px;
  border-radius: 100px;
  margin-top: .5rem;
}
.status-live { background: rgba(16,185,129,.1); color: #6ee7b7; }
.status-building { background: rgba(245,158,11,.1); color: #fbbf24; }
.status-roadmap { background: rgba(6,182,212,.1); color: var(--accent-cyan); }

/* ── Section Headings ── */
.section-label {
  font: 600 10px/1 'Inter';
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: .8rem;
}

h2 {
  font: 700 1.3rem/1.25 'Inter';
  color: var(--ink);
  letter-spacing: -.02em;
  margin: 2.5rem 0 .8rem;
}

h3 {
  font: 600 1rem/1.3 'Inter';
  color: var(--ink);
  margin: 1.8rem 0 .5rem;
}

h2:first-child, h3:first-child { margin-top: 0; }

p {
  color: var(--ink2);
  margin-bottom: 1rem;
}
p:last-child { margin-bottom: 0; }

/* ── Content Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .8rem;
  margin: 1rem 0;
}

.doc-card {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: all .18s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.doc-card:hover {
  background: var(--surf2);
  border-color: var(--brd2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.doc-card-icon {
  font-size: 1.4rem;
  margin-bottom: .5rem;
  display: block;
}

.doc-card-name {
  font: 600 13px/1.3 'Inter';
  color: var(--ink);
  margin-bottom: .25rem;
}

.doc-card-desc {
  font: 400 12px/1.5 'Inter';
  color: var(--ink2);
}

.doc-card-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .6rem;
}

/* ── Info Box ── */
.info-box {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0;
}

.info-box.highlight {
  border-left: 3px solid var(--sc);
}

.info-box.roadmap {
  background: rgba(6,182,212,.04);
  border-color: rgba(6,182,212,.15);
  border-left: 3px solid var(--accent-cyan);
}

.info-box-label {
  font: 600 10px/1 'Inter';
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.info-box.roadmap .info-box-label { color: var(--accent-cyan); }
.info-box.highlight .info-box-label { color: var(--sc); }

.info-box p {
  font-size: 13px;
}

/* ── Feature List ── */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .8rem 0;
}

.feature-list li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font: 400 13px/1.55 'Inter';
  color: var(--ink2);
}

.feature-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink3);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ── Data Flow Diagram ── */
.flow-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.flow-node {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: .4rem .7rem;
  font: 500 12px/1 'Inter';
  color: var(--ink);
  white-space: nowrap;
}
.flow-node a {
  color: inherit;
  text-decoration: none;
}
.flow-node a:hover { text-decoration: underline; }

.flow-arrow {
  color: var(--ink3);
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Screenshot Placeholder ── */
.screenshot {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.2rem 0;
}

.screenshot img {
  width: 100%;
  display: block;
  border-radius: 0;
}

.screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--ink3);
  font: 400 12px/1 'Inter';
  gap: .5rem;
}

.screenshot-caption {
  padding: .5rem .8rem;
  font: 400 11px/1.4 'Inter';
  color: var(--ink3);
  border-top: 1px solid var(--brd);
}

/* ── Cross-link / Related Section ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .6rem;
  margin: .8rem 0;
}

.related-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font: 500 12px/1.3 'Inter';
  transition: all .15s;
}
.related-link:hover {
  background: var(--surf2);
  border-color: var(--brd2);
  text-decoration: none;
}
.related-link .rel-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.related-link .rel-label {
  color: var(--ink2);
  font-weight: 400;
  font-size: 11px;
  display: block;
  margin-top: 1px;
}

/* ── Tech Stack Pills ── */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: .6rem 0;
}

.tech-pill {
  font: 500 10px/1 'Inter';
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--brd);
  color: var(--ink2);
}

/* ── Table ── */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 13px;
}

.doc-table th {
  text-align: left;
  font: 600 11px/1 'Inter';
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink3);
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--brd2);
}

.doc-table td {
  padding: .55rem .7rem;
  color: var(--ink2);
  border-bottom: 1px solid var(--brd);
  vertical-align: top;
}

.doc-table tr:hover td {
  background: rgba(255,255,255,.02);
}

/* ── Two-column layout for doc pages ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .page { padding: 1.5rem 1rem 3rem; }
  .page-title { font-size: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ── Table of Contents ── */
.toc {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  margin: 0 0 2rem;
  overflow: hidden;
}

.toc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.toc-title {
  font: 600 10px/1 'Inter';
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink3);
}

.toc-chevron {
  width: 14px;
  height: 14px;
  color: var(--ink3);
  transition: transform .2s;
}
.toc.open .toc-chevron {
  transform: rotate(180deg);
}

.toc-body {
  display: none;
  padding: 0 1rem .7rem;
}
.toc.open .toc-body {
  display: block;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
}

.toc-list li {
  position: relative;
}

.toc-list a {
  font: 500 11px/1 'Inter';
  color: var(--ink2);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--brd);
  transition: all .15s;
  white-space: nowrap;
}
.toc-list a:hover {
  color: var(--ink);
  background: rgba(255,255,255,.06);
  border-color: var(--brd2);
  text-decoration: none;
}

.toc-list .toc-h3 a {
  font-weight: 400;
  font-size: 10px;
  color: var(--ink3);
  background: none;
  border-color: transparent;
  padding: 3px 8px;
}
.toc-list .toc-h3 a:hover {
  color: var(--ink2);
  background: rgba(255,255,255,.03);
  border-color: var(--brd);
}

/* ── Search ── */
.search-wrap {
  position: relative;
  margin-left: .5rem;
}

.search-toggle {
  background: none;
  border: none;
  color: var(--ink2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all .15s;
  display: flex;
  align-items: center;
}
.search-toggle:hover {
  background: rgba(255,255,255,.05);
  color: var(--ink);
}

.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.search-overlay.open {
  display: flex;
}

.search-box {
  background: var(--surf);
  border: 1px solid var(--brd2);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  box-shadow: 0 16px 64px rgba(0,0,0,.5);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--brd);
}

.search-input-wrap svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink3);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  padding: .85rem .7rem;
  font: 400 14px/1 'Inter';
  color: var(--ink);
  outline: none;
}
.search-input::placeholder {
  color: var(--ink3);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: .4rem;
}

.search-result {
  display: block;
  padding: .6rem .8rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.search-result:hover {
  background: rgba(255,255,255,.05);
  text-decoration: none;
}

.search-result-title {
  font: 600 13px/1.3 'Inter';
  color: var(--ink);
}
.search-result-section {
  font: 400 11px/1.3 'Inter';
  color: var(--ink3);
}
.search-result-desc {
  font: 400 11.5px/1.4 'Inter';
  color: var(--ink2);
  margin-top: 2px;
}

.search-empty {
  padding: 2rem 1rem;
  text-align: center;
  font: 400 13px/1.4 'Inter';
  color: var(--ink3);
}

.search-hint {
  padding: .5rem 1rem;
  border-top: 1px solid var(--brd);
  font: 400 10.5px/1 'Inter';
  color: var(--ink3);
  text-align: center;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--brd);
  margin: 2.5rem 0;
}

/* ── Footer ── */
.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--brd);
  font: 400 11px/1.5 'Inter';
  color: var(--ink3);
  text-align: center;
}
