*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--bg: #f0f0fa;
	--text: #0a0a14;
	--text-muted: rgba(10, 10, 20, 0.42);
	--ghost-bg: rgba(10, 10, 20, 0.05);
	--ghost-border: rgba(10, 10, 20, 0.18);
	--ghost-hover-bg: rgba(10, 10, 20, 0.1);
	--success: #1a5c35;
	--error: #7a1515;
}

html {
	font-size: 16px;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: "D-DIN", Arial, Verdana, sans-serif;
	min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────── */
header {
	padding: 2.5rem 3rem 0;
}

header h1 {
	font-family: "D-DIN-Bold", "D-DIN", Arial, Verdana, sans-serif;
	font-weight: 700;
	font-size: 3rem;
	line-height: 1;
	letter-spacing: 0.96px;
	text-transform: uppercase;
}

.h1-tiny {
	font-size: 0.45em;
	vertical-align: baseline;
	letter-spacing: 0.96px;
}

header p {
	margin-top: 0.5rem;
	font-size: 0.75rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	color: var(--text-muted);
	line-height: 2;
}

/* ── Main ────────────────────────────────────────────────────────── */
main {
	padding: 2rem 3rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ── Drop Zone ───────────────────────────────────────────────────── */
.drop-zone {
	min-height: 220px;
	border: 1px solid var(--ghost-border);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	cursor: pointer;
	transition:
		background 0.2s,
		border-color 0.2s;
	outline: none;
	padding: 3rem;
	text-align: center;
}

.drop-zone.has-files {
	min-height: 0;
	padding: 1.5rem 3rem;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragover {
	background: var(--ghost-bg);
	border-color: var(--text);
}

.drop-label {
	font-family: "D-DIN-Bold", "D-DIN", Arial, Verdana, sans-serif;
	font-weight: 700;
	font-size: 2rem;
	letter-spacing: 0.96px;
	text-transform: uppercase;
	line-height: 1;
	transition: font-size 0.2s;
}

.drop-zone.has-files .drop-label {
	font-size: 1rem;
	letter-spacing: 1.17px;
}

.drop-zone.has-files .drop-sub,
.drop-zone.has-files .drop-hint {
	display: none;
}

.drop-sub {
	font-size: 0.75rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	color: var(--text-muted);
	line-height: 2;
}

.drop-hint {
	font-size: 0.625rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-muted);
	line-height: 0.94;
	margin-top: 0.25rem;
}

/* ── File List ───────────────────────────────────────────────────── */
#file-list {
	border: 1px solid var(--ghost-border);
	border-top: none;
}

/* shared grid for header, rows, summary */
.list-header,
.list-row,
.list-summary {
	display: grid;
	grid-template-columns: 1fr 100px 110px 90px 150px;
	align-items: center;
	gap: 1rem;
	padding: 0.7rem 1rem;
}

.list-header {
	font-size: 0.625rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-muted);
	line-height: 0.94;
	border-bottom: 1px solid var(--ghost-border);
}

/* ── List Row ────────────────────────────────────────────────────── */
.list-row {
	border-bottom: 1px solid var(--ghost-border);
	transition: background 0.12s;
}

.list-row:last-child {
	border-bottom: none;
}

.list-row:hover {
	background: var(--ghost-bg);
}

.list-row:hover .row-remove {
	opacity: 1;
}

.col-name {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	overflow: hidden;
	min-width: 0;
}

.row-remove {
	flex-shrink: 0;
	opacity: 0;
	background: none;
	border: 1px solid var(--ghost-border);
	color: var(--text-muted);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		opacity 0.12s,
		color 0.12s,
		border-color 0.12s;
	padding: 0;
}

.row-remove:hover {
	color: var(--text);
	border-color: var(--text);
}

.row-filename {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.8125rem;
	/* preserve original filename capitalisation */
	text-transform: none;
	font-variant-numeric: tabular-nums;
}

.col-size {
	font-size: 0.75rem;
	letter-spacing: 0.3px;
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.col-size.done {
	color: var(--text);
}

.col-saved {
	font-family: "D-DIN-Bold", "D-DIN", Arial, sans-serif;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-muted);
	white-space: nowrap;
}

.col-saved.smaller {
	color: var(--success);
}
.col-saved.larger {
	color: var(--error);
}

.col-action {
	display: flex;
	justify-content: flex-end;
}

/* error in row */
.row-error {
	font-size: 0.625rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--error);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ── Summary Row ─────────────────────────────────────────────────── */
.list-summary {
	border-top: 1px solid var(--text);
	background: var(--ghost-bg);
}

