/* AB Racing Line — the user guide's layout: the front page (/racingline/guide) and every
   topic page under /racingline/guide/. It sits on /racingline/assets/site.css, which holds the
   app's colours, fonts and shared pieces (2026-10-26: the guide in the app's own look, from
   the approved board https://claude.ai/artifact/TARFiVQv5i3QnuPB1PCsD1). This file keeps
   the class names the page contents use (tools/guide_pages/*.html): .fig, .annotated,
   ol.legend, .n, .tldr, .steps/.step, .callout, .chip, .ui, kbd, .marks, details.q,
   h2.sec .k, h3.sub, .facts, .next. */

/* the marker pink: the numbers drawn on the pictures (tools/capture_*.py), so a number in
   the text is the same circle as the one on the picture */
:root { --marker: #ff2d8e; --purple: #c27bff; --yellow: #ffd23f; }

img { height: auto; }
strong { color: var(--text); }

/* ── header: the site's mark, where you are, search ─────────────────── */
.gh { position: sticky; top: 0; z-index: 50; background: var(--bar); border-bottom: 1px solid var(--line); }
.gh-in { padding: 8px 24px; min-height: 68px; display: flex; align-items: center; gap: 10px 18px; }
.gh .brand b { font-size: 17px; }
.gh-sep { width: 1px; height: 32px; background: var(--line); flex-shrink: 0; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--label); }
.crumbs a:hover { color: var(--green); }
.crumbs .here { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.gh-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: var(--radius-btn); border: 1px solid var(--line-2); background: var(--bar); margin-left: auto; }
.gh-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(153, 204, 0, 0.18); }
.gh-search input { width: 220px; border: 0; background: transparent; color: var(--text); font-family: var(--sans); font-size: 14px; outline: none; }
.gh-search input::placeholder { color: var(--muted); }
.gh-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--radius-btn); color: var(--body); font-size: 14px; white-space: nowrap; }
.gh-link:hover { color: var(--text); background: var(--row); }
.gh .menu-btn { display: none; }

/* ── a topic page: the guide's menu | the page | on this page ───────── */
.g-page { display: grid; grid-template-columns: 250px minmax(0, 1fr) 230px; align-items: start; }
.g-nav { position: sticky; top: 69px; max-height: calc(100vh - 69px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 18px 10px 28px; background: var(--bar); border-right: 1px solid var(--line); min-height: calc(100vh - 69px); }
.g-nav .grp { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); padding: 14px 12px 6px; }
.g-nav .grp:first-child { padding-top: 6px; }
.g-nav a { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: var(--radius-btn); color: var(--body); font-size: 14px; line-height: 1.3; }
.g-nav a:hover { background: var(--row); color: var(--text); }
.g-nav a[aria-current="page"] { background: rgba(153, 204, 0, 0.1); color: var(--green); font-weight: 600; }
.g-nav a svg { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-nav .all { margin-top: 10px; color: var(--green); }

.article { min-width: 0; padding: 36px 40px 64px; max-width: 940px; }
.side { position: sticky; top: 69px; max-height: calc(100vh - 69px); overflow-y: auto; padding: 36px 16px 24px 0; }
.side-title { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); padding: 0 10px 8px; }
.toc-side { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-side a { min-height: 34px; display: flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-btn); color: var(--body); font-size: 14px; line-height: 1.35; }
.toc-side a:hover { background: var(--row); color: var(--text); }
.toc-side a.active { background: rgba(153, 204, 0, 0.1); color: var(--green); font-weight: 600; }

.page-hero { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.page-hero .eyebrow { font-size: 11px; }
.page-hero h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.page-hero .lead { font-size: 19px; line-height: 1.55; max-width: 860px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--chip-line); font-size: 14px; color: var(--body); }
.fact b { color: var(--text); font-weight: 600; }
details.toc-mobile { display: none; border: 1px solid var(--line); border-radius: var(--radius-row); background: var(--card); }
details.toc-mobile summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 16px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
details.toc-mobile ol { margin: 0; padding: 0 16px 14px 34px; }
details.toc-mobile li { margin-bottom: 6px; font-size: 15px; color: var(--body); }

/* the page's own text */
.article p { margin: 0 0 16px; color: var(--body); font-size: 16.5px; line-height: 1.7; max-width: 820px; }
.article li { color: var(--body); font-size: 16px; line-height: 1.65; margin-bottom: 8px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 16px; max-width: 820px; }
h2.sec { margin: 56px 0 16px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 28px; line-height: 1.2; font-weight: 700; scroll-margin-top: 84px; }
h2.sec .k { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--label); text-transform: uppercase; }
h3.sub { margin: 36px 0 12px; font-size: 19px; font-weight: 700; color: var(--text); }

