/* Tiny Computers. One type scale, one grid, one accent: the green of the die.
   Paper and ink, square corners, flat colour, no shadows at rest. */

:root {
  --paper: #F4F4F0;
  --paper-2: #E8E8E2;
  --ink: #0E0E0E;
  --ink-2: #161616;
  --muted: #5B5B55;
  --dim: #77776F;
  --light: #A3A39C;
  --accent: #56D364;
  --accent-2: #7FE195;

  --font: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; /* taste-skill-ignore: real code only */

  /* Five steps: small, body, lead, heading, display. Everything else is one of these. */
  --fs-small: 0.9375rem;
  --fs-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-lead: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  --fs-h2: clamp(2.25rem, 1.4rem + 3.2vw, 4.5rem);
  --fs-display: clamp(3.25rem, 1.2rem + 6.8vw, 8.5rem);

  --m: clamp(20px, 5vw, 80px);
  --max: 1360px;
  --section: clamp(96px, 12vw, 168px);
  --gap: clamp(20px, 3vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--m); top: -80px; z-index: 50; background: var(--accent); color: var(--ink); padding: 12px 20px; font-weight: 500; }
.skip:focus { top: 12px; }

h1, h2 { font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); line-height: 1; }
h3 { font-size: var(--fs-lead); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.lead { font-size: var(--fs-lead); line-height: 1.4; letter-spacing: -0.01em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--m); }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 56px; padding: 0 28px;
  background: var(--accent); color: var(--ink); font-weight: 500; text-decoration: none;
  transition: background-color .2s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #2A2A2A; }
.text-link { font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.text-link:hover { text-decoration-thickness: 4px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 40px; }

.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 72px; padding: 0 var(--m); background: var(--paper);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--ink); }
.nav { display: flex; gap: 32px; }
.nav a { font-size: var(--fs-small); text-decoration: none; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.gh { font-size: var(--fs-small); font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- home hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: 40px var(--m) var(--section);
  min-height: calc(100svh - 72px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: var(--gap);
}
.hero h1 { font-size: clamp(3.25rem, 1rem + 5.4vw, 7rem); line-height: .92; letter-spacing: -0.045em; }
.hero .lead { margin-top: 32px; max-width: 30ch; }
.hero-art { margin: 0; }
.hero-art video { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--ink); }
.hero-art figcaption { margin-top: 16px; font-size: var(--fs-small); color: var(--muted); }

/* ---------- series index with preview ---------- */
.series { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--m); }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px var(--gap); margin-bottom: clamp(48px, 6vw, 88px); }
.sec-head p { max-width: 36ch; }
.index { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.row-link {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: 18px 0; color: var(--dim); text-decoration: none; transition: color .25s var(--ease);
}
.row-link:hover, .row.is-active .row-link { color: var(--ink); }
.row-name { font-size: clamp(2rem, 3.7vw, 3.75rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.row-meta { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-small); white-space: nowrap; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; background: var(--accent); }
.dot.soon { background: transparent; border: 2px solid var(--dim); }
.row-body { display: none; }
.stage { position: sticky; top: 104px; }
.stage-media { position: relative; aspect-ratio: 4 / 3; background: var(--ink); }
.sm { position: absolute; inset: 0; opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.sm.is-on { opacity: 1; }
.sm video, .sm img { width: 100%; height: 100%; object-fit: contain; }
.sc { display: none; margin-top: 28px; }
.sc.is-on { display: block; }
.sc p { margin-top: 12px; max-width: 52ch; }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 20px; font-weight: 500; }
.links a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- pipeline band ---------- */
.how { background: var(--ink); color: var(--paper); padding: var(--section) var(--m) calc(var(--section) * .9); }
.how > *, .follow > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.how-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .6fr); gap: var(--gap); align-items: end; margin-bottom: clamp(48px, 6vw, 88px); }
.how-head p { max-width: 34ch; color: var(--light); justify-self: end; }
.tabs { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-bottom: 40px; }
.tab {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 var(--fs-lead)/1.1 var(--font); letter-spacing: -0.02em; color: var(--light); transition: color .2s var(--ease);
}
.tab:hover, .tab[aria-selected="true"] { color: var(--paper); }
.tab[aria-selected="true"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 12px; background: var(--accent); vertical-align: .1em; }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.panel[hidden] { display: none; }
.panel pre { margin: 0; padding: clamp(24px, 3vw, 40px); background: var(--ink-2); color: #E8E8E2; font: 400 var(--fs-small)/1.8 var(--code); white-space: pre-wrap; overflow-wrap: anywhere; }
.panel mark { background: var(--accent); color: var(--ink); padding: 1px 6px; }
.panel img { width: 100%; height: auto; }
.panel .cap { margin-top: 20px; font-size: var(--fs-small); color: var(--light); }

/* ---------- about ---------- */
.about { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--m); }
.about h2 { margin-bottom: clamp(32px, 4vw, 56px); }
.statement { max-width: 30ch; font-size: var(--fs-lead); line-height: 1.35; letter-spacing: -0.015em; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(64px, 8vw, 112px); }
.three h3 { margin-bottom: 16px; }
.three p { max-width: 36ch; }
.facts { display: flex; flex-wrap: wrap; gap: 48px 120px; margin-top: clamp(72px, 9vw, 136px); }
.facts dt { font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.05em; line-height: .9; }
.facts dd { margin-top: 16px; max-width: 24ch; }

