/* Rust.camp · Rules page. Tokens from /css/tokens.css; no inline styles (CSP). */
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/roboto-condensed-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: optional; src: url("/fonts/inter-latin.woff2") format("woff2"); }
:root { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--rc-bg); color: var(--rc-ink); font-family: var(--rc-font-text); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2 { font-family: var(--rc-font-display); font-weight: 800; margin: 0; line-height: 1.1; }
p { margin: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--rc-ember); color: var(--rc-ember-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--rc-ember); outline-offset: 2px; }
.muted { color: var(--rc-ink-3); } .small { font-size: 13px; }
.rwrap { width: min(100% - 2 * var(--rc-gutter), 1120px); margin-inline: auto; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--rc-ember); margin-bottom: 8px; }
.rc-mark { width: 24px; height: 24px; color: var(--rc-ink); flex: 0 0 auto; }
.rc-mark__dot, .dot { fill: var(--rc-ember); color: var(--rc-ember); }
/* header */
.rnav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--rc-bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--rc-line); }
.rnav__in { display: flex; align-items: center; gap: 16px; height: 60px; }
.rbrand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.rbrand__w { font-family: var(--rc-font-display); font-weight: 800; font-size: 20px; letter-spacing: var(--rc-track-wordmark); }
.rbrand__sep { width: 1px; height: 18px; background: var(--rc-line-2); }
.rbrand__p { font-family: var(--rc-font-display); font-weight: 700; font-size: 14px; letter-spacing: var(--rc-track-display); color: var(--rc-ink-2); }
.rnav__links { display: flex; gap: 18px; margin-left: auto; font-size: 14px; color: var(--rc-ink-2); }
.rnav__links a { text-decoration: none; padding: 6px 0; display: inline-block; }
.rnav__links a:hover, .rnav__links a[aria-current] { color: var(--rc-ink); }
.rnav__links a[aria-current] { box-shadow: inset 0 -2px 0 var(--rc-ember); }
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px; border-radius: 999px; border: 1px solid var(--rc-line); font-size: 12px; font-weight: 600; color: var(--rc-ink-3); }
.lang button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 5px 6px; border-radius: 999px; }
.lang button[aria-pressed="true"] { color: var(--rc-ink); }
@media (max-width: 560px) { .rbrand__sep, .rbrand__p { display: none; } .rnav__links { gap: 12px; } .rnav__links a:first-child { display: none; } .rnav__in { gap: 10px; } }
/* page */
.rmain { padding: 36px 0 64px; }
.rhead { margin-bottom: 28px; max-width: 760px; }
.rhead h1 { font-size: clamp(34px, 5vw, 52px); }
.lede { margin-top: 10px; color: var(--rc-ink-2); font-size: 17px; }
.stand { margin-top: 8px; font-size: 13px; color: var(--rc-ink-3); }
.rgrid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .rgrid { grid-template-columns: 220px minmax(0, 1fr); } .toc { position: sticky; top: 84px; } }
.toc { padding: 16px; border-radius: var(--rc-radius); border: 1px solid var(--rc-line); background: var(--rc-glass); }
.toc__t { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rc-ink-3); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--rc-ink-2); }
@media (max-width: 959px) { .toc ol { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 18px; } }
.toc a { text-decoration: none; } .toc a:hover { color: var(--rc-ember-2); }
.rules { display: grid; min-width: 0; counter-reset: sec; }
.rcard { padding: 26px 0 28px; border-top: 1px solid var(--rc-line-2); scroll-margin-top: 80px; min-width: 0; counter-increment: sec; }
.rcard:first-child { border-top: 0; padding-top: 4px; }
.rcard:target h2 { color: var(--rc-ember-2); }
.rcard h2 { display: flex; align-items: center; gap: 12px; font-size: 24px; margin-bottom: 12px; }
.n { min-width: 1.4em; color: var(--rc-ink-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.rlist { margin: 0; padding-left: 0; display: grid; gap: 10px; color: var(--rc-ink-2); max-width: 64ch; list-style: none; counter-reset: item; }
.rlist li { position: relative; padding-left: 3.2em; counter-increment: item; text-wrap: pretty; }
.rlist li::before { content: counter(sec) "." counter(item); position: absolute; left: 0; top: 0; font-family: var(--rc-font-display); font-weight: 700; color: var(--rc-ink-3); font-variant-numeric: tabular-nums; }
.rp { color: var(--rc-ink-2); margin-top: 8px; max-width: 64ch; text-wrap: pretty; }
.rp:first-of-type { margin-top: 0; }
.tbl-wrap { overflow-x: auto; margin-top: 12px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rc-ink-3); padding: 8px 10px; border-bottom: 1px solid var(--rc-line-2); }
.rtable td { padding: 9px 10px; border-bottom: 1px solid var(--rc-line); vertical-align: top; }
.rtable tr:nth-child(even) td { background: color-mix(in srgb, var(--rc-white) 2%, transparent); }
.rtable td:first-child { color: var(--rc-ink); font-weight: 500; }
.rtable td:last-child { color: var(--rc-ink-2); }
.rfoot { border-top: 1px solid var(--rc-line); padding: 26px 0; }
.rfoot__in { display: grid; gap: 10px; }
.rfoot nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--rc-ink-2); }
.rfoot nav a { display: inline-block; padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (max-width: 400px) { .rnav__links { gap: 10px; font-size: 13px; } .rnav__links a[aria-current] { display: none; } .lang { padding: 2px 3px; } .lang button { padding: 5px 4px; } }

/* Browser surfaces in brand colours */
::selection { background: color-mix(in srgb, var(--rc-ember) 35%, transparent); color: var(--rc-ink); }
html { scrollbar-color: var(--rc-scrollbar) var(--rc-bg); accent-color: var(--rc-ember); }
@media (max-width: 380px) { .rbrand__w { font-size: 16px; } .rnav__links { gap: 8px; } .rnav__in { gap: 8px; } }
p, li { text-wrap: pretty; }
.lede { max-width: 62ch; }
