:root {
  --bg: #f5f5f7;
  --bg-alt: #ffffff;
  --text: #222222;
  --muted: #666666;
  --accent: #4c6fff;
  --accent-soft: rgba(76, 111, 255, 0.1);
  --border: #e0e0e6;
  --radius: 12px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

hr {
  border: none;
  height: 1px;
  background-color: grey;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */

header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(7px);
  background-clip: padding-box;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.header-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.header-nav a {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.header-nav a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

/* Layout */

.page {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding: 0 1.5rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

main {
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem 2rem;
  border: 1px solid var(--border);
}

aside {
  position: sticky;
  top: 4.5rem; /* Below sticky header */
  align-self: flex-start;
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--border);
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}

/* Sidebar sections */

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.sidebar-nav,
.sidebar-tags,
.sidebar-meta {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 0.4rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.sidebar-meta li {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* Blog content */

.post {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
}

h1 a {
  color: inherit;
}

h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

h3 {
  margin-top:0rem;
  padding-top:0.25rem;
  padding-bottom:0rem;
  margin-bottom:0rem;
  font-size: 1.4rem;
}

h4 {
  margin-top:0rem;
  padding-top:0.25rem;
  padding-bottom:0rem;
  margin-bottom:0rem;
  font-size: 1.3rem;
}

h5 {
  margin-top:0rem;
  padding-top:0.25rem;
  padding-bottom:0rem;
  margin-bottom:0rem;
  font-size: 1.1rem;
}

.post ul,ol {
  margin-top: 0rem;
  padding-top:0rem;
  margin-bottom: 0.25rem;
  padding-bottom:0rem;
}

.post blockquote {
  margin-top: 0rem;
  padding-top:0rem;
  margin-bottom:0.25rem;
  padding-bottom:0rem;
}

.post p {
  margin-top:0rem;
  padding-top:0rem;
  padding-bottom:0.25rem;
  margin-bottom:0rem;
}

/* Footer */

footer {
  max-width: var(--max-width);
  margin: 0 auto 1rem;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* Responsive */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  aside {
    position: static;
    max-height: none;
    order: 2;
  }

  main {
    order: 1;
  }
}