@font-face {
  font-family: "VT323";
  src: url("../assets/fonts/VT323-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --panel: #d5daea;
  --blue-light: #a1bee9;
  --navy: #0c1d36;
  --edge-dark: #143059;
  --edge-mid: #9bb3d6;
  --edge-light: #ffffff;
  --green: #00ff00;
  --link: #0000b8;
  font-family: "VT323", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 760px;
  min-height: 520px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--navy);
  background: var(--panel);
}

.converter {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 14px;
}

.status {
  display: block;
  min-height: 38px;
  padding: 5px 11px 4px;
  overflow: hidden;
  color: #d5daea;
  background: #374a99;
  border: 1px solid #000;
  box-shadow: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  margin: 0;
  white-space: nowrap;
}

.workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  height: min(540px, calc(100vh - 110px));
  min-height: 0;
}

.well {
  min-width: 0;
  min-height: 0;
  border: 3px solid;
  border-color: var(--edge-dark) var(--edge-light) var(--edge-light) var(--edge-dark);
  box-shadow:
    inset 2px 2px 0 #000,
    inset -2px -2px 0 var(--edge-mid);
}

.source-well {
  display: block;
  padding: 6px;
  overflow: hidden;
  background: var(--blue-light);
  cursor: pointer;
}

#source {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blue-light);
  image-rendering: pixelated;
  object-fit: contain;
}

#source:not([src]) {
  visibility: hidden;
}

.terminal-well {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 9px;
  overflow: hidden;
  color: var(--green);
  background: #020b09;
  text-shadow: 0 0 2px rgba(0, 255, 0, 0.48);
}

.terminal-command,
.terminal-prompt {
  margin: 0;
  min-height: 18px;
  font: 400 18px/1 "VT323", monospace;
  letter-spacing: 0.02em;
  white-space: pre;
}

.terminal-command {
  grid-row: 1;
}

.terminal-command[hidden] {
  display: none;
}

.ascii-well {
  grid-row: 2;
  align-self: start;
  margin: 0;
  padding: 3px 0;
  overflow: auto;
  color: var(--green);
  background: transparent;
  font: 400 11px/0.7 "VT323", monospace;
  letter-spacing: 0;
  white-space: pre;
  user-select: text;
  scrollbar-color: #087d1c #020b09;
}

.terminal-prompt {
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.72em;
  background: var(--green);
  box-shadow: 0 0 3px rgba(0, 255, 0, 0.6);
  animation: terminal-blink 1.1s steps(1, end) infinite;
}

@keyframes terminal-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-cursor {
    animation: none;
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 30px;
  margin: 0;
  padding: 0 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.42;
}

.text-link,
.actions a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.actions a[aria-disabled="true"] {
  color: #687087;
  cursor: default;
  pointer-events: none;
}

.text-link:focus-visible,
.actions a:focus-visible,
.source-well:focus-within {
  outline: 2px solid #000;
  outline-offset: 2px;
}

body.is-dragging .source-well {
  background: #bfd3f1;
  outline: 2px dashed var(--navy);
  outline-offset: -8px;
}
