* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --primary: #e0e0e0;
  --body: #888;
  --secondary: #666;
  --hover: #e0e0e0;
  --border: #222;
  --surface: #111;
}

body {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--body);
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

/* header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

.face {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

h1 {
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: lowercase;
}

.subtitle {
  color: var(--secondary);
  font-size: 0.75rem;
}

/* input section */
.input-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

input[type="text"] {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus {
  border-color: var(--body);
}

input[type="text"]::placeholder {
  color: var(--secondary);
}

button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--body);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: lowercase;
}

button:hover {
  color: var(--primary);
  border-color: var(--body);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* progress section */
.progress-section {
  display: none;
  margin-bottom: 1.5rem;
}

.progress-section.visible {
  display: block;
}

.progress-bar {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

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

.progress-text {
  text-align: right;
  font-size: 0.75rem;
  color: var(--secondary);
}

/* log section */
.log-section {
  display: none;
  margin-bottom: 2rem;
}

.log-section.visible {
  display: block;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.log-title {
  font-size: 0.75rem;
  color: var(--secondary);
  text-transform: lowercase;
}

.log-status {
  font-size: 0.75rem;
}

.log-status.success {
  color: #4a9;
}

.log-status.error {
  color: #a55;
}

.log-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.75rem;
}

.log-entry {
  margin-bottom: 0.25rem;
  display: flex;
  gap: 0.75rem;
}

.log-entry:last-child {
  margin-bottom: 0;
}

.log-time {
  color: var(--secondary);
  flex-shrink: 0;
}

.log-message {
  color: var(--body);
}

.log-message.highlight {
  color: var(--primary);
}

.log-message.error {
  color: #a55;
}

.log-message.success {
  color: #4a9;
}

/* result section */
.result-section {
  display: none;
}

.result-section.visible {
  display: block;
}

.preview-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.preview-container img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 2px;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#result-url {
  background: var(--surface);
  color: var(--primary);
  text-align: center;
  cursor: text;
}

.result-buttons {
  display: flex;
  gap: 0.5rem;
}

.result-buttons button {
  flex: 1;
}

#copy-btn.copied {
  color: #4a9;
  border-color: #4a9;
}

/* footer */
footer {
  margin-top: 3rem;
  text-align: center;
}

footer p {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

footer .secondary {
  font-size: 0.7rem;
  color: var(--border);
}

/* scrollbar */
.log-container::-webkit-scrollbar {
  width: 6px;
}

.log-container::-webkit-scrollbar-track {
  background: var(--surface);
}

.log-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.log-container::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.log-entry:last-child .log-message:not(.success):not(.error) {
  animation: pulse 1.5s ease-in-out infinite;
}

.log-entry.done .log-message {
  animation: none;
}
