
@font-face {
  font-family: "Charter Web";
  font-style: normal;
  font-weight: normal;
  font-stretch: normal;
  src: url('fonts/charter_regular.woff2') format('woff2');
  font-display: swap;
  size-adjust: 110%;
}

@font-face {
  font-family: "Charter Web";
  font-style: italic;
  font-weight: normal;
  font-stretch: normal;
  src: url('fonts/charter_italic.woff2') format('woff2');
  font-display: swap;
  size-adjust: 110%;
}

@font-face {
  font-family: "Charter Web";
  font-style: normal;
  font-weight: bold;
  font-stretch: normal;
  src: url('fonts/charter_bold.woff2') format('woff2');
  font-display: swap;
  size-adjust: 110%;
}

@font-face {
  font-family: "Charter Web";
  font-style: italic;
  font-weight: bold;
  font-stretch: normal;
  src: url('fonts/charter_bold_italic.woff2') format('woff2');
  font-display: swap;
  size-adjust: 110%;
}

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

:root {
  --bg: #080820;
  --surface: #10113e;
  --text: #e0e0e0;
  --text-muted: #a0a0b0;
  --accent: #4fc3f7;
  --code-bg: #1a1b4a;
  --header-height: 4.5rem;
  --sidebar-width: 15rem;
}

/* CLAUDE: a link to a heading scrolls the heading clear of the sticky .site-header */
html {
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  background: var(--surface);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header a:hover {
  color: var(--text);
}

.site-header .home {
  display: flex;
  align-items: center;
}

.page {
  flex: 1;
  display: flex;
}

/* CLAUDE: the sidebar stays below .site-header and scrolls on its own if the outline is long */
.sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  flex-shrink: 0;
  width: var(--sidebar-width);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 2rem 1rem 2rem 2rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-top: 0.6rem;
}

.sidebar li li {
  margin-top: 0.3rem;
  padding-left: 1rem;
}

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

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

.main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

.main article {
  font-family: "Charter Web", Charter, "Bitstream Charter", XCharter, "Charis SIL", Georgia, serif;
}

.main article h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.main article h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.main article h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.main article p {
  margin-bottom: 1rem;
}

.main article a {
  color: var(--accent);
}

.main article code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.main article pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.main article pre code {
  padding: 0;
  background: none;
}

/* CLAUDE: a runnable atom snippet, matched to the code blocks around it; see web/atom-snippet.js */
.main article atom-snippet {
  --atom-surface: var(--code-bg);
  --atom-muted: var(--text-muted);
  --atom-code-size: 0.9em;
  --atom-radius: 6px;
  margin-bottom: 1rem;
}

.main article ul,
.main article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.main article li {
  margin-bottom: 0.3rem;
}

.main article table {
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.main article th,
.main article td {
  border: 1px solid var(--code-bg);
  padding: 0.3rem 0.7rem;
}

.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .site-header {
    padding: 0 1rem;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 1.5rem 1rem;
  }
}
