/* AB Racing Line — the user guide's one stylesheet: the guide's front page (/racingline/guide)
   and every topic page under /racingline/guide/. One file, so every page looks and behaves
   the same and a change is made once. Built 2026-10-11 from the old manual template (the
   Race Strategy deep guide it replaced): same palette, same Audiowide headings. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #99cc00;
  --green-hi:#c8ff2e;
  --pink:    #ff2d8e;   /* the guide's marker pink: the numbers drawn on the pictures */
  --cyan:    #00e5ff;
  --amber:   #f5a623;
  --yellow:  #ffd23f;
  --purple:  #b18cff;
  --red:     #ff5555;
  --bg:      #07070d;
  --bg2:     #0d0d1a;
  --card:    #0e0f18;
  --card-hi: #141626;
  --txt:     #ffffff;
  --txt-dim: #c2cad4;
  --txt-mute:#8b93a1;
  --line:    #1a1c26;
  --line-hi: #2a2f42;
  --radius:  12px;
  --mono:    'JetBrains Mono', 'Courier New', monospace;
  --display: 'Audiowide', Arial, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
/* height:auto, or a picture's own height="" (there to hold its space while it loads) is
   taken literally and the picture is squashed when the column is narrower than it */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--txt); }

/* ── NAV ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,7,13,0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex; align-items: center;
  padding: 0 28px; height: 60px; gap: 18px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 13px; color: var(--txt);
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo img { width: 30px; height: 30px; object-fit: contain; }
.nav-sep { width: 1px; height: 22px; background: var(--line-hi); flex-shrink: 0; }
.nav-crumbs {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--txt-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-crumbs a { color: var(--txt-mute); }
.nav-crumbs a:hover { color: var(--green); text-decoration: none; }
.nav-crumbs span { color: var(--txt-dim); }
.nav-right { margin-left: auto; display: flex; gap: 18px; flex-shrink: 0; }
.nav-right a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--txt-dim);
}
.nav-right a:hover { color: var(--green); text-decoration: none; }

/* ── BUTTONS + SMALL PARTS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 14px; letter-spacing: 0.04em;
  padding: 13px 22px; border-radius: 10px;
  border: 1px solid var(--line-hi); color: var(--txt); background: var(--card);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--green); transform: translateY(-1px); }
.btn.primary {
  background: var(--green); color: #0a0d02; border-color: var(--green);
  box-shadow: 0 0 0 0 rgba(153,204,0,0);
}
.btn.primary:hover { background: var(--green-hi); box-shadow: 0 6px 28px rgba(153,204,0,0.30); }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 5px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
  white-space: nowrap; vertical-align: 1px;
}
.chip.green  { color: var(--green);  background: rgba(153,204,0,0.12); }
.chip.grey   { color: #a9b0ba;       background: rgba(140,140,150,0.16); }
.chip.yellow { color: var(--yellow); background: rgba(255,210,63,0.14); }
.chip.purple { color: var(--purple); background: rgba(177,140,255,0.16); }
.chip.amber  { color: var(--amber);  background: rgba(245,166,35,0.14); }
.chip.pink   { color: var(--pink);   background: rgba(255,45,142,0.14); }
.chip.cyan   { color: var(--cyan);   background: rgba(0,229,255,0.12); }
.chip.purple { color: #c27bff;       background: rgba(194,123,255,0.14); }

/* a number from a picture, written in the text: the same pink circle as on the picture */
.n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--pink); color: #fff; border: 2px solid #fff;
  font: 700 12.5px/1 'Inter', Arial, sans-serif;
  vertical-align: -5px; flex-shrink: 0;
}
kbd {
  font-family: var(--mono); font-size: 13px; color: var(--txt);
  background: var(--card-hi); border: 1px solid var(--line-hi);
  border-bottom-width: 2px; border-radius: 5px; padding: 0 6px;
}
.ui {   /* a word on the app's screen: a button, a tab, a heading */
  font-weight: 600; color: var(--txt);
  border-bottom: 1px dotted rgba(153,204,0,0.55);
}

/* ── THE FRONT PAGE ──────────────────────────────────────────────────────── */
.home-hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(153,204,0,0.14), transparent 60%),
    radial-gradient(700px 320px at 92% 0%, rgba(0,229,255,0.10), transparent 60%);
}
.home-hero-inner {
  max-width: 1240px; margin: 0 auto; padding: 72px 28px 56px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.24em;
  color: var(--green); text-transform: uppercase; margin-bottom: 14px;
}
.home-hero h1 {
  font-family: var(--display); font-size: 46px; line-height: 1.15; margin-bottom: 18px;
}
.home-hero h1 em { font-style: normal; color: var(--green); }
.home-hero .lead { font-size: 18.5px; color: var(--txt-dim); line-height: 1.75; margin-bottom: 28px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.home-shot {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line-hi);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(153,204,0,0.10);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
}
.home-shot img { width: 100%; }

.search {
  position: relative; max-width: 560px; margin-top: 26px;
}
.search input {
  width: 100%; font: 16px 'Inter', Arial, sans-serif; color: var(--txt);
  background: var(--card); border: 1px solid var(--line-hi); border-radius: 12px;
  padding: 15px 18px 15px 48px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--txt-mute); }
