:root {
  color-scheme: light;
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.dark {
  color-scheme: dark;
  --bg: #020617;
  --surface: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --border: rgba(148, 163, 184, 0.16);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.theme-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.06);
}

.hero {
  display: grid;
  gap: 2rem;
  padding: 4rem 0 3rem;
}

.hero-card {
  padding: 2rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--primary-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 1.7rem + 1.5vw, 3.5rem);
  line-height: 1.05;
}

.lead,
.post-subtitle,
.section-heading p {
  color: var(--muted);
  max-width: 50rem;
}

.latest-posts,
.about,
.post-page {
  padding: 3rem 0;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.posts-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.post-card,
.about-card,
.post-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.post-card h3 {
  margin: 1rem 0 0.75rem;
}

.post-card p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.post-card .button,
.post-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.post-card .button:hover,
.post-actions .button:hover {
  transform: translateY(-1px);
  background: var(--primary-strong);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.post-meta,
.post-header .post-meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-category {
  padding: 0.35rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.about-card {
  display: grid;
  gap: 1rem;
}

.post-detail {
  display: grid;
  gap: 1.75rem;
}

.post-header h1 {
  margin-top: 0.75rem;
  line-height: 1.1;
}

.post-subtitle {
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.post-content p {
  margin: 1rem 0;
  max-width: 65ch;
}

.post-actions {
  margin-top: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--surface);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .header-inner,
  .hero,
  .post-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    justify-content: flex-end;
  }
}
