/* ============================================================
   DashCode — /docs. The feature inventory (Live / Partly live / Coming soon / Exploring) and
   the reference, in three columns: feature copy | its mock | a sticky "On this page" rail.

   Page chrome is Dash Flow (css/flow.css, DESIGN.md): white and warm paper, alpha-black text,
   light serif headings, pills. Every mock is a piece of the app drawn with the app's own
   classes (css/app-ui.css, the same rules as the landing page's live demo) inside an inert
   `.app.mock` window, so the mocks look like the shipped app and follow it when it changes.

   Page class names stay clear of the app's (.docs, .prose, .tree, .tab, .seg, .sect, …), which
   css/app-ui.css styles unscoped.
   ============================================================ */

:root { --bar-h: 72px; --side-w: 216px; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 24px); scrollbar-color: var(--paper-strong) transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Visually hidden, still read aloud. */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* page icons: the sprite's Lucide symbols, stroked */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }

/* machine strings: a 6px Paper chip (DESIGN.md: The Machine Strings Rule) */
/* (page text only: the app windows keep their own code and keys) */
:where(.head, .feature-copy, .ref) :is(code, kbd) {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--text);
  background: var(--paper);
  border-radius: 6px;
  padding: 1px 6px;
}
:where(.head, .feature-copy, .ref) kbd { font-size: 11.5px; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--paper-strong); }
:where(.head, .feature-copy, .ref) kbd + kbd { margin-left: 3px; }

/* ============================== header ============================== */
/* the landing page's header, held at the top while you read; frosted like the dock */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
          backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 -1px 0 var(--rule);
}
.top__nav [aria-current="page"] { background: var(--paper); }

/* ============================== three columns ============================== */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  gap: 72px;
  width: min(100% - 2 * var(--gutter), 1320px);
  margin: 0 auto;
}
main { min-width: 0; }

