/* The page is built out of the system it documents. If a token is wrong, this
   page is wrong too — which is the only way a reference stays honest. */

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

body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font-family: var(--font-system);
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--fill); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top {
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-6) 0;
  margin-bottom: var(--space-8);
}
.top .wrap { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: baseline; justify-content: space-between; }
.top h1 { margin: 0; font-size: var(--text-title-size); line-height: var(--text-title-line); font-weight: var(--text-title-weight); }
.top .sub { color: var(--ink-quiet); font-size: var(--text-meta-size); line-height: var(--text-meta-line); }

.themes { display: flex; gap: 2px; border: 1px solid var(--edge); border-radius: var(--radius-sm); padding: 2px; }
.themes button {
  font: inherit; font-size: var(--text-label-size); font-weight: var(--text-label-weight);
  background: transparent; color: var(--ink-quiet); border: 0;
  border-radius: 2px; padding: var(--space-1) var(--space-3); cursor: pointer;
}
.themes button[aria-pressed="true"] { background: var(--key); color: var(--on-key); }
.themes button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--space-8); }
@media (max-width: 880px) { .layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); } .toc { position: static; } }

.toc { position: sticky; top: var(--space-6); align-self: start; font-size: var(--text-meta-size); line-height: 24px; }
.toc a { display: block; color: var(--ink-quiet); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc .group { color: var(--ink-faint); margin-top: var(--space-4); font-weight: var(--text-label-weight); }
.toc .nested { padding-left: var(--space-3); }

section { margin-bottom: var(--space-12); scroll-margin-top: var(--space-6); }
section > h2 { font-size: var(--text-title-size); line-height: var(--text-title-line); margin: 0 0 var(--space-4); }
section h3 { font-size: var(--text-label-size); line-height: var(--text-label-line); text-transform: none; color: var(--ink-quiet); margin: var(--space-6) 0 var(--space-2); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 var(--space-4); }
.prose h2 { font-size: var(--text-title-size); line-height: var(--text-title-line); margin: var(--space-8) 0 var(--space-3); }
.prose h3 { font-size: 17px; line-height: 24px; color: var(--ink); margin: var(--space-6) 0 var(--space-2); }
.prose ul { margin: 0 0 var(--space-4); padding-left: var(--space-4); }
.prose li { margin-bottom: var(--space-2); }
.prose code, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; color: var(--key); }

.card { background: var(--floor-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.stage { padding: var(--space-6); display: flex; align-items: center; justify-content: center; overflow: auto; }
.stage > * { width: 100%; }

.component { margin-bottom: var(--space-8); }
.component > h3 { font-size: 17px; line-height: 24px; color: var(--ink); margin: 0 0 var(--space-3); }
/* A component's README has its own "Do" / "Don't" headings. They must sit
   under the component's name, not beside it. */
.component .prose h3 { font-size: var(--text-body-size); line-height: var(--text-body-line); margin: var(--space-4) 0 var(--space-2); }

.tokrow {
  display: grid; grid-template-columns: minmax(130px, 170px) 1fr;
  gap: var(--space-4); align-items: start;
  padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline);
}
.tokrow:last-child { border-bottom: 0; }
.tokname { font-size: var(--text-label-size); line-height: var(--text-label-line); font-weight: var(--text-label-weight); word-break: break-word; }
.tokuse { color: var(--ink-quiet); font-size: var(--text-meta-size); line-height: var(--text-meta-line); margin: var(--space-2) 0 0; }
.tokuse p { margin: 0; }

.chips { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: var(--space-2); }
.swatch { width: 40px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--hairline); flex: none; }
.chiptext { font-size: var(--text-meta-size); line-height: 14px; color: var(--ink-quiet); }
.chiptext b { display: block; color: var(--ink); font-weight: var(--text-label-weight); }

.scalar { display: flex; align-items: center; gap: var(--space-3); }
.bar { height: 12px; background: var(--key); border-radius: 2px; flex: none; }
.box { height: 40px; width: 64px; background: var(--floor-sunken); border: 1px solid var(--edge); flex: none; }

.specimen { padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); }
.specimen:last-child { border-bottom: 0; }
.specimen .meta { color: var(--ink-quiet); font-size: var(--text-meta-size); line-height: var(--text-meta-line); margin-bottom: var(--space-2); }

footer { border-top: 1px solid var(--hairline); padding: var(--space-6) 0 var(--space-12); color: var(--ink-quiet); font-size: var(--text-meta-size); line-height: var(--text-meta-line); }
