:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #63635e;
  --border: #d5d5cf;
  --accent: #2f5fd0;
  --accent-text: #ffffff;
  --accent-wash: #e8eefb;
  --error: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #20201e;
    --text: #ecece8;
    --muted: #a3a39c;
    --border: #3a3a36;
    --accent: #8fb0f5;
    --accent-text: #10182c;
    --accent-wash: #232c42;
    --error: #f2968f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, sans-serif;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.intro {
  margin: 4px 0 24px;
  color: var(--muted);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.dropzone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dropzone strong {
  color: var(--accent);
  font-size: 1.125rem;
}

.dropzone small {
  margin-top: 8px;
  color: var(--muted);
}

.status {
  min-height: 1.5em;
  margin: 12px 0;
  color: var(--muted);
}

.status.error {
  color: var(--error);
}

.results {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.thumbnail {
  flex: none;
}

.thumbnail img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.link {
  flex: 1;
  min-width: 0;
  padding: 8px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 14px ui-monospace, monospace;
}

.copy {
  flex: none;
  min-width: 72px;
  padding: 8px 12px;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.copy:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
