/* MSP Atlas documentation site. The same neutral palette and typeface as the app. */
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-sans.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --bg-3: #eceff3;
  --line: #e1e5eb;
  --line-strong: #c9d0d9;
  --text: #151b23;
  --text-2: #3d4856;
  --muted: #5f6b79;
  --primary: #1f6fc5;
  --primary-soft: #e8f1fb;
  --on-primary: #ffffff;
  --note: #1f6fc5;
  --tip: #1d7f4e;
  --tip-soft: #e8f5ee;
  --warn: #9a5b00;
  --warn-soft: #fdf3e2;
  --code-bg: #f3f5f8;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 8px 24px rgb(16 24 40 / 0.08);
  --top: 3.5rem;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0e1116;
    --bg-2: #141920;
    --bg-3: #1c222b;
    --line: #242c37;
    --line-strong: #364150;
    --text: #e8ecf1;
    --text-2: #bcc5cf;
    --muted: #8d98a6;
    --primary: #6aa9ec;
    --primary-soft: #16253a;
    --on-primary: #08121d;
    --note: #6aa9ec;
    --tip: #5fc792;
    --tip-soft: #11241b;
    --warn: #e7b25a;
    --warn-soft: #2a2011;
    --code-bg: #161c24;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e1116;
  --bg-2: #141920;
  --bg-3: #1c222b;
  --line: #242c37;
  --line-strong: #364150;
  --text: #e8ecf1;
  --text-2: #bcc5cf;
  --muted: #8d98a6;
  --primary: #6aa9ec;
  --primary-soft: #16253a;
  --on-primary: #08121d;
  --note: #6aa9ec;
  --tip: #5fc792;
  --tip-soft: #11241b;
  --warn: #e7b25a;
  --warn-soft: #2a2011;
  --code-bg: #161c24;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}
img {
  max-width: 100%;
  height: auto;
}
code,
kbd,
pre {
  font-family: var(--mono);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
}
.skip:focus {
  top: 0.75rem;
}

/* Top bar ----------------------------------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--primary);
}
.topnav {
  display: flex;
  gap: 1.5rem;
}
.topnav a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}
.topnav a:hover,
.topnav a[aria-current] {
  color: var(--text);
}
.topnav a[aria-current] {
  font-weight: 600;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.search {
  position: relative;
}
.search input {
  width: 15rem;
  height: 2.1rem;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}
.search input::placeholder {
  color: var(--muted);
}
.search kbd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}
.search input:not(:placeholder-shown) + kbd {
  display: none;
}
.search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(28rem, 90vw);
  max-height: 70vh;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.search-results a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.45;
  text-decoration: none;
}
.search-results a strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}
.search-results a span {
  color: var(--muted);
  font-size: 0.8rem;
}
.search-results a:hover,
.search-results a[aria-selected='true'] {
  background: var(--bg-3);
}
.search-results p {
  margin: 0;
  padding: 0.6rem 0.7rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.theme,
.gh,
.menu-toggle {
  display: inline-grid;
  place-items: center;
  height: 2.1rem;
  min-width: 2.1rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme:hover,
.gh:hover,
.menu-toggle:hover {
  background: var(--bg-3);
  color: var(--text);
}
.theme svg,
.gh svg {
  width: 1.15rem;
  height: 1.15rem;
}
.menu-toggle {
  display: none;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  font: inherit;
  font-size: 0.875rem;
}

/* Manual layout ----------------------------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr) 14rem;
  gap: 3rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.sidebar {
  position: sticky;
  top: var(--top);
  align-self: start;
  max-height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 2rem 0.5rem 3rem 0;
}
.sidebar-group {
  margin: 1.5rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.sidebar-group:first-child {
  margin-top: 0;
}
.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebar a {
  display: flex;
  gap: 0.6rem;
  padding: 0.32rem 0.6rem;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}
.sidebar a:hover {
  background: var(--bg-2);
  color: var(--text);
}
.sidebar a[aria-current] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar .num {
  min-width: 1.2rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.sidebar a[aria-current] .num {
  color: inherit;
}

.toc {
  position: sticky;
  top: var(--top);
  align-self: start;
  max-height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 2.25rem 0 3rem;
}
.toc p {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}
.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.25rem 0 0.25rem 0.85rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
}
.toc a:hover {
  color: var(--text);
}
.toc a[aria-current] {
  border-left-color: var(--primary);
  color: var(--text);
  font-weight: 500;
}

/* Document text ----------------------------------------------------------------------------------------------- */
.doc {
  min-width: 0;
  max-width: 47rem;
  padding: 2.25rem 0 4rem;
}
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.doc h1 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 2.1rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.doc h1 + p,
.lead {
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1.6;
}
.doc h2 {
  margin: 3rem 0 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.doc h3 {
  margin: 2rem 0 0.5rem;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 620;
  line-height: 1.35;
}
.doc h2 a.anchor,
.doc h3 a.anchor {
  color: inherit;
  text-decoration: none;
}
.doc h2 a.anchor:hover::after,
.doc h3 a.anchor:hover::after {
  content: ' #';
  color: var(--muted);
  font-weight: 400;
}
.doc p,
.doc ul,
.doc ol {
  margin: 0 0 1rem;
}
.doc ul,
.doc ol {
  padding-left: 1.3rem;
}
.doc li {
  margin: 0.3rem 0;
}
.doc li > ul {
  margin: 0.3rem 0 0;
}
.doc li::marker {
  color: var(--muted);
}
.doc strong {
  color: var(--text);
  font-weight: 620;
}
.doc :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

/* Numbered steps: the number in a ring to the left, as in a printed manual. */
.doc ol.steps {
  padding: 0;
  list-style: none;
}
.doc ol.steps > li {
  position: relative;
  margin: 0 0 0.8rem;
  padding-left: 2.4rem;
}
.doc ol.steps > li::before {
  content: counter(list-item);
  position: absolute;
  left: 0;
  top: 0.12rem;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.callout {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--note);
  border-radius: 0 6px 6px 0;
  background: var(--bg-2);
}
.callout p {
  margin: 0.4rem 0 0;
}
.callout p:first-child {
  margin-top: 0;
}
.callout-title {
  color: var(--text);
  font-weight: 620;
}
.callout-tip {
  border-left-color: var(--tip);
  background: var(--tip-soft);
}
.callout-warning {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.table {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}
th,
td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td:first-child {
  color: var(--text);
}

figure {
  margin: 1.75rem 0 2rem;
}
figure a {
  display: block;
}
figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}
figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.code {
  position: relative;
  margin: 1.1rem 0 1.4rem;
}
.code pre {
  margin: 0;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.6;
}
.copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
}
.code:hover .copy,
.copy:focus-visible {
  opacity: 1;
}

