/* ── Anthropic Sans / Serif fonts (same as Claude Code docs) ── */
@font-face {
  font-family: "Anthropic Sans";
  src: url("https://assets.claude.ai/Fonts/AnthropicSans-Text-Regular-Static.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Sans";
  src: url("https://assets.claude.ai/Fonts/AnthropicSans-Text-Medium-Static.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Sans";
  src: url("https://assets.claude.ai/Fonts/AnthropicSans-Text-Semibold-Static.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Sans";
  src: url("https://assets.claude.ai/Fonts/AnthropicSans-Text-Bold-Static.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Serif Display";
  src: url("https://assets.claude.ai/Fonts/AnthropicSerif-Display-Regular-Static.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Serif Display";
  src: url("https://assets.claude.ai/Fonts/AnthropicSerif-Display-Medium-Static.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Serif Display";
  src: url("https://assets.claude.ai/Fonts/AnthropicSerif-Display-Semibold-Static.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens (from Claude Code docs) ── */
:root {
  /* Warm off-white backgrounds */
  --bg-000: #ffffff;
  --bg-100: #f8f7f2;
  --bg-200: #f1f0e8;
  --bg-300: #eae8de;
  --bg-400: #e2e0d4;
  --bg-page: #fdfdf7;
  --bg-sidebar: #f8f7f2;
  --bg-code: #f5f4ee;
  --bg-code-inline: #f0efea;

  /* Warm slate text */
  --text-000: #131311;
  --text-100: #131311;
  --text-200: #3a3a36;
  --text-300: #3a3a36;
  --text-400: #6e6e66;
  --text-500: #6e6e66;

  /* Borders (warm gray, low opacity) */
  --border-color: #e2e0d4;
  --border-light: #eae8de;

  /* Terracotta accent */
  --accent: hsl(15, 55.6%, 52.4%);
  --accent-hover: hsl(15, 63.1%, 59.6%);
  --accent-bg: hsla(15, 55.6%, 52.4%, 0.08);
  --accent-border: hsla(15, 55.6%, 52.4%, 0.25);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 56px;
  --content-max: 768px;
  --toc-width: 220px;

  /* Fonts */
  --font-sans: "Anthropic Sans", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Anthropic Serif Display", Georgia, "Times New Roman", Times, serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

  --radius: 8px;
  --transition: 150ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-100);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

::selection {
  background: var(--accent-bg);
  color: var(--text-000);
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(253, 253, 247, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-100);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-logo .logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: var(--text-400);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color var(--transition);
}
.header-nav a:hover,
.header-nav a.active { color: var(--text-100); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-400);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.menu-toggle:hover { background: var(--bg-200); }
.menu-toggle svg { width: 20px; height: 20px; display: block; }

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 16px 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.sidebar-section { margin-bottom: 20px; }

.sidebar-section-title {
  padding: 4px 20px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-400);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 0.8125rem;
  color: var(--text-400);
  transition: all var(--transition);
  border-left: 2px solid transparent;
  font-weight: 400;
}
.sidebar-link:hover {
  color: var(--text-200);
  background: var(--bg-200);
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar-link .link-icon {
  width: 15px;
  height: 15px;
  opacity: 0.5;
  flex-shrink: 0;
}
.sidebar-link.active .link-icon { opacity: 0.8; }

/* ── Main content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 48px 80px;
}

/* ── Post list (home) ── */
.page-eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  line-height: 1.25;
  color: var(--text-000);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-400);
  margin-bottom: 40px;
  line-height: 1.65;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-400);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.post-card {
  display: block;
  background: var(--bg-000);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: all var(--transition);
  text-decoration: none;
}
.post-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-100);
  margin-bottom: 6px;
  line-height: 1.4;
}
.post-card-excerpt {
  font-size: 0.8125rem;
  color: var(--text-400);
  line-height: 1.6;
  margin-bottom: 12px;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-500);
}
.post-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Categories grid ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}
.category-card {
  background: var(--bg-000);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: all var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.category-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.category-icon.nas { background: hsla(15, 55%, 52%, 0.1); }
.category-icon.ai { background: hsla(210, 70%, 51%, 0.1); }
.category-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-100);
}
.category-count {
  font-size: 0.6875rem;
  color: var(--text-500);
}

/* ── Article content ── */
.article-header { margin-bottom: 36px; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-500);
  margin-bottom: 12px;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text-000);
}

