
/* ============================================================
   ScoutMyTool Blog — design tokens (mirrors scoutmytool.com)
   Default theme: dark.  data-theme="light" overrides.
   ============================================================ */
:root,
:root[data-theme="dark"] {
  --bg:#0a0a0a;
  --surface:#111111;
  --surface-raised:#1a1a1a;
  --border:#222222;
  --border-light:#2a2a2a;
  --text-primary:#f9fafb;
  --text-secondary:#9ca3af;
  --text-tertiary:#6b7280;
  --primary:#6366f1;
  --primary-hover:#818cf8;
  --primary-glow:rgba(99,102,241,.18);
  --success:#10b981;
  --error:#ef4444;
  --info:#3b82f6;
  --code-bg:#161616;
  --code-fg:#e4e4e7;
  --code-border:#2a2a2a;
  --quote-bg:rgba(99,102,241,.08);
  --quote-fg:#cbd5e1;
  --tag-bg:rgba(99,102,241,.14);
  --tag-fg:#a5b4fc;
  --shadow-glow:0 12px 32px -10px rgba(99,102,241,.18);
}
:root[data-theme="light"] {
  --bg:#f8f9fa;
  --surface:#ffffff;
  --surface-raised:#f1f3f5;
  --border:#e5e7eb;
  --border-light:#f3f4f6;
  --text-primary:#111111;
  --text-secondary:#6b7280;
  --text-tertiary:#9ca3af;
  --primary:#6366f1;
  --primary-hover:#4f46e5;
  --primary-glow:rgba(99,102,241,.12);
  --success:#059669;
  --error:#dc2626;
  --info:#2563eb;
  --code-bg:#f1f5f9;
  --code-fg:#0f172a;
  --code-border:#e5e7eb;
  --quote-bg:#eef2ff;
  --quote-fg:#3730a3;
  --tag-bg:#eef2ff;
  --tag-fg:#4338ca;
  --shadow-glow:0 8px 24px -10px rgba(15,23,42,.12);
}

/* ============================================================
   reset + base
   ============================================================ */
*,*::before,*::after { box-sizing:border-box; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  margin:0;
  color:var(--text-primary);
  background:var(--bg);
  font:17px/1.7 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  min-height:100vh;
}
a { color:var(--primary); text-decoration:none; }
a:hover { color:var(--primary-hover); text-decoration:underline; }

img, svg { max-width:100%; height:auto; display:block; }

/* ============================================================
   container widths
   - article body: 700px (per spec — readable measure)
   - index/wide:   1100px
   ============================================================ */
.container       { max-width:700px;  margin:0 auto; padding:0 1.25rem; }
.container-wide  { max-width:1100px; margin:0 auto; padding:0 1.5rem; }

/* ============================================================
   header / nav  — sticky, blurred, mirrors main site
   ============================================================ */
header.site {
  position:sticky; top:0; z-index:30;
  border-bottom:1px solid var(--border-light);
  background:color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
}
header.site .nav-row {
  max-width:1100px; margin:0 auto;
  padding:0 1rem;
  height:56px;
  display:flex; align-items:center; gap:1rem;
}
header.site .brand {
  display:flex; align-items:center; gap:.6rem; flex-shrink:0;
}
header.site .brand a {
  display:flex; align-items:center; gap:.6rem;
  color:var(--text-primary); text-decoration:none;
}
header.site .brand a:hover { text-decoration:none; }
header.site .brand .logo {
  width:28px; height:28px; border-radius:8px;
  background:linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display:grid; place-items:center;
  box-shadow:0 4px 14px rgba(99,102,241,.4);
}
header.site .brand .logo span {
  color:#fff; font-size:12px; font-weight:800;
}
header.site .brand .name {
  font-size:14px; font-weight:800; letter-spacing:-.01em;
}
header.site nav.cluster {
  display:none; align-items:center; gap:0; margin-left:.5rem;
}
header.site nav.cluster a {
  padding:.4rem .75rem;
  font-size:14px;
  color:var(--text-secondary);
  border-radius:8px;
  transition:color .15s ease, background-color .15s ease;
}
header.site nav.cluster a:hover {
  color:var(--text-primary);
  background:var(--surface);
  text-decoration:none;
}
header.site nav.cluster a.current {
  color:var(--text-primary);
  background:var(--surface);
}
header.site .spacer { margin-left:auto; }
header.site .theme-toggle {
  appearance:none;
  width:36px; height:36px; border-radius:8px;
  background:transparent; border:1px solid var(--border-light);
  color:var(--text-secondary);
  cursor:pointer;
  display:grid; place-items:center;
  transition:color .15s ease, border-color .15s ease, background-color .15s ease;
}
header.site .theme-toggle:hover {
  color:var(--text-primary);
  background:var(--surface);
  border-color:var(--border);
}
header.site .theme-toggle svg { width:18px; height:18px; }
header.site .theme-toggle .icon-sun  { display:none; }
header.site .theme-toggle .icon-moon { display:block; }
:root[data-theme="light"] header.site .theme-toggle .icon-sun  { display:block; }
:root[data-theme="light"] header.site .theme-toggle .icon-moon { display:none; }

