:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --surface: #fbfaf6;
  --text: #17211d;
  --muted: #69736e;
  --line: #d5d8d0;
  --accent: #08734f;
  --accent-dark: #04553a;
  --coral: #ff674d;
  --ink: #102a21;
  --danger: #a93636;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(rgba(16,42,33,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(16,42,33,.028) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font: 16px/1.7 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration-color: #9aa09d; 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: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23,33,29,.14);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand span { display: grid; gap: 3px; }
.brand strong { font: 800 21px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.04em; }
nav { display: flex; gap: 24px; }
nav a { align-self: center; text-decoration: none; color: var(--muted); font-size: 14px; }
.nav-admin { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; }
.hero { min-height: 620px; padding: 84px 0 72px; display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); align-items: center; gap: 72px; }
.hero-copy { max-width: 790px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--muted); font: 700 11px/1.2 ui-monospace, monospace; letter-spacing: .12em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(255,103,77,.12); }
.eyebrow { margin: 0 0 14px; color: var(--accent); font: 700 12px/1.2 ui-monospace, monospace; letter-spacing: .16em; }
.hero h1 { margin: 0; font-size: clamp(54px, 7.6vw, 96px); line-height: .96; letter-spacing: -.065em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p { max-width: 650px; margin: 28px 0 0; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 38px; }
.hero-actions a { text-decoration: none; font-weight: 700; }
.hero-primary { display: inline-flex; gap: 28px; padding: 12px 18px; background: var(--ink); color: white; border-radius: 2px; }
.hero-primary:hover { color: white; background: var(--accent); }
.hero-secondary { color: var(--muted); border-bottom: 1px solid var(--line); }
.hero-mark { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: var(--ink); border-radius: 4px; box-shadow: 18px 18px 0 rgba(8,115,79,.12); }
.hero-mark::before, .hero-mark::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.hero-mark::before { width: 76%; height: 76%; }
.hero-mark::after { width: 48%; height: 48%; }
.hero-mark > img { position: relative; z-index: 2; width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 18px 28px rgba(0,0,0,.2)); }
.mark-grid { position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(white 1px, transparent 1px), linear-gradient(90deg, white 1px, transparent 1px); background-size: 34px 34px; }
.mark-caption { position: absolute; inset: auto 18px 16px; display: flex; justify-content: space-between; color: rgba(255,255,255,.5); font: 600 9px/1 ui-monospace, monospace; letter-spacing: .12em; }
.search { display: flex; max-width: 560px; margin-top: 34px; }
.search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-right: 0; padding: 13px 15px; background: var(--surface); }
.search button, .primary { border: 0; background: var(--accent); color: white; padding: 12px 20px; }
.search button:hover, .primary:hover { background: var(--accent-dark); }
.content-section { padding: 92px 0 96px; }
.narrow-top { padding-top: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--text); }
.section-heading h1, .section-heading h2 { margin: 0; font-size: 38px; line-height: 1; letter-spacing: -.04em; }
.section-heading span { color: var(--muted); }
.post-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.post-card { position: relative; padding: 40px 0 38px; border-bottom: 1px solid var(--line); transition: transform .2s ease; }
.post-card:hover { transform: translateY(-3px); }
.post-card:nth-child(odd) { padding-right: 34px; border-right: 1px solid var(--line); }
.post-card:nth-child(even) { padding-left: 34px; }
.post-card-top { display: flex; align-items: center; justify-content: space-between; }
.post-arrow { color: var(--coral); font-size: 20px; transition: transform .2s ease; }
.post-card:hover .post-arrow { transform: translate(3px,-3px); }
.post-card h2 { margin: 14px 0 10px; font-size: 31px; line-height: 1.18; letter-spacing: -.035em; }
.post-card h2 a { text-decoration: none; }
.post-card p { margin: 0 0 14px; color: var(--muted); }
.post-meta { color: var(--muted); font-size: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { color: var(--accent); font-size: 14px; text-decoration: none; }
.article { max-width: 820px; margin: 0 auto; padding: 76px 0 110px; }
.article-back { display: inline-block; margin-bottom: 60px; color: var(--muted); font: 600 13px/1 ui-monospace, monospace; text-decoration: none; }
.article-meta { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.article-header h1 { margin: 12px 0; font-size: clamp(38px, 6vw, 62px); line-height: 1.08; letter-spacing: -.045em; }
.article-description { color: var(--muted); font-size: 20px; }
.cover { width: 100%; max-height: 480px; margin-top: 28px; object-fit: cover; border-radius: 4px; }
.article-rule { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 52px 0 0; }
.article-rule span { height: 1px; background: var(--line); }
.article-rule img { object-fit: contain; }
.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: 2.15em 0 .7em; line-height: 1.25; letter-spacing: -.035em; scroll-margin-top: 24px; }
.prose h1 { font-size: 40px; }
.prose h2 { padding-bottom: 12px; font-size: 32px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 25px; }
.prose h4 { font-size: 20px; }
.prose h5 { color: var(--accent); font-size: 17px; text-transform: uppercase; letter-spacing: .08em; }
.prose h6 { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .12em; }
.prose p { margin: 1.15em 0; }
.code-block { position: relative; margin: 28px 0; padding-top: 34px; overflow: hidden; background: #11241d; border: 1px solid #203a30; border-radius: 5px; box-shadow: 0 14px 34px rgba(16,42,33,.12); }
.code-label { position: absolute; top: 0; left: 0; padding: 9px 13px; color: #8fb5a5; font: 700 10px/1 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.prose pre { margin: 0; overflow-x: auto; padding: 10px 22px 22px; background: transparent; color: #e7eee9; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose :not(pre) > code { padding: .18em .4em; background: #e2e6df; color: var(--accent-dark); border-radius: 3px; font-size: .88em; }
.prose img { display: block; max-width: 100%; height: auto; margin: 32px auto; border-radius: 5px; }
.prose blockquote { margin: 28px 0; padding: 20px 24px; background: rgba(8,115,79,.06); border-left: 4px solid var(--accent); color: #435049; }
.prose blockquote p:first-child { margin-top: 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.45em; }
.prose li { margin: .4em 0; padding-left: .25em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.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: 28px 0; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { min-width: 120px; padding: 11px 14px; border: 1px solid var(--line); text-align: left; }
.prose th { background: #e7e9e3; font-size: 13px; letter-spacing: .04em; }
.prose tr:nth-child(even) td { background: rgba(255,255,255,.38); }
.prose hr { height: 1px; margin: 54px 0; border: 0; background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent); }
.prose del { color: var(--muted); text-decoration-color: var(--coral); }
.article-footer { margin-top: 78px; padding-top: 30px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; border-top: 1px solid var(--line); }
.article-footer img { object-fit: contain; }
.article-footer strong { font-size: 18px; }
.article-footer p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.article-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }
.empty { padding: 100px 0; text-align: center; }
.site-footer { padding: 28px 0 48px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.admin-shell { padding: 48px 0 80px; }
.login-shell { max-width: 440px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.login-panel { padding: 32px; }
.login-panel h1 { margin-top: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 3px; }
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: 24px; }
.admin-toolbar h1 { margin: 0; }
.toolbar-actions, .editor-actions, .upload-row { display: flex; align-items: center; gap: 10px; }
.button { display: inline-block; border: 0; padding: 9px 15px; border-radius: 3px; text-decoration: none; }
.secondary { background: #e8e9e5; color: var(--text); }
.ghost { background: transparent; color: var(--muted); }
.danger { background: #f3dddd; color: var(--danger); }
.admin-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
.post-sidebar { align-self: start; max-height: 760px; overflow: auto; }
.admin-post { display: block; width: 100%; padding: 15px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.admin-post:hover, .admin-post.active { background: #f0f2ed; }
.admin-post strong, .admin-post span { display: block; }
.admin-post span { color: var(--muted); font-size: 12px; }
.editor-panel { padding: 24px; }
.editor-panel form { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { border: 0; padding: 10px 14px; 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 6px; }
.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: 760px) {
  .site-header, .site-footer, main { width: min(calc(100% - 28px), var(--max)); }
  .site-header { min-height: 76px; }
  nav { gap: 14px; }
  nav > a:first-child { display: none; }
  .hero { min-height: auto; padding: 62px 0; grid-template-columns: 1fr; gap: 48px; }
  .hero h1 { font-size: clamp(50px, 15vw, 72px); }
  .hero-mark { width: min(100%, 390px); justify-self: center; }
  .post-list, .admin-grid, .field-row { grid-template-columns: 1fr; }
  .post-card:nth-child(n) { padding-inline: 0; border-right: 0; }
  .admin-toolbar { align-items: flex-start; gap: 20px; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .site-footer { gap: 16px; flex-direction: column; }
  .article-back { margin-bottom: 40px; }
  .article-footer { grid-template-columns: auto 1fr; }
  .article-footer a { grid-column: 2; }
}
