/* Palette taken from the Project Manager screenshot */
:root {
  --bg:        #1f2023;
  --bar:       #232427;
  --surface:   #26282c;
  --surface-2: #2c2e33;
  --border:    #36383d;
  --track:     #141517;
  --text:      #e6e6e7;
  --heading:   #f3f3f4;
  --muted:     #8b8d93;
  --dim:       #6c6e74;
  --teal:      #4fb39f;
  --orange:    #f0834a;
  --orange-hi: #f5955f;
  --danger:    #e0605a;
  --radius:    4px;
  --font: "Ubuntu", "Segoe UI", "Noto Sans", system-ui, -apple-system, sans-serif;
  --mono: "Ubuntu Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hi); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---- Top bar ------------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 700; font-size: 17px; }
.brand:hover { color: var(--heading); text-decoration: none; }
.dot {
  width: 9px; height: 9px; border-radius: 2px; flex: none;
  background: linear-gradient(135deg, var(--teal) 0 50%, var(--orange) 50% 100%);
}
.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.topnav a { color: #c9cacd; }
.topnav a:hover { color: var(--heading); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--orange); }

/* ---- Layout ------------------------------------------------------------- */
.layout {
  width: 100%; max-width: 1280px; margin: 0 auto; flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px;
  padding: 34px 32px 64px;
}
.sidebar { position: sticky; top: 24px; align-self: start; padding-top: 6px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 40px; padding: 26px 18px 48px; }
  .sidebar { position: static; border-top: 1px solid var(--border); padding-top: 26px; }
}

.page-head { margin-bottom: 30px; }
.page-head h1, .article h1 { color: var(--heading); font-size: 28px; line-height: 1.2; margin: 0 0 8px; font-weight: 700; }
.lede { color: #b5b7bb; margin: 0; font-size: 16px; }

/* Section heading: dot, title, fading rule (as in the screenshot) */
.section-head { display: flex; align-items: center; gap: 12px; margin: 34px 0 16px; }
.section-head h2 { margin: 0; font-size: 18px; color: var(--heading); font-weight: 700; white-space: nowrap; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.section-head .more { font-size: 13px; white-space: nowrap; }

/* ---- Project cards ------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 14px; color: var(--text); min-height: 126px;
}
.card:hover { text-decoration: none; border-color: #4a4d53; background: var(--surface-2); color: var(--text); }
.card-img { width: calc(100% + 36px); margin: -18px -18px 14px; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--border); max-width: none; }
.card-title { color: var(--heading); font-weight: 700; font-size: 16px; }
.card-sub { color: var(--dim); font-size: 13px; margin: 4px 0 14px; }
.card-meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 11.5px; margin-top: auto; padding-top: 10px; }

.bar { height: 3px; background: var(--track); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--orange)); border-radius: 2px; }

/* ---- Post list ---------------------------------------------------------- */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.post-row { border-bottom: 1px solid var(--border); padding: 14px 2px; }
.post-row a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.post-row a:hover { text-decoration: none; }
.post-row a:hover .post-title { color: var(--orange); }
.post-title { color: var(--heading); font-weight: 600; font-size: 16px; }
.post-row time { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.post-sum { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }

.pager { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 30px; color: var(--muted); font-size: 14px; }

/* ---- Sidebar links ------------------------------------------------------ */
.side-title { font-size: 15px; color: var(--heading); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.side-title::before { content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: linear-gradient(135deg, var(--teal) 0 50%, var(--orange) 50% 100%); }
.linklist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.linklist li a {
  display: block; padding: 6px 10px; margin-left: -10px; color: #c9cacd;
  border-left: 2px solid transparent; border-radius: 0 3px 3px 0;
}
.linklist li a:hover { color: var(--heading); background: var(--surface); border-left-color: var(--teal); text-decoration: none; }
.link-heading { color: var(--dim); font-size: 12.5px; font-weight: 600; margin: 16px 0 4px; }
.link-heading:first-child { margin-top: 0; }

/* ---- Article ------------------------------------------------------------ */
.article { max-width: 760px; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 14px; }
.back::before { content: "‹ "; }
.meta { color: var(--dim); font-size: 13px; margin: 12px 0 22px; display: flex; gap: 14px; flex-wrap: wrap; }
.article-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; font-size: 13px; color: var(--muted); }
.article-progress .bar { flex: 1; max-width: 320px; }
.cover { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 28px; }

.prose { font-size: 16px; line-height: 1.75; max-width: 70ch; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--heading); line-height: 1.3; margin: 1.8em 0 .5em; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--teal); }
.prose img { display: block; border-radius: var(--radius); border: 1px solid var(--border); margin: 1.4em 0; }
.prose blockquote { border-left: 3px solid var(--teal); padding: 2px 0 2px 16px; color: #b8babe; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }
.prose pre { background: var(--track); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 13.5px; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2em 0; }
.prose del { color: var(--dim); }
.prose a { text-decoration: underline; text-decoration-color: rgba(240,131,74,.4); text-underline-offset: 3px; }

.empty { padding: 40px 0; color: var(--muted); }
.empty h1 { color: var(--heading); font-size: 24px; }

.sitefoot { border-top: 1px solid var(--border); padding: 18px 32px; color: var(--dim); font-size: 12.5px; text-align: center; }

.preview-banner { background: #3a2a1f; color: #f5c7a9; border-bottom: 1px solid #5a3b27; padding: 8px 14px; font-size: 13.5px; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
