/* kinesics.io: lab notes on cool paper, annotated with a highlighter. One family for reading (Newsreader), one for
   the wire (Martian Mono). The live message beside the face is the one loud thing; everything else stays quiet. */
:root {
  --paper: #eef1ec;
  --ink: #1c2530;
  --mute: #5e6b70;
  --rule: #b9c3c0;
  --mark: #f3dd4c;
  --link: #24508f;
  --code-bg: #e3e8e3;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161c21;
    --ink: #dde3e0;
    --mute: #93a0a3;
    --rule: #34403f;
    --mark: #6b5d12;
    --link: #8fb3ec;
    --code-bg: #1e262b;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font: 400 1.0625rem/1.62 "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
code, pre, .wire { font-family: "Martian Mono", ui-monospace, monospace; font-size: 0.8rem; }
code { background: var(--code-bg); padding: 0.08em 0.3em; border-radius: 3px; }
pre { background: var(--code-bg); padding: 1rem 1.1rem; border-radius: 4px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; padding: 0; }

.page { max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
header.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 0.9rem; }
.name { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
nav.top a { margin-left: 1.25rem; color: var(--mute); text-decoration: none; }
nav.top a:hover, nav.top a[aria-current] { color: var(--ink); }

.lede { max-width: var(--measure); margin: 3rem 0 2rem; }
.lede h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 1rem; }
.lede p { font-size: 1.2rem; color: var(--mute); margin: 0; }

/* the face and the message it is moved by */
.stage { display: grid; grid-template-columns: minmax(14rem, 22rem) 1fr; gap: 2rem; align-items: start; margin: 1rem 0 0.75rem; }
.stage > * { min-width: 0; } /* (a grid item would otherwise grow to its widest line of the message) */
.face { width: 100%; height: auto; display: block; }
.face .line { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.face .iris { fill: var(--ink); }
.face .lid { fill: var(--paper); stroke: var(--ink); stroke-width: 2.2; }
.face .open { fill: var(--ink); opacity: 0.85; }
.wire { margin: 0; padding: 1rem 1.1rem; background: var(--code-bg); border-radius: 4px; white-space: pre; overflow-x: auto; line-height: 1.6; min-height: 20rem; }
.wire mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 0.1em; transition: background-color 0.6s; }
.wire .quiet { background: transparent; }
.caption { color: var(--mute); font-size: 0.95rem; max-width: var(--measure); margin: 0.25rem 0 3rem; }
.caption button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }

main section, .doc { max-width: var(--measure); }
main h2, .doc h2 { font-size: 1.55rem; font-weight: 500; letter-spacing: -0.01em; margin: 3.2rem 0 0.6rem; }
.doc h1 { font-size: 2.2rem; font-weight: 500; letter-spacing: -0.02em; margin: 2.5rem 0 0.5rem; }
.doc h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.4rem; }
p, li { max-width: var(--measure); overflow-wrap: break-word; }
table { display: block; overflow-x: auto; }
ul { padding-left: 1.2rem; }
li { margin: 0.3rem 0; }

table { border-collapse: collapse; width: 100%; max-width: 46rem; margin: 1rem 0; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.45rem 0.9rem 0.45rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; }
td.n { font-variant-numeric: tabular-nums; }

.puppets { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; max-width: 52rem; margin-top: 1rem; }
.puppets h3 { margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 600; }
.puppets p { margin: 0; color: var(--mute); font-size: 0.97rem; }

footer { margin-top: 5rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--mute); font-size: 0.92rem; max-width: var(--measure); }

@media (max-width: 46rem) {
  .stage { grid-template-columns: 1fr; }
  .face { max-width: 16rem; }
  .wire { min-height: 0; font-size: 0.72rem; }
  nav.top a { margin: 0 1rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wire mark { transition: none; }
}