.summary-label {
	font-size: 0.75rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.summary-label strong {
	color: var(--text);
	font-family: "D-DIN-Bold", "D-DIN", Arial, sans-serif;
	font-weight: 700;
}

.summary-bold {
	font-family: "D-DIN-Bold", "D-DIN", Arial, sans-serif;
	font-weight: 700;
	color: var(--text) !important;
}

/* ── Controls ────────────────────────────────────────────────────── */
.controls {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding: 1.25rem 0;
	border-top: 1px solid var(--ghost-border);
	margin-top: 2rem;
}

.controls label {
	font-size: 0.75rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	color: var(--text-muted);
	white-space: nowrap;
}

.controls label strong {
	color: var(--text);
	font-family: "D-DIN-Bold", "D-DIN", Arial, sans-serif;
	font-weight: 700;
	font-style: normal;
}

.controls input[type="range"] {
	flex: 1;
	min-width: 100px;
	appearance: none;
	height: 1px;
	background: var(--ghost-border);
	outline: none;
	cursor: pointer;
}

.controls input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	width: 11px;
	height: 11px;
	background: var(--text);
	border-radius: 50%;
	cursor: pointer;
}

.controls-actions {
	display: flex;
	gap: 0.5rem;
	margin-left: auto;
}

/* ── Ghost Buttons ───────────────────────────────────────────────── */
.btn-ghost {
	background: var(--ghost-bg);
	color: var(--text);
	border: 1px solid var(--ghost-border);
	border-radius: 32px;
	padding: 12px 24px;
	font-family: "D-DIN-Bold", "D-DIN", Arial, Verdana, sans-serif;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s;
	white-space: nowrap;
}

.btn-ghost:hover {
	background: var(--ghost-hover-bg);
	border-color: var(--text);
}

.btn-ghost:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.btn-ghost-sm {
	background: var(--ghost-bg);
	color: var(--text);
	border: 1px solid var(--ghost-border);
	border-radius: 32px;
	padding: 7px 14px;
	font-family: "D-DIN-Bold", "D-DIN", Arial, Verdana, sans-serif;
	font-weight: 700;
	font-size: 0.625rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s;
	white-space: nowrap;
}

.btn-ghost-sm:hover {
	background: var(--ghost-hover-bg);
	border-color: var(--text);
}

/* ── Spinner ─────────────────────────────────────────────────────── */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.spinner {
	display: inline-block;
	width: 10px;
	height: 10px;
	border: 1.5px solid rgba(10, 10, 20, 0.15);
	border-top-color: var(--text);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

[hidden] {
	display: none !important;
}

/* ── Overlay ─────────────────────────────────────────────────────── */
.overlay {
	position: fixed;
	inset: 0;
	background: rgba(240, 240, 250, 0.93);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 200;
}

.overlay-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
	width: 320px;
}

.overlay-logo {
	width: 200px;
	height: 200px;
	object-fit: contain;
	animation: float 2.4s ease-in-out infinite;
}

@keyframes float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.overlay-status {
	font-family: "D-DIN-Bold", "D-DIN", Arial, Verdana, sans-serif;
	font-weight: 700;
	font-size: 2.5rem;
	letter-spacing: 0.96px;
	text-transform: uppercase;
	color: var(--text);
	line-height: 1;
}

.overlay-track {
	width: 100%;
	height: 1px;
	background: var(--ghost-border);
	position: relative;
	overflow: hidden;
}

.overlay-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: var(--text);
	transition: width 0.15s ease;
}

@keyframes scan {
	0% {
		left: -35%;
		width: 35%;
	}
	60% {
		left: 100%;
		width: 35%;
	}
	100% {
		left: 100%;
		width: 35%;
	}
}

.overlay-bar.scanning {
	animation: scan 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
	width: 35%;
	transition: none;
}

.overlay-sub {
	font-size: 0.625rem;
	letter-spacing: 1.17px;
	text-transform: uppercase;
	color: var(--text-muted);
	line-height: 0.94;
}

/* ── Byline ──────────────────────────────────────────────────────── */
.byline {
	position: fixed;
	bottom: 1.25rem;
	right: 1.5rem;
	font-size: 0.625rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.15s;
}

.byline:hover {
	color: var(--text);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
	header {
		padding: 1.5rem 1.25rem 0;
	}
	main {
		padding: 1.25rem 1.25rem 3rem;
	}

	header h1,
	.drop-label {
		font-size: 2rem;
	}

	.list-header,
	.list-row,
	.list-summary {
		grid-template-columns: 1fr 80px 70px 130px;
	}

	/* hide "Compressed" column on mobile */
	.list-header .col-size:nth-child(3),
	.list-row .col-size.done-comp,
	.list-summary .col-size:nth-child(3) {
		display: none;
	}

	.controls {
		gap: 0.75rem;
	}
	.controls-actions {
		margin-left: 0;
		width: 100%;
		justify-content: flex-end;
	}
}