/* small parts in the text */
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; vertical-align: 1px; border: 1px solid transparent; }
.chip.green  { color: var(--green); background: var(--green-soft); border-color: rgba(153, 204, 0, 0.55); }
.chip.grey   { color: var(--body); background: rgba(140, 150, 165, 0.12); border-color: var(--chip-line); }
.chip.yellow { color: var(--yellow); background: rgba(255, 210, 63, 0.12); border-color: rgba(255, 210, 63, 0.5); }
.chip.amber  { color: var(--amber); background: rgba(255, 176, 0, 0.14); border-color: rgba(255, 176, 0, 0.55); }
.chip.pink   { color: #ff6fdc; background: rgba(255, 60, 205, 0.13); border-color: rgba(255, 60, 205, 0.6); }
.chip.cyan   { color: var(--cyan-2); background: rgba(0, 184, 212, 0.1); border-color: rgba(0, 184, 212, 0.55); }
.chip.purple { color: var(--purple); background: rgba(194, 123, 255, 0.13); border-color: rgba(194, 123, 255, 0.55); }
.n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--marker); color: #fff; border: 2px solid #fff; font: 700 12.5px/1 var(--sans); vertical-align: -5px; flex-shrink: 0; }
kbd { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--row); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; }
.ui { font-weight: 600; color: var(--text); border-bottom: 1px dotted rgba(153, 204, 0, 0.6); }

/* "In 30 seconds" */
.tldr { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); margin: 24px 0 8px; max-width: 860px; }
.tldr-title { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.article .tldr ol, .article .tldr ul { list-style: none; margin: 0; padding: 0; counter-reset: tl; display: flex; flex-direction: column; gap: 8px; }
/* the number sits in the padding, so a line can mix words, a .ui label and an (i) freely
   (a flex row would split each of those into its own column) */
.article .tldr li { counter-increment: tl; position: relative; margin: 0; padding: 10px 12px 10px 48px; border-radius: var(--radius-row); background: var(--row); color: var(--text); font-size: 15px; line-height: 1.6; }
.article .tldr ol > li::before { content: counter(tl); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--text); color: var(--page); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.article .tldr ul > li::before { content: ""; position: absolute; left: 21px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* a picture: click to see it full size */
.fig { margin: 22px 0 28px; }
.fig img { width: 100%; display: block; border-radius: var(--radius); border: 1px solid var(--line); background: var(--page); cursor: zoom-in; }
.fig.narrow { max-width: 460px; }
.fig.mid { max-width: 680px; }
.fig figcaption { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--label); }
.fig figcaption b { color: var(--body); font-weight: 600; }
.fig.tall .crop { position: relative; max-height: 860px; overflow: hidden; border-radius: var(--radius); }
.fig.tall .crop::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(rgba(7, 7, 13, 0), var(--page)); pointer-events: none; }

/* a picture with its numbers explained beside it */
.annotated { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; margin: 24px 0 32px; }
.annotated.wide-pic { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.annotated.narrow-pic { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.annotated.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.annotated .fig { margin: 0; }
.annotated .legend { position: sticky; top: 84px; }
.article ol.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: none; }
.article ol.legend > li { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border-radius: var(--radius-row); background: var(--row); color: var(--body); font-size: 15px; line-height: 1.55; }
.article ol.legend > li > .n { margin-top: 1px; }
.article ol.legend > li b { display: block; margin-bottom: 2px; color: var(--text); font-weight: 600; }
.article ol.legend.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 8px; margin-top: 4px; }

/* numbered steps: do this, then this */
.steps { counter-reset: step; margin: 24px 0 8px; }
.step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding-bottom: 30px; }
.step::before { counter-increment: step; content: counter(step); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--text); color: var(--page); font-family: var(--mono); font-size: 16px; font-weight: 700; }
.step::after { content: ""; position: absolute; left: 17px; top: 44px; bottom: 6px; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.step:last-child::after { display: none; }
.step h3 { margin: 4px 0 8px; font-size: 19px; line-height: 1.35; font-weight: 700; color: var(--text); }
.step p { max-width: 780px; }
.step .fig { margin: 16px 0 6px; }

.callout { max-width: 820px; margin: 20px 0; padding: 14px 18px; border-radius: var(--radius-row); background: rgba(153, 204, 0, 0.06); border: 1px solid rgba(153, 204, 0, 0.35); color: var(--body); font-size: 15.5px; line-height: 1.65; }
.callout strong:first-child { color: var(--green); }
.callout.tip { background: rgba(0, 184, 212, 0.07); border-color: rgba(0, 184, 212, 0.45); }
.callout.tip strong:first-child { color: var(--cyan-2); }
.callout.warn { background: rgba(255, 176, 0, 0.07); border-color: rgba(255, 176, 0, 0.5); }
.callout.warn strong:first-child { color: var(--amber); }

/* the marks reference: a chip and what it means */
.article .marks { list-style: none; padding: 0; margin: 14px 0 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 8px; max-width: none; }
.article .marks li { margin: 0; padding: 10px 14px; border-radius: var(--radius-row); background: var(--row); font-size: 15px; line-height: 1.55; }
.marks .chip { margin-right: 10px; }

/* questions */
details.q { max-width: 860px; margin: 8px 0; border-radius: var(--radius-row); background: var(--row); }
details.q summary { cursor: pointer; list-style: none; min-height: 48px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 600; font-size: 16px; color: var(--text); }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; color: var(--green); font-family: var(--mono); font-size: 18px; line-height: 1; }
details.q[open] summary::after { content: "×"; }
details.q > div { padding: 0 18px 14px; color: var(--body); line-height: 1.65; }

