@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OpenTUI Mono";
  src: url("fonts/OpenTUIMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }
html {
  scrollbar-gutter: stable;
  background: #140c12;
}
body {
  margin: 0;
  min-height: 100dvh;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
h1, h2, h3 { font-size: inherit; font-weight: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scan-study {
  --field: #140c12;
  --type: #f4ebe3;
  --accent: #5c7cff;
  --mute: color-mix(in srgb, var(--type) 52%, transparent);
  background: var(--field);
  color: var(--type);
  color-scheme: dark;
  font-family: "Inter", Arial, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv11" 1;
  letter-spacing: -.018em;
}
.scan-study ::selection { background: var(--accent); color: var(--type); }
.scan-study a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .14em;
  text-decoration-color: var(--accent);
}

.scan-stage {
  position: relative;
  min-height: 100dvh;
}
.scan-mark {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.scan-mark canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-copy {
  position: relative;
  z-index: 1;
  width: min(30rem, 40%);
  margin-left: auto;
  padding: 0 48px 64px 20px;
}
.scan-page {
  width: auto;
  margin: 0;
  padding: 0 0 64px;
}
.scan-page > main,
.scan-page > article,
.scan-page > footer {
  width: min(42rem, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}
.scan-page > main,
.scan-page > article { margin-top: 5rem; }
.scan-page-tool > main {
  width: min(80rem, calc(100% - 48px));
}
.scan-page main > .scan-block:first-of-type { margin-top: 0; }

.scan-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.scan-page .scan-header {
  position: relative;
  overflow: visible;
  align-items: flex-start;
  height: 6.25rem;
  padding-right: 28px;
}
.scan-mast {
  position: absolute;
  left: max(0px, calc(50% - min(23rem, calc((100% - 48px) / 2))));
  top: -.22em;
  z-index: 0;
  margin: 0;
  font-size: clamp(96px, 12vw, 155px);
  font-style: italic;
  font-weight: 450;
  letter-spacing: -.07em;
  line-height: 1;
  transform: rotate(170deg);
  pointer-events: none;
  user-select: none;
}
.scan-header nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 44px;
  gap: 22px;
  font-size: 15px;
  font-weight: 430;
  letter-spacing: -.02em;
}
.scan-header nav a { text-decoration: none; }
.scan-header a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
.scan-name {
  width: 100%;
  margin-top: 32px;
  font-size: clamp(56px, 7vw, 84px);
  font-style: italic;
  font-weight: 450;
  letter-spacing: -.062em;
  line-height: .88;
}
.scan-name span { display: block; }
.scan-page-title {
  width: 100%;
  margin-top: 32px;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 450;
  letter-spacing: -.055em;
  line-height: .92;
}
.scan-intro {
  max-width: 28ch;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 430;
  line-height: 1.32;
  letter-spacing: -.028em;
}
.scan-intro p + p { margin-top: .2em; }
.scan-intro a {
  font-family: "OpenTUI Mono", ui-monospace, monospace;
  font-size: .88em;
  letter-spacing: 0;
}
.scan-intro + .scan-index,
.scan-intro + .scan-more { margin-top: 28px; }
.scan-block { margin-top: 48px; }
.scan-block h2 {
  margin-bottom: 16px;
  font: 11px/1.4 "OpenTUI Mono", monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.scan-block a { text-decoration: none; }
.scan-index, .scan-reel, .scan-notes { list-style: none; }
.scan-index > li + li { margin-top: 18px; }
.scan-index h3 {
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -.038em;
  line-height: 1.12;
}
.scan-index h3 button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
.scan-index h3 button:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
.scan-fold { margin-top: 12px; }
.scan-clip { position: relative; display: block; background: #000; }
.scan-clip a { display: block; }
.scan-clip video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.scan-clip .scan-audio { opacity: 1; }
.scan-index p {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 430;
  line-height: 1.35;
  letter-spacing: -.02em;
  color: var(--mute);
}

.scan-reel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 12px;
}
.scan-cel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: #000;
}
.scan-cel a { display: block; height: 100%; text-decoration: none; }
.scan-cel img,
.scan-cel video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-cel video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.scan-cel.is-playing video { opacity: 1; }
.scan-cel:hover,
.scan-cel:focus-within {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}
.scan-audio {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 4px;
  place-items: center;
  border: 0;
  background: #000c;
  color: #fff;
  cursor: pointer;
  opacity: 0;
}
.scan-cel:hover .scan-audio,
.scan-cel.is-playing .scan-audio,
.scan-audio:focus-visible { opacity: 1; }
.scan-audio:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.scan-audio svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}
.scan-audio .sound-on,
.scan-audio:not([data-muted="false"]) .sound-off { fill: none; }
.scan-audio[data-muted="false"] .sound-off,
.scan-audio:not([data-muted="false"]) .sound-on { display: none; }

.scan-feature { display: block; text-decoration: none; }
.scan-feature time,
.scan-article > header time {
  display: block;
  font: 11px/1 "OpenTUI Mono", monospace;
  letter-spacing: .14em;
  color: var(--mute);
}
.scan-feature h3 {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 450;
  letter-spacing: -.05em;
  line-height: .92;
}
.scan-feature p {
  margin-top: 10px;
  max-width: 28ch;
  font-size: 16px;
  font-weight: 430;
  line-height: 1.32;
  letter-spacing: -.022em;
  color: var(--mute);
}
.scan-notes { margin-top: 28px; }
.scan-notes li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.scan-notes li + li { margin-top: 10px; }
.scan-notes h3 {
  font-size: 16px;
  font-weight: 430;
  letter-spacing: -.025em;
  line-height: 1.28;
}
.scan-notes a { text-decoration: none; }
.scan-notes time {
  flex-shrink: 0;
  font: 11px/1.5 "OpenTUI Mono", monospace;
  letter-spacing: 0;
  color: var(--mute);
}
.scan-more {
  margin-top: 18px;
  font: 12px/1 "OpenTUI Mono", monospace;
  letter-spacing: 0;
}
.scan-copy a:hover { text-decoration: underline; }
.scan-feature:hover { text-decoration: none; }
.scan-feature:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); }

