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

:root {
  --bg: #f4f0e8;
  --surface: #ffffff;
  --border: #d8d0c0;
  --ink: #1a1a18;
  --muted: #8a8070;
  --accent: #c8401a;
  --accent-light: #fdf0ec;
  --success: #1a7a3a;
  --success-light: #edf7f1;
  --danger: #c0392b;
  --warn-bg: #fff8f0;
  --warn-border: #f0d8b8;
  --warn-text: #b35a00;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Epilogue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23f4f0e8'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%23ede8de' opacity='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 540px;
  position: relative;
}

header {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

h1 {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.subtext {
  margin-top: 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 3px;
  padding: 2rem;
  box-shadow: 4px 4px 0 var(--border);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 2px;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.15s,
    background 0.15s;
  margin-bottom: 1.25rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.drop-main {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.drop-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
}

.drop-limit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── File list ── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.file-list:empty {
  display: none;
}

.file-item {
  border-radius: 2px;
  overflow: hidden;
}

.file-item.pending {
  background: var(--accent-light);
  border: 1.5px solid #f0c8bc;
}
.file-item.warning {
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-border);
}
.file-item.success {
  background: var(--success-light);
  border: 1.5px solid #b8e0c4;
}
.file-item.error {
  background: #fff0f0;
  border: 1.5px solid #f0b8b8;
}

.file-item-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.file-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

.file-item-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.file-item-status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.15rem;
  min-height: 1em;
}
.file-item-status.ok {
  color: var(--success);
}
.file-item-status.err {
  color: var(--danger);
}
.file-item-status.warn {
  color: var(--warn-text);
}

.file-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.2rem;
  transition: color 0.15s;
  flex-shrink: 0;
}

.file-item-remove:hover {
  color: var(--accent);
}
.file-item-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Per-file progress bar */
.file-item-bar {
  height: 2px;
  background: var(--border);
  display: none;
}
.file-item-bar.show {
  display: block;
}
.file-item-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Overall progress ── */
.overall-progress {
  display: none;
  margin-bottom: 1.25rem;
}

.overall-progress.show {
  display: block;
}

.overall-meta {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.overall-track {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.overall-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
  border-radius: 999px;
}

/* Turnstile */
.turnstile-wrap {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

/* Button */
.btn-upload {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.btn-upload:hover:not(:disabled) {
  background: var(--accent);
}
.btn-upload:active:not(:disabled) {
  transform: scale(0.99);
}
.btn-upload:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Status / Summary */
.status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
  color: var(--muted);
}

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

footer {
  margin-top: 1.75rem;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
}
