@font-face {
  font-family: VT323;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/vendor/vt323-latin.woff2) format("woff2");
}

/* Matches transfer.davidxie.dev and the BIOS screen on davidxie.dev */
:root {
  --bg: #000;
  --bright: #e8e8e8;
  --text: #b4b4b4;
  --dim: #8c8c8c;
  --rule: #555;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  font: 20px/1.35 VT323, ui-monospace, monospace;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Pages that need a login stay blank until the session is checked. */
body.loading section { visibility: hidden; }

.screen { max-width: 768px; margin: 0 auto; padding: 40px 24px; }

.topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 24px;
  color: var(--bright);
}
.home-link { text-decoration: none; }

nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a, nav button { padding: 0 4px; color: var(--text); text-decoration: none; }
nav a[aria-current] { color: #000; background: var(--text); }

h1, h2 { margin: 24px 0 0; font: inherit; color: var(--bright); text-transform: uppercase; }
h1 { margin-top: 0; }

p { margin: 12px 0 0; }
.bright { color: var(--bright); }
.dim { font-size: 18px; color: var(--dim); }

a { color: inherit; }
a:hover { color: #fff; }

.badge { padding: 0 4px; color: #000; background: var(--text); }
.ok { color: var(--bright); }
.error { color: var(--danger); }
.error .badge { background: var(--danger); }

/* Buttons read as BIOS options: plain until hovered or focused, then inverted. */

button {
  padding: 0 4px;
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:hover, button:focus-visible { color: #000; background: var(--text); outline: none; }
button.primary { padding: 0 8px; color: #000; background: var(--text); }
button.primary:hover, button.primary:focus-visible { background: var(--bright); }
button.danger { color: var(--danger); }
button.danger:hover, button.danger:focus-visible { color: #000; background: var(--danger); }
button:disabled { opacity: .5; cursor: default; }

input:not([type="checkbox"]), select {
  padding: 0 8px;
  font: inherit;
  color: var(--bright);
  background: #0b0b0b;
  border: 1px solid var(--rule);
  border-radius: 0;
}
input:focus, select:focus { border-color: var(--text); outline: none; }
input[type="checkbox"] { accent-color: var(--text); }

/* Label ......... [ value ] unit */
.field { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.field > span:first-child { white-space: nowrap; }
.field .dots { min-width: 2ch; }
.field input { width: 9ch; }
.field input.wide { width: min(100%, 22ch); }
.field .unit { min-width: 5ch; }

/* Drop zone, as on transfer: dashed while idle, inverted while dragging. */

.dropzone {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 40px 16px;
  text-align: center;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px dashed var(--rule);
}
.dropzone:hover, .dropzone:focus-visible { color: var(--bright); background: none; border-color: var(--text); }
.dropzone .armed { display: none; }
body.dragging .dropzone { color: #000; background: var(--text); border: 1px solid var(--text); }
body.dragging .dropzone .idle { display: none; }
body.dragging .dropzone .armed { display: inline; }

/* Lists: name ......... meta, with links and actions on the line below. */

ul { margin: 4px 0 0; padding: 0; list-style: none; }
ul:empty { display: none; }
li + li { margin-top: 8px; }

.row { display: flex; gap: 8px; white-space: nowrap; }
.name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dots { flex: 1 0 2ch; overflow: hidden; color: var(--rule); }
.dots::before { content: "................................................................................................................................"; }
.meta { white-space: pre; }
.failed .meta { color: var(--danger); }

.sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding-left: 2ch; font-size: 18px; color: var(--dim); }
.sub a { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.sub .grow { flex: 1; }

/* User profiles: a grid of files with previews */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.grid li + li { margin-top: 0; }
.tile { min-width: 0; padding: 8px; border: 1px dashed var(--rule); }
.tile .name { display: block; margin-top: 6px; white-space: nowrap; }
.tile .sub { padding-left: 0; }

.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 150px;
  overflow: hidden;
  background: #0b0b0b;
}
.preview img, .preview video { width: 100%; height: 100%; object-fit: contain; }
.preview audio { width: 100%; }
.preview pre {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text);
  border: 0;
}
.preview .ext { font-size: 32px; color: var(--dim); text-transform: uppercase; }

/* Admin */

.stats { margin: 4px 0 0; }
.stats div { display: flex; gap: 8px; }
.stats dt, .stats dd { margin: 0; white-space: nowrap; }
.stats dd { color: var(--bright); }

.panel { margin-top: 8px; padding: 8px 12px; border: 1px dashed var(--rule); }
.panel .field + .field { margin-top: 4px; }

pre {
  margin: 12px 0 0;
  padding: 8px 12px;
  font: inherit;
  color: var(--bright);
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px dashed var(--rule);
}

/* Docs */

code { font: inherit; color: var(--bright); }
.params li { padding-left: 2ch; text-indent: -2ch; }
.params li::before { content: "- "; color: var(--rule); }

details { margin-top: 32px; font-size: 18px; color: var(--dim); }
summary { cursor: pointer; color: var(--text); }
summary:hover { color: #fff; }

footer {
  margin-top: 40px;
  padding-top: 12px;
  font-size: 18px;
  color: var(--dim);
  border-top: 1px dashed var(--rule);
}

/* Touch screens: tap wording and bigger targets. */

.touch { display: none; }

@media (hover: none) {
  .keys { display: none; }
  .touch { display: inline; }
  .sub button, nav a, nav button { padding: 6px 8px; }
  button.primary { padding: 8px 12px; }
}

@media (max-width: 560px) {
  .screen { padding: 24px 16px; }
}

/* Icon tiles, like a desktop file browser */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.tiles li + li { margin-top: 0; }

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 14px 8px 10px;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
button.tile { width: 100%; font: inherit; background: none; cursor: pointer; }
.tile:hover, .tile:focus-visible { color: var(--text); background: #141414; border-color: var(--rule); outline: none; }
.tile .icon svg { display: block; width: auto; height: 60px; }
.tile-name {
  display: -webkit-box;
  max-width: 100%;
  padding: 0 4px;
  overflow: hidden;
  line-height: 1.15;
  color: var(--bright);
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* The selected icon's label inverts, like on an old desktop. */
.tile:hover .tile-name, .tile:focus-visible .tile-name { color: #000; background: var(--text); }
.tile-meta { font-size: 16px; color: var(--dim); }

.tile.add { border: 1px dashed var(--rule); }
.tile.add .icon { display: grid; place-items: center; width: 60px; height: 60px; font-size: 48px; line-height: 1; color: var(--dim); }

.crumbs { margin: 0; color: var(--dim); }
.crumbs a { color: var(--text); }

.search {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 6px 12px;
}

/* The viewer */
.viewer {
  display: block;
  width: 100%;
  height: 78vh;
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--rule);
}
.viewer-wrap { position: relative; }

@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .tile .icon svg { height: 50px; }
}

/* The viewer gets more room than the other pages. */
.wide-screen { max-width: 1100px; }

/* Text notes: the editor and how they're shown */
.editor {
  display: block;
  width: 100%;
  min-height: 60vh;
  margin-top: 12px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.35;
  color: var(--bright);
  background: #0b0b0b;
  border: 1px solid var(--rule);
  resize: vertical;
}
.editor:focus { border-color: var(--text); outline: none; }

.note-text {
  margin-top: 12px;
  padding: 12px 14px;
  min-height: 30vh;
  white-space: pre-wrap;
  word-break: break-word;
}