.scan-article > header { margin-top: 32px; }
.scan-article .scan-page-title { margin-top: 8px; }

.scan-prose {
  margin-top: 28px;
  font-size: 16px;
  font-weight: 430;
  line-height: 1.5;
  letter-spacing: -.018em;
}
.scan-prose > * + * { margin-top: 1em; }
.scan-prose h2 {
  margin-top: 2em;
  font-size: 22px;
  font-weight: 450;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.scan-prose h3 {
  margin-top: 1.6em;
  font-size: 18px;
  font-weight: 450;
  letter-spacing: -.03em;
}
.scan-prose a:hover { text-decoration: underline; }
.scan-prose ul,
.scan-prose ol { padding-left: 1.2em; }
.scan-prose ul { list-style: disc; }
.scan-prose ol { list-style: decimal; }
.scan-prose li + li { margin-top: .35em; }
.scan-prose pre {
  overflow-x: auto;
  padding: 14px 16px;
  background: #0c080b;
  border: 1px solid #3a2830;
  font: 13px/1.45 "OpenTUI Mono", ui-monospace, monospace;
  letter-spacing: 0;
}
.scan-prose code {
  font-family: "OpenTUI Mono", ui-monospace, monospace;
  font-size: .92em;
  letter-spacing: 0;
}
.scan-prose :not(pre) > code { color: var(--accent); }
.scan-prose img,
.scan-prose video {
  display: block;
  max-width: 100%;
  height: auto;
}
.scan-prose figure { margin-top: 1.6em; }
.scan-prose figcaption {
  margin-top: .6em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mute);
}
.scan-prose figcaption strong { color: var(--type); font-weight: 500; }
.scan-prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1em;
  color: var(--mute);
}
.scan-prose hr {
  border: 0;
  border-top: 1px solid #3a2830;
}
.scan-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.scan-prose th,
.scan-prose td {
  border-bottom: 1px solid #3a2830;
  padding: .4em .5em .4em 0;
  text-align: left;
}

