/* =========================================================================
   bootstrapfounders — styles
   Minimal, monospace, terminal/docs aesthetic. Flat. No gradients. No emoji.
   ========================================================================= */

:root {
  --bg:         #101010;
  --bg-1:       #161616;   /* topbar, inputs, subtle hover */
  --bg-2:       #1c1c1c;   /* hover / active fill */
  --text:       #e4e4e4;
  --text-dim:   #9a9a9a;
  --text-faint: #6a6a6a;
  --line:       #282828;
  --accent:     #7ec699;   /* muted mint-green */

  --radius:    4px;
  --maxw:      900px;
  --sidebar-w: 230px;
  --topbar-h:  52px;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg:         #fbfbfa;
  --bg-1:       #ffffff;
  --bg-2:       #f0f0ee;
  --text:       #1a1a1a;
  --text-dim:   #555555;
  --text-faint: #8a8a8a;
  --line:       #e3e3df;
  --accent:     #1f7a4d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

::selection { background: var(--accent); color: var(--bg); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; font-weight: 700; font-size: .95rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-prompt { color: var(--accent); margin-right: 8px; font-weight: 700; }
.brand-accent { color: var(--accent); }

.search-wrap { position: relative; flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center; }
.search-prompt { position: absolute; left: 11px; color: var(--text-faint); pointer-events: none; }
#search {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit; font-size: .85rem;
  padding: 7px 34px 7px 26px;
  outline: none;
  transition: border-color .12s;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--text-faint); }
#search::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 500 .7rem var(--mono); color: var(--text-faint);
  border: 1px solid var(--line); border-radius: 3px; padding: 0 6px;
}

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text-dim);
  font-size: 1rem; cursor: pointer; transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-toggle { display: none; }

.txt-btn { color: var(--text-dim); font-size: .82rem; padding: 6px; }
.txt-btn:hover { color: var(--accent); }

/* ── Layout ──────────────────────────────────────────────────────────── */
.layout { display: flex; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex; flex-direction: column;
  background: var(--bg);
}

#nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-section { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 16px 10px 6px; }
.nav-link {
  position: relative;
  display: flex; align-items: center;
  padding: 6px 10px 6px 22px; border-radius: var(--radius);
  color: var(--text-dim); font-size: .85rem;
  cursor: pointer; transition: color .1s, background .1s; user-select: none;
  text-transform: lowercase;
}
.nav-link::before { content: ""; position: absolute; left: 9px; color: var(--accent); }
.nav-link:hover { background: var(--bg-1); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--bg-1); }
.nav-link.active::before { content: ">"; }
.nav-link .count { margin-left: auto; font-size: .72rem; color: var(--text-faint); }
.nav-link.active .count { color: var(--accent); }

.sidebar-foot { border-top: 1px solid var(--line); padding: 14px 10px 4px; margin-top: 10px; font-size: .78rem; }
.sidebar-foot p { color: var(--text-faint); margin: 0 0 8px; }
.sidebar-foot a { color: var(--text-dim); }
.sidebar-foot a:hover { color: var(--accent); }

.scrim { display: none; }

.content { flex: 1; min-width: 0; padding: 34px clamp(16px, 4vw, 46px) 70px; }
.content-inner { max-width: var(--maxw); margin: 0 auto; }

/* ── Home lede ───────────────────────────────────────────────────────── */
.lede { border-bottom: 1px solid var(--line); padding-bottom: 30px; margin-bottom: 30px; }
.lede .tag-line { color: var(--text-faint); font-size: .8rem; margin: 0 0 16px; }
.lede h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 700; }
.lede h1 .accent { color: var(--accent); }
.lede p { color: var(--text-dim); max-width: 64ch; margin: 0 0 18px; font-size: .95rem; line-height: 1.6; }
.lede .meta { color: var(--text-faint); font-size: .8rem; margin: 0; }
.lede .meta b { color: var(--text); font-weight: 700; }

/* ── Section headings ────────────────────────────────────────────────── */
.block-title { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 4px; }
.block-title::before { content: "## "; color: var(--accent); }
.block-sub { color: var(--text-dim); margin: 0 0 18px; font-size: .88rem; }
.block { margin-bottom: 46px; }