/* ---------- follow band ---------- */
.follow { background: var(--accent); color: var(--ink); padding: var(--section) var(--m); }
.follow-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--gap); align-items: end; }
.follow p { font-size: var(--fs-lead); line-height: 1.4; max-width: 40ch; }

/* ---------- project pages ---------- */
.page-hero {
  max-width: var(--max); margin: 0 auto; padding: 40px var(--m) clamp(48px, 6vw, 96px);
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: var(--gap);
}
.crumb { font-size: var(--fs-small); margin-bottom: 32px; }
.crumb a { color: var(--muted); }
.page-hero h1 { font-size: var(--fs-display); line-height: .92; letter-spacing: -0.045em; }
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; font-size: var(--fs-small); color: var(--muted); }
.page-hero .lead { margin-top: 24px; max-width: 38ch; }
.page-media { margin: 0; }
.page-media figcaption { margin-top: 14px; font-size: var(--fs-small); color: var(--muted); }
.page-media video { width: 100%; height: auto; background: var(--ink); }
.page-media img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; background: var(--ink); }
.page-section { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--m) 0; }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); gap: var(--gap); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.page-head p { max-width: 44ch; justify-self: end; }
.prose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.prose p { font-size: var(--fs-body); line-height: 1.6; max-width: 52ch; }

