/* docs.socketandpivot.com. Brand: Brand/guide/BRAND-GUIDE.md.
   Charcoal and bone, Instrument Sans, chartreuse for one job only: focus and the current page in dark mode. */

@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --charcoal: #1c1c1c;
  --bone: #ededed;
  --accent: #c8f23c;

  --bg: var(--bone);
  --ink: var(--charcoal);
  --muted: #595959;      /* 6.0:1 on bone */
  --line: #c4c4c4;
  --panel: #e3e3e3;
  --mark: var(--charcoal); /* chartreuse never goes on bone */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--charcoal);
    --ink: var(--bone);
    --muted: #9e9e9e;    /* 6.4:1 on charcoal */
    --line: #3a3a3a;
    --panel: #262626;
    --mark: var(--accent);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font: 17px/1.6 "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand .wm { height: 26px; width: auto; display: block; align-self: center; }
.brand span { font-weight: 700; font-size: 17px; color: var(--muted); }
.home { font-size: 15px; color: var(--muted); }

/* layout */
.layout {
  display: grid; grid-template-columns: 230px minmax(0, 1fr);
  max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px);
  gap: clamp(24px, 4vw, 64px);
}
.side { padding-top: 36px; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { margin: 0; }
.side .grp { font-weight: 700; font-size: 14px; color: var(--muted); margin: 22px 0 6px; }
.side .grp:first-child { margin-top: 0; }
.side a { display: block; padding: 4px 0 4px 16px; text-decoration: none; font-size: 15.5px; position: relative; }
.side a:hover { text-decoration: underline; }
.side a[aria-current="page"] { font-weight: 700; }
.side a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: var(--mark);
}

main { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 48px; padding: 36px 0 80px; min-width: 0; }
main > .src { grid-column: 1 / -1; margin: 0 0 -12px; font-size: 14px; color: var(--muted); }
article { min-width: 0; max-width: 46rem; }
.toc { position: sticky; top: 24px; align-self: start; font-size: 14px; }
.toc p { font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--ink); text-decoration: underline; }

/* prose */
article h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 18px; }
article h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; margin: 48px 0 12px; padding-top: 4px; }
article h3 { font-size: 19px; margin: 32px 0 8px; }
article p, article ul, article ol { margin: 0 0 16px; }
article li { margin: 4px 0; }
article strong { font-weight: 700; }
article hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
code {
  font: 0.88em ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--panel); padding: 0.1em 0.35em; border-radius: 3px;
}
pre { background: var(--panel); padding: 14px 16px; overflow-x: auto; border-radius: 4px; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 14px; }
table { border-collapse: collapse; width: 100%; margin: 0 0 20px; font-size: 15px; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th { font-weight: 700; border-bottom-color: var(--ink); white-space: nowrap; }
td:first-child { white-space: normal; }
th.r, td.r { text-align: right; font-variant-numeric: tabular-nums; }

.foot {
  border-top: 1px solid var(--line); padding: 24px clamp(16px, 4vw, 48px) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 14px; color: var(--muted);
}
.foot p { margin: 0; }

@media (max-width: 1100px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; padding-top: 20px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .side ul { display: flex; flex-wrap: wrap; gap: 2px 14px; }
  .side .grp { display: none; }
  .side a { padding-left: 0; }
  .side a[aria-current="page"]::before { display: none; }
  .side a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
  .home { display: none; }
}
@media print {
  .side, .toc, .top .home, .skip { display: none; }
  .layout, main { display: block; }
}
