:root{
  --blue: #2563eb;
  --indigo: #6366f1;
  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --orange: #f97316;
  --blue-soft: #eff6ff;
  --red: #ef4444;
  --red-soft: #fef2f2;

  --ink: #16192a;
  --ink-soft: #454a5f;
  --muted: #6b7086;
  --line: #e6e9f2;
  --paper: #ffffff;
  --paper-dim: #f7f8fc;
  --radius: .9rem;
}

*,*::before,*::after{ box-sizing:border-box; }
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
.wrap{ max-width:1180px; margin:0 auto; padding:0 28px; }
.wrap-narrow{ max-width:760px; }

/* ---------- nav ---------- */
.site-nav .wrap{
  display:flex; align-items:center; justify-content:space-between; padding:18px 28px;
  border-bottom:1px solid var(--line);
}
.logo{ display:flex; align-items:center; gap:9px; font-weight:700; font-size:1rem; }
.logo .mark{ width:24px;height:24px;border-radius:7px; background:linear-gradient(135deg, var(--blue), var(--indigo)); }
.nav-links{ display:flex; align-items:center; gap:26px; font-size:.9rem; color:var(--muted); }
.nav-links a.active{ color:var(--ink); font-weight:600; }
.nav-cta{
  padding:8px 16px; border-radius:8px; font-weight:600;
  background:linear-gradient(135deg, var(--blue), var(--indigo)); color:#fff !important;
}

/* ---------- hero ---------- */
.hero{ padding:52px 0 36px; background:var(--blue-soft); text-align:center; }
.hero h1{ font-size:clamp(1.8rem,4vw,2.5rem); letter-spacing:-.02em; margin:0 0 12px; text-wrap:balance; }
.hero p{ color:var(--ink-soft); max-width:560px; margin:0 auto; line-height:1.6; }
.hero-tag{ text-align:left; padding:40px 0 28px; }
.hero-tag h1{ text-align:left; }

/* ---------- filters ---------- */
.filters{ display:flex; flex-wrap:wrap; gap:10px; padding:26px 0 6px; }
.pill{
  font-size:.83rem; padding:7px 15px; border-radius:999px; border:1px solid var(--line);
  color:var(--muted); background:var(--paper);
}
.pill.is-active{ background:var(--ink); color:#fff !important; border-color:var(--ink); font-weight:600; }

/* ---------- grid / cards ---------- */
.grid-section{ padding:18px 0 60px; }
.row-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin:30px 0 12px; }

.card{
  background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
  display:flex; flex-direction:column; box-shadow:0 8px 24px -18px rgba(20,25,50,.25);
}
.card .thumb{
  aspect-ratio:16/9; position:relative; display:block;
  background:linear-gradient(135deg, var(--blue-soft), var(--emerald-soft));
  background-size:cover; background-position:center;
}
.card .tag{
  position:absolute; top:12px; left:12px; font-size:.68rem; font-weight:700; letter-spacing:.02em;
  padding:4px 10px; border-radius:999px; background:rgba(255,255,255,.9); color:var(--blue);
}
.card .body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.card h3{ font-size:1rem; line-height:1.35; margin:0; letter-spacing:-.01em; }
.card .excerpt{ font-size:.85rem; color:var(--muted); line-height:1.5; margin:0; }
.card .meta{ display:flex; justify-content:space-between; font-size:.74rem; color:var(--muted); margin-top:auto; padding-top:10px; border-top:1px solid var(--line); }

.row-1{ display:grid; grid-template-columns:1fr; gap:20px; }
.row-1 .card-hero{ flex-direction:row; }
.row-1 .card-hero .thumb{ width:44%; aspect-ratio:auto; }
.row-1 .card-hero .body{ width:56%; justify-content:center; padding:26px 30px; }
.row-1 .card-hero h3{ font-size:1.4rem; }

.row-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.row-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.row-4 .excerpt{ display:none; }

@media (max-width:900px){
  .row-3,.row-4{ grid-template-columns:repeat(2,1fr); }
  .row-1 .card-hero{ flex-direction:column; }
  .row-1 .card-hero .thumb,.row-1 .card-hero .body{ width:100%; }
}

.pagination{ display:flex; align-items:center; justify-content:center; gap:20px; margin-top:40px; font-size:.85rem; }
.page-btn{ color:var(--blue); font-weight:600; }
.page-status{ color:var(--muted); font-variant-numeric:tabular-nums; }

/* ---------- single post ---------- */
.post-topbar{ border-bottom:1px solid var(--line); padding:14px 0; }
.back-link{ font-size:.85rem; color:var(--muted); }
.post-header{ padding:36px 0 20px; }
.post-header .tag{ display:inline-block; font-size:.72rem; font-weight:700; color:var(--blue); background:var(--blue-soft); padding:4px 11px; border-radius:999px; margin-bottom:14px; }
.post-header h1{ font-size:clamp(1.8rem,4vw,2.4rem); letter-spacing:-.02em; margin:0 0 14px; text-wrap:balance; }
.post-meta{ display:flex; gap:14px; font-size:.85rem; color:var(--muted); }

.post-feature{ margin:20px auto 30px; }
.post-feature img{ border-radius:var(--radius); }

.post-layout{ display:grid; grid-template-columns:200px 1fr; gap:48px; align-items:start; padding-bottom:10px; }
.post-toc{ position:sticky; top:24px; }
.toc-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 10px; }
.toc-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; border-left:2px solid var(--line); }
.toc-list a{ display:block; padding-left:14px; font-size:.85rem; color:var(--muted); }
.toc-list a:hover{ color:var(--blue); }

.post-content{ max-width:680px; font-size:1.02rem; line-height:1.75; color:var(--ink-soft); }
.post-content h2{ font-size:1.35rem; letter-spacing:-.01em; margin:38px 0 14px; color:var(--ink); }
.post-content h3{ font-size:1.12rem; margin:28px 0 12px; color:var(--ink); }
.post-content img{ border-radius:.6rem; margin:20px 0; }
.post-content a{ color:var(--blue); text-decoration:underline; }
.post-content blockquote{ border-left:3px solid var(--emerald); margin:20px 0; padding:4px 20px; color:var(--ink); background:var(--emerald-soft); border-radius:0 .5rem .5rem 0; }
.post-content .kg-width-wide{ max-width:920px; margin-left:calc(50% - 460px); margin-right:calc(50% - 460px); }
.post-content .kg-width-full{ max-width:none; width:100%; margin-left:0; margin-right:0; }

@media (max-width:820px){
  .post-content .kg-width-wide,
  .post-content .kg-width-full{ max-width:100%; margin-left:0; margin-right:0; }
}

@media (max-width:820px){
  .post-layout{ grid-template-columns:1fr; }
  .post-toc{ position:static; order:2; }
}

.cta-banner{
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  margin:44px 0; padding:22px 26px; border-radius:var(--radius);
  background:linear-gradient(135deg, var(--blue), var(--indigo)); color:#fff !important;
}
.cta-title{ font-weight:700; font-size:1.05rem; }
.cta-sub{ font-size:.9rem; opacity:.9; }

.post-tags{ display:flex; flex-wrap:wrap; gap:8px; margin:20px 0 40px; }
.related-section{ padding-top:10px; padding-bottom:60px; }

/* ---------- footer ---------- */
.site-footer{ border-top:1px solid var(--line); padding:26px 0; text-align:center; }
.site-footer p{ margin:0 0 4px; font-size:.85rem; color:var(--muted); }
.site-footer .disclaimer{ font-size:.76rem; }
