:root {
  --ink: #16202e;
  --ink-2: #3d4a5c;
  --muted: #667085;
  --line: #e3e7ee;
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --accent: #c2410c;
  --accent-ink: #9a3412;
  --accent-soft: #fff1e8;
  --navy: #14233a;
  --radius: 10px;
  --wrap: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.65 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* header */
.site-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--accent); font-weight: 800; letter-spacing: .5px; }
.brand-name { display: block; font-size: 1.35rem; font-weight: 400; letter-spacing: -.2px; line-height: 1.1; }
.brand-name b { font-weight: 800; }
.brand-tag { display: block; font-size: .8rem; color: #b9c3d3; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #dfe6f0; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; }

/* hero */
.hero { background: linear-gradient(180deg, var(--navy), #1d3150); color: #fff; padding: 40px 0 48px; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 10px; }
.hero .lede { color: #cfd8e5; max-width: 680px; margin: 0; font-size: 1.05rem; }
.section-title { font-size: 1.3rem; margin: 36px 0 16px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin-bottom: 48px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 6px 22px rgba(20, 35, 58, .09); }
.card-img { display: block; aspect-ratio: 37 / 20; background: var(--bg-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.08rem; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.card-excerpt { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }
.card .meta { margin-top: auto; }
.grid-3 .card-excerpt { display: none; }
.chip { align-self: flex-start; display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; text-decoration: none; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }

/* post */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.post { padding: 8px 0 48px; min-width: 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 20px 0 14px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #c0c7d2; }
.crumbs a { color: var(--muted); }
.post-header h1 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); margin: 10px 0 8px; letter-spacing: -.3px; }
.post-header { margin-bottom: 18px; }
.archive-header h1 { margin: 8px 0 2px; }
.archive-header { margin-bottom: 22px; }
.toc { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 12px 18px; margin: 0 0 26px; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 10px 0 4px; padding-left: 22px; font-size: .95rem; }
.toc li { margin: 4px 0; }

.prose { font-size: 1.04rem; }
.prose h2 { font-size: 1.55rem; margin: 2em 0 .6em; padding-top: 6px; scroll-margin-top: 16px; }
.prose h3 { font-size: 1.22rem; margin: 1.7em 0 .5em; }
.prose h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.prose h3 strong, .prose h2 strong { font-weight: inherit; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose li { margin: .25em 0; }
.prose img { border-radius: 6px; }
.prose .aligncenter { display: block; margin: 1em auto; }
.prose .alignleft { float: left; margin: .3em 1.2em .8em 0; }
.prose .alignright { float: right; margin: .3em 0 .8em 1.2em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-2); }
.prose blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--accent); background: var(--bg-2); }
.prose > p:first-child + p em, .prose > p:nth-child(2) em { color: var(--muted); }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.2em 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }

.comments { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 10px; }
.comments h2 { font-size: 1.25rem; }
.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.comment p { margin: 0; }
.comment-head { margin-bottom: 4px !important; font-size: .9rem; }
.comment-head time { color: var(--muted); margin-left: 6px; }
.related { border-top: 1px solid var(--line); margin-top: 40px; }
.related h2 { font-size: 1.25rem; }

/* sidebar */
.sidebar { position: sticky; top: 20px; padding-top: 28px; display: grid; gap: 20px; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: .95rem; }
.box p { margin: 0; color: var(--ink-2); }
.box-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0 0 10px; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 7px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.link-list li:first-child { border-top: 0; padding-top: 0; }
.link-list a { color: var(--ink); text-decoration: none; }
.link-list a:hover { color: var(--accent-ink); text-decoration: underline; }

/* footer */
.site-footer { background: var(--navy); color: #c8d1de; padding: 30px 0 18px; margin-top: 20px; }
.site-footer a { color: #fff; }
.site-footer .muted { color: #9aa7ba; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner > div { max-width: 560px; }
.footer-inner .brand-name { color: #fff; margin: 0 0 6px; }
.footer-inner p { margin: 0 0 8px; font-size: .9rem; }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }

@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; padding-top: 0; margin-bottom: 40px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-inner { padding-top: 12px; padding-bottom: 10px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .hero { padding: 28px 0 32px; }
  .prose .alignleft, .prose .alignright { float: none; display: block; margin: 1em auto; }
}
