/* style.css — chrome for the WIKI SLATE knowledge system.
   Editorial / "slate" aesthetic. Type system:
     • Bricolage Grotesque  — display / headings (precise, editorial, characterful)
     • IBM Plex Sans        — body copy (clean, technical, highly readable)
     • IBM Plex Sans Cond.  — labels / nav / category headers
     • IBM Plex Mono        — data: badges, counts, codes
   Warm paper, dark slate ink, green accent. Full light + dark theming. */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@500;600;700&display=swap');

/* ---------- theme tokens ---------- */
:root,
[data-theme="light"] {
  --bg:#ECE9E0; --paper:#F7F5EF; --paper2:#FBFAF6;
  --ink:#1B232B; --ink2:#46505B; --muted:#6B7480;
  --line:#D7D2C4; --line2:#E7E3D7;
  --accent:#2E7D4F; --accent-ink:#fff;
  --topbar:#1B232B; --topbar-ink:#F2F0E8; --topbar-dim:#C9CDD3;
  --logo-bg:#1B232B; --logo-line:#F2F0E8;
  --shadow:0 8px 24px rgba(20,28,36,.10);
}
[data-theme="dark"] {
  --bg:#0F1318; --paper:#171F27; --paper2:#1D2731;
  --ink:#ECEAE2; --ink2:#AAB2BB; --muted:#828B95;
  --line:#2A343E; --line2:#222C35;
  --accent:#46A873; --accent-ink:#08130C;
  --topbar:#0B0F13; --topbar-ink:#ECEAE2; --topbar-dim:#9AA2AB;
  --logo-bg:#0B0F13; --logo-line:#ECEAE2;
  --shadow:0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing:border-box; }
html, body { margin:0; }
body {
  background:var(--bg); color:var(--ink);
  font-family:'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease, color .25s ease;
}
a { color:inherit; text-decoration:none; }
code { font-family:'IBM Plex Mono', monospace; font-size:.9em; background:var(--line2);
  padding:1px 6px; border-radius:5px; }

/* ---------- top bar ---------- */
.topbar {
  position:sticky; top:0; z-index:60; background:var(--topbar); color:var(--topbar-ink);
  display:flex; align-items:center; gap:18px; padding:10px 22px;
  box-shadow:0 1px 0 rgba(255,255,255,.05);
}
.brand { display:flex; align-items:center; gap:12px; }
.logo { display:block; border-radius:11px; }
.brandtext { display:flex; flex-direction:column; line-height:1.05; }
.brandtext b { font-family:'Bricolage Grotesque'; font-weight:800; font-size:19px; letter-spacing:.6px; }
.brandtext i { font-style:normal; font-family:'IBM Plex Sans Condensed'; font-size:11.5px;
  color:var(--topbar-dim); letter-spacing:.4px; margin-top:2px; }
.topnav { margin-left:auto; display:flex; gap:4px; flex-wrap:wrap; }
.topnav a { font-family:'IBM Plex Sans Condensed'; font-weight:600; font-size:13px;
  color:var(--topbar-dim); padding:7px 12px; border-radius:7px; transition:background .15s, color .15s; }
.topnav a:hover { background:rgba(255,255,255,.08); color:var(--topbar-ink); }
.topnav a.on { background:var(--accent); color:var(--accent-ink); }
.themebtn { background:rgba(255,255,255,.08); color:var(--topbar-ink); border:0; cursor:pointer;
  width:34px; height:34px; border-radius:8px; font-size:16px; line-height:1; flex:none; }
.themebtn:hover { background:rgba(255,255,255,.16); }

/* ---------- hero ---------- */
.hero { max-width:1180px; margin:0 auto; padding:38px 22px 10px; }
.eyebrow { display:inline-block; font-family:'IBM Plex Mono'; font-size:11.5px; letter-spacing:1.2px;
  text-transform:uppercase; color:var(--accent); margin-bottom:12px; }
.hero h1 { font-family:'Bricolage Grotesque'; font-weight:800; font-size:clamp(28px,4.4vw,46px);
  line-height:1.04; margin:0 0 12px; letter-spacing:.2px; }
