/* Quant roadmap: docs layout (sidebar · article · on-this-page) on top of the shared theme in styles.css. */

html.guide-root,
html.guide-root body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  overflow-x: clip;
}

html.guide-root {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

:root {
  --serif: "Iowan Old Style", "Source Serif 4", Palatino, "Palatino Linotype", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, ui-monospace, monospace;
  --panel: #0e0e10;
  --panel-2: #141417;
  --side: #0b0b0d;
  --pill: rgba(236, 231, 220, 0.07);
  --line-strong: rgba(236, 231, 220, 0.22);
  --accent-soft: rgba(216, 255, 230, 0.07);
  --accent-line: rgba(216, 255, 230, 0.3);
  --warm: #ffb27a;
  --warm-soft: rgba(255, 178, 122, 0.08);
  --bad: #ff7a7a;
  --good: #8dffb8;
  --topbar-h: 60px;
  --radius: 10px;
}

html.light {
  --panel: #efe9dc;
  --panel-2: #e8e1d2;
  --side: #efe9dc;
  --pill: rgba(28, 25, 20, 0.07);
  --line-strong: rgba(28, 25, 20, 0.22);
  --accent-soft: rgba(11, 107, 74, 0.07);
  --accent-line: rgba(11, 107, 74, 0.32);
  --warm: #b4541a;
  --warm-soft: rgba(180, 84, 26, 0.08);
  --bad: #b3261e;
  --good: #0b6b4a;
}

body.guide {
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */

.g-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg-page) 90%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.g-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.g-brand svg {
  color: var(--accent);
}

.g-links {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
}

.g-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease-out;
}

.g-links a:hover {
  color: var(--ink);
}

.g-links a.active {
  color: var(--ink);
}

.g-links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}

.g-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.g-top .hud-btn {
  opacity: 1;
  pointer-events: auto;
  min-height: 34px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 500;
  padding: 6px 14px;
}

#nav-toggle {
  display: none;
  padding: 6px 10px;
}

.g-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 80ms linear;
}

/* ---------- Layout ---------- */

.g-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 240px;
  align-items: start;
}

