/* fileshare — Ember Slate */

@font-face {
	font-family: "Space Grotesk";
	src: url("/static/fonts/SpaceGrotesk.ttf") format("truetype");
	font-weight: 300 700;
	font-display: swap;
}

:root {
	--canvas: #1c1e20;
	--canvas-deep: #141516;
	--blob-slate: #2b2f33;
	--blob-copper: #b5603c;
	--blob-sage: #7c8b6f;
	--accent: #d98b5f;
	--accent-strong: #e8a06f;
	--text: #ede7dd;
	--text-dim: #a9a39a;

	--glass-fill: rgba(255, 255, 255, 0.07);
	--glass-fill-strong: rgba(255, 255, 255, 0.1);
	--glass-border: rgba(255, 255, 255, 0.16);
	--glass-border-active: rgba(217, 139, 95, 0.55);

	--radius-lg: 28px;
	--radius-md: 16px;
	--radius-sm: 10px;

	--blob-duration-a: 38s;
	--blob-duration-b: 46s;
	--blob-duration-c: 52s;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	background: var(--canvas);
	color: var(--text);
	font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

a {
	color: var(--accent-strong);
}

/* ---------- liquid background ---------- */

.liquid-bg {
	position: fixed;
	inset: 0;
	z-index: -2;
	overflow: hidden;
	background: radial-gradient(120% 120% at 20% 10%, var(--canvas-deep), var(--canvas) 60%);
}

.blob {
	position: absolute;
	border-radius: 42% 58% 61% 39% / 45% 42% 58% 55%;
	filter: blur(60px);
	opacity: 0.55;
	will-change: transform, border-radius;
	mix-blend-mode: screen;
}

.blob-a {
	width: 60vmax;
	height: 60vmax;
	left: -18vmax;
	top: -14vmax;
	background: radial-gradient(circle at 35% 35%, var(--blob-copper), transparent 72%);
	animation: drift-a var(--blob-duration-a) ease-in-out infinite;
}

.blob-b {
	width: 54vmax;
	height: 54vmax;
	right: -16vmax;
	top: 8vmax;
	background: radial-gradient(circle at 60% 40%, var(--blob-sage), transparent 70%);
	animation: drift-b var(--blob-duration-b) ease-in-out infinite;
}

.blob-c {
	width: 46vmax;
	height: 46vmax;
	left: 18vmax;
	bottom: -20vmax;
	background: radial-gradient(circle at 50% 50%, var(--blob-slate), transparent 75%);
	opacity: 0.7;
	animation: drift-c var(--blob-duration-c) ease-in-out infinite;
}

@keyframes drift-a {
	0% {
		transform: translate(0, 0) scale(1);
		border-radius: 42% 58% 61% 39% / 45% 42% 58% 55%;
	}
	33% {
		transform: translate(8vw, 6vh) scale(1.08);
		border-radius: 55% 45% 40% 60% / 60% 55% 45% 40%;
	}
	66% {
		transform: translate(-4vw, 9vh) scale(0.96);
		border-radius: 38% 62% 55% 45% / 40% 60% 40% 60%;
	}
	100% {
		transform: translate(0, 0) scale(1);
		border-radius: 42% 58% 61% 39% / 45% 42% 58% 55%;
	}
}

@keyframes drift-b {
	0% {
		transform: translate(0, 0) scale(1);
		border-radius: 50% 50% 40% 60% / 55% 45% 55% 45%;
	}
	40% {
		transform: translate(-7vw, 8vh) scale(1.1);
		border-radius: 40% 60% 55% 45% / 45% 55% 40% 60%;
	}
	75% {
		transform: translate(5vw, -4vh) scale(0.94);
		border-radius: 58% 42% 48% 52% / 50% 50% 60% 40%;
	}
	100% {
		transform: translate(0, 0) scale(1);
		border-radius: 50% 50% 40% 60% / 55% 45% 55% 45%;
	}
}

@keyframes drift-c {
	0% {
		transform: translate(0, 0) scale(1);
	}
	50% {
		transform: translate(6vw, -8vh) scale(1.12);
		border-radius: 60% 40% 45% 55% / 40% 60% 55% 45%;
	}
	100% {
		transform: translate(0, 0) scale(1);
	}
}

body.dragging-active {
	--blob-duration-a: 11s;
	--blob-duration-b: 13s;
	--blob-duration-c: 15s;
}

.grain {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0.18;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
	background-size: 160px 160px;
}

@media (prefers-reduced-motion: reduce) {
	.blob {
		animation: none !important;
	}
}

/* ---------- layout ---------- */

.app-shell {
	position: relative;
	z-index: 1;
	max-width: 640px;
	margin: 0 auto;
	padding: clamp(1.5rem, 5vw, 4rem) 1.25rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.app-header {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.5rem;
}

.wordmark {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: var(--text);
}

.tagline {
	color: var(--text-dim);
	font-size: 0.95rem;
}

.site-footer {
	margin-top: 1rem;
	text-align: center;
	color: var(--text-dim);
	font-size: 0.8rem;
}

/* ---------- glass panel ---------- */

.glass-panel {
	position: relative;
	background: linear-gradient(155deg, var(--glass-fill-strong), var(--glass-fill));
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	backdrop-filter: blur(22px) saturate(150%);
	-webkit-backdrop-filter: blur(22px) saturate(150%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.08) inset,
		0 20px 60px -20px rgba(0, 0, 0, 0.55);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.glass-panel {
		background: rgba(26, 28, 30, 0.94);
	}
}

.panel-title {
	margin: 0 0 1.25rem;
	font-size: 1.15rem;
	font-weight: 600;
}

/* ---------- dropzone ---------- */

.dropzone {
	border: 1.5px dashed var(--glass-border);
	border-radius: var(--radius-md);
	padding: clamp(2.5rem, 10vw, 4rem) 1.5rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
	border-color: var(--glass-border-active);
	outline: none;
}

.dropzone.is-active {
	border-color: var(--accent-strong);
	background-color: rgba(217, 139, 95, 0.08);
	transform: scale(1.01);
}

.dropzone-main {
	margin: 0 0 0.35rem;
	font-size: 1.15rem;
	font-weight: 600;
}

.dropzone-sub {
	margin: 0;
	color: var(--text-dim);
	font-size: 0.9rem;
}

/* ---------- file review list ---------- */

.file-list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-height: 40vh;
	overflow-y: auto;
}

.file-row {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.6rem 0.8rem;
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.9rem;
}

.file-row-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-row-size {
	color: var(--text-dim);
	flex-shrink: 0;
}

/* ---------- form controls ---------- */

.options-grid {
	display: grid;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.field-checkbox {
	flex-direction: row;
	align-items: center;
	gap: 0.6rem;
}

.field-label {
	font-size: 0.85rem;
	color: var(--text-dim);
}

.input {
	background: rgba(0, 0, 0, 0.22);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-sm);
	color: var(--text);
	padding: 0.65rem 0.8rem;
	font: inherit;
	font-size: 0.95rem;
	transition: border-color 0.2s ease;
}

.input:focus {
	outline: none;
	border-color: var(--accent-strong);
}

.field-checkbox .input,
.field-checkbox input[type="checkbox"] {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--accent);
}

