/* Content-hashed static asset. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f7f6;
  --text: #202321;
  --muted: #6d736f;
  --line: #e3e5e3;
  --accent: #176b4d;
  --accent-dark: #10523a;
  --accent-soft: #edf5f1;
  --danger: #b42318;
  --max: 920px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dcece4; }
a { color: inherit; text-decoration-color: #aeb4b0; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
.site-header, .site-footer, main { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.site-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -.025em;
  text-decoration: none;
}
nav { display: flex; gap: 22px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
nav a:hover { color: var(--text); }

.hero { padding: 104px 0 92px; border-bottom: 1px solid var(--line); }
.hero-copy { max-width: 720px; }
.hero-kicker, .eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(44px, 7vw, 68px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.hero-copy > p:last-child {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.content-section { padding: 72px 0 92px; }
.narrow-top { padding-top: 64px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--text);
}
.section-heading h1, .section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.section-heading > span { color: var(--muted); font-size: 14px; }
.section-link { color: var(--muted); font-size: 14px; text-decoration: none; }
.section-link:hover { color: var(--accent); }

.post-list { display: block; }
.post-card { padding: 32px 0 34px; border-bottom: 1px solid var(--line); }
.post-card h2 {
  margin: 9px 0 8px;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -.035em;
}
.post-card h2 a { text-decoration: none; }
.post-card p { max-width: 720px; margin: 0 0 12px; color: var(--muted); }
.post-meta { color: var(--muted); font-size: 13px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.tag { color: var(--muted); font-size: 13px; text-decoration: none; }
.tag:hover { color: var(--accent); }

.search { display: flex; max-width: 560px; margin-top: 30px; }
.search input { flex: 1; min-width: 0; border-right: 0; }
.search button, .primary { border: 0; background: var(--accent); color: white; padding: 10px 18px; }
.search button:hover, .primary:hover { background: var(--accent-dark); }

.pagination {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding-top: 32px;
}
.pagination-direction, .pagination-page {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 14px;
  text-decoration: none;
}
.pagination-direction { padding: 0 12px; }
.pagination-direction:hover, .pagination-page:hover, .pagination-page.active { border-color: var(--text); color: var(--text); }
.pagination-direction.disabled { opacity: .4; }
.pagination-pages { display: flex; justify-content: center; align-items: center; gap: 6px; }
.pagination-ellipsis { padding: 0 3px; color: var(--muted); }
.pagination-status { color: var(--muted); font-size: 13px; white-space: nowrap; }

.article { max-width: 720px; margin: 0 auto; padding: 64px 0 96px; }
.article-back { display: inline-block; margin-bottom: 44px; color: var(--muted); font-size: 13px; text-decoration: none; }
.article-meta { color: var(--muted); }
.article-header h1 {
  margin: 12px 0 14px;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1.12;
  letter-spacing: -.045em;
}
.article-description { margin: 0 0 18px; color: var(--muted); font-size: 19px; }
.cover { width: 100%; max-height: 460px; margin-top: 30px; object-fit: cover; border-radius: 2px; }
.prose { margin-top: 52px; font-size: 17px; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin: 2em 0 .65em;
  line-height: 1.3;
  letter-spacing: -.025em;
  scroll-margin-top: 24px;
}
.prose h1 { font-size: 36px; }
.prose h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 29px; }
.prose h3 { font-size: 23px; }
.prose h4 { font-size: 19px; }
.prose h5 { color: var(--accent); font-size: 16px; }
.prose h6 { color: var(--muted); font-size: 14px; }
.prose p { margin: 1.1em 0; }
.code-block { position: relative; margin: 26px 0; padding-top: 32px; overflow: hidden; background: #171a18; border-radius: 3px; }
.code-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 9px 14px;
  color: #aab5af;
  font: 600 10px/1 ui-monospace, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.prose pre { margin: 0; overflow-x: auto; padding: 10px 20px 22px; background: transparent; color: #e8ecea; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose :not(pre) > code { padding: .16em .38em; background: var(--surface); color: var(--accent-dark); border-radius: 2px; font-size: .88em; }
.prose img { display: block; max-width: 100%; height: auto; margin: 30px auto; border-radius: 2px; }
.prose blockquote { margin: 26px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--line); color: #505752; }
.prose blockquote p:first-child { margin-top: 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); }
.prose .task-list-item, .prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
.prose input[type="checkbox"] { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--accent); vertical-align: -.15em; }
.prose table { display: block; width: 100%; margin: 26px 0; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { min-width: 120px; padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface); font-size: 13px; }
.prose hr { height: 1px; margin: 48px 0; border: 0; background: var(--line); }
.prose del { color: var(--muted); }
.article-footer {
  margin-top: 68px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
}
.article-footer strong { font-size: 16px; }
.article-footer p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.article-footer a { color: var(--accent); font-size: 14px; text-decoration: none; }

.empty { padding: 96px 0; text-align: center; }
.site-footer {
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.admin-shell { padding: 44px 0 76px; }
.login-shell { max-width: 420px; margin: 0 auto; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 3px; }
.login-panel { padding: 30px; }
.login-panel h1 { margin-top: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, textarea, select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid #cfe2d8; border-color: var(--accent); }
textarea { resize: vertical; }
.login-panel button { width: 100%; margin-top: 20px; }
.form-error { color: var(--danger); }
.admin-toolbar { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.admin-toolbar h1 { margin: 0; }
.toolbar-actions, .editor-actions, .upload-row { display: flex; align-items: center; gap: 9px; }
.button { display: inline-block; border: 0; padding: 9px 14px; border-radius: 2px; text-decoration: none; }
.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.ghost { background: transparent; color: var(--muted); }
.danger { background: #fff0ee; color: var(--danger); }
.admin-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.post-sidebar { align-self: start; max-height: 760px; overflow: auto; }
.admin-post { display: block; width: 100%; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.admin-post:hover, .admin-post.active { background: var(--surface); }
.admin-post strong, .admin-post span { display: block; }
.admin-post span { color: var(--muted); font-size: 12px; }
.editor-panel { padding: 22px; }
.editor-panel form { display: grid; gap: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.editor-tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { border: 0; padding: 9px 13px; background: transparent; color: var(--muted); }
.tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.markdown-editor { min-height: 520px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6; }
.preview { min-height: 520px; margin: 0; padding: 0 4px; }
.editor-actions { justify-content: flex-end; }
.editor-actions #save-status { margin-right: auto; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .site-header, .site-footer, main { width: min(calc(100% - 28px), var(--max)); }
  .site-header { min-height: 62px; }
  nav { gap: 14px; }
  nav a { font-size: 13px; }
  nav a:last-child { display: none; }
  .hero { padding: 72px 0 68px; }
  .hero h1 { font-size: clamp(40px, 13vw, 56px); }
  .hero-copy > p:last-child { font-size: 16px; }
  .content-section { padding: 56px 0 72px; }
  .section-heading h1, .section-heading h2 { font-size: 26px; }
  .post-card { padding: 26px 0 28px; }
  .post-card h2 { font-size: 23px; }
  .pagination { grid-template-columns: 1fr 1fr; }
  .pagination-pages { grid-column: 1 / -1; grid-row: 1; }
  .pagination-status { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .pagination-direction:first-child { grid-column: 1; grid-row: 3; }
  .pagination-direction:last-child { grid-column: 2; grid-row: 3; }
  .article { padding: 48px 0 72px; }
  .article-back { margin-bottom: 34px; }
  .prose { margin-top: 42px; font-size: 16px; }
  .article-footer { grid-template-columns: 1fr; }
  .site-footer { gap: 8px; flex-direction: column; }
  .admin-grid, .field-row { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: flex-start; gap: 18px; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}
