/* Doc pages (kaggle, privacy, terms): the main page's tokens and type, set for reading. */
:root {
  --p-bg: #eef0f3; --p-surface: #e2e5ea; --p-ink: #0b0c0e; --p-muted: #5d6470;
  --p-accent: #1f2de6; --p-accent-ink: #ffffff; --p-action: #1f2de6; --p-action-ink: #ffffff;
  --p-inv-bg: #0b0c0e; --p-inv-surface: #17181a; --p-inv-ink: #eef0f3; --p-inv-muted: #8e8f92;
  --p-inv-accent: #eef0f3; --p-inv-accent-ink: #0b0c0e; --p-inv-action: #eef0f3; --p-inv-action-ink: #0b0c0e;
  --font-display: "Funnel Display", system-ui, sans-serif;
  --font-text: "Funnel Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.03em;
}

.doc-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.doc-nav .wrap { display: flex; align-items: center; gap: var(--s-6); height: 64px; }
.doc-nav__links { display: flex; gap: var(--s-5); margin-left: auto; font-size: var(--t-small); }
.doc-nav__links a { color: var(--muted); white-space: nowrap; }
.doc-nav__links a:hover, .doc-nav__links a[aria-current] { color: var(--ink); }

.doc-head { padding-block: clamp(56px, 8vw, 112px) clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.doc-head h1 { font: var(--display-weight) var(--t-h1)/1.04 var(--font-display); letter-spacing: var(--display-tracking);
  max-width: 16ch; margin: 0 0 var(--s-5); }
.doc-head p { font-size: var(--t-lead); line-height: 1.5; max-width: 60ch; margin: 0; }
.doc-head .facts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); padding: 0; list-style: none; }
.doc-head .facts li { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--t-small); background: var(--p-surface); }
.doc-head .facts b { font-weight: 500; }

.doc-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(48px, 6vw, 88px) clamp(72px, 9vw, 128px); }
.doc-toc { position: sticky; top: 96px; align-self: start; display: grid; gap: var(--s-3); font-size: var(--t-small); }
.doc-toc a { color: var(--muted); padding-left: 12px; border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--ink); border-left-color: var(--accent); }

.doc-text { max-width: 68ch; font-size: 17px; line-height: 1.65; }
.doc-text > section { scroll-margin-top: 96px; padding-bottom: var(--s-8, 56px); }
.doc-text > section + section { padding-top: var(--s-8, 56px); border-top: 1px solid var(--line); }
.doc-text h2 { font: var(--display-weight) var(--t-h2)/1.1 var(--font-display); letter-spacing: var(--display-tracking); margin: 0 0 var(--s-5); }
.doc-text p, .doc-text ul, .doc-text ol { margin: 0 0 var(--s-4); }
.doc-text ul { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.doc-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc-text code { font: 15px/1.4 var(--font-mono); padding: 2px 7px; border-radius: var(--r-sm); background: var(--p-surface); white-space: nowrap; }

/* setup steps: a real sequence, so they are numbered */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(step); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--p-accent-ink); font: 500 14px/1 var(--font-mono); }

.term { background: var(--p-inv-bg); color: var(--p-inv-ink); border-radius: var(--r-md, 4px); padding: var(--s-5); margin: var(--s-5) 0;
  font: 15px/1.7 var(--font-mono); overflow-x: auto; }
.term span { color: var(--p-inv-muted); }

.scores { width: 100%; border-collapse: collapse; margin: var(--s-5) 0; font-size: 16px; }
.scores th { text-align: left; font-weight: 500; font-size: var(--t-small); color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--ink); }
.scores td { padding: 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.scores td:last-child, .scores th:last-child { text-align: right; width: 40%; }
.scores .bar { display: inline-block; height: 8px; background: var(--accent); vertical-align: middle; margin-right: 10px; border-radius: 1px; }
.scores tr.is-browser td { color: var(--muted); }
.scores tr.is-browser .bar { background: #9aa3f0; }

.fixes { display: grid; gap: var(--s-3); margin: 0; }
.fixes div { padding: var(--s-4) var(--s-5); background: var(--p-surface); border-radius: var(--r-sm); }
.fixes dt { font-weight: 500; margin-bottom: 4px; }
.fixes dd { margin: 0; color: var(--muted); }

.doc-foot { border-top: 1px solid var(--line); padding-block: var(--s-6); font-size: var(--t-small); color: var(--muted); }
.doc-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); justify-content: space-between; }
.doc-foot a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .doc-body { grid-template-columns: minmax(0, 1fr); }
  .doc-text { min-width: 0; }
  .doc-toc { display: none; }
  .doc-nav__links a.hide-sm { display: none; }
}
@media (max-width: 639px) {
  .doc-text { font-size: 16px; }
  .doc-text code { white-space: normal; word-break: break-word; }
  .scores td:last-child, .scores th:last-child { width: 46%; }
}

/* privacy and terms: one short column, no contents list */
.doc-body--single { grid-template-columns: minmax(0, 1fr); }
.doc-text h2 + p { margin-top: 0; }
.doc-text section > h2:not(:first-child) { margin-top: var(--s-7, 40px); }

/* phones: logo and the one button only, so the nav never overflows */
@media (max-width: 479px) {
  .doc-nav__links { display: none; }
  .doc-nav .btn { margin-left: auto; }
}
