:root {
  color-scheme: dark;
  --page: #0b0f14;
  --surface: #111923;
  --surface-raised: #172230;
  --border: #263445;
  --text: #e6edf5;
  --muted: #9aaabd;
  --accent: #68d5c3;
  --accent-soft: rgba(104, 213, 195, .12);
  --code: #0a111a;
  --content-width: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.header-inner {
  width: min(var(--content-width), calc(100% - 3rem));
  min-height: 2rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a { color: var(--muted); font-size: .94rem; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* The checkbox and label provide a CSS-only mobile menu. */
.menu-toggle, .menu-button { display: none; }

.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 80% 15%, rgba(104, 213, 195, .12), transparent 38%),
    linear-gradient(180deg, #101923 0%, var(--page) 100%);
}
.hero-inner {
  width: min(var(--content-width), calc(100% - 3rem));
  margin: 0 auto;
  padding: 1rem 0 1rem;
}
.eyebrow {
  margin: 0 0 .9rem;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.035em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.hero-copy { max-width: 650px; margin: 1.25rem 0 0; color: var(--muted); font-size: 1.12rem; }

.page-layout {
  width: min(var(--content-width), calc(100% - 3rem));
  margin: 3.5rem auto 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 4rem;
  align-items: start;
}
article { min-width: 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; color: var(--muted); font-size: .88rem; }
.tag {
  display: inline-block;
  padding: .18rem .65rem;
  border: 1px solid rgba(104, 213, 195, .28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
}
article h2 { margin: 1.2rem 0 1rem; font-size: clamp(1.8rem, 3vw, 2.5rem); }
article h3 { margin: 2.2rem 0 .7rem; font-size: 1.35rem; }
article p { color: #c3ceda; }
.lead { color: var(--text); font-size: 1.12rem; }
pre {
  overflow-x: auto;
  margin: 1.4rem 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code);
  color: #c9e7e1;
  font: .9rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:not(pre) > code { padding: .15rem .35rem; border-radius: 5px; background: var(--surface-raised); color: var(--accent); }
.callout {
  margin: 1.7rem 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: #cbd8e4;
}

aside { position: sticky; top: 108px; }
.sidebar-card {
  margin-bottom: 1.2rem;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.sidebar-card h3 { margin: 0 0 .8rem; font-size: 1rem; }
.sidebar-card p, .sidebar-card li { color: var(--muted); font-size: .9rem; }
.sidebar-card ul { margin: 0; padding-left: 1.1rem; }
.sidebar-card li + li { margin-top: .45rem; }

.more-posts {
  width: min(var(--content-width), calc(100% - 3rem));
  margin: 0 auto 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.more-posts h2 { margin: 0 0 1.2rem; font-size: 1.5rem; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.post-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.post-card small { color: var(--muted); }
.post-card h3 { margin: .55rem 0; font-size: 1.05rem; }
.post-card p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
footer { border-top: 1px solid var(--border); color: var(--muted); text-align: center; }
footer p { width: min(var(--content-width), calc(100% - 3rem)); margin: 0 auto; padding: 1.6rem 0; font-size: .86rem; }

@media (max-width: 760px) {
  .header-inner { width: calc(100% - 2rem); min-height: 64px; flex-wrap: wrap; gap: 0; }
  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
  }
  .menu-button::before { content: "☰"; }
  .menu-toggle:checked + .menu-button::before { content: "✕"; }
  .site-nav { display: none; flex-basis: 100%; padding: 0 0 1rem; }
  .menu-toggle:checked ~ .site-nav { display: block; }
  .site-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .site-nav li { border-top: 1px solid var(--border); }
  .site-nav a { display: block; padding: .8rem .2rem; }
  .hero-inner { width: calc(100% - 2rem); padding: 3.8rem 0 3.2rem; }
  .page-layout { width: calc(100% - 2rem); margin: 2.5rem auto 3.5rem; grid-template-columns: 1fr; gap: 2rem; }
  aside { position: static; }
  .more-posts { width: calc(100% - 2rem); margin-bottom: 3.5rem; }
  .post-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