.input-link {
	flex: 1;
	min-width: 0;
	font-family: "Space Grotesk", monospace;
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	padding: 0.7rem 1.3rem;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
	transform: scale(0.97);
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent-strong), var(--blob-copper));
	color: #1a1310;
}

.btn-primary:hover {
	filter: brightness(1.08);
}

.btn-ghost {
	background: transparent;
	border-color: var(--glass-border);
	color: var(--text);
}

.btn-ghost:hover {
	border-color: var(--glass-border-active);
}

.btn-copy {
	background: rgba(255, 255, 255, 0.08);
	border-color: var(--glass-border);
	color: var(--text);
	flex-shrink: 0;
}

.btn-copy.is-copied {
	background: var(--blob-sage);
	color: #15190f;
	border-color: transparent;
}

.btn-small {
	padding: 0.45rem 0.9rem;
	font-size: 0.85rem;
	flex-shrink: 0;
}

.btn-download {
	width: 100%;
	margin-top: 1.5rem;
	padding: 0.9rem 1.3rem;
	font-size: 1rem;
}

.actions-row {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
}

/* ---------- progress ---------- */

.progress-track {
	position: relative;
	height: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.progress-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--blob-copper), var(--accent-strong));
	transition: width 0.2s ease;
}

.progress-fill::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
	background-size: 200% 100%;
	animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
	from {
		background-position: 200% 0;
	}
	to {
		background-position: -200% 0;
	}
}

.progress-label {
	margin: 0.7rem 0 0;
	color: var(--text-dim);
	font-size: 0.85rem;
	text-align: right;
}

/* ---------- result / error ---------- */

.link-row {
	display: flex;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
}

.result-meta {
	color: var(--text-dim);
	font-size: 0.9rem;
}

.owner-tools {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.owner-tools summary {
	cursor: pointer;
	color: var(--text-dim);
	font-size: 0.9rem;
	margin-bottom: 0.9rem;
}

.hint {
	color: var(--text-dim);
	font-size: 0.8rem;
}

#btn-reset {
	margin-top: 1.5rem;
}

.error-panel {
	border-color: rgba(181, 96, 60, 0.5);
}

.form-error {
	color: var(--accent-strong);
	font-size: 0.9rem;
}

/* ---------- detail / collection / password pages ---------- */

.detail-panel,
.password-panel {
	text-align: left;
}

.file-name {
	margin: 0 0 1.5rem;
	font-size: 1.4rem;
	word-break: break-word;
}

.meta-list {
	margin: 0 0 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.meta-row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-row dt {
	color: var(--text-dim);
}

.meta-row dd {
	margin: 0;
	font-weight: 600;
}

.collection-file-list {
	list-style: none;
	margin: 1.5rem 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.collection-file-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.6rem 0.8rem;
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.collection-file-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
}

.collection-file-size {
	color: var(--text-dim);
	font-size: 0.85rem;
	flex-shrink: 0;
}

.password-form {
	display: flex;
	gap: 0.75rem;
	margin-top: 1rem;
}

.password-form .input {
	flex: 1;
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
	.actions-row {
		flex-direction: column-reverse;
	}

	.actions-row .btn {
		width: 100%;
	}

	.password-form {
		flex-direction: column;
	}

	.meta-row,
	.collection-file-row,
	.file-row {
		flex-wrap: wrap;
	}
}
