/* Pult site. Two surfaces from the brand guide: the VHS layer on screen black
   and Proof Terminal on paper. --a0..--a15 hold the palette on air; the rest of
   the frame stays neutral. Default palette: the house theme ch16. */

@font-face { font-family: "Sixtyfour Scan"; src: url(fonts/sixtyfour-scan.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Sixtyfour"; src: url(fonts/sixtyfour.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url(fonts/vt323.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Chivo"; font-weight: 400; src: url(fonts/chivo-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Chivo"; font-weight: 700; src: url(fonts/chivo-700.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #f6f6f3;
  --ink: #16171b;
  --screen: #0c0d12;
  --phosphor: #ece8dc;
  --osd: #9fa3b0;
  --graphite: #5c5e66;
  --rule: #d9d9d4;
  --magenta: #c4006b;
  --tint: #6ee2ee;
  --ok: #1fd16f;
  --flag: #ffe46b;

  --bg: #0c0d12;
  --fg: #ece8dc;
  --a0: #0c0d12; --a1: #ff4444; --a2: #1fd16f; --a3: #ffd21a;
  --a4: #4a7dff; --a5: #f04de0; --a6: #14cfe0; --a7: #c9c9c4;
  --a8: #5a5c68; --a9: #ff7a6e; --a10: #6fe8a0; --a11: #ffe46b;
  --a12: #86a6ff; --a13: #f78cec; --a14: #6ee2ee; --a15: #ffffff;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1200px;
  --display: "Sixtyfour", "VT323", ui-monospace, monospace;
  --scan: "Sixtyfour Scan", "Sixtyfour", "VT323", ui-monospace, monospace;
  --term: "VT323", ui-monospace, "Cascadia Mono", monospace;
  --body: "Chivo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, pre, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code { font-family: var(--term); font-size: 1.14em; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.screen :focus-visible { outline-color: var(--flag); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--ink); color: var(--paper); }
.skip:focus { top: 8px; }

/* Screen surface */
.screen { position: relative; background: var(--screen); color: var(--phosphor); }
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / .028) 0 1px, transparent 1px 3px);
}