.scan-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: baseline;
  margin-top: 56px;
}
.scan-footer > a { font-size: 16px; letter-spacing: -.02em; text-decoration: none; }
.scan-footer > a:hover { text-decoration: underline; }
.scan-footer nav { display: flex; gap: 20px; font: 12px/1 "OpenTUI Mono", monospace; }
.scan-footer button {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: 12px/1 "OpenTUI Mono", monospace;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scan-study.board-open { padding-bottom: 220px; }
.scan-board {
  position: fixed;
  inset: auto 0 0;
  z-index: 12;
  background: #160e14;
  border-top: 1px solid #3a2830;
  color: #f4ebe3;
  font: 9px/1.2 "OpenTUI Mono", monospace;
  padding: 0;
  overflow-x: auto;
}
.scan-board .rack { display: flex; min-width: 980px; }
.scan-board .mod {
  flex: 1 1 auto;
  padding: 12px 14px 14px;
  border-right: 1px solid #3a2830;
}
.scan-board .mod:last-child { border-right: 0; }
.scan-board h3, .mod-kicker {
  margin: 0 0 8px;
  color: #c45a7a;
  font: 9px/1 "OpenTUI Mono", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mod-kicker { margin-top: 12px; }
.scan-board .copy {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 8px;
  background: #140c12;
  border: 1px solid #3a2830;
  color: #f4ebe3;
  font: 12px/1.3 Inter, Arial, sans-serif;
  letter-spacing: -.02em;
}
.scan-board .copy:focus { outline: 1px solid #e5ef28; outline-offset: 2px; }
.scan-board .keys, .scan-board .jacks { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.scan-board .keys button {
  background: none;
  font: inherit;
}
.scan-board .keys label, .scan-board .jacks label, .scan-board .sw, .scan-board .keys button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid #3a2830;
  color: #b5a8ae;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.scan-board .jacks label { width: 38px; padding: 5px 0; }
.scan-board .keys input, .scan-board .jacks input, .scan-board .sw input, .scan-board .pot input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.scan-board .keys label:has(input:checked),
.scan-board .jacks label:has(input:checked),
.scan-board .sw:has(input:checked) {
  border-color: #ff4538;
  color: #e5ef28;
}
.scan-board .jacks label:has(input:checked) {
  background: #ff4538;
  color: #140c12;
}
.scan-board .pots { display: flex; gap: 10px; margin-top: 4px; }
.scan-board .pot {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #b5a8ae;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: grab;
}
.scan-board .dial {
  display: block;
  width: 34px;
  height: 34px;
  border: 1.5px solid #5a4048;
  border-radius: 50%;
  background: #140c12;
  transform: rotate(var(--a, -135deg));
}
.scan-board .dial::after {
  content: "";
  display: block;
  width: 2px;
  height: 11px;
  margin: 5px auto 0;
  background: #f4ebe3;
}
.scan-board .pot:has(input:focus-visible) .dial { outline: 2px solid #e5ef28; outline-offset: 3px; }
.scan-board .sw { margin-top: 10px; width: fit-content; cursor: pointer; }

.terminal-story-player,
.vt520-video-figure {
  margin: 1.6em 0;
  width: 100%;
  max-width: none;
}
.terminal-story-player {
  --terminal-accent: #5c7cff;
  --terminal-background: #0c080b;
  --terminal-border: #3a2830;
  --terminal-chrome: #160e14;
  --terminal-text: #f4ebe3;
}
.terminal-window {
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border);
  color: var(--terminal-text);
  font-family: "OpenTUI Mono", ui-monospace, monospace;
  overflow: hidden;
}
.terminal-window__bar {
  align-items: center;
  background: var(--terminal-chrome);
  border-bottom: 1px solid var(--terminal-border);
  color: var(--mute);
  display: grid;
  font-size: 11px;
  grid-template-columns: 1fr auto 1fr;
  height: 2.2rem;
  letter-spacing: .02em;
  padding: 0 12px;
}
.terminal-window__mark {
  border: 1px solid #3a2830;
  color: var(--type);
  font-size: 9px;
  justify-self: start;
  letter-spacing: .08em;
  padding: 2px 5px;
}
.terminal-window__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-window__size {
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  justify-self: end;
}
.terminal-window__screen {
  aspect-ratio: 5 / 4;
  background: var(--terminal-background);
  overflow: auto;
  padding: 18px 20px;
  scrollbar-color: #5a4048 var(--terminal-background);
  scrollbar-width: thin;
}
.terminal-window .terminal-window__screen pre {
  background: transparent;
  border: 0;
  color: var(--terminal-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.48;
  margin: 0;
  min-width: calc(var(--terminal-columns, 80) * 1ch);
  overflow: visible;
  padding: 0;
  white-space: pre;
}
.terminal-row {
  display: block;
  height: 1.48em;
  line-height: 1.48em;
}
.terminal-run {
  display: inline-block;
  height: 100%;
  line-height: inherit;
  vertical-align: top;
}
.story-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  min-height: 2rem;
}
.story-segments {
  align-items: center;
  background: #160e14;
  border: 1px solid #3a2830;
  display: none;
  gap: 8px;
  height: 2rem;
  padding: 0 10px;
}
.terminal-story-player.is-ready .story-segments { display: flex; }
.story-segment {
  --progress: 0;
  appearance: none;
  background: #5a4048;
  border: 0;
  cursor: pointer;
  flex: 0 0 auto;
  height: 6px;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 6px;
}
.story-segment::after {
  background: var(--terminal-accent);
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(var(--progress));
  transform-origin: left;
}
.story-segment[aria-current="step"] {
  background: #3a2830;
  width: 3.2rem;
}
.playback-button {
  align-items: center;
  appearance: none;
  background: #160e14;
  border: 1px solid #3a2830;
  color: var(--type);
  cursor: pointer;
  display: none;
  font-size: 12px;
  gap: 6px;
  height: 2rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 2rem;
}
.terminal-story-player.is-ready .playback-button { display: inline-flex; }
.playback-button.is-wide {
  padding: 0 10px;
  width: 6.5rem;
}
.playback-button:not(.is-wide) [data-player-toggle-label] { display: none; }
.playback-button .icon {
  display: none;
  fill: currentColor;
  height: 14px;
  width: 14px;
}
.playback-button:not([data-state]) .icon-play,
.playback-button[data-state="play"] .icon-play,
.playback-button[data-state="pause"] .icon-pause,
.playback-button[data-state="replay"] .icon-replay { display: block; }
.story-status {
  color: var(--mute);
  font-family: "OpenTUI Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .02em;
}
.terminal-story-player.is-ready .story-status { display: none; }
.vt520-video-frame {
  background: #090909;
  overflow: hidden;
}
.vt520-video-frame video {
  display: block;
  height: auto;
  width: 100%;
}

@media (max-width: 1000px) {
  .scan-copy { width: min(26rem, 44%); padding: 0 32px 48px 0; }
  .scan-page > main,
  .scan-page > article { width: min(40rem, calc(100% - 40px)); }
  .scan-page-tool > main { width: min(72rem, calc(100% - 40px)); }
  .scan-name { font-size: 56px; }
  .scan-intro { margin-top: 16px; font-size: 17px; }
  .scan-feature h3 { font-size: 28px; }
}

@media (max-width: 680px) {
  .scan-stage { min-height: 0; }
  .scan-mark {
    position: relative;
    inset: auto;
    height: 62vw;
  }
  .scan-copy { width: auto; padding: 8px 20px 48px; }
  .scan-page { padding-bottom: 48px; }
  .scan-page .scan-header { height: 4.4rem; padding-right: 16px; }
  .scan-mast { left: 12px; font-size: 72px; top: -.22em; }
  .scan-header nav { gap: 16px; }
  .scan-page > main,
  .scan-page > article,
  .scan-page > footer,
  .scan-page-tool > main {
    width: auto;
    margin-left: 20px;
    margin-right: 20px;
  }
  .scan-page > main,
  .scan-page > article { margin-top: 2.5rem; }
  .scan-name { margin-top: 28px; font-size: 48px; }
  .scan-page-title { margin-top: 24px; font-size: 36px; }
  .scan-intro { margin-top: 14px; font-size: 16px; }
  .scan-feature h3 { font-size: 26px; }
  .scan-block { margin-top: 32px; }
  .scan-footer { margin-top: 36px; }
  .scan-footer button { margin-left: 0; }
  .scan-study.board-open { padding-bottom: 220px; }
  .scan-board { padding: 12px 14px 16px; }
  .terminal-window__bar { grid-template-columns: auto 1fr; }
  .terminal-window__title { justify-self: center; padding-right: 1.5rem; }
  .terminal-window__size { display: none; }
  .terminal-window .terminal-window__screen pre { font-size: 11px; }
}

@media (max-width: 480px) {
  .scan-page .scan-header {
    height: auto;
    padding: 4.8rem 16px 0 0;
  }
}
