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

:root {
  --bg: #0d1117;
  --bg-elevated: #151b23;
  --line: #232b36;
  --accent: #5eff8f;
  --accent-dim: #2c5f3f;
  --text: #e6edf3;
  --text-dim: #8b9bb0;
  --danger: #ff6b6b;
  --radius: 10px;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(94,255,143,0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(94,255,143,0.04), transparent 45%);
}

a { color: inherit; text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.logo-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-credit {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  padding-left: 24px; /* выравнивание под текстом лого, после эмодзи-иконки */
}

/* ---------- Landing layout ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

h1 {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 40px;
  max-width: 520px;
}

/* ---------- Dropzone (signature element) ---------- */
.dropzone {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: #121a14;
}

.dropzone.dragover { border-style: solid; }

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-icon {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-block;
  margin-bottom: 18px;
}

.dz-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dz-hint {
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--mono);
}

/* ---------- Queue / preview list ---------- */
.queue {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.queue-info {
  flex: 1;
  min-width: 0;
}

.queue-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-size {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.queue-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.queue-status.ok { color: var(--accent); }
.queue-status.err { color: var(--danger); }

.progress-bar {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  background: var(--accent);
  color: #06140a;
  border: none;
  border-radius: 7px;
  padding: 11px 20px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-small {
  padding: 7px 14px;
  font-size: 13px;
}

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

/* ---------- Results panel ---------- */
.results {
  margin-top: 28px;
  display: none;
}

.results.show { display: block; }

.results-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.link-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}

.batch-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.batch-banner .link-row {
  margin-bottom: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.footer-note {
  margin-top: 48px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--mono);
  line-height: 1.7;
}

/* ---------- View page (single image / batch) ---------- */
.view-page { background: var(--bg); color: var(--text); min-height: 100vh; }

.view-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  text-align: center;
}

.full-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.view-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.meta {
  margin-top: 14px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
}

.batch-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.batch-main h1 {
  font-size: 20px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.grid-item {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1;
  padding: 0;
  background: none;
  cursor: pointer;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
  display: block;
}

.grid-item:hover img { transform: scale(1.04); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 11, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

.lightbox.show { display: flex; }

.lb-image {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  border-radius: 8px;
  border: 1px solid var(--line);
  user-select: none;
}

.lb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav:hover { border-color: var(--accent); color: var(--accent); }

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-bar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-counter {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  min-width: 60px;
  text-align: center;
}

@media (max-width: 700px) {
  .lb-nav { width: 38px; height: 38px; font-size: 20px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-bar { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 600px) {
  .page { padding: 40px 16px 60px; }
  .dropzone { padding: 40px 16px; }
}
