/* Vellum — user-facing design tokens.
   Media-first: dark by default, covers are the primary content, chrome recedes.
   One accent, a tight type scale, and generous spacing so artwork breathes. */

:root {
  --bg: #0a0a0c;
  --surface: #131316;
  --surface-2: #1b1b20;
  --surface-3: #24242b;
  --border: #26262e;
  --border-strong: #34343e;

  --text: #f3f3f5;
  --muted: #a2a2ae;
  --faint: #6c6c78;

  --accent: #6d7cff;
  --accent-hover: #808dff;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-text: #ffffff;
  --danger: #ff6b6b;
  --success: #46d17f;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-cover: 8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    'Noto Sans', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --nav-width: 232px;
  --shadow-cover: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f1f1f3;
    --surface-3: #e7e7ea;
    --border: #e6e6ea;
    --border-strong: #d2d2d9;
    --text: #16161a;
    --muted: #5d5d68;
    --faint: #8b8b96;
    --accent: #5563e8;
    --accent-hover: #4553d8;
    --accent-text: #ffffff;
    --shadow-cover: 0 1px 2px rgba(20, 20, 30, 0.08), 0 6px 18px rgba(20, 20, 30, 0.1);
    --shadow-lift: 0 10px 28px rgba(20, 20, 30, 0.16);
  }
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 17px;
}
h3 {
  font-size: 15px;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* ── Controls ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--surface-3);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}
.btn-lg {
  padding: 11px 22px;
  font-size: 15px;
  border-radius: 12px;
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ── Surfaces ───────────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.chip:hover {
  color: var(--text);
  border-color: var(--faint);
}
.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.alert {
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  font-size: 13px;
}
.ok {
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--success) 9%, transparent);
  font-size: 13px;
}

.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* ── Cover card ─────────────────────────────────────────────────────── */

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-cover);
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: var(--shadow-cover);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.cover.wide {
  aspect-ratio: 1 / 1;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 700;
  color: var(--faint);
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
}
.cover img + .placeholder {
  display: none;
}

/* ── Empty state ────────────────────────────────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--text);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-cover);
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid var(--bg);
}