/* where to go next */
.next { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 18px 0 0; }
.next a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); }
.next a:hover { border-color: var(--line-2); background: #121522; color: var(--text); }
.next small { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.next span { font-size: 16px; font-weight: 600; }

/* ── the front page ─────────────────────────────────────────────────── */
.home-hero { border-bottom: 1px solid var(--line); }
.home-hero-inner { max-width: 1240px; margin: 0 auto; padding: 56px 24px 48px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.home-hero h1 { margin: 0 0 16px; font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.home-hero h1 em { font-style: normal; color: var(--green); }
.home-hero .lead { font-size: 18px; margin-bottom: 24px; }
.home-hero .eyebrow { margin-bottom: 12px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.home-shot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--page); }
.home-shot img { width: 100%; display: block; }
.search { position: relative; max-width: 560px; margin-top: 24px; }
.search input { width: 100%; height: 50px; padding: 0 16px 0 46px; border-radius: var(--radius-btn); border: 1px solid var(--line-2); background: var(--bar); color: var(--text); font-family: var(--sans); font-size: 16px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(153, 204, 0, 0.18); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
.search-none { display: none; margin: 8px 0 0; font-size: 15px; color: var(--body); }
.home-main { max-width: 1240px; margin: 0 auto; padding: 8px 24px 80px; }
.group { margin-top: 48px; }
.group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; }
.group-head h2 { margin: 0; font-size: 26px; font-weight: 700; }
.group-head p { margin: 0; font-size: 15px; color: var(--body); }
.group-num { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--label); border: 1px solid var(--chip-line); border-radius: 999px; padding: 2px 9px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.topic { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.topic:hover { border-color: var(--line-2); transform: translateY(-2px); color: var(--text); }
.topic-pic { aspect-ratio: 16 / 9.5; overflow: hidden; background: var(--page); border-bottom: 1px solid var(--line); }
.topic-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.topic-pic.icon { display: flex; align-items: center; justify-content: center; background: var(--bar); }
.topic-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.topic-kicker { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.topic.tutorial .topic-kicker { color: var(--cyan-2); }
.topic.deep .topic-kicker { color: var(--purple); }
.topic-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.topic-desc { font-size: 14.5px; line-height: 1.55; color: var(--body); }
@media (prefers-reduced-motion: reduce) { .topic { transition: none; } .topic:hover { transform: none; } }

/* ── the lightbox: any picture, full size ───────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 500; display: none; align-items: flex-start; justify-content: center; overflow: auto; padding: 32px; background: rgba(4, 4, 8, 0.95); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: none; margin: auto; border-radius: var(--radius-btn); border: 1px solid var(--line-2); }
.lightbox-hint { position: fixed; top: 14px; right: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--body); }

/* ── narrower screens ───────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .g-page { grid-template-columns: 240px minmax(0, 1fr); }
  .side { display: none; }
  details.toc-mobile { display: block; }
}
@media (max-width: 1100px) {
  .home-hero-inner { grid-template-columns: 1fr; padding-top: 40px; }
  .annotated, .annotated.wide-pic, .annotated.narrow-pic, .annotated.half { grid-template-columns: 1fr; }
  .annotated .legend { position: static; }
}
@media (max-width: 900px) {
  .g-page { display: block; }
  .g-nav { display: none; position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .g-nav.open { display: flex; }
  .gh .menu-btn { display: inline-flex; }
  .gh-search { display: none; }
  .article { padding: 28px 24px 56px; }
}
@media (max-width: 640px) {
  .gh-in { padding: 8px 12px 8px 16px; min-height: 64px; gap: 8px; }
  .gh-sep, .crumbs, .gh-link.hide-sm { display: none; }
  .gh .menu-btn { margin-left: auto; }
  .article { padding: 22px 16px 48px; }
  .page-hero h1 { font-size: 31px; }
  .page-hero .lead { font-size: 17px; }
  h2.sec { font-size: 23px; margin-top: 44px; }
  .article p { font-size: 16px; }
  .home-hero-inner { padding: 32px 16px 32px; gap: 24px; }
  .home-hero h1 { font-size: 32px; }
  .home-main { padding: 0 16px 56px; }
  .step { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .step::before { width: 30px; height: 30px; font-size: 14px; }
  .step::after { left: 14px; top: 36px; }
  .lightbox { padding: 10px; }
}