/* ---- the side rail: "On this page" ---- */
.side { min-width: 0; }
.side nav {
  position: sticky;
  top: calc(var(--bar-h) + 40px);
  max-height: calc(100vh - var(--bar-h) - 64px);
  overflow-y: auto;
  margin-top: 88px;
  padding: 0 4px 24px 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.side__label { margin: 0 0 10px 12px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side__sub { margin: 2px 0 12px; }
.side a {
  display: flex; align-items: center; gap: 10px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px; line-height: 18px;
  color: var(--text-2);
  text-decoration: none;
  transition: background-color 100ms var(--ease), color 100ms var(--ease);
}
.side a:hover { background: var(--paper); color: var(--text); }
.side a.is-active { background: var(--paper); color: var(--text); }
.side__grp > a { color: var(--text); }
.side__sub a { padding-left: 16px; }
/* every sub entry has a mark slot, so names line up whether or not they carry a status */
.side__sub .mk { margin-right: 0; }

/* ---- status marks: a 6px dot and a word, never a tinted pill ---- */
.mk {
  display: inline-block;
  width: 6px; height: 6px; flex: none;
  border-radius: 50%;
  background: var(--text-3);
}
.mk--live { background: var(--ok); }
/* half a dot: some of it is on */
.mk--partial { background: linear-gradient(90deg, var(--ok) 50%, transparent 50%); box-shadow: inset 0 0 0 1.25px var(--ok); }
.mk--soon { background: var(--text); }
/* the one that isn't a commitment: hollow, so it reads apart even in grayscale */
.mk--exploring { background: none; box-shadow: inset 0 0 0 1.25px var(--text-2); }
/* reference entries: no status, an empty slot */
.mk--none { background: none; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; line-height: 16px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ============================== page head ============================== */
.head { max-width: 46rem; padding: 88px 0 0; }
.head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(44px, 1.2rem + 3.4vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lead {
  margin: 24px 0 0;
  max-width: 34em;
  font-size: 16px; line-height: 24px; letter-spacing: -0.011em;
  color: var(--text-2);
}
.lead strong { color: var(--text); font-weight: 500; }
.meta { margin: 16px 0 0; font-size: 12px; line-height: 16px; color: var(--text-2); }
.legend {
  display: flex; flex-wrap: wrap;
  gap: 8px 24px;
  margin: 32px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 12px; line-height: 16px;
  color: var(--text-2);
}
.legend div { display: flex; align-items: center; gap: 8px; }
.legend b { font-weight: 500; color: var(--text); }

/* ---- the contents list: the rail's stand-in when there's no room for a rail ---- */
.toc { display: none; margin: 48px 0 0; padding: 24px 0 0; border-top: 1px solid var(--rule); }
.toc__label { margin: 0 0 16px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.toc__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.toc h2 { margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; }
.toc h2 a { text-decoration: none; }
.toc ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.toc li a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; transition: color 150ms var(--ease); }
.toc li a:hover { color: var(--text); }
/* the second Live column has no heading of its own: line its list up with the first's */
.toc__cont { padding-top: 28px; }
.toc .toc__next { margin-top: 24px; }

/* ============================== groups + feature rows ============================== */
.group { padding-top: 144px; }
.group-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(34px, 1.4rem + 1.4vw, 48px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.group-head p { margin: 16px 0 0; max-width: 34em; font-size: 16px; line-height: 24px; color: var(--text-2); }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
  padding: 64px 0;
  border-bottom: 1px solid var(--rule);
}
.feature:last-child { border-bottom: 0; padding-bottom: 0; }
.feature-copy { min-width: 0; }
.feature-copy h3 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 28px; line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.feature-copy > p { margin: 16px 0 0; max-width: 60ch; font-size: 14px; line-height: 22px; color: var(--text-2); }
.feature-copy strong { color: var(--text); font-weight: 500; }
.notes { margin: 16px 0 0; padding: 0; list-style: none; max-width: 60ch; font-size: 14px; line-height: 22px; color: var(--text-2); }
.notes li { position: relative; padding: 8px 0 8px 18px; border-top: 1px solid var(--rule); }
.notes li::before {
  content: ""; position: absolute; left: 2px; top: 17px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--paper-strong);
}
.notes b { color: var(--text); font-weight: 500; }
.notes a, .feature-copy p a { color: var(--text); text-decoration: underline; text-decoration-color: var(--paper-strong); text-underline-offset: 3px; }
.notes a:hover, .feature-copy p a:hover { color: var(--link-hover); }
.feature-visual { min-width: 0; }
.feature, .group, .ref, .ref h4[id] { scroll-margin-top: calc(var(--bar-h) + 16px); }

/* ============================== the mocks ==============================
   Each sits on a Paper slab like a print on a mount; the window is the app (css/app-ui.css),
   drawn at its real type size and cropped by the slab where it runs long. Only the window
   casts a shadow. Mocks are illustrations: `inert`, so nothing in them takes focus or clicks. */
.frame {
  display: grid;
  place-items: center;
  padding: 32px;
  border-radius: 24px;
  background: var(--paper);
  overflow: hidden;
}
.mock {
  width: 100%;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border), var(--window-shadow);
  user-select: none;
  -webkit-user-select: none;
}
/* the border sits inside the window; panes lie over it, so draw it again on top */
.mock::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; z-index: 9; }
.caption { margin: 12px 8px 0; font-size: 12px; line-height: 16px; color: var(--text-2); text-align: center; text-wrap: balance; }
/* a wide view (the Overview's boards, Files): the window keeps a real width and runs off the slab's
   right edge, cropped like the landing page's stage */
.frame--bleed { place-items: start; padding-right: 0; }
.frame--bleed .mock { width: 860px; max-width: none; border-radius: 10px 0 0 10px; }

/* ---- the windows' insides: static stand-ins for live parts ---- */
.mock .shell { height: auto; }
.mock .panel { display: flex; flex-direction: column; }
.mock .panel__body { overflow: hidden; }
.mock .term { overflow: hidden; cursor: default; }
/* fields drawn as text (nothing to type into) */
.mock .mock-field { display: flex; align-items: center; }
.mock .mock-ph { display: block; color: var(--muted); }
.mock .info__git-msg.mock-ph { min-height: 32px; }
.mock .mock-caret { display: inline-block; width: 1px; height: 17px; margin-left: 1px; vertical-align: -3px; background: var(--ink); animation: blink 1.1s steps(1) infinite; }
/* hover, held still: the row or item the caption points at */
.mock .menu__item.is-hover, .mock .sb__iconbtn.is-hover { background: var(--sb-hover); color: var(--sb-ink); }
.mock .rm__item.is-hover .rm__line { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.mock .rm__item.is-hover .rm__acts { opacity: 1; }
.mock .rm__item.is-hover .rm__grip { opacity: .7; }

/* sidebar + a dialog over the dimmed workspace (Add, the quick switcher) */
.mock--add, .mock--side { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.mock--add .sb, .mock--side .sb { position: relative; }
.mock--add .sb__list { flex: none; }
.mock--add .sb { min-height: 380px; }
.mock--add .sb__foot { margin-top: auto; }
.mock .mock-menu { position: absolute; left: 8px; right: 8px; bottom: 50px; z-index: 4; min-width: 0; }
.mock-scrim { display: grid; align-content: start; justify-items: center; padding: 40px 28px; min-width: 0; background: color-mix(in srgb, #000 30%, var(--panel-bg)); }
.mock-scrim .dlg { width: 100%; max-width: 480px; }
.mock-switcher { max-width: 400px !important; }
.mock .dlg .add-form input { min-width: 0; }

/* Settings › Links: label | url rows */
.mock .add-form:has(.mock-linkshead) { grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.mock .mock-linkshead { display: flex; align-items: center; justify-content: space-between; margin-top: 0; padding-top: 0; border-top: 0; }
.mock .mock-found { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.mock .mock-found svg { color: var(--green); }

/* ---- the Mac app's own chrome: the menu bar, the app menu, the update alert (native macOS, not
   the app's web UI, so system type and the site's app tokens) ---- */
.mock--desk { position: relative; overflow: hidden; background: var(--bg); color: var(--ink); font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; letter-spacing: normal; }
.macbar { display: flex; align-items: center; gap: 18px; height: 26px; padding: 0 14px; background: color-mix(in srgb, var(--card) 80%, var(--bg)); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.macbar b { padding: 1px 8px; margin: 0 -8px; border-radius: 5px; background: color-mix(in srgb, var(--blue) 85%, #000); color: #fff; font-weight: 700; }
.desk { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 20px; align-items: start; padding: 0 20px 24px 12px; }
.macmenu { padding: 5px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px; background: color-mix(in srgb, var(--card) 92%, var(--bg)); box-shadow: var(--shadow-lg); }
.macmenu div { display: flex; align-items: center; padding: 3px 9px; border-radius: 4px; white-space: nowrap; }
.macmenu div span { margin-left: auto; padding-left: 16px; color: var(--muted); }
.macmenu .is-on { background: color-mix(in srgb, var(--blue) 85%, #000); color: #fff; }
.macmenu hr { height: 1px; margin: 4px 9px; border: 0; background: var(--border); }
.nsalert { display: grid; justify-items: center; gap: 4px; margin-top: 32px; padding: 18px 16px 16px; border-radius: 12px; background: color-mix(in srgb, var(--card) 92%, var(--bg)); box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); text-align: center; }
.nsalert .brand-mark { width: 30px; height: 30px; margin-bottom: 6px; }
.nsalert b { font-size: 13px; }
.nsalert p { margin: 0; font-size: 11.5px; color: var(--ink); }
.nsalert p.sub { color: var(--muted); }
.nsalert .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 12px; }
.nsalert .row span { padding: 4px 0; border-radius: 6px; background: var(--tile); font-size: 12.5px; }
.nsalert .row .def { background: color-mix(in srgb, var(--blue) 85%, #000); color: #fff; }

/* ============================== reference ============================== */
.ref { max-width: 46rem; padding: 64px 0 0; }
.ref + .ref { margin-top: 64px; border-top: 1px solid var(--rule); }
.ref h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 28px; line-height: 1.05;
  letter-spacing: -0.03em;
}
.ref h4 {
  margin: 40px 0 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: 22px; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-2);
}
.ref p, .ref li { font-size: 14px; line-height: 22px; color: var(--text-2); }
.ref p { margin: 16px 0 0; }
.ref strong { color: var(--text); font-weight: 500; }
.ref ul { margin: 12px 0 0; padding-left: 1.1rem; }
.ref li + li { margin-top: 6px; }
.ref li::marker { color: var(--text-3); }
.ref a { color: var(--text); text-decoration: underline; text-decoration-color: var(--paper-strong); text-underline-offset: 3px; transition: color 150ms var(--ease); }
.ref a:hover { color: var(--link-hover); }
.ref pre {
  margin: 20px 0 0;
  padding: 20px 24px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--text);
  font: 12px/1.7 var(--font-mono);
  overflow-x: auto;
  tab-size: 2;
}
.ref pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; }
.ref pre .d { color: var(--text-2); }

/* tables: hairline rows, no boxes */
.table-wrap { margin: 16px 0 0; overflow-x: auto; }
.ref table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.ref th, .ref td { padding: 10px 16px 10px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.ref th:last-child, .ref td:last-child { padding-right: 0; }
.ref thead th { border-top: 0; padding-bottom: 8px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-2); }
.ref td { color: var(--text-2); }
.ref td:first-child { color: var(--text); white-space: nowrap; }
.ref td code { white-space: nowrap; }

.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; margin-top: 8px; }
.keys .table-wrap { margin: 24px 0 0; }
.keys td:first-child { width: 1%; padding-right: 20px; }
.keys caption {
  caption-side: top; text-align: left; padding: 0 0 12px;
  font-family: var(--serif); font-weight: 200; font-size: 22px; line-height: 1; letter-spacing: -0.03em;
  color: var(--text-2);
}

.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.lists > div { padding: 24px; border-radius: 24px; background: var(--paper); }
.lists h4 { margin: 0; }
.lists ul { margin-top: 12px; }

.price { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.price > div { flex: 1 1 200px; padding: 24px; border-radius: 24px; background: var(--paper); }
.price .k { font-size: 12px; line-height: 16px; color: var(--text-2); }
.price .v {
  margin-top: 12px;
  font-family: var(--serif); font-weight: 200;
  font-size: 48px; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.price .v small { font-family: var(--sans); font-size: 14px; letter-spacing: -0.01em; color: var(--text-2); }

/* ============================== closing ============================== */
.closing { max-width: 46rem; margin: 144px 0 0; }
.closing h2 {
  margin: 0;
  font-family: var(--serif); font-weight: 200;
  font-size: clamp(34px, 1.4rem + 1.4vw, 48px); line-height: 1; letter-spacing: -0.03em;
}
.closing p { margin: 16px 0 0; font-size: 16px; line-height: 24px; color: var(--text-2); }
.closing .cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.closing .note { margin-top: 16px; font-size: 12px; line-height: 16px; }

/* ============================== motion ============================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================== responsive ============================== */
/* No room for a third column: the side rail goes, the contents list under the head takes over. */
@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); width: min(100% - 2 * var(--gutter), 1080px); }
  .side { display: none; }
  .toc { display: block; }
}
@media (max-width: 960px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 56px 0; }
  .keys, .lists { grid-template-columns: minmax(0, 1fr); }
  .toc__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .mock-hide-sm { display: none; }
  .desk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --bar-h: 64px; }
  .head { padding-top: 48px; }
  .group { padding-top: 112px; }
  .frame { padding: 16px; border-radius: 24px; }
  .feature-copy h3, .ref h3 { font-size: 26px; }
  .closing { margin-top: 112px; }
  .closing .cta .pill { flex: 1 1 auto; }
}