@media (min-width:768px) {
  header.site nav.cluster { display:flex; }
}

/* ============================================================
   index page — banner + clickable cards
   ============================================================ */
section.banner {
  padding:3rem 0 2.5rem;
  background:
    radial-gradient(ellipse at top left, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(168,85,247,.08) 0%, transparent 50%),
    var(--bg);
  border-bottom:1px solid var(--border-light);
}
section.banner h1 {
  margin:0 0 .65rem;
  font-size:2.1rem;
  letter-spacing:-.02em;
  font-weight:800;
  color:var(--text-primary);
}
section.banner p {
  margin:0;
  color:var(--text-secondary);
  font-size:1.05rem;
  max-width:640px;
}
section.banner .meta {
  margin-top:1.25rem;
  font-size:.78rem;
  color:var(--text-tertiary);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.articles-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:1.25rem;
  padding:2.5rem 0 1rem;
}
@media (min-width:768px) {
  .articles-grid { grid-template-columns:repeat(2, 1fr); gap:1.5rem; }
}

.article-card {
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:12px;
  padding:1.5rem 1.4rem;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display:flex; flex-direction:column;
}
.article-card:hover {
  transform:translateY(-2px);
  border-color:var(--primary);
  box-shadow:var(--shadow-glow);
}
.article-card a.card-link {
  display:flex; flex-direction:column; height:100%;
  color:inherit; text-decoration:none;
}
.article-card a.card-link:hover { text-decoration:none; }

.article-card .a-title {
  /* Per spec #6 — titles MUST look like obvious clickable links. */
  font-size:1.18rem;
  font-weight:700;
  line-height:1.35;
  letter-spacing:-.01em;
  margin-bottom:.55rem;
  color:var(--primary);
  text-decoration:none;
  transition:color .15s ease;
}
.article-card a.card-link:hover .a-title {
  color:var(--primary-hover);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}
.article-card .a-desc {
  color:var(--text-secondary);
  font-size:.95rem;
  line-height:1.55;
  flex-grow:1;
  margin-bottom:1rem;
}
.article-card .a-meta {
  display:flex; gap:.6rem; flex-wrap:wrap; align-items:center;
  color:var(--text-tertiary);
  font-size:.8rem;
}
.article-card .a-meta .pill {
  background:var(--surface-raised);
  padding:.2rem .6rem;
  border-radius:999px;
  border:1px solid var(--border-light);
  color:var(--text-secondary);
}

.empty {
  color:var(--text-secondary);
  padding:3rem 1rem; text-align:center;
}

/* ============================================================
   article page
   ============================================================ */
article.post {
  padding:2.25rem 0 1rem;
}
article.post header.hero {
  margin:0 0 1.75rem;
  padding-bottom:1.5rem;
  border-bottom:1px solid var(--border-light);
}
article.post h1 {
  font-size:2.15rem;
  line-height:1.18;
  letter-spacing:-.02em;
  font-weight:800;
  margin:0 0 1rem;
  color:var(--text-primary);
}
article.post .badges {
  display:flex; flex-wrap:wrap; gap:.5rem; align-items:center;
  color:var(--text-tertiary);
  font-size:.85rem;
}
article.post .badges .dot { color:var(--text-tertiary); opacity:.5; }
article.post .badges time { color:var(--text-secondary); }
article.post .badges .read { color:var(--text-secondary); }
article.post .badges .badge {
  background:var(--tag-bg); color:var(--tag-fg);
  padding:.2rem .65rem; border-radius:999px;
  font-size:.78rem; font-weight:500;
}

article.post h2 {
  font-size:1.5rem;
  line-height:1.3;
  letter-spacing:-.01em;
  margin:2.5rem 0 .9rem;
  padding-left:.85rem;
  border-left:3px solid var(--primary);
  color:var(--text-primary);
  font-weight:700;
}
article.post h3 {
  font-size:1.18rem;
  line-height:1.35;
  margin:2rem 0 .65rem;
  font-weight:700;
  color:var(--text-primary);
}
article.post p { margin:0 0 1.15rem; color:var(--text-primary); }
article.post strong { font-weight:700; color:var(--text-primary); }
article.post a {
  color:var(--primary);
  border-bottom:1px solid transparent;
  transition:border-color .15s ease, color .15s ease;
}
article.post a:hover {
  color:var(--primary-hover);
  border-bottom-color:var(--primary-hover);
  text-decoration:none;
}

article.post ul, article.post ol {
  padding-left:1.4rem; margin:0 0 1.15rem;
}
article.post li { margin:.45rem 0; }

article.post blockquote {
  margin:1.75rem 0;
  padding:1rem 1.25rem;
  background:var(--quote-bg);
  color:var(--quote-fg);
  border-left:4px solid var(--primary);
  border-radius:0 8px 8px 0;
  font-style:italic;
}
article.post blockquote p { margin:0; }

