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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #e63946;
  --accent-blue: #388bfd;
  --accent-hover: #ff6b6b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Header ─────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem 1rem;
  background: var(--surface);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-svg {
  height: 2.2rem;
  width: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.site-brand h1 a {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-brand h1 a:hover {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text);
}

.site-tagline {
  max-width: 1100px;
  margin: 0.75rem auto 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Main layout ─────────────────────────────────────── */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ── Cards ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Featured post */
.featured-post {
  margin-bottom: 2rem;
}

.card--featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 700px) {
  .card--featured {
    grid-template-columns: 1fr;
  }
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Card image */
.card-image {
  position: relative;
  background: #0d1117;
  min-height: 240px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 240px;
}

.card-image-placeholder svg {
  width: 100%;
  height: 100%;
}

/* Card body */
.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.card-body h2 a:hover {
  color: var(--accent);
}

.card--featured .card-body h2 {
  font-size: 1.35rem;
}

.excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: rgba(230, 57, 70, 0.15);
  color: var(--accent);
  border: 1px solid rgba(230, 57, 70, 0.3);
  width: fit-content;
}

.tag--blue {
  background: rgba(56, 139, 253, 0.15);
  color: var(--accent-blue);
  border-color: rgba(56, 139, 253, 0.3);
}

/* Meta */
.meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Read more */
.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  transition: color 0.2s;
}

.read-more:hover {
  color: var(--accent-hover);
}

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
}

/* ── Post page ───────────────────────────────────────── */

.post-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.post-wrap .tag {
  margin-bottom: 0.5rem;
}

.post-wrap h1 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-wrap .meta {
  margin-bottom: 2rem;
}

.post-hero {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.post-hero svg,
.post-hero img {
  width: 100%;
  display: block;
}

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #cdd9e5;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.post-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.25rem 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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