.page-head h2 { font-size: 1.4rem; letter-spacing: -.01em; margin: 0 0 6px; font-weight: 700; text-transform: lowercase; }
.page-head h2::before { content: "# "; color: var(--accent); }
.page-sub { color: var(--text-dim); margin: 0 0 18px; font-size: .9rem; max-width: 64ch; }

/* ── Filters ─────────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: .82rem; }
.filter { color: var(--text-faint); cursor: pointer; padding-bottom: 1px; border-bottom: 1px solid transparent; transition: color .1s; user-select: none; }
.filter:hover { color: var(--text); }
.filter.active { color: var(--accent); border-bottom-color: var(--accent); }
.results-meta { color: var(--text-faint); font-size: .78rem; margin: 0 0 4px; }

/* ── Directory rows ──────────────────────────────────────────────────── */
.list { border-top: 1px solid var(--line); margin-top: 14px; }
.row {
  display: block; padding: 15px 8px;
  border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.row:hover { text-decoration: none; background: var(--bg-1); }
.row.has-thumb { display: flex; gap: 14px; align-items: flex-start; }
.row-thumb {
  width: 52px; height: 52px; flex-shrink: 0; margin-top: 2px;
  object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1);
}
/* site icons: contained on a light tile so any favicon stays visible */
.row-thumb.fav { object-fit: contain; padding: 8px; background: #fff; }
.row-main { flex: 1; min-width: 0; }
.row-head { display: flex; align-items: baseline; gap: 10px; }
.row-name { color: var(--text); font-weight: 700; font-size: .95rem; }
.row:hover .row-name { color: var(--accent); }
.row-by { color: var(--text-faint); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-arrow { margin-left: auto; color: var(--text-faint); transition: transform .12s, color .12s; }
.row:hover .row-arrow { color: var(--accent); transform: translateX(2px); }
.row-desc { color: var(--text-dim); margin: 6px 0 9px; font-size: .86rem; line-height: 1.6; max-width: 78ch; }
.row-tags { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tag { color: var(--text-faint); font-size: .76rem; }
.tag::before { content: "#"; opacity: .55; }
.tag.flag { color: var(--accent); }

/* compact rows (home category + guide lists) */
.row.compact { padding: 13px 8px; }
.row.compact .row-desc { margin-bottom: 0; }

/* ── Guide article (wiki) ────────────────────────────────────────────── */
.article { max-width: 74ch; }
.article .crumb { color: var(--text-faint); font-size: .8rem; margin-bottom: 22px; }
.article .crumb a { color: var(--text-dim); }
.article h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
.article .lede-text { font-size: 1rem; color: var(--text-dim); margin: 0 0 8px; line-height: 1.6; }
.article hr.rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.article-body { font-size: .92rem; color: var(--text); }
.article-body h3 { font-size: 1.02rem; margin: 30px 0 10px; letter-spacing: -.01em; font-weight: 700; }
.article-body h3::before { content: "## "; color: var(--accent); }
.article-body p { color: var(--text-dim); margin: 0 0 14px; line-height: 1.7; }
.article-body ul, .article-body ol { color: var(--text-dim); padding-left: 20px; margin: 0 0 16px; }
.article-body li { margin: 7px 0; line-height: 1.6; }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body em { color: var(--text); font-style: normal; border-bottom: 1px dotted var(--text-faint); }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 2px solid var(--accent); background: var(--bg-1);
  margin: 20px 0; padding: 12px 16px; color: var(--text); font-size: .9rem; line-height: 1.6;
}
.article-foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 22px; flex-wrap: wrap; font-size: .85rem; }
.article-foot a { color: var(--text-dim); }
.article-foot a:hover { color: var(--accent); }

/* ── Misc ────────────────────────────────────────────────────────────── */
.empty { color: var(--text-faint); padding: 70px 10px; font-size: .9rem; }
.empty .big { font-size: 1.4rem; color: var(--text-dim); margin-bottom: 10px; }

footer.site-foot { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: .78rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
footer.site-foot a { color: var(--text-dim); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-toggle { display: grid; }
  .search-kbd { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 45;
    transform: translateX(-100%); transition: transform .18s ease; width: 250px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 40; background: rgba(0,0,0,.55); }
}
@media (max-width: 520px) {
  .content { padding: 24px 14px 60px; }
  .txt-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
