:root {
  --bg: #ffffff;
  --bg-mint: #f0fdf4;
  --bg-mint-soft: #f7fcf8;
  --mint: #86efac;
  --mint-mid: #4ade80;
  --mint-strong: #22c55e;
  --mint-deep: #15803d;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --border: rgba(15, 23, 42, 0.08);
  --border2: rgba(15, 23, 42, 0.12);
  --accent: #16a34a;
  --radius: 12px;
  --radius-lg: 20px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--mint-deep); text-decoration: none; }
a:hover { color: var(--mint-strong); text-decoration: underline; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 32px; padding: 14px 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.logo::before { content: ''; width: 30px; height: 30px; background: linear-gradient(135deg, var(--mint-mid), var(--mint-strong)); border-radius: 8px; display: inline-block; }
.logo-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; background: var(--bg-mint); color: var(--mint-deep); border-radius: 100px; text-transform: uppercase; letter-spacing: 0.06em; }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { color: var(--text2); font-weight: 500; }
.nav a:hover { color: var(--mint-deep); text-decoration: none; }
.header-cta { margin-left: auto; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 100px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; transition: 0.15s; }
.btn-primary { background: var(--mint-strong); color: #fff; }
.btn-primary:hover { background: var(--mint-deep); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--bg-mint); color: var(--mint-deep); }
.btn-secondary:hover { background: var(--mint); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint-deep); }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

/* Layout */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 80px 0 40px; text-align: center; }
.hero h1 { font-size: 52px; line-height: 1.1; letter-spacing: -1.5px; font-weight: 800; margin-bottom: 16px; }
.hero h1 .accent { background: linear-gradient(135deg, var(--mint-strong), var(--mint-deep)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lede { font-size: 19px; color: var(--text2); max-width: 580px; margin: 0 auto; }
@media (max-width: 700px) { .hero { padding: 48px 0 24px; } .hero h1 { font-size: 36px; letter-spacing: -1px; } }

/* Posts grid */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; padding: 24px 0 80px; }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: 0.2s; }
.post-card:hover { transform: translateY(-3px); border-color: var(--mint); box-shadow: 0 8px 32px rgba(34,197,94,0.08); text-decoration: none; }
.post-card-cover { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg-mint), var(--bg-mint-soft)); background-size: cover; background-position: center; }
.post-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card-meta { font-size: 12px; color: var(--text3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.post-card h2 { font-size: 20px; line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.3px; }
.post-card h2 a { color: var(--text); }
.post-card-excerpt { color: var(--text2); font-size: 14.5px; margin-bottom: auto; }
.post-card-read { margin-top: 14px; font-size: 13px; color: var(--mint-deep); font-weight: 600; }

/* Article */
.article { padding: 56px 0; }
.article-header { text-align: center; margin-bottom: 40px; }
.article-meta { font-size: 13px; color: var(--text3); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.article-meta a { color: var(--mint-deep); }
.article h1 { font-size: 42px; line-height: 1.15; letter-spacing: -1px; margin-bottom: 18px; font-weight: 800; }
.article-lede { font-size: 18px; color: var(--text2); }
.article-cover { aspect-ratio: 16/9; background-size: cover; background-position: center; border-radius: var(--radius-lg); margin: 40px 0 48px; }
.article-content { font-size: 17px; line-height: 1.75; }
.article-content h2 { font-size: 28px; line-height: 1.25; letter-spacing: -0.5px; margin: 36px 0 14px; font-weight: 700; }
.article-content h3 { font-size: 22px; margin: 28px 0 10px; font-weight: 700; }
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 12px 0 22px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote { border-left: 4px solid var(--mint); padding: 6px 0 6px 20px; margin: 24px 0; color: var(--text2); font-style: italic; }
.article-content code { font-family: var(--mono); background: var(--bg-mint); padding: 2px 7px; border-radius: 4px; font-size: 0.9em; color: var(--mint-deep); }
.article-content pre { background: #0f172a; color: #e2e8f0; padding: 20px; border-radius: var(--radius); overflow-x: auto; margin: 20px 0; font-family: var(--mono); font-size: 14px; line-height: 1.55; }
.article-content pre code { background: transparent; padding: 0; color: inherit; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 24px 0; }
.article-content a { color: var(--mint-deep); border-bottom: 1px solid var(--mint); text-decoration: none; }
.article-content a:hover { color: var(--mint-strong); border-bottom-color: var(--mint-strong); }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
@media (max-width: 700px) { .article h1 { font-size: 30px; } .article-content { font-size: 16px; } .article-content h2 { font-size: 24px; } }

.article-footer { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.article-footer .back { font-size: 14px; color: var(--text2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 60px; color: var(--text3); font-size: 13px; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: var(--text2); margin-right: 14px; }

/* Empty state */
.empty { text-align: center; padding: 80px 24px; color: var(--text3); }
.empty h2 { font-size: 22px; color: var(--text); margin-bottom: 10px; }

/* ─── Admin styles ─── */
.admin-shell { background: #f8fafc; min-height: 100vh; }
.admin-header { background: #fff; border-bottom: 1px solid var(--border); }
.admin-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; padding: 14px 24px; gap: 24px; }
.admin-header .nav { gap: 24px; }
.admin-header .nav a.active { color: var(--mint-deep); font-weight: 700; }
.admin-user { margin-left: auto; color: var(--text3); font-size: 13px; }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.admin-h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }

table.adm { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--border); }
table.adm th, table.adm td { padding: 12px 16px; text-align: left; font-size: 14px; }
table.adm thead { background: #f8fafc; }
table.adm th { font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border); }
table.adm tbody tr { border-bottom: 1px solid var(--border); }
table.adm tbody tr:last-child { border-bottom: 0; }
table.adm tbody tr:hover { background: #fafbfc; }

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.status-published { background: #dcfce7; color: #15803d; }
.status-draft { background: #fef3c7; color: #a16207; }

.form-card { background: #fff; padding: 32px; border-radius: var(--radius); box-shadow: 0 1px 0 var(--border); }
.form-row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin-bottom: 22px; align-items: start; }
.form-row label { font-size: 14px; font-weight: 600; color: var(--text); padding-top: 10px; }
.form-row .help { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 4px; }
.form-row input[type="text"], .form-row input[type="password"], .form-row textarea, .form-row select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border2); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--text);
}
.form-row textarea { font-family: var(--mono); font-size: 13px; resize: vertical; min-height: 320px; line-height: 1.55; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: 0; border-color: var(--mint-mid); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 24px; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr; gap: 8px; } .form-row label { padding-top: 0; } }

.login-card { background: #fff; max-width: 380px; margin: 80px auto; padding: 32px; border-radius: var(--radius-lg); box-shadow: 0 4px 24px rgba(0,0,0,0.04); }
.login-card h1 { font-size: 22px; margin-bottom: 6px; font-weight: 700; }
.login-card p { color: var(--text3); font-size: 14px; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border2); border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.login-card .btn { width: 100%; padding: 12px; }
.login-card .alert { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: 0 1px 0 var(--border); }
.stat-card .stat-label { font-size: 12px; color: var(--text3); text-transform: uppercase; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.image-tile { aspect-ratio: 1; background: #f1f5f9; border-radius: var(--radius); background-size: cover; background-position: center; position: relative; cursor: pointer; border: 1px solid var(--border); }
.image-tile:hover { border-color: var(--mint); }
.image-tile .copy-url { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); color: #fff; padding: 8px; font-size: 11px; font-family: var(--mono); text-align: center; opacity: 0; transition: 0.2s; }
.image-tile:hover .copy-url { opacity: 1; }