.hero p { font-size:15px; color:var(--ink2); max-width:780px; line-height:1.55; margin:0 0 20px; }
.toolrow { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.search { flex:1; min-width:240px; max-width:480px; display:flex; align-items:center; gap:9px;
  background:var(--paper); border:1px solid var(--line); border-radius:10px; padding:11px 13px;
  color:var(--ink2); }
.search input { border:0; outline:0; background:transparent; font-size:14px; width:100%;
  color:var(--ink); font-family:inherit; }
.btn { font-family:'IBM Plex Sans Condensed'; font-weight:700; font-size:13.5px; letter-spacing:.4px;
  background:var(--accent); color:var(--accent-ink); padding:11px 18px; border-radius:10px;
  border:1px solid transparent; transition:transform .1s, filter .15s; }
.btn:hover { filter:brightness(1.05); transform:translateY(-1px); }
.btn.ghost { background:transparent; color:var(--ink); border-color:var(--line); }
.btn.ghost:hover { border-color:var(--accent); color:var(--accent); }

/* ---------- stats dashboard ---------- */
.stats { max-width:1180px; margin:22px auto 0; padding:0 22px; display:grid;
  grid-template-columns:repeat(4,1fr); gap:14px; }
.stat { background:var(--paper); border:1px solid var(--line); border-radius:12px;
  padding:16px 18px; display:flex; flex-direction:column; gap:3px; }
.stat b { font-family:'Bricolage Grotesque'; font-weight:800; font-size:24px; letter-spacing:.3px; }
.stat span { font-family:'IBM Plex Sans Condensed'; font-size:12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.6px; }

/* ---------- content blocks ---------- */
.wrap { max-width:1180px; margin:0 auto; padding:14px 22px 50px; }
.block { margin-top:34px; }
.block-head { display:flex; align-items:baseline; gap:14px; border-bottom:1px solid var(--line);
  padding-bottom:9px; margin-bottom:16px; }
.block-head h2 { font-family:'Bricolage Grotesque'; font-weight:800; font-size:20px; margin:0; letter-spacing:.3px; }
.count { margin-left:auto; font-family:'IBM Plex Mono'; font-size:12px; color:var(--muted); }
.lede { font-size:14.5px; color:var(--ink2); max-width:820px; line-height:1.6; margin:0 0 16px; }
.empty { font-size:14px; color:var(--muted); padding:18px 0; }

/* ---------- learning journey strip ---------- */
.journey { list-style:none; margin:0; padding:0; display:grid;
  grid-template-columns:repeat(5,1fr); gap:10px; counter-reset:lv; }
.journey li { background:var(--paper); border:1px solid var(--line); border-radius:10px;
  padding:12px 12px; display:flex; align-items:center; gap:10px; }
.journey .lv { font-family:'Bricolage Grotesque'; font-weight:800; font-size:14px; color:var(--accent-ink);
  background:var(--accent); width:26px; height:26px; border-radius:7px; display:grid;
  place-items:center; flex:none; }
.journey .nm { font-family:'IBM Plex Sans Condensed'; font-weight:600; font-size:13px; line-height:1.2; }

/* ---------- category filters ---------- */
.filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.chip { font-family:'IBM Plex Sans Condensed'; font-weight:600; font-size:12.5px; cursor:pointer;
  background:var(--paper); color:var(--ink2); border:1px solid var(--line); border-radius:20px;
  padding:6px 13px; transition:all .15s; }
.chip:hover { border-color:var(--c, var(--accent)); color:var(--ink); }
.chip.on { background:var(--ink); color:var(--paper); border-color:var(--ink); }

/* ---------- category sections ---------- */
.cat-sec { margin-top:26px; }
.cat-head { display:flex; align-items:center; gap:11px; margin:0 0 13px; }
.cat-head .bar { width:26px; height:9px; border-radius:3px; background:var(--c); }
.cat-head h3 { font-family:'IBM Plex Sans Condensed'; font-weight:700; font-size:15px; margin:0;
  text-transform:uppercase; letter-spacing:.8px; }
.cat-head .n { font-family:'IBM Plex Mono'; font-size:11.5px; color:var(--muted); }

/* ---------- cards ---------- */
.cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px,1fr)); gap:14px; }
.card { position:relative; display:flex; flex-direction:column; gap:8px; background:var(--paper);
  border:1px solid var(--line); border-top:4px solid var(--c,#5B6470); border-radius:11px;
  padding:15px 16px 16px; min-height:120px; transition:transform .12s, box-shadow .12s, border-color .12s; }
.card:hover { transform:translateY(-3px); box-shadow:var(--shadow); }
.card .badge { font-family:'IBM Plex Mono'; font-size:11px; font-weight:600; color:#fff;
  background:var(--c,#5B6470); align-self:flex-start; padding:2px 9px; border-radius:20px; }
.card .ttl { font-family:'Bricolage Grotesque'; font-weight:700; font-size:16px; line-height:1.25; }
.card .desc { font-size:12.5px; color:var(--ink2); line-height:1.45; }
.card .meta { margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.card .tag { font-family:'IBM Plex Sans Condensed'; font-size:11px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.5px; }
.card .go { font-family:'IBM Plex Mono'; font-size:11px; color:var(--c,#5B6470); opacity:.95; }

/* ---------- footer ---------- */
.foot { background:var(--topbar); color:var(--topbar-dim); margin-top:36px; padding:22px;
  font-family:'IBM Plex Mono'; font-size:11.5px; }
.foot .in { max-width:1180px; margin:0 auto; display:flex; justify-content:space-between;
  gap:14px; flex-wrap:wrap; }
.foot .by { color:var(--accent); }

/* ---------- responsive ---------- */
@media (max-width:860px) {
  .stats { grid-template-columns:repeat(2,1fr); }
  .journey { grid-template-columns:repeat(2,1fr); }
  .topnav { display:none; }
}
@media (max-width:520px) {
  .stats { grid-template-columns:1fr 1fr; }
  .journey { grid-template-columns:1fr; }
}

/* ---------- print ---------- */
@media print {
  .topbar, .toolrow, .filters, .themebtn { display:none !important; }
  body { background:#fff; }
  .card { break-inside:avoid; box-shadow:none; }
}

/* ---------- page viewer (header on every page) ---------- */
.viewbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--paper); border-bottom:1px solid var(--line); padding:10px 22px; }
.viewbar .back { font-family:'IBM Plex Sans Condensed'; font-weight:700; font-size:13px;
  color:var(--accent); }
.viewbar .vtitle { display:flex; align-items:center; gap:8px; font-family:'Bricolage Grotesque';
  font-weight:700; font-size:15px; }
.viewbar .vtitle .dot { width:10px; height:10px; border-radius:3px; background:var(--c); }
.viewbar .vcat { font-family:'IBM Plex Sans Condensed'; font-size:11px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.6px; }
.viewbar .spacer { margin-left:auto; }
.viewbar .pill { font-family:'IBM Plex Mono'; font-size:11.5px; color:var(--ink2);
  background:var(--bg); border:1px solid var(--line); border-radius:20px; padding:6px 12px;
  transition:border-color .15s, color .15s; }
.viewbar .pill:hover { border-color:var(--accent); color:var(--accent); }
.viewbar .pill.disabled { opacity:.4; pointer-events:none; }
/* viewer = full-height flex column: header + toolbar pinned, poster fills the
   rest and scrolls inside. The iframe stretches to the full body width, so the
   poster always renders at desktop width (never its mobile breakpoint). */
html.viewer-doc, body.viewer { height:100%; }
body.viewer { margin:0; background:var(--bg); display:flex; flex-direction:column;
  min-height:100vh; min-height:100dvh; }
body.viewer .topbar { flex:0 0 auto; }
.viewbar { flex:0 0 auto; }
.frame { flex:1 1 auto; width:100%; min-height:0; border:0; display:block; background:var(--bg); }

/* scroll-to-top button (site-wide) */
.to-top { position:fixed; right:20px; bottom:20px; z-index:80; width:46px; height:46px;
  border-radius:50%; border:1px solid var(--line); background:var(--paper); color:var(--ink);
  font-size:19px; line-height:1; cursor:pointer; box-shadow:var(--shadow); display:grid;
  place-items:center; opacity:0; visibility:hidden; transform:translateY(10px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s ease, border-color .15s, color .15s; }
.to-top.show { opacity:1; visibility:visible; transform:translateY(0); }
.to-top:hover { border-color:var(--accent); color:var(--accent); }

@media (max-width:560px) {
  .viewbar .vcat { display:none; }
  .viewbar { gap:8px; padding:9px 14px; }
  .to-top { right:14px; bottom:14px; }
}
@media print {
  .viewbar, .to-top { display:none !important; }
}