.g-nav,
.g-toc {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.g-nav {
  min-height: calc(100vh - var(--topbar-h));
  padding: 22px 18px 40px 20px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.g-nav-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.g-nav a {
  display: block;
  margin: 0 0 2px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  text-decoration: none;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

.g-nav a:hover {
  color: var(--ink);
}

.g-nav a.active {
  color: var(--accent);
  background: var(--pill);
}

.g-toc {
  padding: 40px 20px 40px 8px;
}

.g-toc p {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.g-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-toc a {
  display: block;
  padding: 5px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-toc a:hover {
  color: var(--ink);
}

.g-toc a.active {
  color: var(--accent);
}

/* ---------- Article ---------- */

.g-main {
  min-width: 0;
  padding: 64px 56px 120px;
}

.article {
  max-width: 680px;
  margin: 0 auto;
}

.chapter {
  margin-bottom: 72px;
}

.chapter + .chapter {
  border-top: 1px solid var(--line);
  padding-top: 64px;
}

.article h1 {
  margin: 0 0 30px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.6vw, 3.55rem);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.article h2 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink);
}

.article h3 {
  margin: 48px 0 18px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.article h4 {
  margin: 28px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.article p,
.article li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.article p {
  margin: 0 0 18px;
}

.article .lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}

.article ul,
.article ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article li {
  margin: 0 0 6px;
  padding-left: 2px;
}

.article li::marker {
  color: var(--accent);
}

.article strong {
  color: var(--ink);
  font-weight: 600;
}

.article a {
  color: var(--accent);
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article ul.refs li {
  margin-bottom: 8px;
}

.article :not(pre) > code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.84em;
  color: var(--ink);
}

/* Learning paths */
.paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 10px;
}

.article a.path {
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-soft);
  transition: border-color 120ms ease-out;
}

.article a.path:hover {
  border-color: var(--accent-line);
  text-decoration: none;
}

.path b {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
}

.path span {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ---------- Components ---------- */

.callout {
  margin: 28px 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

.callout .callout-t {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.callout.warn {
  border-left-color: var(--warm);
  background: var(--warm-soft);
}

.callout.warn .callout-t {
  color: var(--warm);
}

.callout p,
.callout li {
  font-size: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 22px 0 28px;
}

.card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card h5 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
}

.card .tag {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.card p,
.card li {
  font-size: 14.5px;
  line-height: 1.55;
}

.card p:last-child {
  margin-bottom: 0;
}

.card ul {
  margin: 0;
  padding-left: 18px;
}

.tbl-wrap {
  margin: 22px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.article th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.article td {
  padding: 11px 14px;
  vertical-align: top;
  line-height: 1.5;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.article tr:last-child td {
  border-bottom: 0;
}

.article td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.article td.mono,
.article td code {
  font-family: var(--mono);
  font-size: 12.5px;
}

.eqn {
  margin: 20px 0 24px;
  padding: 16px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.eqn .katex-display {
  margin: 0;
}

.eqn .cap {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

.article .katex {
  color: var(--ink);
  font-size: 1.06em;
}

.code {
  position: relative;
  margin: 22px 0 28px;
  border: 1px solid rgba(216, 255, 230, 0.12);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}

.code .code-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(216, 255, 230, 0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(216, 255, 230, 0.55);
}

.code pre {
  border: 0;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  tab-size: 4;
}

.code .copy {
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--code-ink);
  background: var(--copy-bg);
  border: 1px solid rgba(216, 255, 230, 0.18);
  cursor: pointer;
}

.code .copy:hover {
  color: #fff;
}

.code .c {
  color: rgba(216, 255, 230, 0.45);
}

.code .k {
  color: #ffc58f;
}

.code .s {
  color: #a8e6ff;
}

figure.fig {
  margin: 30px 0 34px;
}

.fig-body {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-x: auto;
}

.fig-body svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 560px;
}

figure.fig figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}

figure.fig figcaption b {
  color: var(--ink);
  font-weight: 600;
}

svg .bx {
  fill: var(--bg-page);
  stroke: var(--line-strong);
  stroke-width: 1;
}

svg .bx-a {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.2;
}

svg .bx-w {
  fill: var(--warm-soft);
  stroke: var(--warm);
  stroke-width: 1.2;
}

svg .ln {
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 1.2;
}

svg .ln-a {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}

svg .ln-w {
  fill: none;
  stroke: var(--warm);
  stroke-width: 1.4;
}

svg .dash {
  stroke-dasharray: 4 4;
}

svg .t {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
}

svg .t-s {
  fill: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9.6px;
  letter-spacing: 0;
}

svg .t-m {
  fill: var(--ink-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

svg .t-a {
  fill: var(--accent);
}

svg .t-w {
  fill: var(--warm);
}

svg .f-a {
  fill: var(--accent);
}

svg .f-w {
  fill: var(--warm);
}

svg .f-b {
  fill: var(--bad);
}

svg .f-g {
  fill: var(--good);
}

svg .f-dim {
  fill: var(--line-strong);
}

/* Interactive labs */
.lab {
  margin: 30px 0 34px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.lab-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.lab-h span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.lab canvas {
  display: block;
  width: 100%;
  height: 300px;
  cursor: default;
}

.lab-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-muted);
}

.lab-controls label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lab-controls output {
  min-width: 46px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.lab-controls input[type="range"] {
  width: 150px;
  accent-color: var(--accent);
}

.lab-btn {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.lab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article .lab-readout {
  margin: 0;
  padding: 0 16px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.lab-readout b {
  color: var(--accent);
  font-weight: 600;
}

.lab-readout .bad {
  color: var(--bad);
}

/* Numbered steps */
.steps {
  counter-reset: step;
  margin: 24px 0 30px;
  padding: 0;
  list-style: none;
}

.article .steps > li {
  position: relative;
  margin: 0 0 20px;
  padding-left: 44px;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.steps > li > b:first-child {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

details.reveal {
  margin: 16px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

details.reveal summary {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

details.reveal summary::-webkit-details-marker {
  display: none;
}

details.reveal summary::before {
  content: "+ ";
}

details.reveal[open] summary::before {
  content: "− ";
}

details.reveal > div {
  padding: 0 18px 8px;
}

/* Resource list */
.res {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.article .res li {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
}

.res li::marker {
  content: "";
}

.res li > span {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  color: var(--ink-muted);
}

.res li > small {
  float: right;
  margin: 3px 0 0 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 44px;
}

.next a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
}

.next a span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-dim);
}

.next a:hover {
  border-color: var(--accent-line);
  text-decoration: none;
}

.g-foot {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-dim);
}

.g-foot a {
  color: var(--ink-muted);
}

.g-scrim {
  display: none;
}

/* ---------- Opening curriculum ---------- */

.landing {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 28px 36px;
}

.dash {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(340px, 1.15fr) minmax(290px, 1fr);
  gap: 28px 22px;
  align-items: center;
}

.intro h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 2.7vw, 2.85rem);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.intro h1 span {
  display: block;
  white-space: nowrap;
}

.intro h1 span + span {
  margin-top: 0.28em;
}

.landing .standfirst {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.landing .standfirst a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.landing .standfirst a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet-label {
  margin: 12px 4px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.board {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}

.board-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.board-h .dots,
.kit-top .dots {
  display: inline-flex;
  gap: 5px;
}

.board-h .dots i,
.kit-top .dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.board-h .dots i:first-child,
.kit-top .dots i:first-child {
  background: var(--accent);
}

.board-h a {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
  text-decoration: none;
}

.board-h a:hover {
  color: var(--accent);
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 10px;
}

a.mod {
  display: grid;
  grid-template-columns: 38px 26px 1fr 14px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-page);
  color: inherit;
  text-decoration: none;
}

a.mod:hover {
  border-color: var(--accent-line);
  text-decoration: none;
}

.mod .rn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.mod .ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pill);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
}

.mod b {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.mod small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-muted);
}

.mod .go {
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

a.tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

a.tile:hover {
  border-color: var(--accent-line);
  text-decoration: none;
}

.tile i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--pill);
  color: var(--ink-muted);
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
}

.sheets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

a.sheet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

a.sheet span {
  color: var(--ink-dim);
  font-weight: 400;
  font-size: 12px;
}

a.sheet:hover {
  border-color: var(--accent-line);
  text-decoration: none;
}

.atlas {
  grid-column: 1 / -1;
  padding: 14px 16px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
}

.atlas-svg {
  display: block;
  width: 100%;
  height: auto;
}

.atlas-svg .edge {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.atlas-svg .region {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--ink-muted);
}

.atlas-svg a .hit {
  fill: transparent;
}

.atlas-svg a .dot {
  fill: var(--accent);
}

.atlas-svg a.topic .dot {
  opacity: 0.72;
}

.atlas-svg a.hub .dot {
  stroke: var(--bg-page);
  stroke-width: 1.5;
}

.atlas-svg a.b .dot {
  fill: var(--warm);
}

.atlas-svg a.c .dot {
  fill: #9eb6d6;
}

html.light .atlas-svg a.c .dot {
  fill: #3d5a80;
}

.atlas-svg a text {
  opacity: 0;
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--ink);
}

.atlas-svg a:hover text,
.atlas-svg a:focus text,
.atlas-svg a.on text {
  opacity: 1;
}

.atlas-svg a:hover .dot,
.atlas-svg a:focus .dot,
.atlas-svg a.on .dot {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.atlas-read {
  margin: 4px 2px 0;
  min-height: 1.3em;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.article {
  margin-top: 64px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .g-shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .g-toc {
    display: none;
  }

  .g-main {
    padding: 52px 44px 100px;
  }
}

@media (max-width: 900px) {
  .g-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  #nav-toggle {
    display: inline-flex;
  }

  .g-links {
    display: none;
  }

  .g-nav {
    position: fixed;
    z-index: 30;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    max-height: none;
    min-height: 0;
    transform: translateX(-102%);
    transition: transform 220ms ease-out;
  }

  body.nav-open .g-nav {
    transform: none;
  }

  body.nav-open .g-scrim {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.45);
  }

  .g-main {
    padding: 36px 20px 80px;
  }

  .paths,
  .boards,
  .tiles {
    grid-template-columns: 1fr;
  }

  .landing {
    padding: 28px 16px 0;
  }

  .dash {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .intro h1 {
    font-size: clamp(2.4rem, 8vw, 3rem);
  }
}

@media (max-width: 640px) {
  .g-top {
    gap: 12px;
    padding: 0 12px;
  }

  .article p,
  .article li {
    font-size: 15.5px;
  }

  .article h3 {
    font-size: 1.55rem;
  }

  .next {
    grid-template-columns: 1fr;
  }

  .lab canvas {
    height: 240px;
  }

  .code pre {
    padding: 14px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.guide-root {
    scroll-behavior: auto;
  }
}
