/* ============================================================
   SmartStore AI Academy — design system
   Palette:
     --bg:         #0B0D10  near-black, slightly cool
     --surface:    #14171C  panel background
     --surface-2:  #1B1F26  hover/active surface
     --border:     #262B33
     --text:       #E7E9EC
     --text-mute:  #8A92A0
     --accent:     #5EEAD4  signal teal — verified/active state
     --accent-2:   #F2A65A  amber — phase/build track
   Type:
     Display/labels: 'IBM Plex Mono' — this is engineering documentation;
       monospace headers signal "build log," not decoration.
     Body: 'Inter' — long-form reading needs a humanist sans, not mono.
   ============================================================ */

:root {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --border: #262b33;
  --text: #e7e9ec;
  --text-mute: #8a92a0;
  --accent: #5eead4;
  --accent-dim: #2f5f59;
  --accent-2: #f2a65a;
  --accent-2-dim: #6b4a28;
  --danger: #f2755a;
  --radius: 6px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 860px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

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

/* ---------- layout shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .menu-toggle { display: none !important; }
  .scrim { display: none !important; }
}

/* ---------- sidebar ---------- */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px 60px;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 4px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }

.tagline {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0 0 24px;
  font-family: var(--mono);
}

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

.nav-group-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-mute);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-2);
  font-weight: 500;
}

.nav-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  min-width: 18px;
}
.nav-list a.active .nav-num { color: var(--accent); }

.nav-check {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  opacity: 0.85;
}

/* ---------- main content ---------- */

.main {
  padding: 0 24px 100px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 70%, transparent);
  z-index: 10;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
}
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--accent); }

.page-nav {
  display: flex;
  gap: 10px;
}

.page-nav a {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-mute);
  text-decoration: none;
}
.page-nav a:hover { color: var(--accent); border-color: var(--accent-dim); }

.content-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ---------- markdown content typography ---------- */

.doc h1 {
  font-family: var(--mono);
  font-size: 28px;
  line-height: 1.3;
  margin: 8px 0 4px;
  color: var(--text);
}

.doc > p:first-of-type.subtitle,
.doc h1 + h3 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14px;
  color: var(--accent);
  margin-top: 0;
}

.doc h2 {
  font-family: var(--mono);
  font-size: 20px;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.doc h3 {
  font-family: var(--mono);
  font-size: 16px;
  margin: 32px 0 12px;
  color: var(--accent-2);
}

.doc p { color: #cdd2da; margin: 14px 0; }
.doc strong { color: var(--text); }
.doc em { color: var(--text); }

.doc ul, .doc ol {
  color: #cdd2da;
  padding-left: 22px;
}
.doc li { margin: 6px 0; }

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

.doc a { color: var(--accent); }

.doc blockquote {
  margin: 16px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent-2);
  color: var(--text-mute);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.doc blockquote p { color: var(--text-mute); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.doc th {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--surface);
}
.doc td { color: #cdd2da; }

/* code */

.doc code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.doc pre {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 18px 0;
}

.doc pre code {
  background: none;
  padding: 0;
  color: #d6dae0;
  font-size: 13px;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-mute);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.doc pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy-btn.copied { color: var(--accent); }

/* ---------- prev/next footer ---------- */

.doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.doc-footer a {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}
.doc-footer a:hover { border-color: var(--accent-dim); background: var(--surface); }
.doc-footer .label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.doc-footer .next { text-align: right; }

/* ============================================================
   Landing page
   ============================================================ */

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 90px 24px 40px;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero h1 .accent { color: var(--accent); }

.hero p.lead {
  font-size: 18px;
  color: var(--text-mute);
  max-width: 640px;
  margin: 0 0 36px;
}

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.stat .num {
  font-family: var(--mono);
  font-size: 30px;
  color: var(--text);
}
.stat .num .accent { color: var(--accent); }
.stat .label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
}

.track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
@media (max-width: 720px) { .track-grid { grid-template-columns: 1fr; } }

.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}
.track-card:hover {
  text-decoration: none;
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.track-card.build:hover { border-color: var(--accent-2-dim); }

.track-card .track-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.track-card.build .track-label { color: var(--accent-2); }

.track-card h2 {
  font-family: var(--mono);
  font-size: 22px;
  margin: 0 0 10px;
}

.track-card p {
  color: var(--text-mute);
  font-size: 14.5px;
  margin: 0 0 18px;
}

.track-card .go {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.track-card.build .go { color: var(--accent-2); }

.index-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.index-section h2 {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 4px;
}

.row-list { list-style: none; padding: 0; margin: 0; }

.row-list li {
  border-bottom: 1px solid var(--border);
}

.row-list a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  text-decoration: none;
  color: var(--text);
}
.row-list a:hover { color: var(--accent); }
.row-list a:hover .row-num { color: var(--accent); }

.row-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  min-width: 28px;
}

.row-title { flex: 1; font-size: 15px; }
.row-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}

.site-footer {
  text-align: center;
  padding: 40px 24px 80px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 12px;
}

/* search box */
.search-box {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 10px;
  margin-bottom: 18px;
}
.search-box:focus { outline: none; border-color: var(--accent-dim); }
.nav-list li.hidden { display: none; }
