/* =========================================================
   Shamim Hossain — Blog
   Modern minimal tech theme, light + dark
   ========================================================= */

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #14171f;
  --text-muted: #5b6270;
  --border: #e6e8ec;
  --accent: #4f46e5;
  --accent-strong: #3730a3;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --code-bg: #f1f1f5;
  --shadow: 0 1px 2px rgba(20, 23, 31, 0.04), 0 8px 24px rgba(20, 23, 31, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-width: 880px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-elevated: #12141b;
  --text: #e7e9ee;
  --text-muted: #8b93a3;
  --border: #232733;
  --accent: #818cf8;
  --accent-strong: #a5b0ff;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --code-bg: #171a23;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --bg-elevated: #12141b;
    --text: #e7e9ee;
    --text-muted: #8b93a3;
    --border: #232733;
    --accent: #818cf8;
    --accent-strong: #a5b0ff;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --code-bg: #171a23;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}

.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.nav a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 6px;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav .icon-btn:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.nav .icon-btn svg {
  width: 17px;
  height: 17px;
}

#theme-toggle .sun,
#theme-toggle .moon {
  display: none;
}
:root[data-theme="dark"] #theme-toggle .moon { display: inline-flex; }
:root[data-theme="dark"] #theme-toggle .sun { display: none; }
:root[data-theme="light"] #theme-toggle .sun { display: inline-flex; }
:root[data-theme="light"] #theme-toggle .moon { display: none; }
:root:not([data-theme]) #theme-toggle .sun { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) #theme-toggle .sun { display: none; }
  :root:not([data-theme]) #theme-toggle .moon { display: inline-flex; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 100%);
  opacity: 0.6;
  pointer-events: none;
}

.hero .container {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 760px;
}

.hero p.lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 0 32px;
}

.hero .cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ---------- Posts grid ---------- */

.posts-section {
  padding: 24px 0 100px;
}

.posts-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.posts-section h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.post-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.post-card .meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-card .meta-row .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.35;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.post-card p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ---------- Post page ---------- */

.post-hero {
  padding: 56px 0 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
}

.back-link:hover {
  color: var(--accent-strong);
}

.post-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.post-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

article.post-body {
  padding: 12px 0 100px;
  max-width: 720px;
  margin: 0 auto;
  font-size: 17.5px;
}

article.post-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 44px 0 16px;
  letter-spacing: -0.01em;
}

article.post-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 34px 0 12px;
}

article.post-body p {
  margin: 0 0 20px;
  color: var(--text);
}

article.post-body strong {
  color: var(--text);
}

article.post-body a {
  color: var(--accent-strong);
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
}

article.post-body ul,
article.post-body ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

article.post-body li {
  margin-bottom: 10px;
}

article.post-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

article.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}

article.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
}

article.post-body pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

article.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

article.post-body img {
  border-radius: var(--radius-sm);
  margin: 8px 0 24px;
}

.post-footer-cta {
  max-width: 720px;
  margin: 0 auto 100px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.post-footer-cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ---------- About / placeholder ---------- */

.about-placeholder {
  padding: 90px 0 120px;
  text-align: center;
}

.about-placeholder .icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
}

.about-placeholder h1 {
  font-family: var(--font-display);
  font-size: 30px;
  margin: 0 0 12px;
}

.about-placeholder p {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 28px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.site-footer a {
  text-decoration: none;
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent-strong);
}

.footer-links {
  display: flex;
  gap: 18px;
}

/* ---------- Utility ---------- */

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--code-bg) 25%, var(--border) 37%, var(--code-bg) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 120px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
}
