/* ──────────────────────────────────────────────────────────────────────────
   index — bare directory listing. Text only, in the reader's own monospace.
   Self-contained: the border frame is redrawn here rather than imported, so
   nothing on this page depends on the old site. Everything lives inside it.

   The type is the generic monospace keyword rather than a webfont, the way a
   server's own autoindex renders: it is whatever the reader has set, it costs
   no request, and it is there when the site is read straight off a disk.
   ────────────────────────────────────────────────────────────────────────── */

:root {
	--mono:   monospace;
	--rule:   rgb(120,120,120);
	--ink:    rgb(20,20,20);
	--faint:  rgb(130,130,130);
	--link:   rgb(0,0,238);
	--seen:   rgb(85,26,139);
	--paper:  rgb(255,255,255);
	--chrome: rgb(226,242,232);
	--row:    19px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
	background: var(--chrome);
	color: var(--ink);
	font-family: var(--mono);
	font-weight: 400;
	font-size: 13px;
	line-height: var(--row);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

::selection { color: black; background: yellow; }

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--seen); }
a:hover { text-decoration: underline; }

/* ── frame ─────────────────────────────────────────────────────────────── */
.border-wrap { flex: 0 0 auto; }

.border {
	display: flex;
	justify-content: space-between;
	background: rgb(215,214,204);
}

.border.top    { border-bottom: 3px double var(--rule); }
.border.bottom { border-top:    3px double var(--rule); }

.border img.ornament {
	border-left: 3px double var(--rule);
	border-right: 3px double var(--rule);
	width: 17px; height: 17px; padding: 2px;
	image-rendering: pixelated;
}

main {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	border-left: 3px double var(--rule);
	border-right: 3px double var(--rule);
	margin: 0 14px;
	background: var(--paper);
}

#listing {
	flex: 1 1 auto;
	overflow: auto;
	padding: 10px 16px 40px 16px;
}

#listing::-webkit-scrollbar { width: 14px; height: 10px; }
#listing::-webkit-scrollbar-thumb {
	background: rgb(215,214,204);
	border-left: 1px solid var(--rule);
}

/* ── flicker — five characters wide, pinned to the bottom-left corner ───── */
.flicker {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 2;
	width: 5ch;
	height: var(--row);
	line-height: var(--row);
	text-align: center;
	font-size: 13px;
	color: var(--ink);
	background: var(--paper);
	border-top: 1px solid var(--rule);
	border-right: 1px solid var(--rule);
	white-space: pre;
	overflow: hidden;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

/* ── head ──────────────────────────────────────────────────────────────── */
h1 {
	font-size: 14px;
	font-weight: 500;
	line-height: var(--row);
	letter-spacing: 0.01em;
}

hr {
	border: none;
	border-top: 1px solid var(--rule);
	margin: 4px 0 6px 0;
}

/* ── rows ──────────────────────────────────────────────────────────────── */
.group { display: block; }

.group .group {
	margin-left: 9px;
	border-left: 1px dotted rgb(195,195,195);
	padding-left: 9px;
}

.row {
	display: flex;
	align-items: baseline;
	line-height: var(--row);
	white-space: nowrap;
}

.row > .name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.row > .date,
.row > .size {
	flex: 0 0 auto;
	color: var(--faint);
	font-weight: 300;
	font-size: 12px;
	padding-left: 18px;
}

.row > .size { width: 86px; text-align: right; }
.row > .date { width: 106px; text-align: right; }

.row .name > a,
.row .name > span.leaf {
	cursor: pointer;
}

.row.is-dir .name > a { font-weight: 500; }

.row .name > a.open { text-decoration: underline; }

/* ── modules — the only non-text things inside the frame ───────────────── */
.module {
	margin: 4px 0 10px 0;
	border: 1px solid var(--rule);
	background: var(--paper);
	max-width: 760px;
}

.module-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--rule);
	padding: 1px 6px;
	font-size: 12px;
	font-weight: 300;
	color: var(--faint);
	white-space: nowrap;
}

.module-bar a, .module-bar button {
	font: inherit;
	font-family: var(--mono);
	color: var(--link);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 4px;
}

.module-body { padding: 6px; }

.module audio { width: 100%; display: block; }
.module video { width: 100%; display: block; background: black; }
.module iframe { width: 100%; border: none; display: block; }
.module img {
	max-width: 100%;
	max-height: 52vh;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	image-rendering: auto;
}

.module video { max-height: 64vh; }

.module pre {
	font-family: var(--mono);
	font-weight: 400;
	font-size: 13px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ── shows ─────────────────────────────────────────────────────────────── */
.shows { line-height: var(--row); }

.shows .show-section {
	font-weight: 500;
	margin-top: 8px;
}

.shows .show-section:first-child { margin-top: 0; }

.shows .show { margin: 4px 0 0 12px; }

.shows .show-head { font-weight: 400; }

.shows .show-line {
	margin-left: 14px;
	font-weight: 300;
	word-break: break-word;
}

.shows .show-key {
	margin-top: 10px;
	padding-top: 4px;
	border-top: 1px solid rgb(220,220,220);
	font-size: 12px;
	font-weight: 300;
	color: var(--faint);
}

.gallery-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 4px;
	font-size: 12px;
	font-weight: 300;
	color: var(--faint);
}

.gallery-nav button {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--link);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 6px;
}

.app-frame { height: 70vh; min-height: 360px; }
.embed-frame { height: 120px; }

/* ── small screens ─────────────────────────────────────────────────────── */
@media (max-width: 680px) {
	body { font-size: 14px; }
	main { margin: 0; border-left: none; border-right: none; }
	#listing { padding: 8px 8px 40px 8px; }
	.row > .date { display: none; }
	.row > .size { width: 64px; padding-left: 8px; }
	.row { white-space: normal; }
	.row > .name { overflow: visible; text-overflow: clip; word-break: break-word; }
	.app-frame { height: 60vh; }
}
