:root {
  --brand: #1F4E79;
  --brand-2: #2f6fb0;
  --brand-ink: #143252;
  --brand-light: #E8EEF7;
  --accent: #f0b429;
  --note-bg: #FFF7E0;
  --note-border: #E0C060;
  --text: #1b2430;
  --muted: #64707d;
  --line: #e5e9ef;
  --card: #ffffff;
  --bg: #eef1f6;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
img { max-width: 100%; }

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-ink); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.brand .name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.1; }
.brand .name small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; letter-spacing: .01em; }

/* ---- Hero (home) ---- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(240,180,41,.18), transparent 60%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  color: #fff;
}
.hero .inner { max-width: 1040px; margin: 0 auto; padding: 56px 20px 64px; }
.hero h1 { margin: 0; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 12px 0 0; font-size: 1.1rem; max-width: 620px; color: #dbe6f2; }
.hero .kicker {
  display: inline-block; margin-bottom: 14px; padding: 5px 12px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 20px 72px; }
.reading { max-width: 760px; }

/* ---- Home grid ---- */
.section-title { margin: 36px 0 4px; font-size: 1.25rem; letter-spacing: -.01em; }
.section-sub { margin: 0 0 8px; color: var(--muted); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: #d3dce8; }
.card .thumb { aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb.placeholder {
  background:
    radial-gradient(500px 200px at 20% 10%, rgba(255,255,255,.25), transparent 50%),
    linear-gradient(135deg, var(--brand-2), var(--brand-ink));
  display: flex; align-items: center; justify-content: center;
}
.card .thumb.placeholder span { color: rgba(255,255,255,.9); font-size: 2rem; font-weight: 800; letter-spacing: .04em; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.chip {
  align-self: flex-start;
  background: var(--brand-light); color: var(--brand);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px; margin-bottom: 10px;
}
.card h3 { margin: 0 0 6px; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card .meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.card .meta .read { color: var(--brand-2); font-weight: 600; }

/* ---- Article ---- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; text-decoration: none; font-size: .9rem; font-weight: 600; }
.back:hover { text-decoration: underline; }
.post-head { margin-bottom: 8px; }
.post-head .chip { display: inline-block; margin-bottom: 14px; }
.post-head h1 { margin: 0; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.post-head .byline { margin-top: 10px; color: var(--muted); font-size: .9rem; }
article { font-size: 1.02rem; }
article h2 {
  color: var(--brand-ink);
  margin-top: 44px; margin-bottom: 12px;
  font-size: 1.4rem; letter-spacing: -.01em;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
article h3 { margin-top: 28px; font-size: 1.1rem; }
article p { margin: 14px 0; }
article table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }
article th, article td { border-bottom: 1px solid var(--line); padding: 11px 14px; text-align: left; }
article thead th { background: var(--brand); color: #fff; border-bottom: none; font-weight: 600; }
article tbody tr:nth-child(even) { background: #fafbfd; }
article tbody tr:last-child td { border-bottom: none; }

.note, article blockquote {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-left: 5px solid var(--accent);
  padding: 14px 18px;
  margin: 22px 0;
  border-radius: 10px;
  color: #6b5518;
}
article blockquote p { margin: 0; }

ol.steps { padding-left: 0; list-style: none; counter-reset: step; }
ol.steps > li { position: relative; padding: 2px 0 22px 52px; counter-increment: step; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; box-shadow: var(--shadow);
}
ol.steps > li::after {
  content: ""; position: absolute; left: 16px; top: 40px; bottom: 6px;
  width: 2px; background: var(--line);
}
ol.steps > li:last-child::after { display: none; }
ol.steps > li strong { display: block; margin-bottom: 2px; color: var(--brand-ink); }

/* Markdown ordered lists get a lighter numbered style */
article > ol:not(.steps) { padding-left: 22px; }
article > ol:not(.steps) > li { margin-bottom: 8px; }
article ul { padding-left: 22px; }
article ul li { margin-bottom: 8px; }
article code { background: #eef1f6; padding: 2px 6px; border-radius: 6px; font-size: .9em; }

figure { margin: 14px 0 0; }
figure img { border: 1px solid var(--line); border-radius: 10px; display: block; box-shadow: var(--shadow); }
figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }

footer { color: var(--muted); font-size: .85rem; text-align: center; padding: 32px 20px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.9rem; }
  .post-head h1 { font-size: 1.6rem; }
  .hero .inner { padding: 40px 20px 46px; }
}
