:root {
  --accent: #3b82f6;
  --accent-2: #6366f1;
  --bg-1: #070b16;
  --bg-2: #101a33;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --text-muted: rgba(238, 242, 251, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #1d3f8f 0%, transparent 45%),
              radial-gradient(circle at 80% 0%, #4338ca 0%, transparent 40%),
              radial-gradient(circle at 50% 100%, #0e2a5e 0%, transparent 45%),
              linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.blob { position: fixed; border-radius: 50%; filter: blur(90px); opacity: 0.5; z-index: 0; pointer-events: none; }
.blob.one { width: 380px; height: 380px; background: var(--accent-2); top: -100px; left: -100px; }
.blob.two { width: 420px; height: 420px; background: #1d4ed8; bottom: -140px; right: -120px; }

nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 11, 22, 0.6);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; margin: 0 auto;
  padding: 18px 32px;
}
nav .brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); letter-spacing: -0.02em; }
nav .links { display: flex; gap: 22px; }
nav .links a { color: var(--text-muted); text-decoration: none; font-size: 0.92rem; font-weight: 600; transition: color 0.15s; }
nav .links a:hover, nav .links a.active { color: var(--text); }

main {
  position: relative; z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px 28px;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin-bottom: 20px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 14px;
  font-size: 0.95rem; font-weight: 700; color: #ffffff; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.32);
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--glass-border); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }

input, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 12px;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 200px; font-family: ui-monospace, monospace; font-size: 0.88rem; line-height: 1.5; }

.error { color: #fca5a5; font-size: 0.85rem; margin-bottom: 10px; }
.muted { color: var(--text-muted); font-size: 0.88rem; }

h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 12px; }
h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

main.wide { max-width: 1040px; }

.section-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.section-heading h2 { font-size: 1.3rem; letter-spacing: -0.01em; }
.section-heading a { color: var(--accent-2); text-decoration: none; font-size: 0.88rem; font-weight: 700; }
.section-heading a:hover { text-decoration: underline; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.28);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.4);
}

.post-card .cover {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  background: rgba(255, 255, 255, 0.04);
}
.post-card .cover.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}

.post-card .content {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 18px 20px;
  flex: 1;
}
.post-card .top-row {
  display: flex; align-items: center; gap: 10px;
}
.post-card .tag {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--accent-2);
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 9px; border-radius: 999px;
  width: fit-content;
}
.post-card .date {
  font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.post-card h3 { font-size: 1.05rem; line-height: 1.32; letter-spacing: -0.01em; }
.post-card p {
  font-size: 0.86rem; color: var(--text-muted); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.post-card .read-more {
  margin-top: auto; padding-top: 6px;
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
}

.post-card.featured {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .post-card.featured { flex-direction: row; align-items: flex-start; }
  .post-card.featured .cover { width: 46%; aspect-ratio: auto; height: 320px; }
  .post-card.featured .content { padding: 24px 28px; gap: 10px; }
  .post-card.featured h3 { font-size: 1.5rem; line-height: 1.28; }
  .post-card.featured p { font-size: 0.94rem; -webkit-line-clamp: 3; }
}

.post-hero {
  width: 100%; max-height: 380px; object-fit: cover;
  border-radius: 18px; margin-bottom: 20px;
  border: 1px solid var(--glass-border);
}

.post-content { line-height: 1.7; font-size: 1rem; }
.post-content h1, .post-content h2, .post-content h3 { margin: 24px 0 10px; letter-spacing: -0.01em; }
.post-content p { margin-bottom: 14px; }
.post-content ul, .post-content ol { margin: 0 0 14px 22px; }
.post-content a { color: var(--accent); }
.post-content code { background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 6px; font-size: 0.85em; }
.post-content pre { background: rgba(0,0,0,0.3); padding: 14px; border-radius: 12px; overflow-x: auto; margin-bottom: 14px; }
.post-content pre code { background: none; padding: 0; }
.post-content blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-muted); margin-bottom: 14px; }

footer { position: relative; z-index: 1; text-align: center; padding: 20px; font-size: 12.5px; color: var(--text-muted); }

.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-row:last-child { border-bottom: none; }
.admin-row .title { font-weight: 600; }
.admin-row .actions { display: flex; gap: 8px; }
.admin-row .actions button { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.badge { font-size: 0.7rem; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,0.1); color: var(--text-muted); }
.badge.published { background: rgba(52, 211, 153, 0.2); color: #34d399; }

@media (max-width: 480px) {
  nav { padding: 18px 20px; }
  main { padding: 16px 16px 60px; }
  .card { padding: 24px 20px; }
}
