/* The site's own layout and prose. Components are in components.css, vendored
   from the design system; this file only arranges them and styles rendered
   Markdown. Every colour, radius and space is a token. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font-size: 15px; line-height: 1.65; background: var(--background); color: var(--foreground); overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--font-mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -48px; z-index: var(--z-popover); background: var(--primary); color: var(--primary-foreground); padding: 8px 12px; border-radius: var(--radius-md); }
.skip:focus { top: var(--space-2); }

/* Type roles from tokens.json */
.display { font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 var(--space-6); }
.title { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.heading { font-size: 21px; line-height: 28px; font-weight: 650; letter-spacing: -.02em; }
.lede { font-size: 17px; line-height: 28px; color: var(--muted-foreground); margin: var(--space-3) 0 0; max-width: 64ch; }

/* The lockup: inline SVG, word in currentColor, sized by height. */
.hs-logo { width: auto; }
.site-lockup { height: 24px; color: var(--foreground); }
.footer-lockup { height: 22px; color: var(--foreground); }
.hs-header__brand { color: var(--foreground); }

/* Mobile drawer */
.drawer { border-top: 1px solid var(--border); padding: var(--space-2) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: 2px; background: var(--background); }
.drawer[hidden] { display: none; }
.drawer a, .drawer__theme { display: flex; align-items: center; gap: var(--space-2); padding: 10px; border-radius: var(--radius-md); color: var(--foreground); text-decoration: none; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left; }
.drawer a:hover, .drawer__theme:hover { background: var(--accent); }
@media (min-width: 721px) { .drawer { display: none !important; } }

/* Landing */
.hero-mark { display: flex; justify-content: center; }
.hs-hero__mark { height: 220px; width: 220px; }
.hs-hero .hs-install { max-width: 100%; }
.page-shell { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-8); }
.page-shell > section { padding: var(--space-13) 0 0; }
.page-shell > section:last-child { padding-bottom: var(--space-13); }
.story__beats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.beat p { margin: 0; color: var(--muted-foreground); }
.beat strong { color: var(--foreground); font-weight: 600; }
.proof-code { margin: var(--space-8) 0 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-3\.5); align-items: start; }
.proof-code figcaption { grid-column: 1 / -1; font-size: 13px; line-height: 20px; color: var(--muted-foreground); max-width: 80ch; }
.proof-code .hs-term { align-self: start; }
.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hs-feature code.hs-inline-code { align-self: flex-start; }
.hs-feature--link .hs-feature__title { color: var(--card-foreground); font-size: 15px; }
.hs-feature--link:hover .hs-feature__title { color: var(--link); }
.outcomes > p, .measured > p, .roadmap > p { margin: var(--space-5) 0 0; max-width: 72ch; }
.name p { max-width: 72ch; color: var(--muted-foreground); margin: 0; }
.name .heading { margin: 0 0 var(--space-3); }
@media (max-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story__beats, .grid--3 { grid-template-columns: 1fr; }
  .proof-code { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .page-shell { padding: 0 var(--space-4); }
  .grid--4 { grid-template-columns: 1fr; }
  .display { font-size: 27px; line-height: 32px; }
  .hero-mark { display: none; }
  .hs-hero .hs-install { width: 100%; }
  .hs-hero .hs-install__cmd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Code blocks: Giallo writes inline light-dark() colours, which follow the
   root's color-scheme — so the theme toggle recolours them too. */
.hs-code__body pre, .prose pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 21px; background: var(--code-bg) !important; color: var(--code-foreground); }
.prose pre { border: 1px solid var(--border); border-radius: var(--radius-md); margin: var(--space-4) 0; }
.giallo-l { display: inline-block; min-height: 1lh; width: 100%; }
.prose pre code, .hs-code__body code { font-size: inherit; background: none; padding: 0; }
pre[data-lang="text"], pre:has(> code[data-lang="text"]) { background: var(--muted) !important; }

/* Docs layout: sidebar 240 · content ≤72ch · on-this-page 200 */
.docs { max-width: 1200px; margin: 0 auto; padding: var(--space-12) var(--space-8); display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: var(--space-12); align-items: start; }
.docs__nav, .docs__toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.docs__main { min-width: 0; }
.docs__head { margin-bottom: var(--space-8); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.docs__foot { margin-top: var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); }
.source { font-size: 13px; color: var(--muted-foreground); margin: 0; }
.hs-toc__link[aria-current="true"] { color: var(--foreground); border-left-color: var(--sun); font-weight: 600; }
@media (max-width: 1100px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .docs__toc { display: none; } }
@media (max-width: 820px) {
  .docs { grid-template-columns: minmax(0, 1fr); padding: var(--space-8) var(--space-4); gap: var(--space-6); }
  .docs__nav { position: static; max-height: none; order: 2; border-top: 1px solid var(--border); padding-top: var(--space-6); }
  .hs-sidebar { width: auto; }
}

/* Rendered Markdown */
.prose { max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 21px; line-height: 28px; font-weight: 650; letter-spacing: -.02em; margin: var(--space-12) 0 var(--space-3); }
.prose h3 { font-size: 17px; line-height: 24px; font-weight: 650; letter-spacing: -.01em; margin: var(--space-8) 0 var(--space-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-4); }
.prose li + li { margin-top: var(--space-1); }
.prose :not(pre) > code { font-size: .87em; background: var(--inline-code-bg); padding: 2px 6px; border-radius: var(--radius-sm); }
.prose blockquote { margin: var(--space-4) 0; padding: 2px 0 2px 13px; border-left: 3px solid var(--sun); color: var(--muted-foreground); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.55; margin: var(--space-4) 0 var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: 9.5px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; color: var(--muted-foreground); background: var(--card); }
.prose tr:last-child td { border-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: var(--space-8) 0; }
.page-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.page-list li { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.page-list a { font-weight: 600; text-decoration: none; }
.page-list a:hover { text-decoration: underline; }
.page-list span { font-size: 13px; color: var(--muted-foreground); }
.need { margin-bottom: var(--space-2); }

/* Search: the header's box, the drawer's, and the search page. Each form is
   hidden when scripts cannot run, because without them it would lead only to a
   page saying so. */
.header-search { flex: 0 1 200px; min-width: 112px; }
.header-search .hs-input { height: 32px; font-size: 13px; }
.header-search .hs-input-wrap__icon { top: 8px; }
.drawer__search { margin: var(--space-2) 0; }
.search__form { display: flex; flex-direction: column; gap: var(--space-2); margin: 0 0 var(--space-3); }
.search__status { min-height: 21px; margin: 0 0 var(--space-4); font-size: 13px; line-height: 21px; color: var(--muted-foreground); }
.search__results { margin: 0; }
.search__results:empty { display: none; }
.search__results span { overflow-wrap: anywhere; }
.search__results mark { background: var(--sun-soft); color: var(--foreground); border-radius: 2px; }
.search__results .search__snippet { margin-top: var(--space-1); }
/* The results arrive after first paint, so nothing may sit below them on
   screen to be pushed down: the page holds a screen's height, which puts the
   one-column sidebar below the fold. Below 721px the sidebar is not drawn at
   all; the drawer's Guide link reaches the overview, which lists every page. */
.docs--search .search { min-height: calc(100vh - 60px); }
@media (max-width: 720px) { .docs--search .docs__nav { display: none; } }
@media (max-width: 720px) { .site-search .hs-input { font-size: 16px; } }
@media (scripting: none) { .site-search { display: none !important; } }

/* 404 */
.lost { max-width: 72ch; margin: 0 auto; padding: var(--space-20) var(--space-8); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.topology-figure { margin: 0 0 24px; } .topology-figure img { width: 100%; height: auto; display: block; border-radius: 16px; }
