/* ===========================================================
   MotionDrop — live wallpaper gallery
   Token system
   =========================================================== */
:root {
  --bg: #0b0e14;
  --surface: #12161f;
  --surface-2: #1a2030;
  --border: #232a3a;
  --text: #edeff4;
  --text-muted: #8890a0;
  --accent: #6ee7c0;
  --accent-2: #7c8cff;
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #141a26 0%, var(--bg) 45%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #05130f; }

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

/* ---------- layout shells ---------- */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.75); }
}

.nav-links { display: flex; gap: 28px; align-items: center; font-size: 0.95rem; color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 14ch;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 700;
}

/* ---------- section headings ---------- */
.section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.section-head .count {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- video grid & "screen" tiles ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 9 / 16;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110, 231, 192, 0.25), 0 18px 40px -12px rgba(110, 231, 192, 0.25);
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
}

.tile-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  background: rgba(11, 14, 20, 0.6);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
}

.tile-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
}

.tile-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.tile-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.dl-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #05130f;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.dl-btn:hover { transform: scale(1.08); background: #85f2d1; }
.dl-btn svg { width: 16px; height: 16px; }

/* ---------- ad slots ---------- */
.ad-slot {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.ad-label {
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- empty state ---------- */
.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty h3 { color: var(--text); font-family: var(--font-display); margin-bottom: 8px; }

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.pagination a:hover { border-color: var(--accent); color: var(--text); }
.pagination .active { background: var(--accent); color: #05130f; border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- long-form content pages ---------- */
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 32px 0 10px;
  color: var(--text);
}
.prose ul { padding-left: 20px; color: var(--text-muted); }
.prose ul li { margin-bottom: 6px; }
.prose p a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms (admin) ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.card h1, .card h2 { font-family: var(--font-display); margin-top: 0; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }

.field input[type=text],
.field input[type=password],
.field input[type=file],
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.field input:focus, .field textarea:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #05130f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.btn:hover { background: #85f2d1; transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--accent); background: transparent; }
.btn.danger { background: var(--danger); color: #250909; }
.btn.danger:hover { background: #ff8a8a; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.alert.error { background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4); color: #ffb3b3; }
.alert.success { background: rgba(110, 231, 192, 0.12); border: 1px solid rgba(110, 231, 192, 0.4); color: var(--accent); }

/* ---------- admin dashboard ---------- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table video {
  width: 60px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}

.upload-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 36px;
}

.file-list { margin: 4px 0 20px; display: flex; flex-direction: column; gap: 8px; }

.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.file-row input.file-title-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 4px 0;
  width: 100%;
}
.file-row input.file-title-input:focus { outline: none; border-bottom: 1px solid var(--accent); }

.file-size {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
.file-status.ok { color: var(--accent); }
.file-status.err { color: var(--danger); }

.progress-wrap {
  display: none;
  margin-top: 12px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .15s ease;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}