/* ---------- the sketches ---------- */
.demo { background: var(--ink); color: var(--paper); padding: clamp(24px, 3.5vw, 48px); }
.demo-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.demo-btn {
  appearance: none; min-height: 44px; padding: 0 20px; cursor: pointer;
  background: var(--ink-2); color: var(--paper); border: 0; border-radius: 0;
  font: 500 var(--fs-small)/1 var(--font); transition: background-color .2s var(--ease);
}
.demo-btn:hover { background: #262626; }
.demo-btn[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
.demo-view { min-height: 180px; }
.demo-status { margin-top: 28px; min-height: 3em; color: var(--light); font-size: var(--fs-body); }
.cells { display: grid; grid-template-columns: 5.5rem repeat(8, minmax(0, 1fr)); gap: 8px; align-items: stretch; margin-bottom: 8px; }
.cells-label { align-self: center; font-size: var(--fs-small); color: var(--light); }
.cell { background: var(--ink-2); padding: 12px 8px; text-align: center; transition: background-color .25s var(--ease); }
.cell.is-on { background: var(--accent); color: var(--ink); }
.cell-id { display: block; font-size: 0.8125rem; color: var(--light); }
.cell.is-on .cell-id { color: var(--ink); }
.cell strong { display: block; font-size: var(--fs-lead); font-variant-numeric: tabular-nums; }
.matrix { display: grid; gap: 8px; }
.matrix-row { display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 28px; }
.matrix-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 280px; }
.matrix-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.matrix-grid span { background: var(--ink-2); padding: 12px 0; text-align: center; font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.matrix .cells-label { margin-top: 6px; }
.matrix-grid.tpu-acc span.is-on { background: var(--accent); color: var(--ink); }
.tpu-row { display: flex; flex-wrap: wrap; gap: 40px; }
.num { width: 100%; min-width: 0; padding: 10px 0; background: var(--ink-2); border: 0; border-radius: 0; color: var(--paper); text-align: center; font: 500 var(--fs-lead)/1 var(--font); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.num:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.table-wrap { overflow-x: auto; }
table.pipe { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 6px; font-size: var(--fs-small); }
table.pipe th { font-weight: 500; color: var(--light); text-align: left; padding: 6px 10px; }
table.pipe th.is-now { color: var(--accent); }
table.pipe td { background: var(--ink-2); padding: 10px 8px; overflow-wrap: anywhere; }
table.pipe th code { font-family: var(--code); font-size: 0.8125rem; color: var(--paper); }
table.pipe th code.asm { color: var(--light); white-space: normal; }
table.pipe td.is-stage { background: #242424; }
table.pipe td.is-fwd { background: var(--accent); color: var(--ink); font-weight: 700; }
table.pipe th:first-child, table.pipe td:first-child { width: 4.5rem; }
.regs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.reg { background: var(--ink-2); padding: 10px 14px; font-size: var(--fs-small); font-variant-numeric: tabular-nums; color: var(--light); }
.reg.is-set { color: var(--ink); background: var(--accent); }
.state { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ir { margin: 0 0 28px; padding: 24px; background: var(--ink-2); color: #E8E8E2; font: 400 var(--fs-small)/1.7 var(--code); white-space: pre; overflow-x: auto; }
.lowering { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: 28px; }
.lowering-title { font-weight: 700; margin-bottom: 8px; }
.compile-out .matrix { margin-top: 8px; }

/* ---------- gallery ---------- */
.shots { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 20px; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; object-fit: contain; background: var(--ink); }
.shot figcaption { margin-top: 14px; font-size: var(--fs-small); color: var(--muted); }

/* ---------- pager ---------- */
.pager {
  max-width: var(--max); margin: 0 auto; padding: var(--section) var(--m);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  font-size: var(--fs-lead); font-weight: 700; letter-spacing: -0.02em;
}
.pager a { text-decoration: none; }
.pager a span { display: block; font-size: var(--fs-small); font-weight: 400; color: var(--muted); letter-spacing: 0; margin-bottom: 4px; }
.pager a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.pager-all { font-size: var(--fs-small); font-weight: 500; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: clamp(80px, 9vw, 120px) var(--m) 40px; overflow: hidden; }
.foot-mark { margin: 0 0 96px -0.04em; font-size: 13vw; font-weight: 700; letter-spacing: -0.055em; line-height: .8; white-space: nowrap; }
.foot-cols { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.foot-h { margin-bottom: 16px; font-weight: 700; }
.foot ul li + li { margin-top: 10px; }
.foot-cols p + p { margin-top: 12px; }
.foot a { text-underline-offset: 5px; overflow-wrap: anywhere; }
.foot a:hover { color: var(--accent); }
.foot-base { max-width: var(--max); margin: 120px auto 0; display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: var(--fs-small); color: var(--light); }
.foot-base a { color: var(--paper); }

/* ---------- phone and small tablet ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .hero, .page-hero { grid-template-columns: 1fr; min-height: 0; }
  .index { grid-template-columns: 1fr; }
  .stage { display: none; }
  .row-link { flex-direction: column; align-items: flex-start; gap: 10px; }
  .row-body { display: block; padding-bottom: 32px; }
  .row-body p { max-width: 40ch; color: var(--muted); }
  .row-body img { width: 100%; height: auto; margin-top: 20px; aspect-ratio: 16 / 10; object-fit: contain; background: var(--ink); }
  .row-name { font-size: 2.25rem; }
  .how-head, .page-head, .follow-grid, .three { grid-template-columns: 1fr; }
  .how-head p, .page-head p { justify-self: start; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .tab { font-size: 1.125rem; }
  .panel pre { font-size: 0.8125rem; }
  .prose, .lowering { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; gap: 40px; }
  .cells { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .cells-label { grid-column: 1 / -1; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-mark { margin-bottom: 64px; }
  .foot-base { flex-direction: column; align-items: flex-start; margin-top: 72px; }
  .pager { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* A quieter instrument-like visual system for the project hub. */
:root {
  --paper: #f6f8f8;
  --paper-2: #e8eeee;
  --ink: #17292e;
  --ink-2: #20363b;
  --muted: #53686d;
  --dim: #697c80;
  --light: #b7cccb;
  --accent: #a6e3d1;
  --accent-2: #c4f1e4;
  --max: 1440px;
  --section: clamp(76px, 9vw, 136px);
}
body { line-height: 1.55; }
h1, h2 { font-weight: 500; letter-spacing: -.045em; }
h3 { font-weight: 500; }
.top { border-bottom: 1px solid #dce5e4; background: rgba(246,248,248,.96); }
.brand { font-weight: 700; }
.nav a, .gh { text-decoration: none; }
.gh { border: 1px solid #bccdcc; border-radius: 5px; padding: 8px 15px; }
.btn { border-radius: 5px; font-weight: 700; }
.hero { min-height: min(720px, calc(100svh - 72px)); padding-top: 70px; gap: clamp(48px, 6vw, 100px); }
.hero h1 { font-size: clamp(3.7rem, 5.9vw, 6.4rem); line-height: .98; }
.hero .lead { font-size: clamp(1.2rem, 1.65vw, 1.5rem); max-width: 36ch; color: var(--muted); }
.hero-art video, .stage-media, .page-media video, .page-media img { border-radius: 8px; background: var(--ink); }
.hero-art figcaption, .page-media figcaption { color: var(--muted); }
.series { border-top: 1px solid #dce5e4; }
.sec-head p, .page-head p { color: var(--muted); }
.index { gap: clamp(48px, 8vw, 120px); }
.row { border-top: 1px solid #d3dfde; }
.row:last-child { border-bottom: 1px solid #d3dfde; }
.row-link { padding: 24px 0; color: var(--ink); align-items: center; }
.row-name { font-size: clamp(1.7rem, 2.8vw, 2.75rem); font-weight: 500; }
.row-link:hover .row-name, .row.is-active .row-name { color: #26735f; }
.dot { border-radius: 50%; background: #338a70; }
.stage-media { overflow: hidden; }
.stage-media video { border-radius: 8px; }
.how { background: #e5efed; color: var(--ink); }
.how-head p { color: var(--muted); }
.tab { color: var(--muted); }
.tab:hover, .tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::before { background: #438a78; }
.panel pre { border-radius: 8px; }
.panel .cap { color: var(--muted); }
.about .statement { max-width: 40ch; color: var(--muted); }
.facts dt { font-weight: 500; }
.follow { background: #cde9e1; }
.page-hero { padding-top: clamp(55px, 8vw, 110px); gap: clamp(40px, 6vw, 90px); }
.page-hero h1 { font-size: clamp(3rem, 6vw, 6.5rem); overflow-wrap: anywhere; }
.page-hero .lead { color: var(--muted); font-size: clamp(1.2rem, 1.6vw, 1.55rem); }
.page-hero .actions a:not(.btn) { font-size: 1rem; }
.page-section { padding-top: var(--section); }
.sketch-label { font-size: .9rem; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.demo { border-radius: 8px; }
.demo-btn { border-radius: 4px; }
.shot img { border-radius: 6px; }
.foot { background: var(--ink); }
.foot-mark { font-weight: 500; font-size: clamp(4rem, 11.5vw, 11rem); }
.js [data-reveal] { opacity: 1; transform: none; transition: none; }
@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .row-link { flex-direction: row; align-items: center; }
  .row-body { padding-bottom: 24px; }
  .row-body img { border-radius: 6px; max-height: 260px; }
}
@media (max-width: 480px) {
  .row-link { align-items: flex-start; flex-direction: column; }
  .hero h1 { font-size: clamp(3rem, 13vw, 4.5rem); }
  .page-hero h1 { font-size: clamp(2.7rem, 11vw, 4rem); }
}
@media (max-width: 600px) {
  .foot-mark { font-size: 10.7vw; }
}