/* Header */
.bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 22px/1 var(--display); letter-spacing: .02em; }
.brand img { width: 44px; height: 44px; margin: -6px 0 -6px -6px; }
.nav { display: flex; flex-wrap: wrap; gap: 0 22px; font: 22px/1 var(--term); }
.nav a { display: inline-block; padding: 11px 0; text-decoration: none; }
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.osd { display: flex; justify-content: space-between; gap: 16px; font: 24px/1 var(--term); color: var(--osd); }
.osd b { font-weight: 400; color: var(--phosphor); }
.play { display: inline-block; width: .55em; height: .7em; margin-left: .35em; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.hero { position: relative; z-index: 1; padding-block: clamp(20px, 5vw, 56px) clamp(28px, 5vw, 52px); }
.hero h1 {
  margin-block: clamp(20px, 3.4vw, 38px);
  font: 400 min(calc((100vw - 2 * var(--gutter)) / 11.4), 100px)/1.14 var(--scan);
  text-shadow: -.022em 0 rgb(255 68 68 / .6), .022em 0 rgb(20 207 224 / .6);
}
.hero h1 span { display: block; white-space: nowrap; }
.hero h1, .screen h2, .paper h2, .doc h1, .doc h2, .nosignal h1 { text-transform: uppercase; }
.hero-foot { display: grid; gap: 22px 56px; align-items: end; }
.lede { max-width: 42em; font-size: clamp(18px, 1.5vw, 20px); line-height: 1.55; }
.lede code { color: var(--tint); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 20px; border: 2px solid currentColor; font: 24px/1 var(--term); text-decoration: none; }
.btn.fill { background: var(--phosphor); border-color: var(--phosphor); color: var(--screen); }
.btn:hover { background: var(--phosphor); border-color: var(--phosphor); color: var(--screen); }
.btn.fill:hover { background: transparent; color: var(--phosphor); }
@media (min-width: 900px) { .hero-foot { grid-template-columns: 1fr auto; } }

/* Tracking band: the mark at full bleed, driven by the palette on air */
.band { position: relative; display: grid; grid-template-rows: 14fr 10fr 16fr; height: clamp(84px, 13vw, 168px); overflow: hidden; background: var(--bg); transition: background .2s; }
.band > div { display: grid; grid-template-columns: repeat(7, 1fr); }
.band > div:nth-child(2) { transform: translateX(15.9%); }
.band > div:nth-child(3) { transform: translateX(-4.5%); width: 110%; }
.band i { display: block; transition: background .2s; }
.band i:nth-child(1) { background: var(--a7); }
.band i:nth-child(2) { background: var(--a3); }
.band i:nth-child(3) { background: var(--a6); }
.band i:nth-child(4) { background: var(--a2); }
.band i:nth-child(5) { background: var(--a5); }
.band i:nth-child(6) { background: var(--a1); }
.band i:nth-child(7) { background: var(--a4); }
.band.slip > div:nth-child(2) { animation: slip .36s steps(4) both; }
@keyframes slip { 0% { transform: translateX(-22%); } 40% { transform: translateX(31%); } 70% { transform: translateX(6%); } 100% { transform: translateX(15.9%); } }

/* Demo */
.demo { position: relative; z-index: 1; padding-block: clamp(44px, 7vw, 80px); }
.demo-head { display: grid; gap: 14px 56px; margin-bottom: 26px; }
.screen h2, .paper h2 { font-weight: 400; line-height: 1.2; }
.screen h2 { font-family: var(--scan); font-size: clamp(21px, 3vw, 34px); text-shadow: -.02em 0 rgb(255 68 68 / .55), .02em 0 rgb(20 207 224 / .55); }
.demo-head p { max-width: 46em; color: var(--phosphor); }
.demo-head code { color: var(--tint); }
.set { display: grid; gap: 14px; }
.tui, .pane { font: 20px/1.2 var(--term); }
.tui { padding: 14px 16px; border: 1px solid #2a2c35; background: #000; min-width: 0; }
.tui-top b { font-weight: 400; }
.tui-top u { text-underline-offset: 3px; }
.faint { opacity: .62; }
.tui-help { margin-bottom: 12px; }
.rows { outline-offset: 3px; }
.rows li { display: grid; grid-template-columns: 2ch 20ch 20ch minmax(0, 1fr); gap: 0 2ch; padding: 2px 4px; cursor: pointer; }
.rows li:hover { background: #1b1c22; }
.rows li[aria-selected="true"] { background: var(--phosphor); color: #000; }
.rows span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 40px)); margin-top: 14px; }
.swatches i { height: 20px; }
.panes { display: grid; gap: 10px; min-width: 0; }
.pane { padding: 12px 14px; min-width: 0; overflow: hidden; background: var(--bg); color: var(--fg); transition: background .2s, color .2s; }
.pane h3 { margin-bottom: 6px; font: inherit; opacity: .7; }
.pane pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.meter { display: grid; grid-template-columns: 5ch 1fr 5ch; gap: 1ch; align-items: center; }
.meter div { display: flex; gap: 2px; height: 12px; }
.meter i { flex: 1; background: var(--a8); opacity: .35; }
.meter i.on { opacity: 1; background: var(--a2); }
.meter i.mid { opacity: 1; background: var(--a3); }
.meter i.hot { opacity: 1; background: var(--a1); }
.a1 { color: var(--a1); } .a2 { color: var(--a2); } .a3 { color: var(--a3); } .a4 { color: var(--a4); } .a5 { color: var(--a5); } .a6 { color: var(--a6); }

.remote { display: none; gap: 8px; }
.js .remote { display: grid; grid-template-columns: repeat(4, 1fr); }
.remote button { min-height: 48px; padding: 6px; border: 1px solid #4a4c57; background: #17181e; color: var(--phosphor); font: 22px/1 var(--term); cursor: pointer; }
.remote button:hover { background: #262833; }
.remote button:active { background: var(--phosphor); color: #000; }
.status { min-height: 1.3em; margin-top: 12px; font: 24px/1.2 var(--term); color: var(--flag); }
@media (min-width: 900px) {
  .demo-head { grid-template-columns: auto 1fr; align-items: start; }
  .set { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 92px; }
  .js .remote { grid-template-columns: 1fr; align-content: start; }
}
@media (max-width: 899px) {
  .term.has-copy { padding-top: 50px; }
  .rows li { grid-template-columns: 2ch 20ch minmax(0, 1fr); }
  .rows span:last-child { display: none; }
  .tui-help { display: none; }
}

/* Paper surface */
.paper { position: relative; padding-left: 12px; }
.strip { position: absolute; inset: 0 auto 0 0; width: 12px; display: grid; }
.strip i { display: block; transition: background .2s; }
.paper h2 { font-family: var(--display); font-size: clamp(21px, 2.8vw, 32px); margin-bottom: 18px; }
.block { padding-block: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.muted { color: var(--graphite); }
.steps { display: grid; gap: 30px 56px; align-items: start; }
.steps ol { display: grid; gap: 22px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 3.2ch 1fr; gap: 0 12px; }
.steps li::before { content: counter(s, decimal-leading-zero); font: 26px/1.1 var(--term); color: var(--magenta); }
.steps h3 { font: 700 18px/1.3 var(--body); }
.steps code.cmd { display: inline-block; margin-block: 2px 4px; }
.steps p, .steps code.cmd { grid-column: 2; }
.term { position: relative; min-width: 0; padding: 16px 18px; background: var(--screen); color: var(--phosphor); font: 19px/1.28 var(--term); overflow-x: auto; box-shadow: 6px 6px 0 var(--a6); transition: box-shadow .2s; }
.term .p { color: var(--tint); }
.term .add { color: var(--ok); }
.term .dim { color: var(--osd); }
.copy { position: absolute; top: 8px; right: 8px; min-height: 36px; padding: 2px 10px; border: 1px solid var(--osd); background: var(--screen); color: var(--phosphor); font: 19px/1 var(--term); cursor: pointer; }
.copy:hover { background: var(--phosphor); color: var(--screen); }
.columns { display: grid; gap: 34px 56px; }
.columns h3 { font: 700 18px/1.3 var(--body); margin-bottom: 8px; }
.apps { display: grid; gap: 10px; }
.apps dt { font: 22px/1.1 var(--term); color: var(--magenta); }
.apps dd { margin: 0 0 8px; }
.note { max-width: 46em; }
.note strong { font-weight: 700; }
.tip { margin-top: 18px; padding: 12px 16px; border-left: 4px solid var(--magenta); background: #ecebe6; }
.support { display: grid; gap: 18px 56px; align-items: center; }
.support h2 { margin-bottom: 8px; }
.btn.ink { border-color: var(--ink); background: var(--ink); color: var(--paper); justify-self: start; }
.btn.ink:hover { background: var(--magenta); border-color: var(--magenta); color: #fff; }
@media (min-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .support { grid-template-columns: 1fr auto; }
}

/* Footer */
.foot { position: relative; padding-block: 34px; font-size: 16px; }
.foot .wrap { position: relative; z-index: 1; display: grid; gap: 18px 40px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 0 22px; font: 22px/1 var(--term); }
.foot .links a { display: inline-block; padding: 11px 0; text-decoration: none; }
.foot .links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot small { font-size: 15px; color: var(--osd); }
@media (min-width: 900px) { .foot .wrap { grid-template-columns: 1fr auto; align-items: center; } }

/* Docs */
.docs-bar { background: var(--screen); color: var(--phosphor); }
.docs { display: grid; gap: 8px 56px; padding-block: 36px 72px; }
.docs nav { font-size: 16px; }
.docs nav h2 { margin: 0 0 6px; font: 22px/1 var(--term); color: var(--magenta); }
.docs nav ul { display: flex; flex-wrap: wrap; gap: 0 18px; }
.docs nav a { display: inline-block; padding: 7px 0; text-decoration: none; }
.docs nav a:hover { color: var(--magenta); text-decoration: underline; }
.doc { min-width: 0; max-width: 780px; }
.doc h1 { font: 400 clamp(30px, 5vw, 48px)/1.1 var(--display); margin-bottom: 14px; }
.doc section { padding-top: 36px; }
.doc h2 { font-family: var(--display); font-size: clamp(20px, 2.4vw, 25px); font-weight: 400; line-height: 1.25; margin-bottom: 12px; }
.doc h3 { font: 700 18px/1.3 var(--body); margin: 24px 0 6px; }
.doc p, .doc ul.list, .doc .term, .doc .table { margin-bottom: 14px; }
.doc ul.list { list-style: square; padding-left: 20px; }
.doc ul.list li { margin-bottom: 4px; }
.doc :not(pre) > code, .doc td code { padding: 0 .28em; background: #e8e7e1; overflow-wrap: anywhere; }
.doc a { color: var(--magenta); text-underline-offset: 3px; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { font-weight: 700; border-bottom-color: var(--ink); }
@media (min-width: 900px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); }
  .docs nav > div { position: sticky; top: 24px; }
  .docs nav ul { display: block; }
  .docs nav a { padding: 3px 0; }
}

/* No signal */
.nosignal { display: grid; min-height: 100vh; align-content: center; gap: 18px; padding: var(--gutter); text-align: center; justify-items: center; }
.nosignal h1 { position: relative; z-index: 1; font: 400 clamp(30px, 8vw, 72px)/1.1 var(--scan); }
.nosignal p, .nosignal .actions { position: relative; z-index: 1; }

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