:root {
  --primary: #235e9d;
  --primary-hover: #1a4671;
  --primary-light: #3a8dd8;
  --accent: #47aedb;
  --text: #1f2937;
  --text-muted: #4b5563;
  --text-soft: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --card: #ffffff;
  --border: #e5e7eb;
  --image-bg: #e5e7eb;
}
html.dark {
  --text: #f3f4f6;
  --text-muted: #d1d5db;
  --text-soft: #9ca3af;
  --bg: #111827;
  --bg-soft: #1f2937;
  --card: #1f2937;
  --border: #374151;
  --image-bg: #374151;
  --primary: #3a8dd8;
  --primary-hover: #5aa3e6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; background: var(--bg-soft); }
.container { max-width: 1216px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 1216px; margin: 0 auto; padding: 0 32px; }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95);
  backdrop-filter: blur(4px); border-bottom: 1px solid rgba(229,231,235,.6);
}
html.dark .site-header { background: rgba(17,24,39,.95); border-color: rgba(55,65,81,.6); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 8px; }
.logo { height: 32px; width: auto; display: block; }
html.dark .logo { filter: brightness(0) invert(1); }
.brand:hover { opacity: .8; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text-muted); background: none;
  border: 0; padding: 8px 12px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 4px 6px -1px rgba(0,0,0,.15); }
html.dark .nav-link.active { color: #111827; }
.chev { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px; margin-top: 4px; padding: 4px;
  background: var(--card); border: 1px solid rgba(35,94,157,.2); border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.12);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text-muted); font-size: 14px; }
.dropdown-menu a:hover { background: var(--bg-soft); color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 20px;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-sun { display: none; }
html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }
.menu-toggle { display: none; }
.nav-actions-mobile { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px;
  font-size: 14px; font-weight: 500; border-radius: 6px; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
html.dark .btn-primary { color: #111827; }
.btn-outline { background: var(--card); color: var(--text); border-color: var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn-outline:hover { background: var(--bg-soft); }

/* Home and blog */
.section { padding-top: 96px; padding-bottom: 96px; }
.section-title { font-size: 24px; font-weight: 700; margin: 0 0 24px; line-height: 32px; }
.page-title { font-size: 36px; font-weight: 700; margin: 0 0 24px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden;
  color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.12); }
.card-image { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--image-bg); }
.card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.card-body { padding: 24px; }
.card-body h3 { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0 0 12px; }
.byline { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-soft); }
.byline-name { color: var(--text-muted); font-weight: 500; }
.byline-date { margin-left: auto; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none;
}

/* Post */
.post { max-width: 864px; margin: 0 auto; padding: 32px 16px 64px; }
.back-link { display: inline-block; margin-bottom: 48px; font-size: 16px; }
.post-hero { width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 auto 32px; }
.post h1 { font-size: 48px; line-height: 1.1; font-weight: 800; margin: 0 0 24px; }
.post .byline { justify-content: flex-start; font-size: 14px; }
.post .byline .avatar { width: 48px; height: 48px; font-size: 16px; }
.post .byline-name { color: var(--text); font-size: 16px; font-weight: 600; }
.post .byline-date { margin-left: 0; }
.post hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0 32px; }

/* Prose (page and post bodies) */
.prose { font-size: 18px; line-height: 1.6; color: var(--text-muted); }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 600; line-height: 1.3; margin: 1.4em 0 .5em; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 20px; }
.prose p { margin: 0 0 1em; }
.prose img { border-radius: 8px; display: block; margin: 1.5em auto; }
.prose a { text-decoration: underline; }
.prose blockquote { border-left: 4px solid var(--primary); margin: 1.5em 0; padding: .25em 1em; color: var(--text-soft); }
.prose pre, .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose iframe { width: 100%; border: 0; display: block; margin: 1.5em 0; background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px; text-align: left; }

/* Pages */
.page { margin: 0 auto; padding: 48px 16px 64px; max-width: 896px; }
.page-wide { max-width: 1216px; }
.page-full { max-width: none; padding-left: 0; padding-right: 0; }
.not-found { text-align: center; padding-top: 96px; padding-bottom: 96px; }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-grid h3 { font-size: 14px; font-weight: 600; margin: 0 0 24px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 16px; }
.footer-grid li a { color: var(--text-muted); font-size: 14px; }
.footer-grid li a:hover { color: var(--primary); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 32px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted);
}
.footer-legal { display: flex; gap: 32px; }
.footer-legal a { color: var(--text-muted); }

/* Responsive */
@media (max-width: 1023px) {
  .container-narrow { padding: 0 24px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .menu-toggle { display: inline-flex; order: 3; }
  .header-actions { margin-left: auto; }
  .hide-mobile { display: none; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
  }
  .main-nav.open { display: flex; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; margin: 0; padding-left: 16px; }
  .nav-actions-mobile { display: flex; gap: 8px; margin-top: 8px; }
  .container-narrow { padding: 0 16px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .card-grid, .footer-grid { grid-template-columns: 1fr; }
  .post h1 { font-size: 32px; }
}
