/* =========================================================
   slipjar.app — shared tokens, header, footer, primitives
   ========================================================= */
:root{
  --bg:#ffffff;
  --bg-alt:#f8fafc;
  --bg-alt-2:#f1f5f9;
  --ink:#0f172a;
  --ink-2:#1e293b;
  --muted:#64748b;
  --muted-2:#94a3b8;
  --line:#e2e8f0;
  --line-2:#eef2f6;
  --brand:#2563eb;
  --brand-2:#3b82f6;
  --brand-deep:#1d4ed8;
  --brand-soft:#dbeafe;
  --brand-softer:#eff6ff;
  --chip-bg:#f1f5f9;
  --chip-ink:#334155;
  --green:#16a34a;
  --green-soft:#dcfce7;
  --green-softer:#ecfdf5;
  --purple:#7c3aed;
  --purple-soft:#ede9fe;
  --purple-softer:#f5f3ff;
  --orange:#f59e0b;
  --orange-soft:#fef3c7;
  --orange-softer:#fef9c3;
  --red:#ef4444;
  --shadow-sm:0 1px 2px rgba(15,23,42,.04);
  --shadow:0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:0 4px 12px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  font-size:14px;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:0;background:none}
input,textarea{font-family:inherit}
img{max-width:100%;display:block}
.wrap{max-width:1024px;margin:0 auto;padding:0 32px}

/* ============ HEADER ============ */
.site-header{height:72px;display:flex;align-items:center;border-bottom:1px solid transparent}
.site-header.bordered{border-bottom-color:var(--line)}
.site-header .wrap{display:flex;align-items:center;gap:48px;width:100%}
.logo{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:600;color:var(--ink)}
.logo-mark{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center}
.logo-mark svg{width:32px;height:32px}
.logo .dot-app{color:var(--muted)}
.nav{display:flex;align-items:center;gap:28px;font-size:14px;font-weight:500}
.nav a{color:var(--ink-2);display:inline-flex;align-items:center;gap:4px;padding:6px 0;position:relative}
.nav a:hover{color:var(--brand)}
.nav a.active{color:var(--brand)}
.nav a.active::after{
  content:"";position:absolute;left:0;right:0;bottom:-22px;height:2px;background:var(--brand);border-radius:2px;
}
.nav .caret{width:10px;height:10px;display:inline-block}
.nav .caret svg{display:block}
.head-right{margin-left:auto;display:flex;align-items:center;gap:16px}
.search-box{
  position:relative;width:200px;height:36px;
  background:var(--bg-alt);border:1px solid var(--line);border-radius:8px;
  display:flex;align-items:center;
}
.search-box .ico{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted-2)}
.search-box input{width:100%;height:100%;border:0;background:transparent;outline:none;padding:0 12px 0 32px;font-size:13px;color:var(--ink)}
.search-box input::placeholder{color:var(--muted-2)}
.theme-toggle{
  width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  color:var(--muted);border:1px solid transparent;
}
.theme-toggle:hover{background:var(--bg-alt)}

/* ============ FOOTER ============ */
.footer{border-top:1px solid var(--line);padding:40px 0 20px;background:#fff}
.footer-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr 1.4fr;gap:32px;margin-bottom:32px}
.foot-about{font-size:12.5px;color:var(--muted);line-height:1.6;margin:14px 0 18px;max-width:240px}
.socials{display:flex;gap:10px}
.socials a{
  width:30px;height:30px;border-radius:8px;background:var(--bg-alt);
  display:flex;align-items:center;justify-content:center;color:var(--muted);
}
.socials a:hover{background:var(--brand-soft);color:var(--brand)}
.foot-h{font-size:13px;font-weight:600;color:var(--ink);margin:0 0 14px}
.foot-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.foot-list a{font-size:13px;color:var(--muted)}
.foot-list a:hover{color:var(--brand)}
.subscribe-text{font-size:12.5px;color:var(--muted);line-height:1.55;margin:0 0 12px;max-width:260px}
.subscribe-form{display:flex;gap:8px}
.subscribe-form input{
  flex:1;height:40px;border:1px solid var(--line);border-radius:10px;
  padding:0 14px;font-size:13px;outline:none;background:#fff;
}
.subscribe-form input::placeholder{color:var(--muted-2)}
.subscribe-form input:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.subscribe-form button{
  height:40px;padding:0 18px;border-radius:10px;background:var(--brand);color:#fff;
  font-size:13px;font-weight:500;
}
.subscribe-form button:hover{background:var(--brand-deep)}
.foot-bot{
  padding-top:20px;border-top:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
  font-size:12.5px;color:var(--muted-2);
}
.foot-bot .links{display:flex;gap:24px}
.foot-bot a:hover{color:var(--brand)}

