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

:root {
  --color-background: #050505;
  --color-surface: #0b0b0b;
  --color-surface-alt: #101010;
  --color-highlight: #f5f2e5;
  --color-text-primary: #f5f2e5;
  --color-text-secondary: #b9b5a7;
  --color-accent: #f5f2e5;
  --color-border: rgba(245, 242, 229, 0.2);
  --color-border-strong: rgba(245, 242, 229, 0.32);
  --color-border-subtle: rgba(245, 242, 229, 0.12);
  --color-fill-soft: rgba(245, 242, 229, 0.05);
  --color-fill-hover: rgba(245, 242, 229, 0.08);
  --border-radius-lg: 22px;
  --border-radius-md: 18px;
  --border-radius-sm: 12px;
  --transition-base: 0.28s ease;
  --max-width: 820px;
}

:root[data-theme="light"] {
  --color-background: #f7f5f1;
  --color-surface: #f7f5f1;
  --color-surface-alt: #efe9dc;
  --color-highlight: #1c1a16;
  --color-text-primary: #1c1a16;
  --color-text-secondary: #585248;
  --color-accent: #1c1a16;
  --color-border: rgba(28, 26, 22, 0.24);
  --color-border-strong: rgba(28, 26, 22, 0.45);
  --color-border-subtle: rgba(28, 26, 22, 0.14);
  --color-fill-soft: rgba(28, 26, 22, 0.06);
  --color-fill-hover: rgba(28, 26, 22, 0.1);
}

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

html, body {
  padding: 0;
  margin: 0;
  min-height: 100%;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 72px 24px 120px;
}

.page-shell {
  width: 100%;
  max-width: var(--max-width);
  display: grid;
  gap: 32px;
}

.tool-stack {
  display: grid;
  gap: 32px;
}

.page-header {
  display: grid;
  gap: 16px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.hero-title-with-back {
  justify-items: start;
}

.hero-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  background: transparent;
  transition: border var(--transition-base), transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.hero-back-link span {
  display: inline-block;
  transform: translateX(-1px);
}

.hero-back-link:hover,
.hero-back-link:focus-visible {
  transform: translateX(-3px);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
  background: var(--color-fill-soft);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.tool-card {
  width: 100%;
  padding: 32px;
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 24px;
}

.form {
  display: grid;
  gap: 20px;
}

.form button {
  justify-self: flex-start;
  padding: 14px 26px;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  background: var(--color-text-primary);
  color: var(--color-background);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border var(--transition-base);
}

.form button:hover,
.form button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.dropzone {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 36px;
  text-align: center;
  background: var(--color-fill-soft);
  cursor: pointer;
  transition: border var(--transition-base), background var(--transition-base), transform var(--transition-base);
}

.dropzone:hover,
.dropzone.active {
  border-color: var(--color-border-strong);
  background: var(--color-fill-hover);
  transform: translateY(-2px);
}

.dropzone p {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dropzone .select-files {
  text-decoration: underline;
}

.dropzone small {
  display: block;
  margin-top: 10px;
  color: var(--color-text-secondary);
}

.thumbnail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: 380px;
}

.thumbnail-card {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-alt);
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

.thumbnail-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.thumb-info {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  color: var(--color-text-secondary);
}

.thumb-name {
  font-weight: 600;
  color: var(--color-text-primary);
  word-break: break-word;
}

.thumb-size {
  font-size: 0.85rem;
}

 .status-card {
  border-radius: var(--border-radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-alt);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.status-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.status-card[data-tone="error"] {
  border-color: rgba(255, 112, 112, 0.4);
}

.status-card[data-tone="warning"] {
  border-color: rgba(255, 196, 112, 0.35);
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-links a {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-fill-soft);
  color: var(--color-text-primary);
  font-weight: 600;
  transition: border var(--transition-base), transform var(--transition-base);
}

.download-links a:hover,
.download-links a:focus-visible {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.progress {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--color-fill-soft);
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  animation: progress-slide 1.3s infinite ease-in-out;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

.tabs-list p {
  margin: 0;
  color: var(--color-text-secondary);
}

.tabs-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
  display: grid;
  gap: 6px;
}

.footer {
  margin: 0 auto 48px;
  padding: 18px 24px;
  background: var(--color-surface);
  border-radius: var(--border-radius-md);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  max-width: var(--max-width);
  width: calc(100% - 48px);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 720px) {
  main {
    padding: 56px 16px 80px;
  }

  .tool-card {
    padding: 24px;
  }

  .dropzone {
    padding: 28px;
  }

  .thumbnail-card img {
    height: 180px;
  }
}

.primary-action {
  padding: 14px 26px;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  background: var(--color-text-primary);
  color: var(--color-background);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border var(--transition-base);
}

.primary-action:hover,
.primary-action:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.status-card[hidden] {
  display: none !important;
}
