@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --bg: #050505;
  --bg-elev: #0c0c0c;
  --bg-card: #101010;
  --bg-input: #0a0a0a;
  --line: #262626;
  --line-2: #1c1c1c;
  --txt: #ffffff;
  --dim: #d0d0d0;
  --muted: #b0b0b0;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --ok: #39ff6a;
  --err: #ff5c5c;
  --font: "JetBrains Mono", ui-monospace, monospace;
  --r: 8px;
  --ease: 0.16s ease;
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

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

html {
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--txt);
  background: var(--bg);
  line-height: 1.5;
}

/* --- Фон (WebGL + фолбэк-градиент) --- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0d0d0d;
  pointer-events: none;
}
.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.bg:not(.bg-ready)::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 42% at 55% 48%, rgba(128, 128, 128, 0.18) 0%, rgba(128, 128, 128, 0.05) 40%, transparent 70%),
    #0d0d0d;
}

/* --- Каркас --- */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.card {
  width: 100%;
  max-width: 560px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: rgba(16, 16, 16, 0.92);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.card-head img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.card-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card-head .lead {
  margin: 0.15rem 0 0;
  font-size: 11.5px;
  color: var(--dim);
}

/* --- Dropzone --- */
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  background: var(--bg-input);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.dropzone:hover {
  border-color: rgba(139, 92, 246, 0.45);
  background: #0c0c0c;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  color: var(--accent-2);
}
.dropzone__title {
  font-size: 13px;
  color: var(--txt);
  font-weight: 500;
}
.dropzone__hint {
  margin-top: 0.35rem;
  font-size: 11px;
  color: var(--muted);
}
.dropzone input[type="file"] { display: none; }

/* --- Кнопки --- */
.btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt);
  transition: background var(--ease), color var(--ease), border-color var(--ease), opacity var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn-primary {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
}
.btn-primary:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.28);
  border-color: rgba(139, 92, 246, 0.65);
  color: #fff;
}
.btn-primary:disabled {
  background: #101010;
  border-color: #262626;
  color: #5a5a5a;
  cursor: not-allowed;
}
.btn-ghost {
  background: #0a0a0a;
  border-color: var(--line);
  color: var(--dim);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--txt);
  background: #141414;
  border-color: rgba(139, 92, 246, 0.45);
}
.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn svg { width: 1.1em; height: 1.1em; opacity: 0.9; flex-shrink: 0; }
.btn-danger {
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.45);
  color: #ffb3b3;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 92, 92, 0.22);
  border-color: rgba(255, 92, 92, 0.7);
  color: #fff;
}

.ttl-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ttl-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ttl-btns .btn.is-active {
  border-color: rgba(139, 92, 246, 0.65);
  color: #fff;
  background: rgba(139, 92, 246, 0.2);
}

/* --- Прогресс --- */
.progress {
  height: 6px;
  border-radius: 999px;
  background: #1c1c1c;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

/* --- Файл в очереди --- */
.file-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 12px;
  color: var(--dim);
  background: var(--bg-input);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0.6rem 0.8rem;
}
.file-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--txt);
}
.file-row__size { color: var(--muted); flex-shrink: 0; }

/* --- Результат --- */
.result {
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--r);
  background: rgba(139, 92, 246, 0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.result__label {
  font-size: 11px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result__link-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.result__link {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 12px;
  color: var(--txt);
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.result__link-row .btn { flex-shrink: 0; }

.error-box {
  border: 1px solid rgba(255, 92, 92, 0.4);
  background: rgba(255, 92, 92, 0.08);
  color: #ffb3b3;
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  font-size: 12px;
}

.hidden { display: none !important; }

.foot {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
}

/* --- Страница 404 --- */
.notfound {
  text-align: center;
  gap: 0.75rem;
}
.notfound h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.4;
}
.notfound__err {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
