:root {
  --background: 0 0% 9%;
  --panel: 0 0% 7%;
  --foreground: 40 22% 90%;
  --muted-foreground: 40 6% 60%;
  --faint: 40 4% 38%;
  --border: 40 5% 20%;
  --primary: 22 90% 60%;
  --pupil: 40 60% 94%;
  --danger: 4 80% 68%;
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, monospace;
  --dur-fast: 140ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --measure: 1180px;
  --gutter: 40px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; background: hsl(var(--background)); }
body {
  margin: 0;
  font: 400 15px/1.6 var(--font-body);
  color: hsl(var(--foreground));
  /* the dotted clouds are the real picture, stretched across the page and kept behind everything */
  background: hsl(var(--background)) url("clouds.jpg") top center / 100% auto no-repeat fixed;
  background-blend-mode: lighten;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 3px; }
.nav, main, footer { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 26px; padding-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 13px; letter-spacing: 0.14em; }
#mascot { image-rendering: pixelated; flex: none; }
.nav nav { display: flex; gap: 26px; flex-wrap: wrap; justify-content: flex-end; }
.nav nav a { font-size: 13px; text-decoration: none; color: hsl(var(--muted-foreground)); transition: color var(--dur-fast) var(--ease); }
.nav nav a:hover { color: hsl(var(--foreground)); }

.hero { padding: 16vh 0 20vh; }
h1 { font: 300 clamp(44px, 7.4vw, 100px)/0.98 var(--font-display); letter-spacing: -0.035em; margin: 0; max-width: 13ch; text-wrap: balance; }
.lede { margin: 34px 0 0; max-width: 56ch; font-size: 17px; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.go { display: inline-block; margin-top: 30px; padding: 9px 14px; border: 1px solid hsl(var(--border)); font-size: 13px; text-decoration: none; background: hsl(var(--background)); transition: border-color var(--dur-fast) var(--ease); }
.go:hover { border-color: hsl(var(--primary)); }

.band { padding: 72px 0; border-top: 1px solid hsl(var(--border)); }
h2 { font: 300 clamp(32px, 4vw, 54px)/1.05 var(--font-display); letter-spacing: -0.03em; margin: 0 0 40px; }
h3 { font: 500 12px/1.4 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin: 34px 0 14px; }

/* work, set out like publications */
.latest { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; align-items: end; margin-bottom: 44px; }
.latest video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; border: 1px solid hsl(var(--border)); background: hsl(var(--panel)); cursor: pointer; }
.latest p { margin: 0; color: hsl(var(--muted-foreground)); max-width: 46ch; }
.latest strong { display: block; font: 300 26px/1.2 var(--font-display); letter-spacing: -0.02em; color: hsl(var(--foreground)); margin-bottom: 8px; }
.pubs { display: grid; gap: 14px; }
.pub { background: hsl(var(--background)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 36px; align-items: center; padding: 30px; border: 1px solid hsl(var(--border)); }
.pub h4 { font: 300 24px/1.2 var(--font-display); letter-spacing: -0.015em; margin: 0 0 12px; max-width: 24ch; }
.pub p { margin: 0; color: hsl(var(--muted-foreground)); font-size: 14.5px; max-width: 52ch; }
.pub .meta { margin-top: 26px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: hsl(var(--faint)); }
.pub .meta::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: hsl(var(--primary)); }
.pub button { margin-top: 18px; padding: 7px 12px; background: none; border: 1px solid hsl(var(--border)); font-size: 13px; transition: border-color var(--dur-fast) var(--ease); }
.pub button:hover { border-color: hsl(var(--primary)); }
.pub canvas { width: 100%; height: auto; display: block; border: 1px solid hsl(var(--border)); background: hsl(var(--panel)); }

/* the workspace: a terminal that opens */
.term { border: 1px solid hsl(var(--border)); background: hsl(var(--panel)); }
.term summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; cursor: pointer; list-style: none; font: 400 13px/1.5 var(--font-code); }
.term summary::-webkit-details-marker { display: none; }
.now { position: relative; padding-left: 18px; }
.now::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; background: hsl(var(--primary)); }
.now b { font-weight: 500; color: hsl(var(--primary)); }
.open { flex: none; color: hsl(var(--muted-foreground)); font-family: var(--font-body); }
.term[open] .open { display: none; }
.term[open] summary { border-bottom: 1px solid hsl(var(--border)); }
.bar { display: flex; align-items: center; gap: 14px; padding: 10px 22px 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button, .plain { background: none; border: 0; padding: 3px 8px; font: 400 13px var(--font-code); color: hsl(var(--muted-foreground)); }
.tabs button:hover, .plain:hover { color: hsl(var(--foreground)); }
.tabs button[aria-pressed="true"] { color: hsl(var(--primary)); }
.plain { margin-left: auto; }
.lines { list-style: none; margin: 0; padding: 12px 22px 14px; color: hsl(var(--muted-foreground)); font: 400 12.5px/1.6 var(--font-code); }
.lines li { padding: 1px 0 1px 18px; position: relative; }
.lines li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 5px; height: 5px; background: hsl(var(--faint)); }
.run { margin: 0 22px; border: 1px solid hsl(var(--border)); }
.screen { position: relative; height: min(46vh, 420px); }
.run canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.run img[hidden] { display: none; }
.run figcaption { padding: 10px 16px 12px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 13px; }
.code { position: relative; height: min(42vh, 400px); overflow: auto; margin-top: 14px; padding: 6px 0 16px; font: 400 12.5px/1.7 var(--font-code); counter-reset: ln; scrollbar-width: thin; scrollbar-color: hsl(var(--border)) transparent; }
.code .l { display: block; white-space: pre; padding-right: 22px; counter-increment: ln; color: hsl(var(--muted-foreground)); }
.code .l::before { content: counter(ln); display: inline-block; width: 44px; padding-right: 14px; text-align: right; color: hsl(var(--faint)); }
.code b { font-weight: 500; color: hsl(var(--foreground)); }
.code i { font-style: normal; color: hsl(var(--pupil)); }
.code .c { color: hsl(var(--faint)); }
.code .live { color: hsl(var(--primary)); }
.code .caret::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: hsl(var(--primary)); }