/* ============ COMMON PRIMITIVES ============ */
.badge{
  display:inline-flex;align-items:center;height:28px;padding:0 14px;
  background:var(--brand-soft);color:var(--brand);border-radius:999px;
  font-size:11px;font-weight:600;letter-spacing:.08em;
}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:16px;flex-wrap:wrap}
.section-title{font-size:22px;font-weight:700;color:var(--ink);letter-spacing:-.01em;margin:0}
.section-link{font-size:13px;color:var(--brand);font-weight:500;display:inline-flex;align-items:center;gap:6px}
.section-link:hover{color:var(--brand-deep)}

/* author inline (avatar + name on one line) */
.author{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink-2);font-weight:500}
.author .avatar{
  width:28px;height:28px;border-radius:999px;background:#bfdbfe;
  display:flex;align-items:center;justify-content:center;
  color:var(--brand-deep);font-weight:600;font-size:11px;
}

/* breadcrumbs */
.crumbs{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);margin-bottom:24px;flex-wrap:wrap}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--brand)}
.crumbs .sep{color:var(--muted-2)}
.crumbs .cur{color:var(--ink-2)}

/* post card (reusable) */
.post{display:flex;flex-direction:column;gap:12px}
.post-thumb{
  aspect-ratio:1/0.66;border-radius:14px;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
}
.post-thumb svg{width:100%;height:100%;display:block}
.post-cat{
  display:inline-flex;align-self:flex-start;height:22px;padding:0 10px;border-radius:999px;
  font-size:10px;font-weight:600;letter-spacing:.08em;
  background:var(--chip-bg);color:var(--chip-ink);
}
.post-title{font-size:15px;font-weight:600;color:var(--ink);line-height:1.35;margin:0}
.post-title a:hover{color:var(--brand)}
.post-excerpt{font-size:12.5px;color:var(--muted);line-height:1.55;margin:0}
.post-meta{font-size:11.5px;color:var(--muted-2);display:flex;align-items:center;gap:8px;margin-top:auto}
.post-meta .sep{width:3px;height:3px;border-radius:999px;background:var(--muted-2)}

/* tags */
.tag-list{display:flex;flex-wrap:wrap;gap:8px}
.tag{
  display:inline-flex;align-items:center;height:30px;padding:0 14px;
  border:1px solid var(--line);border-radius:8px;
  font-size:12.5px;color:var(--ink-2);background:#fff;
}
.tag:hover{border-color:var(--brand);color:var(--brand)}
.tag.is-active{background:var(--brand);color:#fff;border-color:var(--brand)}

/* buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:40px;padding:0 18px;border-radius:10px;
  font-size:13.5px;font-weight:500;cursor:pointer;border:1px solid transparent;
  transition:background .15s, color .15s, border-color .15s;
}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-deep)}
.btn-ghost{background:#fff;color:var(--ink-2);border-color:var(--line)}
.btn-ghost:hover{border-color:var(--brand);color:var(--brand)}


/* ============ DARK THEME ============ */
html.theme-dark{
  --bg:#0b1220; --bg-alt:#0f172a; --bg-alt-2:#1e293b;
  --ink:#f1f5f9; --ink-2:#cbd5e1; --muted:#94a3b8; --muted-2:#64748b;
  --line:#1e293b; --line-2:#0f172a;
  --brand:#60a5fa; --brand-2:#3b82f6; --brand-deep:#1d4ed8;
  --brand-soft:#1e3a8a; --brand-softer:#0c1d3d;
  --chip-bg:#1e293b; --chip-ink:#cbd5e1;
  --green:#22c55e; --green-soft:#14532d; --green-softer:#052e16;
  --purple:#a78bfa; --purple-soft:#3b0764; --purple-softer:#1e0a3c;
  --orange:#fb923c; --orange-soft:#7c2d12; --orange-softer:#451a03;
  --red:#f87171;
}
html.theme-dark body{background:var(--bg);color:var(--ink);}
html.theme-dark .cmp-card,html.theme-dark .post,html.theme-dark .featured,html.theme-dark .author-bio,html.theme-dark .gl-card,html.theme-dark .rt-card,html.theme-dark .footer,html.theme-dark .toolbar-row,html.theme-dark .subscribe-form input{background:var(--bg-alt);}
html.theme-dark .tag,html.theme-dark .chip,html.theme-dark .cmp-thumb{background:var(--bg-alt);color:var(--ink-2)}
html.theme-dark img{opacity:.95;filter:contrast(.95)}
