:root {
  color-scheme: light;
  --cream: #f8edd8;
  --ink: #241a15;
  --red: #ad2622;
  --line: #b99d83;
  --wash: #f0dcc0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
p, dl, ol { margin: 0; }
p, li, dd { line-height: 1.75; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--red); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
code { font: .95em "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.wrap { width: min(calc(100% - 72px), 1180px); margin-inline: auto; }
.skip { position: absolute; inset: 0 auto auto 14px; transform: translateY(-150%); background: white; z-index: 5; padding: 8px; }
.skip:focus { transform: translateY(0); }
.mast { border-bottom: 2px solid var(--ink); }
.mast-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; min-height: 64px; }
.wordmark { text-decoration: none; color: var(--ink); font-size: 1.55rem; font-weight: 900; letter-spacing: -.055em; }
.wordmark span { font-size: .7rem; color: var(--red); margin-left: 12px; letter-spacing: 0; }
.mast nav, .foot nav, .related, .breadcrumbs { display: flex; gap: 16px; flex-wrap: wrap; }
.mast nav a, .foot nav a { color: inherit; font-weight: 700; text-decoration: none; font-size: .86rem; }
.start-grid { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.25fr); align-items: center; gap: 34px; padding-block: 38px; }
.start-copy h1 { font-size: clamp(2.6rem, 5.4vw, 5.1rem); font-weight: 950; letter-spacing: -.07em; margin-block: 10px 18px; }
.scope { color: var(--red); font-size: .91rem; font-weight: 800; }
.devices { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.devices a { padding: 8px 12px; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); text-decoration: none; font-size: .88rem; font-weight: 800; }
.devices a:hover { color: var(--cream); background: var(--red); border-color: var(--red); }
.race-panel { position: relative; isolation: isolate; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--red); overflow: clip; }
.race-panel img { display: block; width: 100%; height: auto; }
.speed { pointer-events: none; position: absolute; inset: auto 0 5% 0; height: 12%; background: repeating-linear-gradient(0deg, transparent 0 13px, #f8edd885 14px 15px, transparent 16px 19px); opacity: .8; transform: translateX(-100%) skewX(-28deg); }
.race-nav { background: var(--ink); color: var(--cream); border-block: 3px solid var(--red); }
.race-nav .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.race-nav a { color: inherit; text-decoration: none; font-weight: 780; padding: 13px 8px; text-align: center; border-right: 1px solid #ffffff38; }
.race-nav a:first-child { border-left: 1px solid #ffffff38; }
.race-nav a:hover { background: #553328; }
.race-nav a:focus-visible { outline-color: var(--cream); outline-offset: -4px; }
.track { max-width: 960px; padding-block: 25px 34px; }
.checkpoint { position: relative; display: grid; grid-template-columns: 180px minmax(0,1fr); align-items: center; gap: 28px; min-height: 155px; border-bottom: 1px dashed var(--line); padding: 16px 14px; scroll-margin-top: 18px; }
.checkpoint::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); transform-origin: top; transform: scaleY(0); }
.checkpoint h2, .guide-band h2 { font-size: clamp(1.35rem, 3.4vw, 2.4rem); margin-bottom: 7px; }
.checkpoint p { margin-bottom: 6px; }
.spot { width: 140px; aspect-ratio: 1; background-image: url('/assets/pit-tools.webp'); background-size: 300% 100%; justify-self: center; }
.toolbox { background-position: center; }
.helmet { background-position: right; }
.guide-band { background: var(--wash); padding: 25px 0 34px; }
.guide-band .wrap { max-width: 960px; }
.guide-index { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.guide-entry { padding: 14px 0; border-top: 2px solid var(--ink); }
.guide-entry h3 { font-size: 1.07rem; }
.guide-entry p { font-size: .91rem; margin-top: 7px; }
.foot { border-top: 2px solid var(--ink); }
.footer-inner { padding-block: 18px; flex-wrap: wrap; font-size: .84rem; }
.inner, .article-shell { max-width: 770px; padding-block: 40px 55px; }
.page-head h1 { font-size: clamp(2.02rem,5vw,3.5rem); letter-spacing: -.05em; }
.page-head p { margin-top: 10px; }
.inner section, .guide-body section { margin-top: 27px; scroll-margin: 14px; }
.inner h2, .guide-body h2 { font-size: 1.38rem; margin-bottom: 8px; }
.source, .filename, .diagnostics { background: var(--wash); padding: 12px 15px; border-left: 4px solid var(--red); }
.filename { margin-top: 7px; }
.package h2 span { font-size: .7em; margin-left: 12px; color: var(--red); }
.related { margin-top: 24px; }
.breadcrumbs { font-size: .88rem; margin-bottom: 22px; }
.article-date { margin-top: 13px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: .85rem; }
.diagnostics dt { font-weight: 820; }
.diagnostics dd { margin: 0 0 10px; }
.diagnostics dd:last-child { margin-bottom: 0; }
.diagnostics div + div { margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .racing .speed { animation: pass 620ms cubic-bezier(.18,.62,.55,1) 1; }
  .checkpoint.passed::before { transition: transform 460ms ease-out; transform: scaleY(1); }
  .checkpoint.passed .spot { animation: slide-in 440ms cubic-bezier(.2,.7,.3,1) 1; }
  @keyframes pass { from { transform: translateX(-102%) skewX(-28deg); } to { transform: translateX(105%) skewX(-28deg); } }
  @keyframes slide-in { from { transform: translateX(-14px) rotate(-3deg); } to { transform: none; } }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 34px); }
  .mast-inner { min-height: 55px; }
  .wordmark { font-size: 1.36rem; }
  .wordmark span { display: none; }
  .mast nav { gap: 10px; }
  .mast nav a { font-size: .78rem; }
  .start-grid { grid-template-columns: 1fr; gap: 18px; padding-block: 23px 27px; }
  .start-copy h1 { font-size: clamp(2.55rem, 11vw, 4.1rem); margin-block: 6px 10px; }
  .race-panel { box-shadow: 4px 4px 0 var(--red); }
  .devices { margin-top: 13px; gap: 6px; }
  .devices a { padding: 6px 9px; font-size: .8rem; }
  .race-nav a { padding: 11px 3px; font-size: .84rem; }
  .checkpoint { grid-template-columns: 80px minmax(0,1fr); gap: 10px; min-height: 135px; padding-inline: 8px 2px; }
  .spot { width: 80px; }
  .checkpoint p { font-size: .93rem; }
  .guide-index { grid-template-columns: 1fr; gap: 6px; }
  .inner, .article-shell { padding-block: 27px 42px; }
}