/* clips */
.count { margin: -24px 0 26px; color: hsl(var(--muted-foreground)); }
.trailer { display: block; width: 100%; border: 1px solid hsl(var(--border)); background: hsl(var(--panel)); }
.trailer[hidden] { display: none; }
/* each row of videos slides sideways */
.rowhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 34px 0 14px; }
.rowhead[hidden] { display: none; }
.rowhead h3 { margin: 0; }
.arrows { display: flex; gap: 6px; }
.arrows button { width: 34px; height: 30px; background: none; border: 1px solid hsl(var(--border)); font-size: 14px; }
.arrows button:hover { border-color: hsl(var(--primary)); }
.wall { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: hsl(var(--border)) transparent; }
.wall .tile { flex: 0 0 168px; scroll-snap-align: start; }
.reels .tile { flex-basis: 150px; }
.wall .tile { position: relative; }
.wall video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: hsl(var(--panel)); border: 1px solid hsl(var(--border)); cursor: pointer; }
.wall .tile span { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px 7px; background: hsl(var(--panel)); color: hsl(var(--foreground)); font-size: 11.5px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.more { display: block; margin: 20px 0 0; padding: 9px 14px; background: none; border: 1px solid hsl(var(--border)); font-size: 13px; }
.more:hover { border-color: hsl(var(--primary)); }
.more[hidden] { display: none; }

/* send a video, treasury */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 60px; align-items: start; }
.cols h3 { margin-top: 0; }
.cols p { margin: 0; color: hsl(var(--muted-foreground)); max-width: 52ch; }
.prompt { display: grid; gap: 8px; max-width: 460px; }
.prompt label { color: hsl(var(--muted-foreground)); font-size: 13px; margin-top: 8px; }
.prompt input[type="url"], .prompt input[type="text"] { font: inherit; color: hsl(var(--foreground)); background: none; border: 0; border-bottom: 1px solid hsl(var(--border)); padding: 8px 0; width: 100%; }
.prompt .check { display: flex; gap: 10px; align-items: flex-start; }
.prompt .check input { margin-top: 4px; accent-color: hsl(var(--primary)); }
.prompt button { justify-self: start; margin-top: 12px; padding: 9px 16px; background: hsl(var(--primary)); color: hsl(var(--panel)); border: 0; font-size: 13px; font-weight: 500; }
.msg { margin: 0; min-height: 1.5em; color: hsl(var(--muted-foreground)); font-size: 13px; }
.msg.bad { color: hsl(var(--danger)); }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid hsl(var(--border)); }
.queue .vote { border: 1px solid hsl(var(--border)); background: none; padding: 3px 0; color: hsl(var(--primary)); font-size: 13px; }
.queue .vote[disabled] { color: hsl(var(--faint)); cursor: default; }
.queue .what { overflow-wrap: anywhere; }
.queue .where { display: block; color: hsl(var(--muted-foreground)); font-size: 13px; overflow-wrap: anywhere; }
.queue .empty { display: block; color: hsl(var(--muted-foreground)); grid-column: 1 / -1; }
.ledger { display: grid; grid-template-columns: 96px 1fr; gap: 10px 20px; margin: 0; font-size: 14.5px; }
.ledger dt { color: hsl(var(--muted-foreground)); }
.ledger dd { margin: 0; overflow-wrap: anywhere; }

footer { padding-top: 34px; padding-bottom: 80px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--faint)); font-size: 12.5px; }
footer p { margin: 0 0 6px; }
footer a, .doc a { color: hsl(var(--muted-foreground)); }
.doc { max-width: 62ch; padding-top: 10vh; padding-bottom: 12vh; }
.doc h1 { font-size: 44px; margin: 18px 0 26px; max-width: none; }
.doc p { color: hsl(var(--muted-foreground)); }

@media (max-width: 820px) {
  :root { --gutter: 22px; }
  body { background-size: auto 300px; background-position: top center; }
  .nav { align-items: flex-start; }
  .nav nav { gap: 6px 16px; max-width: 220px; }
  .hero { padding: 10vh 0 13vh; }
  .lede { font-size: 16px; }
  .band { padding: 52px 0; }
  h2 { margin-bottom: 28px; }
  .latest { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
  .latest strong { font-size: 21px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px; }
  .term summary { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; }
  .bar, .lines { padding-left: 16px; padding-right: 16px; }
  .run { margin: 0 12px; }
  .screen { height: 250px; }
  .code { height: 44vh; font-size: 11.5px; }
  .code .l::before { width: 32px; padding-right: 10px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .wall .tile { flex-basis: 128px; }
  .count { margin-top: -14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