article.post pre, article.post code {
  background:var(--code-bg);
  color:var(--code-fg);
  border-radius:8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
article.post pre {
  padding:1rem 1.15rem;
  overflow:auto;
  line-height:1.55;
  font-size:.92em;
  border:1px solid var(--code-border);
  margin:1.25rem 0 1.5rem;
}
article.post code {
  padding:.12rem .4rem;
  font-size:.92em;
  border:1px solid var(--code-border);
}
article.post pre code { background:none; border:none; padding:0; }

article.post img {
  border-radius:8px;
  margin:1.25rem auto;
  border:1px solid var(--border-light);
}

/* tables — responsive: scroll horizontally on small screens */
article.post .table-wrap {
  overflow-x:auto;
  margin:1.5rem 0;
  border:1px solid var(--border-light);
  border-radius:8px;
}
article.post table {
  width:100%; border-collapse:collapse;
  background:var(--surface);
  font-size:.95rem;
}
article.post th, article.post td {
  padding:.6rem .85rem;
  border-bottom:1px solid var(--border-light);
  text-align:left;
  vertical-align:top;
}
article.post th {
  background:var(--surface-raised);
  font-weight:700;
  color:var(--text-primary);
  border-bottom:1px solid var(--border);
}
article.post tr:last-child td { border-bottom:0; }

article.post hr {
  border:0;
  border-top:1px solid var(--border-light);
  margin:2.5rem 0;
}

/* ============================================================
   ad slots
   ============================================================ */
.ad-slot {
  background:var(--surface);
  border:1px dashed var(--border);
  border-radius:8px;
  padding:1rem;
  text-align:center;
  color:var(--text-tertiary);
  font-size:13px;
  min-height:90px;
  display:flex; align-items:center; justify-content:center;
  margin:2rem 0;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.ad-slot.ad-mid { min-height:250px; }

/* ============================================================
   related articles
   ============================================================ */
section.related { margin-top:3rem; }
section.related h3.section-title {
  font-size:.78rem;
  color:var(--text-tertiary);
  text-transform:uppercase;
  letter-spacing:.1em;
  margin:0 0 1rem;
  font-weight:700;
}
section.related .related-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
}
@media (min-width:640px) {
  section.related .related-grid { grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
}
section.related .related-card {
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:10px;
  padding:1rem 1.1rem;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
section.related .related-card:hover {
  transform:translateY(-2px);
  box-shadow:var(--shadow-glow);
  border-color:var(--primary);
}
section.related .related-card a {
  display:block;
  color:inherit;
}
section.related .related-card a:hover { text-decoration:none; }
section.related .related-card .r-title {
  color:var(--primary);
  font-weight:600;
  line-height:1.35;
  margin-bottom:.4rem;
}
section.related .related-card a:hover .r-title {
  color:var(--primary-hover);
  text-decoration:underline;
  text-underline-offset:3px;
}
section.related .related-card .r-desc {
  color:var(--text-tertiary);
  font-size:.88rem;
  line-height:1.5;
}

/* ============================================================
   footer
   ============================================================ */
footer.site {
  margin-top:4rem;
  padding:2rem 0;
  border-top:1px solid var(--border-light);
  background:color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
footer.site .footer-row {
  max-width:1100px; margin:0 auto;
  padding:0 1.5rem;
  display:flex; flex-direction:column; gap:1rem;
  align-items:flex-start; justify-content:space-between;
}
@media (min-width:640px) {
  footer.site .footer-row { flex-direction:row; align-items:center; }
}
footer.site .brand-row {
  display:flex; align-items:center; gap:.55rem; margin-bottom:.25rem;
}
footer.site .brand-row .logo-sm {
  width:24px; height:24px; border-radius:7px;
  background:linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display:grid; place-items:center;
  box-shadow:0 3px 10px rgba(99,102,241,.3);
}
footer.site .brand-row .logo-sm span { color:#fff; font-size:10px; font-weight:800; }
footer.site .brand-row .name { font-size:.85rem; font-weight:800; color:var(--text-primary); }
footer.site .tagline { color:var(--text-tertiary); font-size:.78rem; margin:0; }
footer.site .links {
  display:flex; flex-wrap:wrap; gap:1rem;
  font-size:.78rem;
  color:var(--text-tertiary);
}
footer.site .links a {
  color:var(--text-tertiary);
  transition:color .15s ease;
}
footer.site .links a:hover { color:var(--text-secondary); text-decoration:none; }

/* ============================================================
   mobile tuning
   ============================================================ */
@media (max-width:640px) {
  body { font-size:16px; line-height:1.65; }
  .container { padding:0 1rem; }
  .container-wide { padding:0 1rem; }
  article.post { padding:1.5rem 0 .5rem; }
  article.post h1 { font-size:1.7rem; }
  article.post h2 { font-size:1.25rem; }
  section.banner { padding:2.25rem 0 1.75rem; }
  section.banner h1 { font-size:1.6rem; }
  .ad-slot.ad-mid { min-height:160px; }
}