.article-desc {
  font-size: 1rem;
  color: var(--text-400);
  line-height: 1.65;
}

/* ── Article body prose ── */
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-000);
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 400;
  margin: 32px 0 12px;
  color: var(--text-000);
}

.article-body h4 {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text-100);
}

.article-body p {
  margin-bottom: 16px;
  color: var(--text-200);
  line-height: 1.65;
  font-size: 1rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 16px;
  padding-left: 22px;
}

.article-body li {
  margin-bottom: 4px;
  color: var(--text-200);
  line-height: 1.65;
  font-size: 1rem;
}

.article-body li::marker {
  color: var(--text-500);
}

.article-body strong {
  font-weight: 600;
  color: var(--text-100);
}

.article-body em {
  color: var(--text-400);
  font-style: italic;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 36px 0;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 12px 18px;
  margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-300);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.article-body blockquote p {
  margin-bottom: 0;
  color: var(--text-300);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.8125em;
  background: var(--bg-code-inline);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-100);
  border: 1px solid var(--border-light);
}

.article-body pre {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin: 16px 0;
  overflow: hidden;
}

.article-body pre code {
  display: block;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  background: none;
  border: none;
  color: var(--text-200);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.article-body pre code::-webkit-scrollbar { height: 4px; }
.article-body pre code::-webkit-scrollbar-track { background: transparent; }
.article-body pre code::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-000);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-500);
  padding: 4px 10px;
  font-size: 0.6875rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.article-body pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover {
  color: var(--text-200);
  border-color: var(--border-color);
  background: var(--bg-200);
}
.copy-btn.copied {
  color: #16a34a;
  border-color: #16a34a;
}

/* ── Tables ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.8125rem;
}
.article-body thead th {
  text-align: left;
  padding: 8px 14px;
  font-weight: 600;
  color: var(--text-300);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
}
.article-body tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-200);
}
.article-body tbody tr:hover {
  background: var(--bg-100);
}

/* ── TOC (right rail) ── */
.toc-rail {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.toc-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-500);
  margin-bottom: 10px;
}

.toc-link {
  display: block;
  padding: 3px 0 3px 12px;
  font-size: 0.75rem;
  color: var(--text-500);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1.5;
}
.toc-link:hover { color: var(--text-300); }
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.toc-link.depth-3 { padding-left: 24px; font-size: 0.6875rem; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-500);
  margin-bottom: 24px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 14px; height: 14px; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 28px 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-500);
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .toc-rail { display: none; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 250ms ease;
    background: var(--bg-page);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0,0,0,0.2);
    z-index: 40;
  }
  .sidebar.open + .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .content-wrapper { padding: 24px 20px 60px; }
  .menu-toggle { display: block; }
  .header-nav { display: none; }
  .page-title { font-size: 1.75rem; }
  .article-title { font-size: 1.5rem; }
  .post-card { padding: 16px 18px; }
}

/* ── Syntax highlight (warm light theme) ── */
.hljs-keyword,
.hljs-selector-tag { color: #8b5cf6; }
.hljs-string,
.hljs-attr { color: #16a34a; }
.hljs-comment { color: #9ca3af; font-style: italic; }
.hljs-number { color: #d97706; }
.hljs-function .hljs-title,
.hljs-title.function_ { color: #2563eb; }
.hljs-built_in { color: #d97706; }
.hljs-variable { color: #dc2626; }
.hljs-type { color: #d97706; }
.hljs-meta { color: #6366f1; }
.hljs-section { color: #2563eb; font-weight: 600; }
.hljs-title { color: #8b5cf6; }
.hljs-params { color: var(--text-200); }
