* { font-family: 'DM Sans', system-ui, sans-serif; }
body { background: #020817; color: #94a3b8; }
.accent { color: #38bdf8; }
.divider { border-color: rgba(255,255,255,0.05); }
.sky-tag { border: 1px solid rgba(56,189,248,0.25); color: #7dd3fc; }
.num { color: rgba(56,189,248,0.15); font-size: 5rem; font-weight: 700; line-height: 1; }
.bg-text {
  position: absolute;
  top: 50%;
  right: -2rem;
  transform: translateY(-50%);
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 700;
  color: rgba(56,189,248,0.03);
  letter-spacing: 0.1em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ── Insights / Prose container ───────────────────────────── */
/*
   Layout philosophy: text elements are capped at 72ch for optimal
   readability. Images, code blocks, and diagrams are NOT capped -
   they inherit the full outer container width (max-w-6xl = 1152px).
   This separates reading comfort from diagram/code real estate.
*/
.prose {
  color: #a8b8cc;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  max-width: 72ch;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: #f1f5f9;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
  max-width: 72ch;
  scroll-margin-top: 5rem;
}
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 0.4em; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.1rem; }
.prose p { margin-bottom: 1.25em; }
.prose a { color: #38bdf8; text-decoration: none; }
.prose a:hover { color: #7dd3fc; text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: #f1f5f9; font-weight: 600; }
.prose em { color: #cbd5e1; font-style: italic; }
.prose ul,
.prose ol { padding-left: 1.5em; margin-bottom: 1.25em; }
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li { margin-bottom: 0.4em; max-width: 72ch; }
.prose blockquote {
  border-left: 3px solid rgba(56,189,248,0.4);
  padding-left: 1.25em;
  margin: 1.5em 0;
  color: #cbd5e1;
  font-style: italic;
}
.prose code {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  color: #7dd3fc;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.prose pre {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 1.25em 1.5em;
  overflow-x: auto;
  margin: 0 0 1.5em 0;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 0.875em;
  color: #e2e8f0;
}
.prose hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 2.5em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.9em;
}
.prose th {
  color: #f1f5f9;
  font-weight: 600;
  text-align: left;
  padding: 0.6em 1em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.prose td {
  padding: 0.6em 1em;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.prose img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5em 0;
  display: block;
}
.prose figure {
  margin: 2em 0;
}
.prose figcaption {
  text-align: center;
  font-size: 0.8em;
  color: #475569;
  margin-top: 0.6em;
  font-style: italic;
}

/* ── Inline highlights ──────────────────────────────── */
/* Usage: <mark class="hl">word</mark> */
/* Reset browser default yellow mark first */
.prose mark {
  background: rgba(56,189,248,0.12) !important;
  color: #7dd3fc !important;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-style: normal;
}
.prose mark.hl {
  background: rgba(56,189,248,0.12) !important;
  color: #7dd3fc !important;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-style: normal;
}
.prose mark.hl-red {
  background: rgba(248,81,73,0.12) !important;
  color: #f85149 !important;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}
.prose mark.hl-green {
  background: rgba(86,211,100,0.12) !important;
  color: #56d364 !important;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}
.prose mark.hl-yellow {
  background: rgba(210,168,0,0.12) !important;
  color: #e3b341 !important;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

/* ── Operational Context & Methodology component ──────── */
.op-context {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0;
  margin-top: -4rem;
}

/* Remove default browser disclosure triangle */
.op-context summary {
  list-style: none;
}
.op-context summary::-webkit-details-marker {
  display: none;
}

.op-context-toggle {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 0;
  cursor: pointer;
  color: #475569;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  user-select: none;
  transition: color 0.2s ease;
}
.op-context-toggle:hover {
  color: #64748b;
}

.op-context-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.op-context[open] .op-context-chevron {
  transform: rotate(180deg);
}

.op-context-body {
  padding: 1.25em 0 2.25em 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  color: #475569;
  font-size: 0.825rem;
  line-height: 1.7;
}
.op-context-body p {
  margin-bottom: 0.75em;
  max-width: 72ch;
}
.op-context-body p:last-child {
  margin-bottom: 0;
}
.op-context-body strong {
  color: #64748b;
  font-weight: 600;
}
.op-context-body code {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
  color: #64748b;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.op-context-body ul {
  padding-left: 1.25em;
  margin-bottom: 0.75em;
  list-style-type: disc;
}
.op-context-body li {
  margin-bottom: 0.25em;
  max-width: 72ch;
}

/* ── Post references block ───────────────────────────── */
.post-references-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #334155;
  font-weight: 500;
  margin-bottom: 0.75em;
}
.post-references-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-references-list li {
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 0.35em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.post-references-list a {
  color: #334155;
  text-decoration: none;
  transition: color 0.2s ease;
}
.post-references-list a:hover {
  color: #475569;
}

/* ── Inline TOC ─────────────────────────────────── */
.post-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 2.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  max-width: 72ch;
}
.post-toc-link {
  font-size: 0.72rem;
  color: #475569 !important;
  text-decoration: none !important;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.post-toc-link:hover {
  color: #64748b !important;
  text-decoration: none !important;
}
.post-toc-sep {
  font-size: 0.72rem;
  color: #2d3748;
  user-select: none;
}

/* ── Back to top button ────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
  z-index: 100;
}
#back-to-top.visible {
  display: flex;
}
#back-to-top:hover {
  color: #64748b;
  border-color: rgba(255,255,255,0.12);
}
#back-to-top svg {
  width: 14px;
  height: 14px;
}