.search input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(153,204,0,0.12); }
.search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); }
.search-none { display: none; color: var(--txt-dim); margin: 6px 0 0; font-size: 15.5px; }

.home-main { max-width: 1240px; margin: 0 auto; padding: 18px 28px 90px; }
.group { margin-top: 54px; }
.group-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.group-head h2 { font-family: var(--display); font-size: 25px; }
.group-head p { color: var(--txt-dim); font-size: 15.5px; }
.group-num {
  font-family: var(--mono); font-size: 12px; color: var(--green);
  border: 1px solid rgba(153,204,0,0.35); border-radius: 6px; padding: 2px 8px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--txt);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: rgba(153,204,0,0.55); box-shadow: 0 14px 40px rgba(0,0,0,0.45);
}
.card-pic { aspect-ratio: 16 / 9.5; overflow: hidden; background: #050508; border-bottom: 1px solid var(--line); }
.card-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .35s; }
.card-pic.icon {   /* a topic with no screen of its own: an icon on the card instead */
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(153,204,0,0.12), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(0,229,255,0.10), transparent 55%), #08080f;
}
.card-pic.icon svg { transition: transform .35s; }
.card:hover .card-pic.icon svg { transform: scale(1.08); }
.card:hover .card-pic img { transform: scale(1.04); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--txt-mute); }
.card-title { font-family: var(--display); font-size: 17px; line-height: 1.3; }
.card-desc { color: var(--txt-dim); font-size: 14.5px; line-height: 1.6; }
.card-meta { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--green); letter-spacing: 0.06em; }
.card.tutorial .card-kicker { color: var(--cyan); }
.card.deep .card-kicker { color: var(--purple); }

/* ── A TOPIC PAGE ────────────────────────────────────────────────────────── */
.page { max-width: 1320px; margin: 0 auto; padding: 0 28px 100px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 54px; }
.side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-top: 40px; }
.side-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--txt-mute); margin-bottom: 12px; }
.toc-side { list-style: none; border-left: 1px solid var(--line-hi); }
.toc-side li { margin: 0; }
.toc-side a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--txt-dim); font-size: 14.5px; line-height: 1.45;
}
.toc-side a:hover { color: var(--txt); text-decoration: none; }
.toc-side a.active { color: var(--green); border-left-color: var(--green); }
.toc-side .sub a { padding-left: 30px; font-size: 13.5px; color: var(--txt-mute); }
.toc-side .sub a.active { color: var(--green); }
.side-back { display: inline-block; margin-top: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }

.article { min-width: 0; padding-top: 40px; }
.article > p, .article > ul, .article > ol, .article section > p,
.article section > ul, .article section > ol, .lead-box, .tldr { max-width: 820px; }

.page-hero { margin-bottom: 34px; }
.page-hero h1 { font-family: var(--display); font-size: 42px; line-height: 1.2; margin-bottom: 16px; }
.page-hero .lead { font-size: 18.5px; color: var(--txt-dim); line-height: 1.75; max-width: 860px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.fact {
  font-size: 13.5px; color: var(--txt-dim); background: var(--card);
  border: 1px solid var(--line-hi); border-radius: 999px; padding: 5px 14px;
}
.fact b { color: var(--txt); font-weight: 600; }

.tldr {
  background: linear-gradient(135deg, rgba(153,204,0,0.10), rgba(0,229,255,0.05));
  border: 1px solid rgba(153,204,0,0.30); border-radius: var(--radius);
  padding: 20px 24px; margin: 28px 0 8px;
}
.tldr-title { font-family: var(--display); font-size: 15px; color: var(--green); margin-bottom: 8px; letter-spacing: 0.04em; }
.tldr ol, .tldr ul { margin: 0; padding-left: 20px; }
.tldr li { color: var(--txt); font-size: 16px; margin-bottom: 6px; }

h2.sec {
  font-family: var(--display); font-size: 27px; line-height: 1.3;
  margin: 70px 0 16px; padding-top: 22px; border-top: 1px solid var(--line);
}
h2.sec .k { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.22em; color: var(--green); text-transform: uppercase; margin-bottom: 8px; }
h3.sub { font-family: var(--display); font-size: 19px; color: var(--green); margin: 40px 0 12px; letter-spacing: 0.02em; }
.article p { color: var(--txt-dim); margin-bottom: 16px; line-height: 1.8; }
.article li { color: var(--txt-dim); line-height: 1.75; margin-bottom: 8px; }
.article ul, .article ol { padding-left: 22px; margin-bottom: 16px; }

/* a picture, click to see it full size */
.fig { margin: 22px 0 30px; }
.fig img {
  width: 100%; border-radius: 10px; border: 1px solid var(--line-hi);
  background: #050508; cursor: zoom-in;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.fig.narrow { max-width: 460px; }
.fig.mid { max-width: 680px; }
.fig figcaption {
  font-size: 14px; color: var(--txt-mute); margin-top: 10px; line-height: 1.55;
}
.fig figcaption b { color: var(--txt-dim); font-weight: 600; }

/* a picture with its numbers explained beside it */
.annotated {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 30px; align-items: start; margin: 24px 0 34px;
}
.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); }

