*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #FAF9F6;
  --bg-subtle: #F2EFE7;
  --text:      #1A1917;
  --muted:     #6D6B63;
  --accent:    #4A6741;
  --accent-hv: #3A5232;
  --border:    #DDD8CC;
  --serif:     'Lora', Georgia, serif;
  --sans:      'Inter', system-ui, -apple-system, sans-serif;
  --content:   680px;
  --wide:      1120px;
}

html { font-size: 18px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.container         { width:100%; max-width:var(--wide);    margin:0 auto; padding:0 2rem; }
.container--narrow { width:100%; max-width:var(--content); margin:0 auto; padding:0 2rem; }

/* Header */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 100;
}
.site-header .container { display:flex; align-items:center; justify-content:space-between; }
.site-logo { text-decoration:none; display:inline-flex; align-items:center; }
.site-logo img { height:54px; width:auto; display:block; transition:opacity .15s; }
.site-logo:hover img { opacity:0.75; }
.site-nav { display:flex; gap:2rem; }
.site-nav a { font-size:0.875rem; color:var(--muted); text-decoration:none; letter-spacing:0.02em; transition:color .15s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

/* Hero */
.hero { padding: 5.5rem 0 4rem; border-bottom: 1px solid var(--border); }
.hero__name { font-family:var(--serif); font-size:clamp(2.25rem,5vw,3.75rem); font-weight:400; line-height:1.15; letter-spacing:-0.02em; margin-bottom:1rem; }
.hero__tagline { font-size:1.0625rem; color:var(--muted); max-width:44ch; }

/* Section header */
.section-header { display:flex; align-items:baseline; justify-content:space-between; padding:3rem 0 0.875rem; border-bottom:1px solid var(--border); }
.section-title { font-size:0.75rem; font-weight:500; letter-spacing:0.1em; text-transform:uppercase; color:var(--muted); }
.section-link { font-size:0.875rem; color:var(--accent); text-decoration:none; }
.section-link:hover { color: var(--accent-hv); }

/* Post list */
.post-list { list-style:none; }
.post-card { padding:2rem 0; border-bottom:1px solid var(--border); }
.post-card:last-child { border-bottom:none; }
.post-meta { font-size:0.8125rem; color:var(--muted); margin-bottom:0.5rem; display:flex; align-items:center; gap:0.5rem; }
.post-meta .sep { opacity:0.4; }
.post-card__title { font-family:var(--serif); font-size:1.4375rem; font-weight:500; line-height:1.3; letter-spacing:-0.01em; margin-bottom:0.625rem; }
.post-card__title a { color:var(--text); text-decoration:none; transition:color .15s; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color:var(--muted); font-size:0.9375rem; line-height:1.65; margin-bottom:0.875rem; max-width:60ch; }
.post-card__read-more { font-size:0.875rem; color:var(--accent); text-decoration:none; }
.post-card__read-more:hover { color: var(--accent-hv); }

/* Page header */
.page-header { padding:3.5rem 0 2rem; border-bottom:1px solid var(--border); }
.page-header__title { font-family:var(--serif); font-size:2.125rem; font-weight:400; letter-spacing:-0.02em; }

/* Single post */
.post-header { padding:3.5rem 0 2rem; }
.back-link { display:inline-flex; align-items:center; gap:.35rem; font-size:.875rem; color:var(--muted); text-decoration:none; margin-bottom:2rem; transition:color .15s; }
.back-link:hover { color: var(--text); }
.post-header__meta { font-size:.8125rem; color:var(--muted); margin-bottom:.75rem; display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.post-author-link   { color:var(--muted); text-decoration:none; border-bottom:1px solid var(--border); }
.post-author-link:hover { color:var(--accent); border-color:var(--accent); }
.post-header__title { font-family:var(--serif); font-size:clamp(1.75rem,4vw,2.5rem); font-weight:400; line-height:1.2; letter-spacing:-0.02em; }

/* Post body */
.post-body { padding:2.5rem 0 5rem; font-size:1.0625rem; line-height:1.8; }
.post-body p          { margin-bottom:1.5rem; }
.post-body h2         { font-family:var(--serif); font-size:1.5rem; font-weight:500; line-height:1.3; letter-spacing:-.01em; margin:2.5rem 0 .875rem; }
.post-body h3         { font-family:var(--serif); font-size:1.1875rem; font-weight:500; margin:2rem 0 .625rem; }
.post-body strong     { font-weight:600; }
.post-body em         { font-style:italic; }
.post-body a          { color:var(--accent); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:2px; }
.post-body a:hover    { color:var(--accent-hv); }
.post-body ul,
.post-body ol         { padding-left:1.5rem; margin-bottom:1.5rem; }
.post-body li         { margin-bottom:.375rem; }
.post-body blockquote { border-left:3px solid var(--border); padding-left:1.25rem; margin:2rem 0; color:var(--muted); font-style:italic; }
.post-body hr         { border:none; border-top:1px solid var(--border); margin:3rem 0; }
.post-body code       { font-family:'SF Mono',Consolas,monospace; font-size:.875em; background:var(--bg-subtle); padding:.125em .375em; border-radius:3px; }
.post-body pre        { background:var(--bg-subtle); padding:1.25rem; border-radius:6px; overflow-x:auto; margin-bottom:1.5rem; }
.post-body pre code   { background:none; padding:0; font-size:.875rem; }
.post-body img        { max-width:100%; height:auto; display:block; border-radius:6px; margin:2rem 0; }
.post-body img + em   { display:block; text-align:center; font-size:.875rem; color:var(--muted); margin-top:-1.25rem; margin-bottom:2rem; font-style:italic; }

/* About */
.about-content { padding:3rem 0 5rem; font-size:1.0625rem; line-height:1.8; }
.about-content p { margin-bottom:1.5rem; }
.about-goals { list-style:none; padding:0; margin:0; }
.about-goals li { padding:0.5rem 0; border-bottom:1px solid var(--border); color:var(--muted); font-style:italic; }
.about-goals li:first-child { border-top:1px solid var(--border); }

.empty-state { padding:4rem 0; color:var(--muted); text-align:center; font-size:.9375rem; }

/* Home two-column layout */
.home-layout {
  width: 100%;
  max-width: calc(var(--content) + 3rem + 260px);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

/* Sidebar */
.sidebar { padding-top: 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.widget { border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; }
.widget__title { font-size: .6875rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.widget__text { font-size: .875rem; color: var(--muted); line-height: 1.6; margin-bottom: .75rem; }
.widget__link { font-size: .875rem; color: var(--accent); text-decoration: none; }
.widget__link:hover { color: var(--accent-hv); }
.widget-bsky { display: flex; flex-direction: column; gap: .75rem; }
.widget-bsky__handle { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; color: var(--text); }
.widget-bsky__btn { display: block; padding: .5rem 1rem; background: #0085ff; color: #fff; border-radius: 4px; font-size: .875rem; font-weight: 500; text-decoration: none; text-align: center; transition: background .15s; }
.widget-bsky__btn:hover { background: #0070d9; }

/* Footer */
.site-footer { border-top:1px solid var(--border); padding:2rem 0; margin-top:auto; }
.site-footer .container { display:flex; align-items:center; justify-content:space-between; }
.footer-copy { font-size:.8125rem; color:var(--muted); }

/* ── Admin ── */
.admin-body { background:#F5F4F1; min-height:100vh; }
.admin-bar { background:var(--text); padding:.875rem 2rem; display:flex; align-items:center; justify-content:space-between; }
.admin-bar__brand { font-family:var(--serif); font-size:1rem; color:var(--bg); text-decoration:none; }
.admin-bar__nav { display:flex; gap:1.5rem; }
.admin-bar__nav a { font-size:.875rem; color:rgba(255,255,255,.6); text-decoration:none; transition:color .15s; }
.admin-bar__nav a:hover { color:#fff; }

.admin-wrap { max-width:820px; margin:0 auto; padding:3rem 2rem; }
.admin-card { background:#fff; border-radius:8px; padding:2rem; border:1px solid #E5E3DD; margin-bottom:1.5rem; }
.admin-h1   { font-family:var(--serif); font-size:1.5rem; font-weight:500; margin-bottom:1.75rem; }

.form-group         { margin-bottom:1.25rem; }
.form-group label   { display:block; font-size:.8rem; font-weight:500; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-bottom:.35rem; }
.form-control       { width:100%; padding:.625rem .875rem; font-family:var(--sans); font-size:1rem; color:var(--text); background:var(--bg); border:1px solid var(--border); border-radius:4px; outline:none; transition:border-color .15s; }
.form-control:focus { border-color:var(--accent); }
textarea.form-control { min-height:160px; resize:vertical; }
.form-hint          { font-size:.8rem; color:var(--muted); margin-top:.25rem; }

.btn            { display:inline-flex; align-items:center; gap:.375rem; padding:.625rem 1.25rem; font-family:var(--sans); font-size:.9375rem; font-weight:500; border-radius:4px; border:none; cursor:pointer; text-decoration:none; transition:all .15s; }
.btn--primary   { background:var(--accent); color:#fff; }
.btn--primary:hover { background:var(--accent-hv); }
.btn--ghost     { background:transparent; color:var(--muted); border:1px solid var(--border); }
.btn--ghost:hover { border-color:var(--muted); color:var(--text); }
.btn--danger    { background:transparent; color:#B91C1C; border:1px solid #FECACA; }
.btn--danger:hover { background:#FEF2F2; }
.btn--sm        { padding:.375rem .75rem; font-size:.8125rem; }
.btn-row        { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; }

.plist        { list-style:none; }
.plist__item  { display:flex; align-items:center; justify-content:space-between; padding:.875rem 0; border-bottom:1px solid #F0EDEA; gap:1rem; }
.plist__title { font-size:.9375rem; font-weight:500; color:var(--text); text-decoration:none; flex:1; }
.plist__meta  { font-size:.8125rem; color:var(--muted); white-space:nowrap; }
.plist__acts  { display:flex; gap:.5rem; flex-shrink:0; }

.badge        { display:inline-block; padding:.125rem .5rem; font-size:.6875rem; font-weight:500; letter-spacing:.04em; text-transform:uppercase; border-radius:2px; }
.badge--pub   { background:#DCFCE7; color:#166534; }
.badge--draft { background:#FEF9C3; color:#854D0E; }

.alert      { padding:.75rem 1rem; border-radius:4px; font-size:.875rem; margin-bottom:1.25rem; }
.alert--ok  { background:#DCFCE7; color:#166534; border:1px solid #BBF7D0; }
.alert--err { background:#FEF2F2; color:#B91C1C; border:1px solid #FECACA; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); }
.login-box  { width:100%; max-width:360px; padding:2.5rem; }
.login-logo { font-family:var(--serif); font-size:1.5rem; font-weight:600; color:var(--text); display:block; text-align:center; margin-bottom:2rem; }

@media (max-width: 860px) {
  .home-layout { grid-template-columns: 1fr; }
  .sidebar { padding-top: 0; }
}
@media (max-width: 600px) {
  html { font-size: 16px; }
  .hero { padding: 3rem 0 2.5rem; }
  .site-nav { gap: 1.25rem; }
  .post-card__title { font-size: 1.25rem; }
  .plist__meta { display: none; }
}