/* The diagram in chapter 1, drawn with the page's own colours. */
.diagram {
  margin: 1.75rem 0 0.6rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.diagram .box {
  fill: var(--bg);
  stroke: var(--line-strong);
}
.diagram .box-main {
  fill: var(--primary-soft);
  stroke: var(--primary);
}
.diagram .t {
  fill: var(--text);
  font: 600 14px var(--sans);
}
.diagram .s {
  fill: var(--muted);
  font: 400 12px var(--sans);
}
.diagram .line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.5;
}
.diagram .dash {
  stroke-dasharray: 4 4;
}
.caption {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.pager a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.pager a:hover {
  border-color: var(--line-strong);
  background: var(--bg-2);
}
.pager span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.pager .next {
  grid-column: 2;
  text-align: right;
}

/* Chapter list on the manual's first page. */
.chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  column-gap: 2rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}
.doc .chapters li {
  margin: 0;
}
.chapters a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  padding: 0.9rem 0.5rem 0.9rem 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.45;
  text-decoration: none;
}
.chapters a:hover strong {
  color: var(--primary);
}
.chapters b {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.chapters strong {
  display: block;
  color: var(--text);
  font-weight: 620;
}

/* Landing page ------------------------------------------------------------------------------------------------ */
.landing {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.hero {
  padding: 5rem 0 3rem;
}
.hero h1 {
  max-width: 48rem;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.hero .lead {
  max-width: 42rem;
  margin: 1.25rem 0 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 3rem;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.6rem;
  padding: 0 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background: var(--bg-2);
}
.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.button.primary:hover {
  filter: brightness(1.08);
}
.version {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.shot img {
  display: block;
  width: 100%;
}
.band {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
}
.band h2 {
  max-width: 40rem;
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.band p {
  max-width: 42rem;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: center;
}
.list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.list li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.list strong {
  color: var(--text);
  font-weight: 620;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}
.grid3 h3 {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 620;
}
.grid3 p {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.grid3 a {
  font-size: 0.9rem;
}

/* Footer ------------------------------------------------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer p {
  margin: 0;
}
.footer a {
  margin-left: 1.25rem;
  color: var(--muted);
}
.footer a:first-child {
  margin-left: 0;
}

/* Narrower screens -------------------------------------------------------------------------------------------- */
@media (max-width: 75rem) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  .layout > .toc {
    display: none;
  }
}
@media (max-width: 60rem) {
  .topnav {
    display: none;
  }
  .search input {
    width: 11rem;
  }
  .menu-toggle {
    display: inline-grid;
  }
  .layout {
    display: block;
    padding: 0 1rem;
  }
  .sidebar {
    position: fixed;
    inset: var(--top) 0 0 0;
    z-index: 25;
    max-height: none;
    padding: 1.5rem 1rem 3rem;
    background: var(--bg);
    visibility: hidden;
  }
  .sidebar.open {
    visibility: visible;
  }
  .split,
  .grid3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    padding-top: 3rem;
  }
}
@media (max-width: 40rem) {
  .topbar-inner {
    gap: 0.75rem;
    padding: 0 1rem;
  }
  .brand span,
  .search kbd,
  .gh {
    display: none;
  }
  .topbar-tools,
  .search {
    flex: 1;
  }
  .search input {
    width: 100%;
  }
  .doc h1 {
    font-size: 1.75rem;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager .next {
    grid-column: 1;
  }
  .landing {
    padding: 0 1rem;
  }
  .footer a {
    margin: 0 1rem 0 0;
  }
}
@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .footer,
  .copy {
    display: none;
  }
  .layout {
    display: block;
  }
  .doc {
    max-width: none;
  }
}

/* Troubleshooting filter. */
.filter {
  width: 100%;
  height: 2.6rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.filter-empty {
  color: var(--muted);
}