/* a very tall picture: the top of it on the page, all of it on a click */
.fig.tall .crop { position: relative; max-height: 860px; overflow: hidden; border-radius: 10px; }
.fig.tall .crop::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px;
  background: linear-gradient(rgba(7,7,13,0), var(--bg)); pointer-events: none;
}
.annotated .fig { margin: 0; }
.annotated .legend { position: sticky; top: 84px; }

ol.legend { list-style: none; padding: 0; margin: 0; }
ol.legend > li {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0;
  color: var(--txt-dim); font-size: 15.5px; line-height: 1.65;
}
ol.legend > li:last-child { border-bottom: none; }
ol.legend > li > .n { margin-top: 2px; }
ol.legend > li b { color: var(--txt); font-weight: 600; display: block; margin-bottom: 2px; }
/* under a full-width picture: the numbers side by side */
ol.legend.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-top: 4px; }
ol.legend.cols > li { border-bottom: none; }

/* numbered steps: do this, then this */
.steps { counter-reset: step; margin: 26px 0 10px; }
.step {
  position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 22px;
  padding-bottom: 34px;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  font-family: var(--display); font-size: 19px; color: #0a0d02; background: var(--green);
  box-shadow: 0 0 0 6px rgba(153,204,0,0.12);
}
.step::after {   /* the line down to the next step */
  content: ""; position: absolute; left: 22px; top: 54px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--line-hi), transparent);
}
.step:last-child::after { display: none; }
.step h3 { font-family: var(--display); font-size: 19px; line-height: 1.35; margin: 8px 0 8px; color: var(--txt); }
.step p { max-width: 780px; }
.step .fig { margin: 16px 0 6px; }

.callout {
  border-left: 3px solid var(--green); background: rgba(153,204,0,0.06);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 20px 0;
  color: var(--txt-dim); font-size: 15.5px; line-height: 1.7; max-width: 820px;
}
.callout strong:first-child { color: var(--green); }
.callout.tip    { border-left-color: var(--cyan);  background: rgba(0,229,255,0.06); }
.callout.tip strong:first-child { color: var(--cyan); }
.callout.warn   { border-left-color: var(--amber); background: rgba(245,166,35,0.07); }
.callout.warn strong:first-child { color: var(--amber); }

/* the marks reference: a chip and what it means */
.marks { list-style: none; padding: 0 !important; margin: 14px 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 34px; }
.marks li { margin: 0; font-size: 15px; line-height: 1.6; padding: 10px 0; border-bottom: 1px solid var(--line); }
.marks .chip { margin-right: 10px; }

/* questions */
details.q { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin: 10px 0; max-width: 860px; }
details.q summary {
  cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 600; color: var(--txt);
  display: flex; justify-content: space-between; gap: 14px;
}
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(--txt-dim); line-height: 1.75; }

/* where to go next */
.next { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 0; }
.next a {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; color: var(--txt); transition: border-color .15s, transform .15s;
}
.next a:hover { text-decoration: none; border-color: var(--green); transform: translateY(-2px); }
.next small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--txt-mute); margin-bottom: 4px; }
.next span { font-family: var(--display); font-size: 15.5px; }

/* the contents box at the top of a page, for phones (the sidebar is hidden there) */
details.toc-mobile { display: none; border: 1px solid var(--line-hi); border-radius: 10px; background: var(--card); margin: 18px 0 0; }
details.toc-mobile summary { cursor: pointer; padding: 12px 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--txt-dim); }
details.toc-mobile ol { padding: 0 16px 14px 34px; margin: 0; }
details.toc-mobile li { margin-bottom: 6px; font-size: 15px; }

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

footer.foot {
  border-top: 1px solid var(--line); padding: 28px; text-align: center;
  font-size: 13px; color: var(--txt-mute);
}
footer.foot a { color: var(--txt-dim); }

/* ── NARROWER SCREENS ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .home-hero-inner { grid-template-columns: 1fr; padding-top: 52px; }
  .home-shot { transform: none; }
  .page { grid-template-columns: 1fr; gap: 0; }
  .side { display: none; }
  details.toc-mobile { display: block; }
  .annotated, .annotated.wide-pic, .annotated.narrow-pic, .annotated.half { grid-template-columns: 1fr; }
  .annotated .legend { position: static; }
  ol.legend.cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav { padding: 0 16px; gap: 12px; }
  .nav-crumbs { display: none; }
  .nav-sep { display: none; }
  .home-hero-inner { padding: 40px 16px 40px; gap: 28px; }
  .home-hero h1 { font-size: 32px; }
  .home-main, .page { padding-left: 16px; padding-right: 16px; }
  .page-hero h1 { font-size: 31px; }
  h2.sec { font-size: 23px; margin-top: 54px; }
  .step { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
  .step::before { width: 38px; height: 38px; font-size: 16px; }
  .step::after { left: 18px; top: 46px; }
  .marks { grid-template-columns: 1fr; }
  .lightbox { padding: 10px; }
}
